@volcengine/veplayer 2.4.2-rc.4 → 2.4.2-rc.6
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/esm/veplayer.biz.live.development.js +1 -1
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +2 -0
- package/esm/veplayer.development.js +4 -3
- package/esm/veplayer.live.d.ts +2 -0
- package/esm/veplayer.live.development.js +4 -3
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.development.js +2 -1
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/veplayer.biz.live.development.js +1 -1
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +2 -0
- package/umd/veplayer.development.js +4 -3
- package/umd/veplayer.live.d.ts +2 -0
- package/umd/veplayer.live.development.js +4 -3
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.development.js +2 -1
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +2 -0
- package/veplayer.live.d.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VePlayer={})}(this,(function(e){"use strict";var t=function(e){return e.H265="h265",e.H264="h264",e}(t||{}),n=function(e){return e.SoftFirst="soft-first",e.H264First="h264-first",e}(n||{}),r=function(e){return e.Software="software",e.Hardware="hardware",e}(r||{}),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a=function(e){return e&&e.Math==Math&&e},s=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof i&&i)||function(){return this}()||i||Function("return this")(),l=function(e){try{return!!e()}catch(t){return!0}},u=!l((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),c=u,h=Function.prototype,f=h.apply,d=h.call,p="object"==typeof Reflect&&Reflect.apply||(c?d.bind(f):function(){return d.apply(f,arguments)}),v=u,g=Function.prototype,y=g.call,m=v&&g.bind.bind(y,y),_=v?m:function(e){return function(){return y.apply(e,arguments)}},b=_,w=b({}.toString),k=b("".slice),E=function(e){return k(w(e),8,-1)},S=E,T=_,C=function(e){if("Function"===S(e))return T(e)},A="object"==typeof document&&document.all,x={all:A,IS_HTMLDDA:void 0===A&&void 0!==A},P=x.all,I=x.IS_HTMLDDA?function(e){return"function"==typeof e||e===P}:function(e){return"function"==typeof e},R={},D=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),O=u,M=Function.prototype.call,L=O?M.bind(M):function(){return M.apply(M,arguments)},F={},U={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,N=B&&!U.call({1:2},1);F.f=N?function(e){var t=B(this,e);return!!t&&t.enumerable}:U;var V,H,G=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},j=l,z=E,K=Object,W=_("".split),q=j((function(){return!K("z").propertyIsEnumerable(0)}))?function(e){return"String"==z(e)?W(e,""):K(e)}:K,X=function(e){return null==e},Y=X,$=TypeError,Z=function(e){if(Y(e))throw $("Can't call method on "+e);return e},J=q,Q=Z,ee=function(e){return J(Q(e))},te=I,ne=x.all,re=x.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:te(e)||e===ne}:function(e){return"object"==typeof e?null!==e:te(e)},ie={},oe=ie,ae=s,se=I,le=function(e){return se(e)?e:void 0},ue=function(e,t){return arguments.length<2?le(oe[e])||le(ae[e]):oe[e]&&oe[e][t]||ae[e]&&ae[e][t]},ce=_({}.isPrototypeOf),he="undefined"!=typeof navigator&&String(navigator.userAgent)||"",fe=s,de=he,pe=fe.process,ve=fe.Deno,ge=pe&&pe.versions||ve&&ve.version,ye=ge&&ge.v8;ye&&(H=(V=ye.split("."))[0]>0&&V[0]<4?1:+(V[0]+V[1])),!H&&de&&(!(V=de.match(/Edge\/(\d+)/))||V[1]>=74)&&(V=de.match(/Chrome\/(\d+)/))&&(H=+V[1]);var me=H,_e=me,be=l,we=s.String,ke=!!Object.getOwnPropertySymbols&&!be((function(){var e=Symbol();return!we(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_e&&_e<41})),Ee=ke&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Se=ue,Te=I,Ce=ce,Ae=Object,xe=Ee?function(e){return"symbol"==typeof e}:function(e){var t=Se("Symbol");return Te(t)&&Ce(t.prototype,Ae(e))},Pe=String,Ie=function(e){try{return Pe(e)}catch(t){return"Object"}},Re=I,De=Ie,Oe=TypeError,Me=function(e){if(Re(e))return e;throw Oe(De(e)+" is not a function")},Le=Me,Fe=X,Ue=function(e,t){var n=e[t];return Fe(n)?void 0:Le(n)},Be=L,Ne=I,Ve=re,He=TypeError,Ge={exports:{}},je=s,ze=Object.defineProperty,Ke=function(e,t){try{ze(je,e,{value:t,configurable:!0,writable:!0})}catch(n){je[e]=t}return t},We="__core-js_shared__",qe=s[We]||Ke(We,{}),Xe=qe;(Ge.exports=function(e,t){return Xe[e]||(Xe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"pure",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 Ye=Ge.exports,$e=Z,Ze=Object,Je=function(e){return Ze($e(e))},Qe=Je,et=_({}.hasOwnProperty),tt=Object.hasOwn||function(e,t){return et(Qe(e),t)},nt=_,rt=0,it=Math.random(),ot=nt(1..toString),at=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ot(++rt+it,36)},st=Ye,lt=tt,ut=at,ct=ke,ht=Ee,ft=s.Symbol,dt=st("wks"),pt=ht?ft.for||ft:ft&&ft.withoutSetter||ut,vt=function(e){return lt(dt,e)||(dt[e]=ct&<(ft,e)?ft[e]:pt("Symbol."+e)),dt[e]},gt=L,yt=re,mt=xe,_t=Ue,bt=function(e,t){var n,r;if("string"===t&&Ne(n=e.toString)&&!Ve(r=Be(n,e)))return r;if(Ne(n=e.valueOf)&&!Ve(r=Be(n,e)))return r;if("string"!==t&&Ne(n=e.toString)&&!Ve(r=Be(n,e)))return r;throw He("Can't convert object to primitive value")},wt=TypeError,kt=vt("toPrimitive"),Et=function(e,t){if(!yt(e)||mt(e))return e;var n,r=_t(e,kt);if(r){if(void 0===t&&(t="default"),n=gt(r,e,t),!yt(n)||mt(n))return n;throw wt("Can't convert object to primitive value")}return void 0===t&&(t="number"),bt(e,t)},St=xe,Tt=function(e){var t=Et(e,"string");return St(t)?t:t+""},Ct=re,At=s.document,xt=Ct(At)&&Ct(At.createElement),Pt=function(e){return xt?At.createElement(e):{}},It=Pt,Rt=!D&&!l((function(){return 7!=Object.defineProperty(It("div"),"a",{get:function(){return 7}}).a})),Dt=D,Ot=L,Mt=F,Lt=G,Ft=ee,Ut=Tt,Bt=tt,Nt=Rt,Vt=Object.getOwnPropertyDescriptor;R.f=Dt?Vt:function(e,t){if(e=Ft(e),t=Ut(t),Nt)try{return Vt(e,t)}catch(n){}if(Bt(e,t))return Lt(!Ot(Mt.f,e,t),e[t])};var Ht=l,Gt=I,jt=/#|\.prototype\./,zt=function(e,t){var n=Wt[Kt(e)];return n==Xt||n!=qt&&(Gt(t)?Ht(t):!!t)},Kt=zt.normalize=function(e){return String(e).replace(jt,".").toLowerCase()},Wt=zt.data={},qt=zt.NATIVE="N",Xt=zt.POLYFILL="P",Yt=zt,$t=Me,Zt=u,Jt=C(C.bind),Qt=function(e,t){return $t(e),void 0===t?e:Zt?Jt(e,t):function(){return e.apply(t,arguments)}},en={},tn=D&&l((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),nn=re,rn=String,on=TypeError,an=function(e){if(nn(e))return e;throw on(rn(e)+" is not an object")},sn=D,ln=Rt,un=tn,cn=an,hn=Tt,fn=TypeError,dn=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,vn="enumerable",gn="configurable",yn="writable";en.f=sn?un?function(e,t,n){if(cn(e),t=hn(t),cn(n),"function"==typeof e&&"prototype"===t&&"value"in n&&yn in n&&!n[yn]){var r=pn(e,t);r&&r[yn]&&(e[t]=n.value,n={configurable:gn in n?n[gn]:r[gn],enumerable:vn in n?n[vn]:r[vn],writable:!1})}return dn(e,t,n)}:dn:function(e,t,n){if(cn(e),t=hn(t),cn(n),ln)try{return dn(e,t,n)}catch(r){}if("get"in n||"set"in n)throw fn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var mn=en,_n=G,bn=D?function(e,t,n){return mn.f(e,t,_n(1,n))}:function(e,t,n){return e[t]=n,e},wn=s,kn=p,En=C,Sn=I,Tn=R.f,Cn=Yt,An=ie,xn=Qt,Pn=bn,In=tt,Rn=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return kn(e,this,arguments)};return t.prototype=e.prototype,t},Dn=function(e,t){var n,r,i,o,a,s,l,u,c,h=e.target,f=e.global,d=e.stat,p=e.proto,v=f?wn:d?wn[h]:(wn[h]||{}).prototype,g=f?An:An[h]||Pn(An,h,{})[h],y=g.prototype;for(o in t)r=!(n=Cn(f?o:h+(d?".":"#")+o,e.forced))&&v&&In(v,o),s=g[o],r&&(l=e.dontCallGetSet?(c=Tn(v,o))&&c.value:v[o]),a=r&&l?l:t[o],r&&typeof s==typeof a||(u=e.bind&&r?xn(a,wn):e.wrap&&r?Rn(a):p&&Sn(a)?En(a):a,(e.sham||a&&a.sham||s&&s.sham)&&Pn(u,"sham",!0),Pn(g,o,u),p&&(In(An,i=h+"Prototype")||Pn(An,i,{}),Pn(An[i],o,a),e.real&&y&&(n||!y[o])&&Pn(y,o,a)))},On=E,Mn=Array.isArray||function(e){return"Array"==On(e)},Ln=Math.ceil,Fn=Math.floor,Un=Math.trunc||function(e){var t=+e;return(t>0?Fn:Ln)(t)},Bn=function(e){var t=+e;return t!=t||0===t?0:Un(t)},Nn=Bn,Vn=Math.min,Hn=function(e){return e>0?Vn(Nn(e),9007199254740991):0},Gn=Hn,jn=function(e){return Gn(e.length)},zn=TypeError,Kn=function(e){if(e>9007199254740991)throw zn("Maximum allowed index exceeded");return e},Wn=Tt,qn=en,Xn=G,Yn=function(e,t,n){var r=Wn(t);r in e?qn.f(e,r,Xn(0,n)):e[r]=n},$n={};$n[vt("toStringTag")]="z";var Zn="[object z]"===String($n),Jn=Zn,Qn=I,er=E,tr=vt("toStringTag"),nr=Object,rr="Arguments"==er(function(){return arguments}()),ir=Jn?er:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=nr(e),tr))?n:rr?er(t):"Object"==(r=er(t))&&Qn(t.callee)?"Arguments":r},or=I,ar=qe,sr=_(Function.toString);or(ar.inspectSource)||(ar.inspectSource=function(e){return sr(e)});var lr=ar.inspectSource,ur=_,cr=l,hr=I,fr=ir,dr=lr,pr=function(){},vr=[],gr=ue("Reflect","construct"),yr=/^\s*(?:class|function)\b/,mr=ur(yr.exec),_r=!yr.exec(pr),br=function(e){if(!hr(e))return!1;try{return gr(pr,vr,e),!0}catch(t){return!1}},wr=function(e){if(!hr(e))return!1;switch(fr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _r||!!mr(yr,dr(e))}catch(t){return!0}};wr.sham=!0;var kr=!gr||cr((function(){var e;return br(br.call)||!br(Object)||!br((function(){e=!0}))||e}))?wr:br,Er=Mn,Sr=kr,Tr=re,Cr=vt("species"),Ar=Array,xr=function(e){var t;return Er(e)&&(t=e.constructor,(Sr(t)&&(t===Ar||Er(t.prototype))||Tr(t)&&null===(t=t[Cr]))&&(t=void 0)),void 0===t?Ar:t},Pr=function(e,t){return new(xr(e))(0===t?0:t)},Ir=l,Rr=me,Dr=vt("species"),Or=function(e){return Rr>=51||!Ir((function(){var t=[];return(t.constructor={})[Dr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Mr=Dn,Lr=l,Fr=Mn,Ur=re,Br=Je,Nr=jn,Vr=Kn,Hr=Yn,Gr=Pr,jr=Or,zr=me,Kr=vt("isConcatSpreadable"),Wr=zr>=51||!Lr((function(){var e=[];return e[Kr]=!1,e.concat()[0]!==e})),qr=function(e){if(!Ur(e))return!1;var t=e[Kr];return void 0!==t?!!t:Fr(e)};Mr({target:"Array",proto:!0,arity:1,forced:!Wr||!jr("concat")},{concat:function(e){var t,n,r,i,o,a=Br(this),s=Gr(a,0),l=0;for(t=-1,r=arguments.length;t<r;t++)if(qr(o=-1===t?a:arguments[t]))for(i=Nr(o),Vr(l+i),n=0;n<i;n++,l++)n in o&&Hr(s,l,o[n]);else Vr(l+1),Hr(s,l++,o);return s.length=l,s}});var Xr=ir,Yr=String,$r=function(e){if("Symbol"===Xr(e))throw TypeError("Cannot convert a Symbol value to a string");return Yr(e)},Zr={},Jr=Bn,Qr=Math.max,ei=Math.min,ti=function(e,t){var n=Jr(e);return n<0?Qr(n+t,0):ei(n,t)},ni=ee,ri=ti,ii=jn,oi=function(e){return function(t,n,r){var i,o=ni(t),a=ii(o),s=ri(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},ai={includes:oi(!0),indexOf:oi(!1)},si={},li=tt,ui=ee,ci=ai.indexOf,hi=si,fi=_([].push),di=function(e,t){var n,r=ui(e),i=0,o=[];for(n in r)!li(hi,n)&&li(r,n)&&fi(o,n);for(;t.length>i;)li(r,n=t[i++])&&(~ci(o,n)||fi(o,n));return o},pi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vi=di,gi=pi,yi=Object.keys||function(e){return vi(e,gi)},mi=D,_i=tn,bi=en,wi=an,ki=ee,Ei=yi;Zr.f=mi&&!_i?Object.defineProperties:function(e,t){wi(e);for(var n,r=ki(t),i=Ei(t),o=i.length,a=0;o>a;)bi.f(e,n=i[a++],r[n]);return e};var Si,Ti=ue("document","documentElement"),Ci=at,Ai=Ye("keys"),xi=function(e){return Ai[e]||(Ai[e]=Ci(e))},Pi=an,Ii=Zr,Ri=pi,Di=si,Oi=Ti,Mi=Pt,Li="prototype",Fi="script",Ui=xi("IE_PROTO"),Bi=function(){},Ni=function(e){return"<"+Fi+">"+e+"</"+Fi+">"},Vi=function(e){e.write(Ni("")),e.close();var t=e.parentWindow.Object;return e=null,t},Hi=function(){try{Si=new ActiveXObject("htmlfile")}catch(i){}var e,t,n;Hi="undefined"!=typeof document?document.domain&&Si?Vi(Si):(t=Mi("iframe"),n="java"+Fi+":",t.style.display="none",Oi.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Ni("document.F=Object")),e.close(),e.F):Vi(Si);for(var r=Ri.length;r--;)delete Hi[Li][Ri[r]];return Hi()};Di[Ui]=!0;var Gi=Object.create||function(e,t){var n;return null!==e?(Bi[Li]=Pi(e),n=new Bi,Bi[Li]=null,n[Ui]=e):n=Hi(),void 0===t?n:Ii.f(n,t)},ji={},zi=di,Ki=pi.concat("length","prototype");ji.f=Object.getOwnPropertyNames||function(e){return zi(e,Ki)};var Wi={},qi=ti,Xi=jn,Yi=Yn,$i=Array,Zi=Math.max,Ji=function(e,t,n){for(var r=Xi(e),i=qi(t,r),o=qi(void 0===n?r:n,r),a=$i(Zi(o-i,0)),s=0;i<o;i++,s++)Yi(a,s,e[i]);return a.length=s,a},Qi=E,eo=ee,to=ji.f,no=Ji,ro="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Wi.f=function(e){return ro&&"Window"==Qi(e)?function(e){try{return to(e)}catch(t){return no(ro)}}(e):to(eo(e))};var io={};io.f=Object.getOwnPropertySymbols;var oo=bn,ao=function(e,t,n,r){return r&&r.enumerable?e[t]=n:oo(e,t,n),e},so=en,lo=function(e,t,n){return so.f(e,t,n)},uo={},co=vt;uo.f=co;var ho,fo,po,vo=ie,go=tt,yo=uo,mo=en.f,_o=function(e){var t=vo.Symbol||(vo.Symbol={});go(t,e)||mo(t,e,{value:yo.f(e)})},bo=L,wo=ue,ko=vt,Eo=ao,So=function(){var e=wo("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=ko("toPrimitive");t&&!t[r]&&Eo(t,r,(function(e){return bo(n,this)}),{arity:1})},To=ir,Co=Zn?{}.toString:function(){return"[object "+To(this)+"]"},Ao=Zn,xo=en.f,Po=bn,Io=tt,Ro=Co,Do=vt("toStringTag"),Oo=function(e,t,n,r){if(e){var i=n?e:e.prototype;Io(i,Do)||xo(i,Do,{configurable:!0,value:t}),r&&!Ao&&Po(i,"toString",Ro)}},Mo=I,Lo=s.WeakMap,Fo=Mo(Lo)&&/native code/.test(String(Lo)),Uo=s,Bo=re,No=bn,Vo=tt,Ho=qe,Go=xi,jo=si,zo="Object already initialized",Ko=Uo.TypeError,Wo=Uo.WeakMap;if(Fo||Ho.state){var qo=Ho.state||(Ho.state=new Wo);qo.get=qo.get,qo.has=qo.has,qo.set=qo.set,ho=function(e,t){if(qo.has(e))throw Ko(zo);return t.facade=e,qo.set(e,t),t},fo=function(e){return qo.get(e)||{}},po=function(e){return qo.has(e)}}else{var Xo=Go("state");jo[Xo]=!0,ho=function(e,t){if(Vo(e,Xo))throw Ko(zo);return t.facade=e,No(e,Xo,t),t},fo=function(e){return Vo(e,Xo)?e[Xo]:{}},po=function(e){return Vo(e,Xo)}}var Yo={set:ho,get:fo,has:po,enforce:function(e){return po(e)?fo(e):ho(e,{})},getterFor:function(e){return function(t){var n;if(!Bo(t)||(n=fo(t)).type!==e)throw Ko("Incompatible receiver, "+e+" required");return n}}},$o=Qt,Zo=q,Jo=Je,Qo=jn,ea=Pr,ta=_([].push),na=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,u,c,h){for(var f,d,p=Jo(l),v=Zo(p),g=$o(u,c),y=Qo(v),m=0,_=h||ea,b=t?_(l,y):n||a?_(l,0):void 0;y>m;m++)if((s||m in v)&&(d=g(f=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return m;case 2:ta(b,f)}else switch(e){case 4:return!1;case 7:ta(b,f)}return o?-1:r||i?i:b}},ra={forEach:na(0),map:na(1),filter:na(2),some:na(3),every:na(4),find:na(5),findIndex:na(6),filterReject:na(7)},ia=Dn,oa=s,aa=L,sa=_,la=D,ua=ke,ca=l,ha=tt,fa=ce,da=an,pa=ee,va=Tt,ga=$r,ya=G,ma=Gi,_a=yi,ba=ji,wa=Wi,ka=io,Ea=R,Sa=en,Ta=Zr,Ca=F,Aa=ao,xa=lo,Pa=Ye,Ia=si,Ra=at,Da=vt,Oa=uo,Ma=_o,La=So,Fa=Oo,Ua=Yo,Ba=ra.forEach,Na=xi("hidden"),Va="Symbol",Ha="prototype",Ga=Ua.set,ja=Ua.getterFor(Va),za=Object[Ha],Ka=oa.Symbol,Wa=Ka&&Ka[Ha],qa=oa.TypeError,Xa=oa.QObject,Ya=Ea.f,$a=Sa.f,Za=wa.f,Ja=Ca.f,Qa=sa([].push),es=Pa("symbols"),ts=Pa("op-symbols"),ns=Pa("wks"),rs=!Xa||!Xa[Ha]||!Xa[Ha].findChild,is=la&&ca((function(){return 7!=ma($a({},"a",{get:function(){return $a(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Ya(za,t);r&&delete za[t],$a(e,t,n),r&&e!==za&&$a(za,t,r)}:$a,os=function(e,t){var n=es[e]=ma(Wa);return Ga(n,{type:Va,tag:e,description:t}),la||(n.description=t),n},as=function(e,t,n){e===za&&as(ts,t,n),da(e);var r=va(t);return da(n),ha(es,r)?(n.enumerable?(ha(e,Na)&&e[Na][r]&&(e[Na][r]=!1),n=ma(n,{enumerable:ya(0,!1)})):(ha(e,Na)||$a(e,Na,ya(1,{})),e[Na][r]=!0),is(e,r,n)):$a(e,r,n)},ss=function(e,t){da(e);var n=pa(t),r=_a(n).concat(hs(n));return Ba(r,(function(t){la&&!aa(ls,n,t)||as(e,t,n[t])})),e},ls=function(e){var t=va(e),n=aa(Ja,this,t);return!(this===za&&ha(es,t)&&!ha(ts,t))&&(!(n||!ha(this,t)||!ha(es,t)||ha(this,Na)&&this[Na][t])||n)},us=function(e,t){var n=pa(e),r=va(t);if(n!==za||!ha(es,r)||ha(ts,r)){var i=Ya(n,r);return!i||!ha(es,r)||ha(n,Na)&&n[Na][r]||(i.enumerable=!0),i}},cs=function(e){var t=Za(pa(e)),n=[];return Ba(t,(function(e){ha(es,e)||ha(Ia,e)||Qa(n,e)})),n},hs=function(e){var t=e===za,n=Za(t?ts:pa(e)),r=[];return Ba(n,(function(e){!ha(es,e)||t&&!ha(za,e)||Qa(r,es[e])})),r};ua||(Ka=function(){if(fa(Wa,this))throw qa("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ga(arguments[0]):void 0,t=Ra(e),n=function(e){this===za&&aa(n,ts,e),ha(this,Na)&&ha(this[Na],t)&&(this[Na][t]=!1),is(this,t,ya(1,e))};return la&&rs&&is(za,t,{configurable:!0,set:n}),os(t,e)},Aa(Wa=Ka[Ha],"toString",(function(){return ja(this).tag})),Aa(Ka,"withoutSetter",(function(e){return os(Ra(e),e)})),Ca.f=ls,Sa.f=as,Ta.f=ss,Ea.f=us,ba.f=wa.f=cs,ka.f=hs,Oa.f=function(e){return os(Da(e),e)},la&&xa(Wa,"description",{configurable:!0,get:function(){return ja(this).description}})),ia({global:!0,constructor:!0,wrap:!0,forced:!ua,sham:!ua},{Symbol:Ka}),Ba(_a(ns),(function(e){Ma(e)})),ia({target:Va,stat:!0,forced:!ua},{useSetter:function(){rs=!0},useSimple:function(){rs=!1}}),ia({target:"Object",stat:!0,forced:!ua,sham:!la},{create:function(e,t){return void 0===t?ma(e):ss(ma(e),t)},defineProperty:as,defineProperties:ss,getOwnPropertyDescriptor:us}),ia({target:"Object",stat:!0,forced:!ua},{getOwnPropertyNames:cs}),La(),Fa(Ka,Va),Ia[Na]=!0;var fs=ke&&!!Symbol.for&&!!Symbol.keyFor,ds=Dn,ps=ue,vs=tt,gs=$r,ys=Ye,ms=fs,_s=ys("string-to-symbol-registry"),bs=ys("symbol-to-string-registry");ds({target:"Symbol",stat:!0,forced:!ms},{for:function(e){var t=gs(e);if(vs(_s,t))return _s[t];var n=ps("Symbol")(t);return _s[t]=n,bs[n]=t,n}});var ws=Dn,ks=tt,Es=xe,Ss=Ie,Ts=fs,Cs=Ye("symbol-to-string-registry");ws({target:"Symbol",stat:!0,forced:!Ts},{keyFor:function(e){if(!Es(e))throw TypeError(Ss(e)+" is not a symbol");if(ks(Cs,e))return Cs[e]}});var As=_([].slice),xs=Mn,Ps=I,Is=E,Rs=$r,Ds=_([].push),Os=Dn,Ms=ue,Ls=p,Fs=L,Us=_,Bs=l,Ns=I,Vs=xe,Hs=As,Gs=function(e){if(Ps(e))return e;if(xs(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];"string"==typeof i?Ds(n,i):"number"!=typeof i&&"Number"!=Is(i)&&"String"!=Is(i)||Ds(n,Rs(i))}var o=n.length,a=!0;return function(e,t){if(a)return a=!1,t;if(xs(this))return t;for(var r=0;r<o;r++)if(n[r]===e)return t}}},js=ke,zs=String,Ks=Ms("JSON","stringify"),Ws=Us(/./.exec),qs=Us("".charAt),Xs=Us("".charCodeAt),Ys=Us("".replace),$s=Us(1..toString),Zs=/[\uD800-\uDFFF]/g,Js=/^[\uD800-\uDBFF]$/,Qs=/^[\uDC00-\uDFFF]$/,el=!js||Bs((function(){var e=Ms("Symbol")();return"[null]"!=Ks([e])||"{}"!=Ks({a:e})||"{}"!=Ks(Object(e))})),tl=Bs((function(){return'"\\udf06\\ud834"'!==Ks("\udf06\ud834")||'"\\udead"'!==Ks("\udead")})),nl=function(e,t){var n=Hs(arguments),r=Gs(t);if(Ns(r)||void 0!==e&&!Vs(e))return n[1]=function(e,t){if(Ns(r)&&(t=Fs(r,this,zs(e),t)),!Vs(t))return t},Ls(Ks,null,n)},rl=function(e,t,n){var r=qs(n,t-1),i=qs(n,t+1);return Ws(Js,e)&&!Ws(Qs,i)||Ws(Qs,e)&&!Ws(Js,r)?"\\u"+$s(Xs(e,0),16):e};Ks&&Os({target:"JSON",stat:!0,arity:3,forced:el||tl},{stringify:function(e,t,n){var r=Hs(arguments),i=Ls(el?nl:Ks,null,r);return tl&&"string"==typeof i?Ys(i,Zs,rl):i}});var il=io,ol=Je;Dn({target:"Object",stat:!0,forced:!ke||l((function(){il.f(1)}))},{getOwnPropertySymbols:function(e){var t=il.f;return t?t(ol(e)):[]}}),_o("asyncIterator"),_o("hasInstance"),_o("isConcatSpreadable"),_o("iterator"),_o("match"),_o("matchAll"),_o("replace"),_o("search"),_o("species"),_o("split");var al=So;_o("toPrimitive"),al();var sl=ue,ll=Oo;_o("toStringTag"),ll(sl("Symbol"),"Symbol"),_o("unscopables"),Oo(s.JSON,"JSON",!0);var ul,cl,hl,fl=ie.Symbol,dl={},pl=D,vl=tt,gl=Function.prototype,yl=pl&&Object.getOwnPropertyDescriptor,ml=vl(gl,"name"),_l={EXISTS:ml,PROPER:ml&&"something"===function(){}.name,CONFIGURABLE:ml&&(!pl||pl&&yl(gl,"name").configurable)},bl=!l((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),wl=tt,kl=I,El=Je,Sl=bl,Tl=xi("IE_PROTO"),Cl=Object,Al=Cl.prototype,xl=Sl?Cl.getPrototypeOf:function(e){var t=El(e);if(wl(t,Tl))return t[Tl];var n=t.constructor;return kl(n)&&t instanceof n?n.prototype:t instanceof Cl?Al:null},Pl=l,Il=I,Rl=re,Dl=Gi,Ol=xl,Ml=ao,Ll=vt("iterator"),Fl=!1;[].keys&&("next"in(hl=[].keys())?(cl=Ol(Ol(hl)))!==Object.prototype&&(ul=cl):Fl=!0);var Ul=!Rl(ul)||Pl((function(){var e={};return ul[Ll].call(e)!==e}));Il((ul=Ul?{}:Dl(ul))[Ll])||Ml(ul,Ll,(function(){return this}));var Bl={IteratorPrototype:ul,BUGGY_SAFARI_ITERATORS:Fl},Nl=Bl.IteratorPrototype,Vl=Gi,Hl=G,Gl=Oo,jl=dl,zl=function(){return this},Kl=function(e,t,n,r){var i=t+" Iterator";return e.prototype=Vl(Nl,{next:Hl(+!r,n)}),Gl(e,i,!1,!0),jl[i]=zl,e},Wl=_,ql=Me,Xl=I,Yl=String,$l=TypeError,Zl=function(e,t,n){try{return Wl(ql(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(r){}},Jl=an,Ql=function(e){if("object"==typeof e||Xl(e))return e;throw $l("Can't set "+Yl(e)+" as a prototype")},eu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Zl(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(r){}return function(n,r){return Jl(n),Ql(r),t?e(n,r):n.__proto__=r,n}}():void 0),tu=Dn,nu=L,ru=_l,iu=Kl,ou=xl,au=Oo,su=ao,lu=dl,uu=Bl,cu=ru.PROPER,hu=uu.BUGGY_SAFARI_ITERATORS,fu=vt("iterator"),du="keys",pu="values",vu="entries",gu=function(){return this},yu=function(e,t,n,r,i,o,a){iu(n,t,r);var s,l,u,c=function(e){if(e===i&&v)return v;if(!hu&&e in d)return d[e];switch(e){case du:case pu:case vu:return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",f=!1,d=e.prototype,p=d[fu]||d["@@iterator"]||i&&d[i],v=!hu&&p||c(i),g="Array"==t&&d.entries||p;if(g&&(s=ou(g.call(new e)))!==Object.prototype&&s.next&&(au(s,h,!0,!0),lu[h]=gu),cu&&i==pu&&p&&p.name!==pu&&(f=!0,v=function(){return nu(p,this)}),i)if(l={values:c(pu),keys:o?v:c(du),entries:c(vu)},a)for(u in l)(hu||f||!(u in d))&&su(d,u,l[u]);else tu({target:t,proto:!0,forced:hu||f},l);return a&&d[fu]!==v&&su(d,fu,v,{name:i}),lu[t]=v,l},mu=function(e,t){return{value:e,done:t}},_u=ee,bu=dl,wu=Yo;en.f;var ku=yu,Eu=mu,Su="Array Iterator",Tu=wu.set,Cu=wu.getterFor(Su);ku(Array,"Array",(function(e,t){Tu(this,{type:Su,target:_u(e),index:0,kind:t})}),(function(){var e=Cu(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,Eu(void 0,!0)):Eu("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values"),bu.Arguments=bu.Array;var Au={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},xu=s,Pu=ir,Iu=bn,Ru=dl,Du=vt("toStringTag");for(var Ou in Au){var Mu=xu[Ou],Lu=Mu&&Mu.prototype;Lu&&Pu(Lu)!==Du&&Iu(Lu,Du,Ou),Ru[Ou]=Ru.Array}var Fu=fl;_o("dispose");var Uu=Fu;_o("asyncDispose");var Bu=Dn,Nu=_,Vu=ue("Symbol"),Hu=Vu.keyFor,Gu=Nu(Vu.prototype.valueOf);Bu({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==Hu(Gu(e))}catch(t){return!1}}});for(var ju=Dn,zu=Ye,Ku=ue,Wu=_,qu=xe,Xu=vt,Yu=Ku("Symbol"),$u=Yu.isWellKnown,Zu=Ku("Object","getOwnPropertyNames"),Ju=Wu(Yu.prototype.valueOf),Qu=zu("wks"),ec=0,tc=Zu(Yu),nc=tc.length;ec<nc;ec++)try{var rc=tc[ec];qu(Yu[rc])&&Xu(rc)}catch(oz){}ju({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if($u&&$u(e))return!0;try{for(var t=Ju(e),n=0,r=Zu(Qu),i=r.length;n<i;n++)if(Qu[r[n]]==t)return!0}catch(oz){}return!1}}),_o("matcher"),_o("metadataKey"),_o("observable"),_o("metadata"),_o("patternMatch"),_o("replaceAll");var ic=Uu,oc=o(ic),ac=_,sc=Bn,lc=$r,uc=Z,cc=ac("".charAt),hc=ac("".charCodeAt),fc=ac("".slice),dc=function(e){return function(t,n){var r,i,o=lc(uc(t)),a=sc(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=hc(o,a))<55296||r>56319||a+1===s||(i=hc(o,a+1))<56320||i>57343?e?cc(o,a):r:e?fc(o,a,a+2):i-56320+(r-55296<<10)+65536}},pc={codeAt:dc(!1),charAt:dc(!0)},vc=pc.charAt,gc=$r,yc=Yo,mc=yu,_c=mu,bc="String Iterator",wc=yc.set,kc=yc.getterFor(bc);mc(String,"String",(function(e){wc(this,{type:bc,string:gc(e),index:0})}),(function(){var e,t=kc(this),n=t.string,r=t.index;return r>=n.length?_c(void 0,!0):(e=vc(n,r),t.index+=e.length,_c(e,!1))}));var Ec=uo.f("iterator"),Sc=o(Ec);function Tc(e){return(Tc="function"==typeof oc&&"symbol"==typeof Sc?function(e){return typeof e}:function(e){return e&&"function"==typeof oc&&e.constructor===oc&&e!==oc.prototype?"symbol":typeof e})(e)}var Cc={exports:{}},Ac=Dn,xc=D,Pc=en.f;Ac({target:"Object",stat:!0,forced:Object.defineProperty!==Pc,sham:!xc},{defineProperty:Pc});var Ic=ie.Object,Rc=Cc.exports=function(e,t,n){return Ic.defineProperty(e,t,n)};Ic.defineProperty.sham&&(Rc.sham=!0);var Dc=Cc.exports,Oc=o(Dc);Dn({target:"Object",stat:!0,sham:!D},{create:Gi});var Mc=ie.Object,Lc=o((function(e,t){return Mc.create(e,t)})),Fc=Je,Uc=xl,Bc=bl;Dn({target:"Object",stat:!0,forced:l((function(){Uc(1)})),sham:!Bc},{getPrototypeOf:function(e){return Uc(Fc(e))}});var Nc=ie.Object.getPrototypeOf,Vc=o(Nc),Hc=l,Gc=function(e,t){var n=[][e];return!!n&&Hc((function(){n.call(null,t||function(){return 1},1)}))},jc=ra.forEach,zc=Gc("forEach")?[].forEach:function(e){return jc(this,e,arguments.length>1?arguments[1]:void 0)};Dn({target:"Array",proto:!0,forced:[].forEach!=zc},{forEach:zc});var Kc=ie,Wc=function(e){return Kc[e+"Prototype"]},qc=Wc("Array").forEach,Xc=ir,Yc=tt,$c=ce,Zc=qc,Jc=Array.prototype,Qc={DOMTokenList:!0,NodeList:!0},eh=o((function(e){var t=e.forEach;return e===Jc||$c(Jc,e)&&t===Jc.forEach||Yc(Qc,Xc(e))?Zc:t})),th=D,nh=Mn,rh=TypeError,ih=Object.getOwnPropertyDescriptor,oh=th&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(oz){return oz instanceof TypeError}}()?function(e,t){if(nh(e)&&!ih(e,"length").writable)throw rh("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},ah=Je,sh=jn,lh=oh,uh=Kn;Dn({target:"Array",proto:!0,arity:1,forced:l((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(oz){return oz instanceof TypeError}}()},{push:function(e){var t=ah(this),n=sh(t),r=arguments.length;uh(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return lh(t,n),n}});var ch=Wc("Array").push,hh=ce,fh=ch,dh=Array.prototype,ph=o((function(e){var t=e.push;return e===dh||hh(dh,e)&&t===dh.push?fh:t}));Dn({target:"Object",stat:!0},{setPrototypeOf:eu});var vh=ie.Object.setPrototypeOf,gh=o(vh),yh=ue,mh=ji,_h=io,bh=an,wh=_([].concat),kh=yh("Reflect","ownKeys")||function(e){var t=mh.f(bh(e)),n=_h.f;return n?wh(t,n(e)):t},Eh=tt,Sh=kh,Th=R,Ch=en,Ah=re,xh=bn,Ph=Error,Ih=_("".replace),Rh=String(Ph("zxcasd").stack),Dh=/\n\s*at [^:]*:[^\n]*/,Oh=Dh.test(Rh),Mh=G,Lh=!l((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Mh(1,7)),7!==e.stack)})),Fh=bn,Uh=function(e,t){if(Oh&&"string"==typeof e&&!Ph.prepareStackTrace)for(;t--;)e=Ih(e,Dh,"");return e},Bh=Lh,Nh=Error.captureStackTrace,Vh=dl,Hh=vt("iterator"),Gh=Array.prototype,jh=function(e){return void 0!==e&&(Vh.Array===e||Gh[Hh]===e)},zh=ir,Kh=Ue,Wh=X,qh=dl,Xh=vt("iterator"),Yh=function(e){if(!Wh(e))return Kh(e,Xh)||Kh(e,"@@iterator")||qh[zh(e)]},$h=L,Zh=Me,Jh=an,Qh=Ie,ef=Yh,tf=TypeError,nf=function(e,t){var n=arguments.length<2?ef(e):t;if(Zh(n))return Jh($h(n,e));throw tf(Qh(e)+" is not iterable")},rf=L,of=an,af=Ue,sf=function(e,t,n){var r,i;of(e);try{if(!(r=af(e,"return"))){if("throw"===t)throw n;return n}r=rf(r,e)}catch(oz){i=!0,r=oz}if("throw"===t)throw n;if(i)throw r;return of(r),n},lf=Qt,uf=L,cf=an,hf=Ie,ff=jh,df=jn,pf=ce,vf=nf,gf=Yh,yf=sf,mf=TypeError,_f=function(e,t){this.stopped=e,this.result=t},bf=_f.prototype,wf=function(e,t,n){var r,i,o,a,s,l,u,c=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=lf(t,c),g=function(e){return r&&yf(r,"normal",e),new _f(!0,e)},y=function(e){return h?(cf(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(f)r=e.iterator;else if(d)r=e;else{if(!(i=gf(e)))throw mf(hf(e)+" is not iterable");if(ff(i)){for(o=0,a=df(e);a>o;o++)if((s=y(e[o]))&&pf(bf,s))return s;return new _f(!1)}r=vf(e,i)}for(l=f?e.next:r.next;!(u=uf(l,r)).done;){try{s=y(u.value)}catch(oz){yf(r,"throw",oz)}if("object"==typeof s&&s&&pf(bf,s))return s}return new _f(!1)},kf=$r,Ef=Dn,Sf=ce,Tf=xl,Cf=eu,Af=function(e,t,n){for(var r=Sh(t),i=Ch.f,o=Th.f,a=0;a<r.length;a++){var s=r[a];Eh(e,s)||n&&Eh(n,s)||i(e,s,o(t,s))}},xf=Gi,Pf=bn,If=G,Rf=function(e,t){Ah(t)&&"cause"in t&&xh(e,"cause",t.cause)},Df=function(e,t,n,r){Bh&&(Nh?Nh(e,t):Fh(e,"stack",Uh(n,r)))},Of=wf,Mf=function(e,t){return void 0===e?arguments.length<2?"":t:kf(e)},Lf=vt("toStringTag"),Ff=Error,Uf=[].push,Bf=function(e,t){var n,r=Sf(Nf,this);Cf?n=Cf(Ff(),r?Tf(this):Nf):(n=r?this:xf(Nf),Pf(n,Lf,"Error")),void 0!==t&&Pf(n,"message",Mf(t)),Df(n,Bf,n.stack,1),arguments.length>2&&Rf(n,arguments[2]);var i=[];return Of(e,Uf,{that:i}),Pf(n,"errors",i),n};Cf?Cf(Bf,Ff):Af(Bf,Ff,{name:!0});var Nf=Bf.prototype=xf(Ff.prototype,{constructor:If(1,Bf),message:If(1,""),name:If(1,"AggregateError")});Ef({global:!0,constructor:!0,arity:2},{AggregateError:Bf});var Vf,Hf,Gf,jf,zf="undefined"!=typeof process&&"process"==E(process),Kf=ue,Wf=lo,qf=D,Xf=vt("species"),Yf=function(e){var t=Kf(e);qf&&t&&!t[Xf]&&Wf(t,Xf,{configurable:!0,get:function(){return this}})},$f=ce,Zf=TypeError,Jf=function(e,t){if($f(t,e))return e;throw Zf("Incorrect invocation")},Qf=kr,ed=Ie,td=TypeError,nd=function(e){if(Qf(e))return e;throw td(ed(e)+" is not a constructor")},rd=an,id=nd,od=X,ad=vt("species"),sd=function(e,t){var n,r=rd(e).constructor;return void 0===r||od(n=rd(r)[ad])?t:id(n)},ld=TypeError,ud=function(e,t){if(e<t)throw ld("Not enough arguments");return e},cd=/(?:ipad|iphone|ipod).*applewebkit/i.test(he),hd=s,fd=p,dd=Qt,pd=I,vd=tt,gd=l,yd=Ti,md=As,_d=Pt,bd=ud,wd=cd,kd=zf,Ed=hd.setImmediate,Sd=hd.clearImmediate,Td=hd.process,Cd=hd.Dispatch,Ad=hd.Function,xd=hd.MessageChannel,Pd=hd.String,Id=0,Rd={},Dd="onreadystatechange";gd((function(){Vf=hd.location}));var Od=function(e){if(vd(Rd,e)){var t=Rd[e];delete Rd[e],t()}},Md=function(e){return function(){Od(e)}},Ld=function(e){Od(e.data)},Fd=function(e){hd.postMessage(Pd(e),Vf.protocol+"//"+Vf.host)};Ed&&Sd||(Ed=function(e){bd(arguments.length,1);var t=pd(e)?e:Ad(e),n=md(arguments,1);return Rd[++Id]=function(){fd(t,void 0,n)},Hf(Id),Id},Sd=function(e){delete Rd[e]},kd?Hf=function(e){Td.nextTick(Md(e))}:Cd&&Cd.now?Hf=function(e){Cd.now(Md(e))}:xd&&!wd?(jf=(Gf=new xd).port2,Gf.port1.onmessage=Ld,Hf=dd(jf.postMessage,jf)):hd.addEventListener&&pd(hd.postMessage)&&!hd.importScripts&&Vf&&"file:"!==Vf.protocol&&!gd(Fd)?(Hf=Fd,hd.addEventListener("message",Ld,!1)):Hf=Dd in _d("script")?function(e){yd.appendChild(_d("script"))[Dd]=function(){yd.removeChild(this),Od(e)}}:function(e){setTimeout(Md(e),0)});var Ud={set:Ed,clear:Sd},Bd=function(){this.head=null,this.tail=null};Bd.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 Nd,Vd,Hd,Gd,jd,zd=Bd,Kd=/ipad|iphone|ipod/i.test(he)&&"undefined"!=typeof Pebble,Wd=/web0s(?!.*chrome)/i.test(he),qd=s,Xd=Qt,Yd=R.f,$d=Ud.set,Zd=zd,Jd=cd,Qd=Kd,ep=Wd,tp=zf,np=qd.MutationObserver||qd.WebKitMutationObserver,rp=qd.document,ip=qd.process,op=qd.Promise,ap=Yd(qd,"queueMicrotask"),sp=ap&&ap.value;if(!sp){var lp=new Zd,up=function(){var e,t;for(tp&&(e=ip.domain)&&e.exit();t=lp.get();)try{t()}catch(oz){throw lp.head&&Nd(),oz}e&&e.enter()};Jd||tp||ep||!np||!rp?!Qd&&op&&op.resolve?((Gd=op.resolve(void 0)).constructor=op,jd=Xd(Gd.then,Gd),Nd=function(){jd(up)}):tp?Nd=function(){ip.nextTick(up)}:($d=Xd($d,qd),Nd=function(){$d(up)}):(Vd=!0,Hd=rp.createTextNode(""),new np(up).observe(Hd,{characterData:!0}),Nd=function(){Hd.data=Vd=!Vd}),sp=function(e){lp.head||Nd(),lp.add(e)}}var cp=sp,hp=function(e){try{return{error:!1,value:e()}}catch(oz){return{error:!0,value:oz}}},fp=s.Promise,dp="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,pp=!dp&&!zf&&"object"==typeof window&&"object"==typeof document,vp=s,gp=fp,yp=I,mp=Yt,_p=lr,bp=vt,wp=pp,kp=dp,Ep=me,Sp=gp&&gp.prototype,Tp=bp("species"),Cp=!1,Ap=yp(vp.PromiseRejectionEvent),xp={CONSTRUCTOR:mp("Promise",(function(){var e=_p(gp),t=e!==String(gp);if(!t&&66===Ep)return!0;if(!Sp.catch||!Sp.finally)return!0;if(!Ep||Ep<51||!/native code/.test(e)){var n=new gp((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[Tp]=r,!(Cp=n.then((function(){}))instanceof r))return!0}return!t&&(wp||kp)&&!Ap})),REJECTION_EVENT:Ap,SUBCLASSING:Cp},Pp={},Ip=Me,Rp=TypeError,Dp=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw Rp("Bad Promise constructor");t=e,n=r})),this.resolve=Ip(t),this.reject=Ip(n)};Pp.f=function(e){return new Dp(e)};var Op,Mp,Lp=Dn,Fp=zf,Up=s,Bp=L,Np=ao,Vp=Oo,Hp=Yf,Gp=Me,jp=I,zp=re,Kp=Jf,Wp=sd,qp=Ud.set,Xp=cp,Yp=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(oz){}},$p=hp,Zp=zd,Jp=Yo,Qp=fp,ev=xp,tv=Pp,nv="Promise",rv=ev.CONSTRUCTOR,iv=ev.REJECTION_EVENT,ov=Jp.getterFor(nv),av=Jp.set,sv=Qp&&Qp.prototype,lv=Qp,uv=sv,cv=Up.TypeError,hv=Up.document,fv=Up.process,dv=tv.f,pv=dv,vv=!!(hv&&hv.createEvent&&Up.dispatchEvent),gv="unhandledrejection",yv=function(e){var t;return!(!zp(e)||!jp(t=e.then))&&t},mv=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,u=e.reject,c=e.domain;try{s?(a||(2===t.rejection&&Ev(t),t.rejection=1),!0===s?n=o:(c&&c.enter(),n=s(o),c&&(c.exit(),i=!0)),n===e.promise?u(cv("Promise-chain cycle")):(r=yv(n))?Bp(r,n,l,u):l(n)):u(o)}catch(oz){c&&!i&&c.exit(),u(oz)}},_v=function(e,t){e.notified||(e.notified=!0,Xp((function(){for(var n,r=e.reactions;n=r.get();)mv(n,e);e.notified=!1,t&&!e.rejection&&wv(e)})))},bv=function(e,t,n){var r,i;vv?((r=hv.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Up.dispatchEvent(r)):r={promise:t,reason:n},!iv&&(i=Up["on"+e])?i(r):e===gv&&Yp("Unhandled promise rejection",n)},wv=function(e){Bp(qp,Up,(function(){var t,n=e.facade,r=e.value;if(kv(e)&&(t=$p((function(){Fp?fv.emit("unhandledRejection",r,n):bv(gv,n,r)})),e.rejection=Fp||kv(e)?2:1,t.error))throw t.value}))},kv=function(e){return 1!==e.rejection&&!e.parent},Ev=function(e){Bp(qp,Up,(function(){var t=e.facade;Fp?fv.emit("rejectionHandled",t):bv("rejectionhandled",t,e.value)}))},Sv=function(e,t,n){return function(r){e(t,r,n)}},Tv=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,_v(e,!0))},Cv=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw cv("Promise can't be resolved itself");var r=yv(t);r?Xp((function(){var n={done:!1};try{Bp(r,t,Sv(Cv,n,e),Sv(Tv,n,e))}catch(oz){Tv(n,oz,e)}})):(e.value=t,e.state=1,_v(e,!1))}catch(oz){Tv({done:!1},oz,e)}}};rv&&(uv=(lv=function(e){Kp(this,uv),Gp(e),Bp(Op,this);var t=ov(this);try{e(Sv(Cv,t),Sv(Tv,t))}catch(oz){Tv(t,oz)}}).prototype,(Op=function(e){av(this,{type:nv,done:!1,notified:!1,parent:!1,reactions:new Zp,rejection:!1,state:0,value:void 0})}).prototype=Np(uv,"then",(function(e,t){var n=ov(this),r=dv(Wp(this,lv));return n.parent=!0,r.ok=!jp(e)||e,r.fail=jp(t)&&t,r.domain=Fp?fv.domain:void 0,0==n.state?n.reactions.add(r):Xp((function(){mv(r,n)})),r.promise})),Mp=function(){var e=new Op,t=ov(e);this.promise=e,this.resolve=Sv(Cv,t),this.reject=Sv(Tv,t)},tv.f=dv=function(e){return e===lv||undefined===e?new Mp(e):pv(e)}),Lp({global:!0,constructor:!0,wrap:!0,forced:rv},{Promise:lv}),Vp(lv,nv,!1,!0),Hp(nv);var Av=vt("iterator"),xv=!1;try{var Pv=0,Iv={next:function(){return{done:!!Pv++}},return:function(){xv=!0}};Iv[Av]=function(){return this},Array.from(Iv,(function(){throw 2}))}catch(oz){}var Rv=function(e,t){if(!t&&!xv)return!1;var n=!1;try{var r={};r[Av]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(oz){}return n},Dv=fp,Ov=xp.CONSTRUCTOR||!Rv((function(e){Dv.all(e).then(void 0,(function(){}))})),Mv=L,Lv=Me,Fv=Pp,Uv=hp,Bv=wf;Dn({target:"Promise",stat:!0,forced:Ov},{all:function(e){var t=this,n=Fv.f(t),r=n.resolve,i=n.reject,o=Uv((function(){var n=Lv(t.resolve),o=[],a=0,s=1;Bv(e,(function(e){var l=a++,u=!1;s++,Mv(n,t,e).then((function(e){u||(u=!0,o[l]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var Nv=Dn,Vv=xp.CONSTRUCTOR;fp&&fp.prototype,Nv({target:"Promise",proto:!0,forced:Vv,real:!0},{catch:function(e){return this.then(void 0,e)}});var Hv=L,Gv=Me,jv=Pp,zv=hp,Kv=wf;Dn({target:"Promise",stat:!0,forced:Ov},{race:function(e){var t=this,n=jv.f(t),r=n.reject,i=zv((function(){var i=Gv(t.resolve);Kv(e,(function(e){Hv(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Wv=L,qv=Pp;Dn({target:"Promise",stat:!0,forced:xp.CONSTRUCTOR},{reject:function(e){var t=qv.f(this);return Wv(t.reject,void 0,e),t.promise}});var Xv=an,Yv=re,$v=Pp,Zv=function(e,t){if(Xv(e),Yv(t)&&t.constructor===e)return t;var n=$v.f(e);return(0,n.resolve)(t),n.promise},Jv=Dn,Qv=fp,eg=xp.CONSTRUCTOR,tg=Zv,ng=ue("Promise"),rg=!eg;Jv({target:"Promise",stat:!0,forced:true},{resolve:function(e){return tg(rg&&this===ng?Qv:this,e)}});var ig=L,og=Me,ag=Pp,sg=hp,lg=wf;Dn({target:"Promise",stat:!0,forced:Ov},{allSettled:function(e){var t=this,n=ag.f(t),r=n.resolve,i=n.reject,o=sg((function(){var n=og(t.resolve),i=[],o=0,a=1;lg(e,(function(e){var s=o++,l=!1;a++,ig(n,t,e).then((function(e){l||(l=!0,i[s]={status:"fulfilled",value:e},--a||r(i))}),(function(e){l||(l=!0,i[s]={status:"rejected",reason:e},--a||r(i))}))})),--a||r(i)}));return o.error&&i(o.value),n.promise}});var ug=L,cg=Me,hg=ue,fg=Pp,dg=hp,pg=wf,vg="No one promise resolved";Dn({target:"Promise",stat:!0,forced:Ov},{any:function(e){var t=this,n=hg("AggregateError"),r=fg.f(t),i=r.resolve,o=r.reject,a=dg((function(){var r=cg(t.resolve),a=[],s=0,l=1,u=!1;pg(e,(function(e){var c=s++,h=!1;l++,ug(r,t,e).then((function(e){h||u||(u=!0,i(e))}),(function(e){h||u||(h=!0,a[c]=e,--l||o(new n(a,vg)))}))})),--l||o(new n(a,vg))}));return a.error&&o(a.value),r.promise}});var gg=Dn,yg=fp,mg=l,_g=ue,bg=I,wg=sd,kg=Zv,Eg=yg&&yg.prototype;gg({target:"Promise",proto:!0,real:!0,forced:!!yg&&mg((function(){Eg.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=wg(this,_g("Promise")),n=bg(e);return this.then(n?function(n){return kg(t,e()).then((function(){return n}))}:e,n?function(n){return kg(t,e()).then((function(){throw n}))}:e)}});var Sg=ie.Promise,Tg=Pp,Cg=hp;Dn({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Tg.f(this),n=Cg(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}});var Ag=Sg,xg=o(Ag),Pg=Dn,Ig=Mn,Rg=_([].reverse),Dg=[1,2];Pg({target:"Array",proto:!0,forced:String(Dg)===String(Dg.reverse())},{reverse:function(){return Ig(this)&&(this.length=this.length),Rg(this)}});var Og=Wc("Array").reverse,Mg=ce,Lg=Og,Fg=Array.prototype,Ug=function(e){var t=e.reverse;return e===Fg||Mg(Fg,e)&&t===Fg.reverse?Lg:t},Bg=o(Ug),Ng=Dn,Vg=Mn,Hg=kr,Gg=re,jg=ti,zg=jn,Kg=ee,Wg=Yn,qg=vt,Xg=As,Yg=Or("slice"),$g=qg("species"),Zg=Array,Jg=Math.max;Ng({target:"Array",proto:!0,forced:!Yg},{slice:function(e,t){var n,r,i,o=Kg(this),a=zg(o),s=jg(e,a),l=jg(void 0===t?a:t,a);if(Vg(o)&&(n=o.constructor,(Hg(n)&&(n===Zg||Vg(n.prototype))||Gg(n)&&null===(n=n[$g]))&&(n=void 0),n===Zg||void 0===n))return Xg(o,s,l);for(r=new(void 0===n?Zg:n)(Jg(l-s,0)),i=0;s<l;s++,i++)s in o&&Wg(r,i,o[s]);return r.length=i,r}});var Qg=Wc("Array").slice,ey=ce,ty=Qg,ny=Array.prototype,ry=function(e){var t=e.slice;return e===ny||ey(ny,e)&&t===ny.slice?ty:t},iy=o(ry);function oy(){oy=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Oc||function(e,t,n){e[t]=n.value},i="function"==typeof oc?oc:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Oc(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(A){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Lc(o.prototype),s=new S(i||[]);return r(a,"_invoke",{value:b(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=u;var h={};function f(){}function d(){}function p(){}var v={};l(v,o,(function(){return this}));var g=Vc&&Vc(Vc(T([])));g&&g!==t&&n.call(g,o)&&(v=g);var y=p.prototype=f.prototype=Lc(v);function m(e){var t;eh(t=["next","throw","return"]).call(t,(function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(r,o,a,s){var l=c(e[r],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==Tc(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function b(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function w(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function k(e){var t,n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),ph(t=this.tryEntries).call(t,n)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],eh(e).call(e,k,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return gh?gh(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Lc(y),e},e.awrap=function(e){return{__await:e}},m(_.prototype),l(_.prototype,a,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,i,o){void 0===o&&(o=xg);var a=new _(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(y),l(y,s,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)ph(n).call(n,r);return Bg(n).call(n),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=T,S.prototype={constructor:S,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,eh(t=this.tryEntries).call(t,E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+iy(r).call(r,1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function ay(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(oz){return void n(oz)}s.done?t(l):xg.resolve(l).then(r,i)}function sy(e){return function(){var t=this,n=arguments;return new xg((function(r,i){var o=e.apply(t,n);function a(e){ay(o,r,i,a,s,"next",e)}function s(e){ay(o,r,i,a,s,"throw",e)}a(void 0)}))}}Dn({target:"Array",stat:!0},{isArray:Mn});var ly=o(ie.Array.isArray);function uy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cy=Yh,hy=o(cy),fy=an,dy=sf,py=Qt,vy=L,gy=Je,yy=function(e,t,n,r){try{return r?t(fy(n)[0],n[1]):t(n)}catch(oz){dy(e,"throw",oz)}},my=jh,_y=kr,by=jn,wy=Yn,ky=nf,Ey=Yh,Sy=Array,Ty=function(e){var t=gy(e),n=_y(this),r=arguments.length,i=r>1?arguments[1]:void 0,o=void 0!==i;o&&(i=py(i,r>2?arguments[2]:void 0));var a,s,l,u,c,h,f=Ey(t),d=0;if(!f||this===Sy&&my(f))for(a=by(t),s=n?new this(a):Sy(a);a>d;d++)h=o?i(t[d],d):t[d],wy(s,d,h);else for(c=(u=ky(t,f)).next,s=n?new this:[];!(l=vy(c,u)).done;d++)h=o?yy(u,i,[l.value,d],!0):l.value,wy(s,d,h);return s.length=d,s},Cy=Ty;Dn({target:"Array",stat:!0,forced:!Rv((function(e){Array.from(e)}))},{from:Cy});var Ay=ie.Array.from,xy=o(Ay);function Py(e,t){var n;if(e){if("string"==typeof e)return uy(e,t);var r=iy(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?xy(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uy(e,t):void 0}}function Iy(e){return function(e){if(ly(e))return uy(e)}(e)||function(e){if(void 0!==oc&&null!=hy(e)||null!=e["@@iterator"])return xy(e)}(e)||Py(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ry(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Dy=uo.f("toPrimitive"),Oy=o(Dy);function My(e){var t=function(e,t){if("object"!==Tc(e)||null===e)return e;var n=e[Oy];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Tc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Tc(t)?t:String(t)}function Ly(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Oc(e,My(r.key),r)}}function Fy(e,t,n){return t&&Ly(e.prototype,t),n&&Ly(e,n),Oc(e,"prototype",{writable:!1}),e}function Uy(e,t,n){return(t=My(t))in e?Oc(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var By=ie.Object.getOwnPropertySymbols,Ny=o(By),Vy=Dn,Hy=ai.indexOf,Gy=Gc,jy=C([].indexOf),zy=!!jy&&1/jy([1],1,-0)<0;Vy({target:"Array",proto:!0,forced:zy||!Gy("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return zy?jy(this,e,t)||0:Hy(this,e,t)}});var Ky=Wc("Array").indexOf,Wy=ce,qy=Ky,Xy=Array.prototype,Yy=function(e){var t=e.indexOf;return e===Xy||Wy(Xy,e)&&t===Xy.indexOf?qy:t},$y=o(Yy),Zy=Je,Jy=yi;Dn({target:"Object",stat:!0,forced:l((function(){Jy(1)}))},{keys:function(e){return Jy(Zy(e))}});var Qy=ie.Object.keys,em=o(Qy);function tm(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=em(e);for(r=0;r<o.length;r++)n=o[r],$y(t).call(t,n)>=0||(i[n]=e[n]);return i}(e,t);if(Ny){var o=Ny(e);for(r=0;r<o.length;r++)n=o[r],$y(t).call(t,n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var nm=ra.filter;Dn({target:"Array",proto:!0,forced:!Or("filter")},{filter:function(e){return nm(this,e,arguments.length>1?arguments[1]:void 0)}});var rm=Wc("Array").filter,im=ce,om=rm,am=Array.prototype,sm=function(e){var t=e.filter;return e===am||im(am,e)&&t===am.filter?om:t},lm=o(sm),um={exports:{}},cm=Dn,hm=l,fm=ee,dm=R.f,pm=D;cm({target:"Object",stat:!0,forced:!pm||hm((function(){dm(1)})),sham:!pm},{getOwnPropertyDescriptor:function(e,t){return dm(fm(e),t)}});var vm=ie.Object,gm=um.exports=function(e,t){return vm.getOwnPropertyDescriptor(e,t)};vm.getOwnPropertyDescriptor.sham&&(gm.sham=!0);var ym=um.exports,mm=o(ym),_m=kh,bm=ee,wm=R,km=Yn;Dn({target:"Object",stat:!0,sham:!D},{getOwnPropertyDescriptors:function(e){for(var t,n,r=bm(e),i=wm.f,o=_m(r),a={},s=0;o.length>s;)void 0!==(n=i(r,t=o[s++]))&&km(a,t,n);return a}});var Em=ie.Object.getOwnPropertyDescriptors,Sm=o(Em),Tm={exports:{}},Cm=Dn,Am=D,xm=Zr.f;Cm({target:"Object",stat:!0,forced:Object.defineProperties!==xm,sham:!Am},{defineProperties:xm});var Pm=ie.Object,Im=Tm.exports=function(e,t){return Pm.defineProperties(e,t)};Pm.defineProperties.sham&&(Im.sham=!0);var Rm=Tm.exports,Dm=o(Rm);function Om(e,t){var n=em(e);if(Ny){var r=Ny(e);t&&(r=lm(r).call(r,(function(t){return mm(e,t).enumerable}))),ph(n).apply(n,r)}return n}function Mm(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?eh(n=Om(Object(i),!0)).call(n,(function(t){Uy(e,t,i[t])})):Sm?Dm(e,Sm(i)):eh(r=Om(Object(i))).call(r,(function(t){Oc(e,t,mm(i,t))}))}return e}var Lm=Wc("Array").concat,Fm=ce,Um=Lm,Bm=Array.prototype,Nm=o((function(e){var t=e.concat;return e===Bm||Fm(Bm,e)&&t===Bm.concat?Um:t})),Vm=Dn,Hm=ra.find,Gm="find",jm=!0;Gm in[]&&Array(1)[Gm]((function(){jm=!1})),Vm({target:"Array",proto:!0,forced:jm},{find:function(e){return Hm(this,e,arguments.length>1?arguments[1]:void 0)}});var zm=Wc("Array").find,Km=ce,Wm=zm,qm=Array.prototype,Xm=o((function(e){var t=e.find;return e===qm||Km(qm,e)&&t===qm.find?Wm:t})),Ym={exports:{}},$m=l((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Zm=l,Jm=re,Qm=E,e_=$m,t_=Object.isExtensible,n_=Zm((function(){t_(1)}))||e_?function(e){return!!Jm(e)&&((!e_||"ArrayBuffer"!=Qm(e))&&(!t_||t_(e)))}:t_,r_=!l((function(){return Object.isExtensible(Object.preventExtensions({}))})),i_=Dn,o_=_,a_=si,s_=re,l_=tt,u_=en.f,c_=ji,h_=Wi,f_=n_,d_=r_,p_=!1,v_=at("meta"),g_=0,y_=function(e){u_(e,v_,{value:{objectID:"O"+g_++,weakData:{}}})},m_=Ym.exports={enable:function(){m_.enable=function(){},p_=!0;var e=c_.f,t=o_([].splice),n={};n[v_]=1,e(n).length&&(c_.f=function(n){for(var r=e(n),i=0,o=r.length;i<o;i++)if(r[i]===v_){t(r,i,1);break}return r},i_({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h_.f}))},fastKey:function(e,t){if(!s_(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!l_(e,v_)){if(!f_(e))return"F";if(!t)return"E";y_(e)}return e[v_].objectID},getWeakData:function(e,t){if(!l_(e,v_)){if(!f_(e))return!0;if(!t)return!1;y_(e)}return e[v_].weakData},onFreeze:function(e){return d_&&p_&&f_(e)&&!l_(e,v_)&&y_(e),e}};a_[v_]=!0;var __=Ym.exports,b_=Dn,w_=s,k_=__,E_=l,S_=bn,T_=wf,C_=Jf,A_=I,x_=re,P_=Oo,I_=en.f,R_=ra.forEach,D_=D,O_=Yo.set,M_=Yo.getterFor,L_=ao,F_=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:L_(e,r,t[r],n);return e},U_=Gi,B_=lo,N_=F_,V_=Qt,H_=Jf,G_=X,j_=wf,z_=yu,K_=mu,W_=Yf,q_=D,X_=__.fastKey,Y_=Yo.set,$_=Yo.getterFor,Z_={getConstructor:function(e,t,n,r){var i=e((function(e,i){H_(e,o),Y_(e,{type:t,index:U_(null),first:void 0,last:void 0,size:0}),q_||(e.size=0),G_(i)||j_(i,e[r],{that:e,AS_ENTRIES:n})})),o=i.prototype,a=$_(t),s=function(e,t,n){var r,i,o=a(e),s=l(e,t);return s?s.value=n:(o.last=s={index:i=X_(t,!0),key:t,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=s),r&&(r.next=s),q_?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},l=function(e,t){var n,r=a(e),i=X_(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return N_(o,{clear:function(){for(var e=a(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,q_?e.size=0:this.size=0},delete:function(e){var t=this,n=a(t),r=l(t,e);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first==r&&(n.first=i),n.last==r&&(n.last=o),q_?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=a(this),r=V_(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!l(this,e)}}),N_(o,n?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),q_&&B_(o,"size",{configurable:!0,get:function(){return a(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=$_(t),o=$_(r);z_(e,t,(function(e,t){Y_(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?K_("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,K_(void 0,!0))}),n?"entries":"values",!n,!0),W_(t)}};(function(e,t,n){var r,i=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),a=i?"set":"add",s=w_[e],l=s&&s.prototype,u={};if(D_&&A_(s)&&(o||l.forEach&&!E_((function(){(new s).entries().next()})))){var c=(r=t((function(t,n){O_(C_(t,c),{type:e,collection:new s}),null!=n&&T_(n,t[a],{that:t,AS_ENTRIES:i})}))).prototype,h=M_(e);R_(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in l)||o&&"clear"==e||S_(c,e,(function(n,r){var i=h(this).collection;if(!t&&o&&!x_(n))return"get"==e&&void 0;var a=i[e](0===n?0:n,r);return t?this:a}))})),o||I_(c,"size",{configurable:!0,get:function(){return h(this).collection.size}})}else r=n.getConstructor(t,e,i,a),k_.enable();P_(r,e,!1,!0),u[e]=r,b_({global:!0,forced:!0},u),o||n.setStrong(r,e,i)})("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Z_);var J_=ie.Map,Q_=Qt,eb=L,tb=Me,nb=nd,rb=X,ib=wf,ob=[].push,ab=function(e){var t,n,r,i,o=arguments.length,a=o>1?arguments[1]:void 0;return nb(this),(t=void 0!==a)&&tb(a),rb(e)?new this:(n=[],t?(r=0,i=Q_(a,o>2?arguments[2]:void 0),ib(e,(function(e){eb(ob,n,i(e,r++))}))):ib(e,ob,{that:n}),new this(n))};Dn({target:"Map",stat:!0,forced:!0},{from:ab});var sb=As,lb=function(){return new this(sb(arguments))};Dn({target:"Map",stat:!0,forced:!0},{of:lb});var ub=Ie,cb=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"get"in e&&"set"in e&&"delete"in e&&"entries"in e)return e;throw TypeError(ub(e)+" is not a map")},hb=function(e,t){return 1==t?function(t,n){return t[e](n)}:function(t,n,r){return t[e](n,r)}},fb=ue("Map"),db={Map:fb,set:hb("set",2),get:hb("get",1),has:hb("has",1),remove:hb("delete",1),proto:fb.prototype},pb=cb,vb=db.remove;Dn({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=pb(this),n=!0,r=0,i=arguments.length;r<i;r++)e=vb(t,arguments[r]),n=n&&e;return!!n}});var gb=cb,yb=db.get,mb=db.has,_b=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var n,r,i=gb(this);return mb(i,e)?(n=yb(i,e),"update"in t&&(n=t.update(n,e,i),_b(i,e,n)),n):(r=t.insert(e,i),_b(i,e,r),r)}});var bb=L,wb=function(e,t,n){for(var r,i,o=n||e.next;!(r=bb(o,e)).done;)if(void 0!==(i=t(r.value)))return i},kb=function(e,t,n){return n?wb(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},Eb=Qt,Sb=cb,Tb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=Sb(this),n=Eb(e,arguments.length>1?arguments[1]:void 0);return!1!==Tb(t,(function(e,r){if(!n(e,r,t))return!1}),!0)}});var Cb=Qt,Ab=cb,xb=kb,Pb=db.Map,Ib=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=Ab(this),n=Cb(e,arguments.length>1?arguments[1]:void 0),r=new Pb;return xb(t,(function(e,i){n(e,i,t)&&Ib(r,i,e)})),r}});var Rb=Qt,Db=cb,Ob=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=Db(this),n=Rb(e,arguments.length>1?arguments[1]:void 0),r=Ob(t,(function(e,r){if(n(e,r,t))return{value:e}}),!0);return r&&r.value}});var Mb=Qt,Lb=cb,Fb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=Lb(this),n=Mb(e,arguments.length>1?arguments[1]:void 0),r=Fb(t,(function(e,r){if(n(e,r,t))return{key:r}}),!0);return r&&r.key}});var Ub=Dn,Bb=L,Nb=I,Vb=Me,Hb=wf,Gb=db.Map,jb=_([].push);Ub({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var n=new(Nb(this)?this:Gb);Vb(t);var r=Vb(n.has),i=Vb(n.get),o=Vb(n.set);return Hb(e,(function(e){var a=t(e);Bb(r,n,a)?jb(Bb(i,n,a),e):Bb(o,n,a,[e])})),n}});var zb=function(e,t){return e===t||e!=e&&t!=t},Kb=cb,Wb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===Wb(Kb(this),(function(t){if(zb(t,e))return!0}),!0)}});var qb=L,Xb=wf,Yb=I,$b=Me,Zb=db.Map;Dn({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var n=new(Yb(this)?this:Zb);$b(t);var r=$b(n.set);return Xb(e,(function(e){qb(r,n,t(e),e)})),n}});var Jb=cb,Qb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=Qb(Jb(this),(function(t,n){if(t===e)return{key:n}}),!0);return t&&t.key}});var ew=Qt,tw=cb,nw=kb,rw=db.Map,iw=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=tw(this),n=ew(e,arguments.length>1?arguments[1]:void 0),r=new rw;return nw(t,(function(e,i){iw(r,n(e,i,t),e)})),r}});var ow=Qt,aw=cb,sw=kb,lw=db.Map,uw=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=aw(this),n=ow(e,arguments.length>1?arguments[1]:void 0),r=new lw;return sw(t,(function(e,i){uw(r,i,n(e,i,t))})),r}});var cw=cb,hw=wf,fw=db.set;Dn({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=cw(this),n=arguments.length,r=0;r<n;)hw(arguments[r++],(function(e,n){fw(t,e,n)}),{AS_ENTRIES:!0});return t}});var dw=Me,pw=cb,vw=kb,gw=TypeError;Dn({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=pw(this),n=arguments.length<2,r=n?void 0:arguments[1];if(dw(e),vw(t,(function(i,o){n?(n=!1,r=i):r=e(r,i,o,t)})),n)throw gw("Reduce of empty map with no initial value");return r}});var yw=Qt,mw=cb,_w=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=mw(this),n=yw(e,arguments.length>1?arguments[1]:void 0);return!0===_w(t,(function(e,r){if(n(e,r,t))return!0}),!0)}});var bw=Me,ww=cb,kw=TypeError,Ew=db.get,Sw=db.has,Tw=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var n=ww(this),r=arguments.length;bw(t);var i=Sw(n,e);if(!i&&r<3)throw kw("Updating absent value");var o=i?Ew(n,e):bw(r>2?arguments[2]:void 0)(e,n);return Tw(n,e,t(o,e,n)),n}});var Cw=L,Aw=Me,xw=I,Pw=an,Iw=TypeError,Rw=function(e,t){var n,r=Pw(this),i=Aw(r.get),o=Aw(r.has),a=Aw(r.set),s=arguments.length>2?arguments[2]:void 0;if(!xw(t)&&!xw(s))throw Iw("At least one callback required");return Cw(o,r,e)?(n=Cw(i,r,e),xw(t)&&(n=t(n),Cw(a,r,e,n))):xw(s)&&(n=s(),Cw(a,r,e,n)),n};Dn({target:"Map",proto:!0,real:!0,forced:!0},{upsert:Rw}),Dn({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:Rw});var Dw=J_,Ow=o(Dw),Mw=o(Dw),Lw=ra.map;Dn({target:"Array",proto:!0,forced:!Or("map")},{map:function(e){return Lw(this,e,arguments.length>1?arguments[1]:void 0)}});var Fw=Wc("Array").map,Uw=ce,Bw=Fw,Nw=Array.prototype,Vw=o((function(e){var t=e.map;return e===Nw||Uw(Nw,e)&&t===Nw.map?Bw:t})),Hw=o(Ag),Gw=o(sm),jw=ai.includes;Dn({target:"Array",proto:!0,forced:l((function(){return!Array(1).includes()}))},{includes:function(e){return jw(this,e,arguments.length>1?arguments[1]:void 0)}});var zw=Wc("Array").includes,Kw=re,Ww=E,qw=vt("match"),Xw=function(e){var t;return Kw(e)&&(void 0!==(t=e[qw])?!!t:"RegExp"==Ww(e))},Yw=TypeError,$w=function(e){if(Xw(e))throw Yw("The method doesn't accept regular expressions");return e},Zw=vt("match"),Jw=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Zw]=!1,"/./"[e](t)}catch(oz){}}return!1},Qw=Dn,ek=$w,tk=Z,nk=$r,rk=Jw,ik=_("".indexOf);Qw({target:"String",proto:!0,forced:!rk("includes")},{includes:function(e){return!!~ik(nk(tk(this)),nk(ek(e)),arguments.length>1?arguments[1]:void 0)}});var ok=Wc("String").includes,ak=ce,sk=zw,lk=ok,uk=Array.prototype,ck=String.prototype,hk=o((function(e){var t=e.includes;return e===uk||ak(uk,e)&&t===uk.includes?sk:"string"==typeof e||e===ck||ak(ck,e)&&t===ck.includes?lk:t})),fk=o(Yy),dk=o(Qy),pk=o(ry),vk=Ie,gk=TypeError,yk=function(e,t){if(!delete e[t])throw gk("Cannot delete property "+vk(t)+" of "+vk(e))},mk=Dn,_k=Je,bk=ti,wk=Bn,kk=jn,Ek=oh,Sk=Kn,Tk=Pr,Ck=Yn,Ak=yk,xk=Or("splice"),Pk=Math.max,Ik=Math.min;mk({target:"Array",proto:!0,forced:!xk},{splice:function(e,t){var n,r,i,o,a,s,l=_k(this),u=kk(l),c=bk(e,u),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=u-c):(n=h-2,r=Ik(Pk(wk(t),0),u-c)),Sk(u+n-r),i=Tk(l,r),o=0;o<r;o++)(a=c+o)in l&&Ck(i,o,l[a]);if(i.length=r,n<r){for(o=c;o<u-r;o++)s=o+n,(a=o+r)in l?l[s]=l[a]:Ak(l,s);for(o=u;o>u-r+n;o--)Ak(l,o-1)}else if(n>r)for(o=u-r;o>c;o--)s=o+n-1,(a=o+r-1)in l?l[s]=l[a]:Ak(l,s);for(o=0;o<n;o++)l[o+c]=arguments[o+2];return Ek(l,u-r+n),i}});var Rk=Wc("Array").splice,Dk=ce,Ok=Rk,Mk=Array.prototype,Lk=o((function(e){var t=e.splice;return e===Mk||Dk(Mk,e)&&t===Mk.splice?Ok:t}));Dn({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Fk=o(ie.Number.isNaN),Uk="\t\n\v\f\r \u2028\u2029\ufeff",Bk=Z,Nk=$r,Vk=Uk,Hk=_("".replace),Gk=RegExp("^["+Vk+"]+"),jk=RegExp("(^|[^"+Vk+"])["+Vk+"]+$"),zk=function(e){return function(t){var n=Nk(Bk(t));return 1&e&&(n=Hk(n,Gk,"")),2&e&&(n=Hk(n,jk,"$1")),n}},Kk={start:zk(1),end:zk(2),trim:zk(3)},Wk=s,qk=l,Xk=_,Yk=$r,$k=Kk.trim,Zk=Uk,Jk=Wk.parseInt,Qk=Wk.Symbol,eE=Qk&&Qk.iterator,tE=/^[+-]?0x/i,nE=Xk(tE.exec),rE=8!==Jk(Zk+"08")||22!==Jk(Zk+"0x16")||eE&&!qk((function(){Jk(Object(eE))}))?function(e,t){var n=$k(Yk(e));return Jk(n,t>>>0||(nE(tE,n)?16:10))}:Jk;Dn({global:!0,forced:parseInt!=rE},{parseInt:rE});var iE=o(ie.parseInt),oE=Wc("Array").keys,aE=ir,sE=tt,lE=ce,uE=oE,cE=Array.prototype,hE={DOMTokenList:!0,NodeList:!0},fE=o((function(e){var t=e.keys;return e===cE||lE(cE,e)&&t===cE.keys||sE(hE,aE(e))?uE:t})),dE=D,pE=_,vE=L,gE=l,yE=yi,mE=io,_E=F,bE=Je,wE=q,kE=Object.assign,EE=Object.defineProperty,SE=pE([].concat),TE=!kE||gE((function(){if(dE&&1!==kE({b:1},kE(EE({},"a",{enumerable:!0,get:function(){EE(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=kE({},e)[n]||yE(kE({},t)).join("")!=r}))?function(e,t){for(var n=bE(e),r=arguments.length,i=1,o=mE.f,a=_E.f;r>i;)for(var s,l=wE(arguments[i++]),u=o?SE(yE(l),o(l)):yE(l),c=u.length,h=0;c>h;)s=u[h++],dE&&!vE(a,l,s)||(n[s]=l[s]);return n}:kE,CE=TE;Dn({target:"Object",stat:!0,arity:2,forced:Object.assign!==CE},{assign:CE});var AE=o(ie.Object.assign),xE=o(By),PE=o(ym),IE=o(Em),RE=o(Rm),DE=o(Dc),OE=o(ic),ME=o(Ec),LE=o(vh),FE=o(Nc),UE=_,BE=Me,NE=re,VE=tt,HE=As,GE=u,jE=Function,zE=UE([].concat),KE=UE([].join),WE={},qE=GE?jE.bind:function(e){var t=BE(this),n=t.prototype,r=HE(arguments,1),i=function(){var n=zE(r,HE(arguments));return this instanceof i?function(e,t,n){if(!VE(WE,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";WE[t]=jE("C,a","return new C("+KE(r,",")+")")}return WE[t](e,n)}(t,n.length,n):t.apply(e,n)};return NE(n)&&(i.prototype=n),i},XE=Dn,YE=p,$E=qE,ZE=nd,JE=an,QE=re,eS=Gi,tS=l,nS=ue("Reflect","construct"),rS=Object.prototype,iS=[].push,oS=tS((function(){function e(){}return!(nS((function(){}),[],e)instanceof e)})),aS=!tS((function(){nS((function(){}))})),sS=oS||aS;XE({target:"Reflect",stat:!0,forced:sS,sham:sS},{construct:function(e,t){ZE(e),JE(t);var n=arguments.length<3?e:ZE(arguments[2]);if(aS&&!oS)return nS(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 r=[null];return YE(iS,r,t),new(YE($E,e,r))}var i=n.prototype,o=eS(QE(i)?i:rS),a=YE(e,o,t);return QE(a)?a:o}});var lS=ie.Reflect.construct,uS=o(lS),cS=o(lS),hS=tt,fS=L,dS=re,pS=an,vS=function(e){return void 0!==e&&(hS(e,"value")||hS(e,"writable"))},gS=R,yS=xl;Dn({target:"Reflect",stat:!0},{get:function e(t,n){var r,i,o=arguments.length<3?t:arguments[2];return pS(t)===o?t[n]:(r=gS.f(t,n))?vS(r)?r.value:void 0===r.get?void 0:fS(r.get,o):dS(i=yS(t))?e(i,n,o):void 0}});var mS=ie.Reflect.get,_S=o(mS),bS=o(mS),wS=o(cy),kS=o(Ay),ES=o(Dy);function SS(e,t){var n=dk(e);if(xE){var r=xE(e);t&&(r=Gw(r).call(r,(function(t){return PE(e,t).enumerable}))),n.push.apply(n,r)}return n}function TS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SS(Object(n),!0).forEach((function(t){IS(e,t,n[t])})):IE?RE(e,IE(n)):SS(Object(n)).forEach((function(t){DE(e,t,PE(n,t))}))}return e}function CS(e){return(CS="function"==typeof OE&&"symbol"==typeof ME?function(e){return typeof e}:function(e){return e&&"function"==typeof OE&&e.constructor===OE&&e!==OE.prototype?"symbol":typeof e})(e)}function AS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),DE(e,VS(r.key),r)}}function PS(e,t,n){return t&&xS(e.prototype,t),n&&xS(e,n),DE(e,"prototype",{writable:!1}),e}function IS(e,t,n){return(t=VS(t))in e?DE(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RS(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}}),DE(e,"prototype",{writable:!1}),t&&OS(e,t)}function DS(e){return(DS=LE?FE.bind():function(e){return e.__proto__||FE(e)})(e)}function OS(e,t){return(OS=LE?LE.bind():function(e,t){return e.__proto__=t,e})(e,t)}function MS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LS(e,t){if(t&&("object"===Tc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return MS(e)}function FS(e){var t=function(){if("undefined"==typeof Reflect||!cS)return!1;if(cS.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(cS(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=DS(e);if(t){var i=DS(this).constructor;n=cS(r,arguments,i)}else n=r.apply(this,arguments);return LS(this,n)}}function US(){return US="undefined"!=typeof Reflect&&bS?bS.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=DS(e)););return e}(e,t);if(r){var i=PE(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},US.apply(this,arguments)}function BS(e){return function(e){if(Array.isArray(e))return NS(e)}(e)||function(e){if(void 0!==OE&&null!=wS(e)||null!=e["@@iterator"])return kS(e)}(e)||function(e,t){var n;if(!e)return;if("string"==typeof e)return NS(e,t);var r=pk(n=Object.prototype.toString.call(e)).call(n,8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return kS(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NS(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function VS(e){var t=function(e,t){if("object"!==Tc(e)||null===e)return e;var n=e[ES];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Tc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Tc(t)?t:String(t)}var HS={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?pk(r).call(r,1):r);return xE?Nm(i).call(i,xE(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,u,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,o),!0;case 6:return c.fn.call(c.context,t,r,i,o,a),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var f,d=c.length;for(u=0;u<d;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,r);break;case 4:c[u].fn.call(c[u].context,t,r,i);break;default:if(!l)for(f=1,l=new Array(h-1);f<h;f++)l[f-1]=arguments[f];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,u=[],c=s.length;l<c;l++)(s[l].fn!==t||i&&!s[l].once||r&&s[l].context!==r)&&u.push(s[l]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(HS);var GS=HS.exports,jS=o(GS),zS=Bn,KS=$r,WS=Z,qS=RangeError,XS=function(e){var t=KS(WS(this)),n="",r=zS(e);if(r<0||r==1/0)throw qS("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},YS=_,$S=Hn,ZS=$r,JS=Z,QS=YS(XS),eT=YS("".slice),tT=Math.ceil,nT=function(e){return function(t,n,r){var i,o,a=ZS(JS(t)),s=$S(n),l=a.length,u=void 0===r?" ":ZS(r);return s<=l||""==u?a:((o=QS(u,tT((i=s-l)/u.length))).length>i&&(o=eT(o,0,i)),e?a+o:o+a)}},rT={start:nT(!1),end:nT(!0)},iT=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(he),oT=rT.start;Dn({target:"String",proto:!0,forced:iT},{padStart:function(e){return oT(this,e,arguments.length>1?arguments[1]:void 0)}});var aT=Wc("String").padStart,sT=ce,lT=aT,uT=String.prototype,cT=o((function(e){var t=e.padStart;return"string"==typeof e||e===uT||sT(uT,e)&&t===uT.padStart?lT:t})),hT=s,fT=l,dT=$r,pT=Kk.trim,vT=Uk,gT=_("".charAt),yT=hT.parseFloat,mT=hT.Symbol,_T=mT&&mT.iterator,bT=1/yT(vT+"-0")!=-1/0||_T&&!fT((function(){yT(Object(_T))}))?function(e){var t=pT(dT(e)),n=yT(t);return 0===n&&"-"==gT(t,0)?-0:n}:yT;Dn({global:!0,forced:parseFloat!=bT},{parseFloat:bT});var wT=o(ie.parseFloat),kT=_l.PROPER,ET=l,ST=Uk,TT=Kk.trim;Dn({target:"String",proto:!0,forced:function(e){return ET((function(){return!!ST[e]()||"
"!=="
"[e]()||kT&&ST[e].name!==e}))}("trim")},{trim:function(){return TT(this)}});var CT=Wc("String").trim,AT=ce,xT=CT,PT=String.prototype,IT=o((function(e){var t=e.trim;return"string"==typeof e||e===PT||AT(PT,e)&&t===PT.trim?xT:t})),RT=Ji,DT=Math.floor,OT=function(e,t){var n=e.length,r=DT(n/2);return n<8?MT(e,t):LT(e,OT(RT(e,0,r),t),OT(RT(e,r),t),t)},MT=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},LT=function(e,t,n,r){for(var i=t.length,o=n.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?r(t[a],n[s])<=0?t[a++]:n[s++]:a<i?t[a++]:n[s++];return e},FT=OT,UT=he.match(/firefox\/(\d+)/i),BT=!!UT&&+UT[1],NT=/MSIE|Trident/.test(he),VT=he.match(/AppleWebKit\/(\d+)\./),HT=!!VT&&+VT[1],GT=Dn,jT=_,zT=Me,KT=Je,WT=jn,qT=yk,XT=$r,YT=l,$T=FT,ZT=Gc,JT=BT,QT=NT,eC=me,tC=HT,nC=[],rC=jT(nC.sort),iC=jT(nC.push),oC=YT((function(){nC.sort(void 0)})),aC=YT((function(){nC.sort(null)})),sC=ZT("sort"),lC=!YT((function(){if(eC)return eC<70;if(!(JT&&JT>3)){if(QT)return!0;if(tC)return tC<603;var e,t,n,r,i="";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(r=0;r<47;r++)nC.push({k:t+r,v:n})}for(nC.sort((function(e,t){return t.v-e.v})),r=0;r<nC.length;r++)t=nC[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));GT({target:"Array",proto:!0,forced:oC||!aC||!sC||!lC},{sort:function(e){void 0!==e&&zT(e);var t=KT(this);if(lC)return void 0===e?rC(t):rC(t,e);var n,r,i=[],o=WT(t);for(r=0;r<o;r++)r in t&&iC(i,t[r]);for($T(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:XT(t)>XT(n)?1:-1}}(e)),n=WT(i),r=0;r<n;)t[r]=i[r++];for(;r<o;)qT(t,r++);return t}});var uC,cC=Wc("Array").sort,hC=ce,fC=cC,dC=Array.prototype,pC=o((function(e){var t=e.sort;return e===dC||hC(dC,e)&&t===dC.sort?fC:t})),vC="undefined"!=typeof window&&window.location&&fk(uC=window.location.href).call(uC,"xgplayerdebugger=1")>-1,gC="color: #525252; background-color: #90ee90;",yC="color: #525252; background-color: red;",mC="color: #525252; background-color: yellow; ",_C="%c[xgplayer]",bC={config:{debug:vC?3:0},logInfo:function(e){for(var t,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];this.config.debug>=3&&(n=console).log.apply(n,Nm(t=[_C,gC,e]).call(t,i))},logWarn:function(e){for(var t,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];this.config.debug>=1&&(n=console).warn.apply(n,Nm(t=[_C,mC,e]).call(t,i))},logError:function(e){var t,n;if(!(this.config.debug<1)){for(var r=this.config.debug>=2?"trace":"error",i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];(n=console)[r].apply(n,Nm(t=[_C,yC,e]).call(t,o))}}};var wC=function(){function e(t){AS(this,e),this.bufferedList=t}return PS(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}(),kC={};function EC(e){var t=CS(e);return null!==e&&("object"===t||"function"===t)}function SC(e,t,n){var r,i,o,a,s,l,u=0,c=!1,h=!1,f=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,o=i;return r=i=void 0,u=t,a=e.apply(o,n)}function v(e,t){return d?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=o}function y(){var e=Date.now();if(g(e))return m(e);s=v(y,function(e){var n=e-u,r=t-(e-l);return h?Math.min(r,o-n):r}(e))}function m(e){return s=void 0,f&&r?p(e):(r=i=void 0,a)}function _(){for(var e=Date.now(),n=g(e),o=arguments.length,f=new Array(o),d=0;d<o;d++)f[d]=arguments[d];if(r=f,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=v(y,t),c?p(e):a}(l);if(h)return s=v(y,t),p(l)}return void 0===s&&(s=v(y,t)),a}return t=+t||0,EC(n)&&(c=!!n.leading,o=(h="maxWait"in n)?Math.max(+n.maxWait||0,t):o,f="trailing"in n?!!n.trailing:f),_.cancel=function(){void 0!==s&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),u=0,r=l=i=s=void 0},_.flush=function(){return void 0===s?a:m(Date.now())},_.pending=function(){return void 0!==s},_}function TC(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"===e&&(e="zh"),e}kC.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]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(e);return i.className=r,i.innerHTML=t,dk(n).forEach((function(t){var r=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&i.setAttribute(r,o):i.setAttribute(r,o)})),i},kC.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 r=document.createElement("div");r.innerHTML=e;var i=r.children;return r=null,i.length>0?(i=i[0],n&&kC.addClass(i,n),t&&dk(t).forEach((function(e){i.setAttribute(e,t[e])})),i):null}catch(o){return bC.logError("util.createDomFromHtml",o),null}},kC.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(r){var n=e.className&&"object"===CS(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},kC.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){kC.hasClass(e,t)||(e.className&&"object"===CS(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},kC.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){kC.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===CS(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},kC.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){kC.hasClass(e,t)?kC.removeClass(e,t):kC.addClass(e,t)}))},kC.classNames=function(){for(var e=arguments,t=[],n=function(n){if("String"===kC.typeOf(e[n]))t.push(e[n]);else if("Object"===kC.typeOf(e[n])){var r;Vw(r=dk(e[n])).call(r,(function(r){e[n][r]&&t.push(r)}))}},r=0;r<arguments.length;r++)n(r);return t.join(" ")},kC.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(r){bC.logError("util.findDom",r),0===fk(n).call(n,"#")&&(e=t.getElementById(pk(n).call(n,1)))}return e},kC.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},kC.padStart=function(e,t,n){for(var r=String(n),i=t>>0,o=Math.ceil(i/r.length),a=[],s=String(e);o--;)a.push(r);return a.join("").substring(0,i-s.length)+s},kC.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=cT(kC).call(kC,Math.floor(e/3600),2,0),n=cT(kC).call(kC,Math.floor((e-3600*t)/60),2,0),r=cT(kC).call(kC,Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,r]:[t,n,r]).join(":")},kC.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},kC.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},kC.deepCopy=function(e,t){if("Object"===kC.typeOf(t)&&"Object"===kC.typeOf(e))return dk(t).forEach((function(n){if("Object"!==kC.typeOf(t[n])||t[n]instanceof Node)if("Array"===kC.typeOf(t[n])){var r;e[n]="Array"===kC.typeOf(e[n])?Nm(r=e[n]).call(r,t[n]):t[n]}else e[n]=t[n];else void 0===e[n]||void 0===e[n]?e[n]=t[n]:kC.deepCopy(e[n],t[n])})),e},kC.deepMerge=function(e,t){var n;return Vw(n=dk(t)).call(n,(function(n){var r;"Array"===kC.typeOf(t[n])&&"Array"===kC.typeOf(e[n])?"Array"===kC.typeOf(e[n])&&(r=e[n]).push.apply(r,BS(t[n])):kC.typeOf(e[n])!==kC.typeOf(t[n])||null===e[n]||"Object"!==kC.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):kC.deepMerge(e[n],t[n])})),e},kC.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},kC.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""},kC.setInterval=function(e,t,n,r){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),r))},kC.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},kC.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var r=setTimeout((function(){t(),kC.clearTimeout(e,r)}),n);return e._timers.push(r),r},kC.clearTimeout=function(e,t){var n=e._timers;if("Array"===kC.typeOf(n)){for(var r=0;r<n.length;r++)if(n[r]===t){Lk(n).call(n,r,1),clearTimeout(t);break}}else clearTimeout(t)},kC.clearAllTimers=function(e){var t=e._timers;"Array"===kC.typeOf(t)&&(Vw(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},kC.createImgBtn=function(e,t,n,r){var i,o,a,s,l,u,c,h,f,d,p,v=kC.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(v.style.backgroundImage='url("'.concat(t,'")'),n&&r)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){var t,i;return!(fk(n).call(n,e)>-1&&fk(r).call(r,e)>-1)||(u=wT(IT(t=pk(n).call(n,0,fk(n).call(n,e))).call(t)),c=wT(IT(i=pk(r).call(r,0,fk(r).call(r,e))).call(i)),h=e,!1)})),v.style.width=Nm(i="".concat(u)).call(i,h),v.style.height=Nm(o="".concat(c)).call(o,h),v.style.backgroundSize=Nm(a=Nm(s=Nm(l="".concat(u)).call(l,h," ")).call(s,c)).call(a,h),v.style.margin="start"===e?Nm(f=Nm(d=Nm(p="-".concat(c/2)).call(p,h," auto auto -")).call(d,u/2)).call(f,h):"auto 5px auto 5px");return v},kC.Hex2RGBA=function(e,t){var n,r=[];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){r.push(iE(e,16))})),Nm(n="rgba(".concat(r.join(","),", ")).call(n,t,")")):"rgba(255, 255, 255, 0.1)"},kC.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},kC.checkIsFunction=function(e){return e&&"function"==typeof e},kC.checkIsObject=function(e){return null!==e&&"object"===CS(e)},kC.hide=function(e){e.style.display="none"},kC.show=function(e,t){e.style.display=t||"block"},kC.isUndefined=function(e){if(null==e)return!0},kC.isNotNull=function(e){return!(null==e)},kC.setStyleFromCsstext=function(e,t){if(t)if("String"===kC.typeOf(t)){var n=t.replace(/\s+/g,"").split(";");Vw(n).call(n,(function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}}))}else{var r;Vw(r=dk(t)).call(r,(function(n){e.style[n]=t[n]}))}},kC.filterStyleFromText=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],r=e.style.cssText;if(!r)return{};var i=r.replace(/\s+/g,"").split(";"),o={},a={};return Vw(i).call(i,(function(e){if(e){var t=e.split(":");t.length>1&&(!function(e,t){for(var n=0,r=t.length;n<r;n++)if(fk(e).call(e,t[n])>-1)return!0;return!1}(t[0],n)?a[t[0]]=t[1]:o[t[0]]=t[1])}})),e.setAttribute("style",""),Vw(t=dk(a)).call(t,(function(t){e.style[t]=a[t]})),o},kC.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),r={};return Vw(n).call(n,(function(e){if(e){var t=e.split(":");t.length>1&&(r[t[0]]=t[1])}})),r},kC.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 r=new window.Image;r.onload=function(e){r=null,t&&t(e)},r.onerror=function(e){r=null,n&&n(e)},r.src=e}},kC.stopPropagation=function(e){e&&e.stopPropagation()},kC.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},kC.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},kC.checkTouchSupport=function(){return"ontouchstart"in window},kC.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],r=0;r<e.length;r++)n.push({start:e.start(r)<.5?0:e.start(r),end:e.end(r)});pC(n).call(n,(function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var i=[];if(t)for(var o=0;o<n.length;o++){var a=i.length;if(a){var s=i[a-1].end;n[o].start-s<t?n[o].end>s&&(i[a-1].end=n[o].end):i.push(n[o])}else i.push(n[o])}else i=n;return new wC(i)},kC.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}},kC.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},kC.getHostFromUrl=function(e){if("String"!==kC.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},kC.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},kC.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},kC.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},kC.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=iE(e)}catch(n){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=iE(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)}))},kC.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},kC.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},kC.createPositionBar=function(e,t){var n=kC.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(n),n},kC.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r={scale:"".concat(t.scale||1),translate:Nm(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")};return dk(r).forEach((function(e){var t,i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),o=Nm(t="".concat(e,"(")).call(t,r[e],")");i.test(n)?(i.lastIndex=-1,n=n.replace(i,o)):n+="".concat(o," ")})),n},kC.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},kC.getIndexByTime=function(e,t){var n=t.length,r=-1;if(n<1)return r;if(e<=t[0].end||n<2)r=0;else if(e>t[n-1].end)r=n-1;else for(var i=1;i<n;i++)if(e>t[i-1].end&&e<=t[i].end){r=i;break}return r},kC.getOffsetCurrentTime=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=-1;if((r=n>=0&&n<t.length?n:kC.getIndexByTime(e,t))<0)return-1;var i=t.length,o=t[r],a=o.start,s=o.end,l=o.cTime,u=o.offset;return e<a?l:e>=a&&e<=s?e-u:e>s&&r>=i-1?s:-1},kC.getCurrentTimeByOffset=function(e,t){var n=-1;if(!t||t.length<0)return e;for(var r=0;r<t.length;r++)if(e<=t[r].duration){n=r;break}if(-1!==n){var i=t[n].start;return n-1<0?i+e:i+(e-t[n-1].duration)}return e};var CC=/(Android)\s([\d.]+)/,AC=/(Version)\/([\d.]+)/,xC=["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"],PC={get device(){return PC.os.isPc?"pc":"mobile"},get browser(){var e,t;if("undefined"==typeof navigator)return"";var n=navigator.userAgent.toLowerCase(),r={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return Nm(e=[]).call(e,Gw(t=dk(r)).call(t,(function(e){return r[e].test(n)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,r=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,a=o||r&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!a;return{isTablet:a,isPhone:s,isIpad:o,isIos:s||o,isAndroid:r,isPc:!(s||r||n||a),isSymbian:n,isWindowsPhone:t,isFireFox:i}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?AC:CC)?t.exec(e):[];if(n&&n.length>=3){var r=n[2].split(".");return r.length>0?iE(r[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&&Vw(xC).call(xC,(function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(oz){return this._logger.error(e,oz),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Hw.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},r=e.audio||{};try{var i=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(r.contentType);return Hw.resolve({supported:i&&o,smooth:!1,powerEfficient:!1})}catch(a){return Hw.resolve(t)}}},IC="3.0.19-rc.0",RC={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},DC={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},OC=PS((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};AS(this,e);var r=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var i,o=n.mediaError?n.mediaError:t.media.error||{},a=t.duration,s=t.currentTime,l=t.ended,u=t.src,c=t.currentSrc,h=t.media,f=h.readyState,d=h.networkState,p=n.errorCode||o.code;DC[p]&&(p=DC[p]);var v={playerVersion:IC,currentTime:s,duration:a,ended:l,readyState:f,networkState:d,src:u||c,errorType:n.errorType,errorCode:p,message:n.errorMessage||o.message,mediaError:o,originError:n.originError?n.originError.stack:"",host:kC.getHostFromUrl(u||c)};return n.ext&&Vw(i=dk(n.ext)).call(i,(function(e){v[e]=n.ext[e]})),v}if(arguments.length>1){for(var g={playerVersion:IC,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],m=0;m<arguments.length;m++)g[y[m]]=arguments[m];return g.ex=r?(r[arguments[0]]||{}).msg:"",g}})),MC="play",LC="ended",FC="pause",UC="error",BC="seeked",NC="timeupdate",VC="waiting",HC="canplay",GC="durationchange",jC="volumechange",zC="loadeddata",KC="emptied",WC="focus",qC="blur",XC="ready",YC="urlNull",$C="autoplay_started",ZC="autoplay_was_prevented",JC="complete",QC="replay",eA="destroy",tA="urlchange",nA="download_speed_change",rA="leaveplayer",iA="enterplayer",oA="loading",aA="fullscreen_change",sA="cssFullscreen_change",lA="mini_state_change",uA="definition_change",cA="before_definition_change",hA="after_definition_change",fA="retry",dA="video_resize",pA="pip_change",vA="playnext",gA="shortcut",yA="user_action",mA="reset",_A="source_error",bA="source_success",wA=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],kA=Object.freeze({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:hA,AUTOPLAY_PREVENTED:ZC,AUTOPLAY_STARTED:$C,BEFORE_DEFINITION_CHANGE:cA,BUFFER_CHANGE:"bufferedChange",CANPLAY:HC,CANPLAY_THROUGH:"canplaythrough",COMPLETE:JC,CSS_FULLSCREEN_CHANGE:sA,DEFINITION_CHANGE:uA,DESTROY:eA,DOWNLOAD_SPEED_CHANGE:nA,DURATION_CHANGE:GC,EMPTIED:KC,ENDED:LC,ENTER_PLAYER:iA,ERROR:UC,FPS_STUCK:"fps_stuck",FULLSCREEN_CHANGE:aA,LEAVE_PLAYER:rA,LOADED_DATA:zC,LOADED_METADATA:"loadedmetadata",LOADING:oA,LOAD_START:"loadstart",MINI_STATE_CHANGE:lA,PAUSE:FC,PIP_CHANGE:pA,PLAY:MC,PLAYER_BLUR:qC,PLAYER_FOCUS:WC,PLAYING:"playing",PLAYNEXT:vA,PROGRESS:"progress",RATE_CHANGE:"ratechange",READY:XC,REPLAY:QC,RESET:mA,RETRY:fA,ROTATE:"rotate",SCREEN_SHOT:"screenShot",SEEKED:BC,SEEKING:"seeking",SEI_PARSED:"SEI_PARSED",SHORTCUT:gA,SOURCE_ERROR:_A,SOURCE_SUCCESS:bA,STALLED:"stalled",STATS_EVENTS:{STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:NC,URL_CHANGE:tA,URL_NULL:YC,USER_ACTION:yA,VIDEO_EVENTS:wA,VIDEO_RESIZE:dA,VOLUME_CHANGE:jC,WAITING:VC,XGLOG:"xglog"});function EA(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var SA=function(e){RS(n,e);var t=FS(n);function n(e){var r;AS(this,n),(r=t.call(this,e))._hasStart=!1,r._currentTime=0,r._duration=0,r._internalOp={},r._lastMuted=!1,r.vtype="MP4",r._rate=-1,r.mediaConfig=AE({},{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 i=e["x5-video-player-type"]||e.x5VideoPlayerType;return PC.isWeixin&&PC.os.isAndroid&&i&&(r.mediaConfig["x5-video-player-type"]=i,delete r.mediaConfig.playsinline,delete r.mediaConfig["webkit-playsinline"],delete r.mediaConfig["x5-playsinline"]),e.loop&&(r.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(r.mediaConfig,"muted")&&(r.mediaConfig.muted=!0),r.media=kC.createDom(r.mediaConfig.mediaType,"",r.mediaConfig,""),e.defaultPlaybackRate&&(r.media.defaultPlaybackRate=r.media.playbackRate=e.defaultPlaybackRate),"Number"===kC.typeOf(e.volume)&&(r.volume=e.volume),e.autoplayMuted&&(r.media.muted=!0,r._lastMuted=!0),e.autoplay&&(r.media.autoplay=!0),r._interval={},r.mediaEventMiddleware={},r.attachVideoEvents(),r}return PS(n,[{key:"setEventsMiddleware",value:function(e){var t,n=this;Vw(t=dk(e)).call(t,(function(t){n.mediaEventMiddleware[t]=e[t]}))}},{key:"removeEventsMiddleware",value:function(e){var t,n=this;Vw(t=dk(e)).call(t,(function(e){delete n.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=Vw(wA).call(wA,(function(t){var n,r=Nm(n="on".concat(t.charAt(0).toUpperCase())).call(n,pk(t).call(t,1));return"function"==typeof e[r]&&e.on(t,e[r]),IS({},t,function(e,t){return function(n,r){var i={player:t,eventName:e,originalEvent:n,detail:n.detail||{},timeStamp:n.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[n.type],muted:t.muted,volume:t.volume,host:kC.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(n.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var o=t.media?t.media.playbackRate:0;if(o&&t._rate===o)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(i.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(i.error=r||t.video.error),t.mediaEventMiddleware[e]){var a=EA.bind(t,e,i);try{t.mediaEventMiddleware[e].call(t,i,a)}catch(s){throw EA.call(t,e,i),s}}else EA.call(t,e,i)}}(t,e))}))),this._evHandlers.forEach((function(e){var n=dk(e)[0];t.addEventListener(n,e[n],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var n=dk(e)[0];t.removeEventListener(n,e[n],!1)})),this._evHandlers.forEach((function(t){var n,r=dk(t)[0],i=Nm(n="on".concat(r.charAt(0).toUpperCase())).call(n,pk(r).call(r,1));"function"==typeof e[i]&&e.off(r,e[i])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){n.media.appendChild(kC.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var r=e.children;if(r){this._videoSourceCount=r.length,this._videoSourceIndex=r.length,this._vLoadeddata=function(e){n.emit(bA,{src:e.target.currentSrc,host:kC.getHostFromUrl(e.target.currentSrc)})};for(var i=null,o=0;o<this._evHandlers.length;o++)if("error"===dk(this._evHandlers[o])[0]){i=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){var t=iE(e.target.getAttribute("data-index"),10);if(n._videoSourceIndex--,0===n._videoSourceIndex||t>=n._videoSourceCount){var r={code:4,message:"sources_load_error"};i?i.error(e,r):n.errorHandler("error",r)}var o=RC[4];n.emit(_A,new OC(n,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<r.length;a++)r[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var n=this.media.error||t,r=n.code?RC[n.code]:"other";n.message;this.media.currentSrc||(n={code:6,message:"empty_src"}),this.emit(e,new OC(this,{errorType:r,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var n=this.media.currentTime;if(e)for(var r=0,i=e.length;r<i&&(t[0]=e.start(r),t[1]=e.end(r),!(t[0]<=n&&n<=t[1]));r++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?kC.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){if(!this.media.error)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(tA,e),this.emit(VC),this._currentTime=0,this._duration=0,kC.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===kC.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"emit",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"on",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"on",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"once",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"once",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"off",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"off",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"offAll",value:function(){US(DS(n.prototype),"removeAllListeners",this).call(this)}}]),n}(jS),TA=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"}};AS(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return PS(e,[{key:"openDB",value:function(e){var t=this,n=this,r=this.myDB.version||1,i=n.indexedDB.open(n.myDB.name,r);i.onerror=function(e){},i.onsuccess=function(r){t.myDB.db=r.target.result,e.call(n)},i.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,r=this.myDB.db.transaction(e,"readwrite").objectStore(e),i=0;i<t.length;i++)(n=r.add(t[i])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,r=this.myDB.db.transaction(e,"readwrite").objectStore(e),i=0;i<t.length;i++)(n=r.put(t[i])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var r=this,i=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);i.onerror=function(){n.call(r,null)},i.onsuccess=function(e){var t=e.target.result;n.call(r,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}(),CA=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],AA=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],xA=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],PA="data-xgplayerid";function IA(e,t,n){for(var r,i=arguments.length,o=new Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];var s,l=t.call.apply(t,Nm(r=[e]).call(r,o));n&&"function"==typeof n&&(l&&l.then?l.then((function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];n.call.apply(n,Nm(t=[e]).call(t,i))})):n.call.apply(n,Nm(s=[e]).call(s,o)))}function RA(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 r,i=arguments,o=this;if(n.pre)try{var a,s;(s=n.pre).call.apply(s,Nm(a=[this]).call(a,pk(Array.prototype).call(arguments)))}catch(y){var l,u;throw y.message=Nm(l=Nm(u="[pluginName: ".concat(this.pluginName,":")).call(u,e,":pre error] >> ")).call(l,y.message),y}if(this.__hooks&&this.__hooks[e])try{var c,h,f,d=(h=this.__hooks[e]).call.apply(h,Nm(c=[this,this]).call(c,pk(Array.prototype).call(arguments)));if(d)if(d.then)d.then((function(e){var r;!1!==e&&IA.apply(void 0,Nm(r=[o,t,n.next]).call(r,BS(i)))})).catch((function(e){throw e}));else IA.apply(void 0,Nm(f=[this,t,n.next]).call(f,pk(Array.prototype).call(arguments)));else if(void 0===d){var p;IA.apply(void 0,Nm(p=[this,t,n.next]).call(p,pk(Array.prototype).call(arguments)))}}catch(y){var v,g;throw y.message=Nm(v=Nm(g="[pluginName: ".concat(this.pluginName,":")).call(g,e,"] >> ")).call(v,y.message),y}else IA.apply(void 0,Nm(r=[this,t,n.next]).call(r,pk(Array.prototype).call(arguments)))}.bind(this)}function DA(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 OA(e,t){var n=this.__hooks;n&&delete n[e]}function MA(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.useHooks&&t.useHooks.apply(t,r)}}function LA(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.removeHooks&&t.removeHooks.apply(t,r)}}}function FA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&Vw(t).call(t,(function(t){e.__hooks[t]=null})),DE(e,"hooks",{get:function(){var t;return e.__hooks&&Vw(t=dk(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}function UA(e){e.__hooks=null}function BA(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];var a;if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,Nm(a=[e,e]).call(a,i));var s,l,u=(l=e.__hooks[t]).call.apply(l,Nm(s=[e,e]).call(s,i));if(u&&u.then)u.then((function(t){var r;return!1===t?null:n.call.apply(n,Nm(r=[e,e]).call(r,i))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==u){var c;return n.call.apply(n,Nm(c=[e,e]).call(c,i))}}function NA(e,t){var n;bC.logError(Nm(n="[".concat(e,"] event or callback cant be undefined or null when call ")).call(n,t))}var VA=function(){function e(t){AS(this,e),kC.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),FA(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return PS(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=kC.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):NA(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(r){n.__onceEvents[r]=t,n.player.once(e,t)})):NA(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(r){delete n.__events[e],n.player.off(r,t)})):NA(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){dk(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,n;if(this.player){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=this.player).emit.apply(n,Nm(t=[e]).call(t,i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var r=TS(TS({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,r)}}},{key:"hook",value:function(e,t){var n;return RA.call.apply(RA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return DA.call.apply(DA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return OA.call.apply(OA,Nm(n=[this]).call(n,pk(Array.prototype).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,t=this,n=this.player,r=this.pluginName;this.offAll(),kC.clearAllTimers(this),kC.checkIsFunction(this.destroy)&&this.destroy(),Vw(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),n.unRegisterPlugin(r),UA(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&DE(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var HA=Element.prototype;HA.matches=HA.matchesSelector||HA.mozMatchesSelector||HA.msMatchesSelector||HA.oMatchesSelector||HA.webkitMatchesSelector}var GA=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function jA(e,t,n,r,i){var o=zA.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}function zA(e,t,n,r){return function(n){n.delegateTarget=GA(n.target,t),n.delegateTarget&&r.call(e,n)}}var KA=function(e,t,n,r,i){return"function"==typeof e.addEventListener?jA.apply(null,arguments):"function"==typeof n?jA.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Vw(Array.prototype).call(e,(function(e){return jA(e,t,n,r,i)})))},WA=o(KA),qA={CONTROLS:"controls",ROOT:"root"},XA={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"},YA="xg-icon-disable";function $A(e){return!!e&&(fk(e)&&/^(?:http|data:|\/)/.test(e))}function ZA(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=null;if(e instanceof window.Element)return kC.addClass(e,i),Vw(r=dk(o)).call(r,(function(t){e.setAttribute(t,o[t])})),e;if($A(e)||$A(e.url))return o.src=$A(e)?e:e.url||"",s=kC.createDom(e.tag||"img","",o,"xg-img ".concat(i));if("function"==typeof e)try{var l,u;return(s=e())instanceof window.Element?(kC.addClass(s,i),Vw(l=dk(o)).call(l,(function(e){s.setAttribute(e,o[e])})),s):(bC.logWarn(Nm(u="warn>>icons.".concat(t," in config of plugin named [")).call(u,a,"] is a function mast return an Element Object")),null)}catch(c){return bC.logError("Plugin named [".concat(a,"]:createIcon"),c),null}return"string"==typeof e?kC.createDomFromHtml(e,o,i):(bC.logWarn(Nm(n="warn>>icons.".concat(t," in config of plugin named [")).call(n,a,"] is invalid")),null)}function JA(e,t){var n,r=t.config.icons||t.playerConfig.icons;Vw(n=dk(e)).call(n,(function(n){var i=e[n],o=i&&i.class?i.class:"",a=i&&i.attr?i.attr:{},s=null;r&&r[n]&&(o=function(e,t){var n;return"object"===CS(e)&&e.class&&"string"==typeof e.class?Nm(n="".concat(t," ")).call(n,e.class):t}(r[n],o),a=function(e,t){var n;return"object"===CS(e)&&e.attr&&"object"===CS(e.attr)&&Vw(n=dk(e.attr)).call(n,(function(n){t[n]=e.attr[n]})),t}(r[n],a),s=ZA(r[n],n,o,a,t.pluginName)),!s&&i&&(s=ZA(i.icon?i.icon:i,a,o,{},t.pluginName)),t.icons[n]=s}))}var QA=function(e){RS(n,e);var t=FS(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return AS(this,n),(e=t.call(this,r)).__delegates=[],e}return PS(n,[{key:"__init",value:function(e){if(US(DS(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,r=null;this.icons={},this.root=null,this.parent=null,JA(this.registerIcons()||{},this),this.langText={};var i,o,a,s=this.registerLanguageTexts()||{};o=this,Vw(a=dk(i=s)).call(a,(function(e){DE(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:i[e]&&i[e][t]||""}})}));var l="";try{l=this.render()}catch(f){var u;throw bC.logError("Plugin:".concat(this.pluginName,":render"),f),new Error(Nm(u="Plugin:".concat(this.pluginName,":render:")).call(u,f.message))}if(l)(r=n.insert(l,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(r=kC.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(r)}this.root=r,this.parent=t;var c=this.config.attr||{},h=this.config.style||{};this.setAttr(c),this.setStyle(h),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,n=this.children();if(n&&"object"===CS(n))if(dk(n).length>0)Vw(t=dk(n)).call(t,(function(t){var r,i,o=t,a=n[o],s={root:e.root};"function"==typeof a?(r=e.config[o]||{},i=a):"object"===CS(a)&&"function"==typeof a.plugin&&(r=a.options?kC.deepCopy(e.config[o]||{},a.options):e.config[o]||{},i=a.plugin),s.config=r,void 0!==r.index&&(s.index=r.index),r.root&&(s.root=r.root),e.registerPlugin(i,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,r=this.langText;t&&function e(t,n){for(var r=0;r<t.children.length;r++)t.children[r].children.length>0?e(t.children[r],n):n(t.children[r])}(t,(function(t){var i=t.getAttribute&&t.getAttribute("lang-key");if(i){var o=n[i.toUpperCase()]||r[i];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||{},r=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var i=n[t]||r[t]||"";i&&(e.innerHTML=i)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,kC.addClass(Xm(this).call(this,".xgplayer-icon"),YA)}},{key:"enable",value:function(){this.config.disable=!1,kC.removeClass(Xm(this).call(this,".xgplayer-icon"),YA)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var i=US(DS(n.prototype),"registerPlugin",this).call(this,e,t,r);return this._children.push(i),i}},{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,r){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.bindEL(e,t)})):this.bindEL(e,t);else{var o,a=n.delegate.call(this,this.root,e,t,r);this.__delegates=Nm(o=this.__delegates).call(o,a)}}},{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 r,i=Nm(r="".concat(e,"_")).call(r,t),o=0;o<this.__delegates.length;o++)if(this.__delegates[o].key===i){var a;this.__delegates[o].destroy(),Lk(a=this.__delegates).call(a,o,1);break}}},{key:"setStyle",value:function(e,t){var n,r=this;if(this.root)return"String"===kC.typeOf(e)?this.root.style[e]=t:void("Object"===kC.typeOf(e)&&Vw(n=dk(e)).call(n,(function(t){r.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n,r=this;if(this.root)return"String"===kC.typeOf(e)?this.root.setAttribute(e,t):void("Object"===kC.typeOf(e)&&Vw(n=dk(e)).call(n,(function(t){r.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?Xm(this).call(this,e).appendChild(t):e.appendChild(t)}catch(n){return bC.logError("Plugin:appendChild",n),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e,t,r,i=this,o=this.player;(Vw(e=this.__delegates).call(e,(function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array)&&(Vw(r=this._children).call(r,(function(e){o.unRegisterPlugin(e.pluginName)})),this._children=null);this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),US(DS(n.prototype),"__destroy",this).call(this),this.icons={},Vw(t=["root","parent"]).call(t,(function(e){i[e]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.children.length,i=Number(n),o=e instanceof window.Node;if(r){for(var a=0,s=null,l="";a<r;a++){s=t.children[a];var u=Number(s.getAttribute("data-index"));if(u>=i){l="beforebegin";break}u<i&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof r)if(Array.isArray(n))n.forEach((function(n){var a,s=WA(e,t,n,r,i);s.key=Nm(a="".concat(t,"_")).call(a,n),o.push(s)}));else{var a,s=WA(e,t,n,r,i);s.key=Nm(a="".concat(t,"_")).call(a,n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return qA}},{key:"POSITIONS",get:function(){return XA}}]),n}(VA),ex=function(){function e(){var t=this;if(AS(this,e),IS(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var r=0;r<e.length;r++)t.__runHandler(e[r].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return EC(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),SC(e,t,{leading:r,trailing:i,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(n){console.error(n)}}return PS(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(PA),r=this.__handlers,i=-1,o=0;o<r.length;o++)r[o]&&e===r[o].target&&(i=o);i>-1?this.__handlers[i].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t,n,r=-1;Vw(t=this.__handlers).call(t,(function(t,n){e===t.target&&(r=n)}));try{this.observer&&this.observer.unobserve(e)}catch(i){}this.observer&&this.observer.unobserve(e),r>-1&&Lk(n=this.__handlers).call(n,r,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(oz){console.error(oz)}return!0}return!1}}]),e}(),tx=null;var nx={pluginGroup:{},init:function(e){var t,n,r=e._pluginInfoId;r||(r=(new Date).getTime(),e._pluginInfoId=r),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.resize()},tx||(tx=new ex),tx.addObserver(t,n)),this.pluginGroup[r]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var n=null,r=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,r=e.options):(n=e,r={}),t&&(r.config=t||{}),{PLUFGIN:n,options:r}},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=dk(t),r=null,i=0;i<n.length;i++)if(e.toLowerCase()===n[i].toLowerCase()){r=t[n[i]];break}return"Object"===kC.typeOf(r)?{root:r.root,position:r.position}:{}},lazyRegister:function(e,t){var n=this,r=t.timeout||1500;return Hw.race([t.loader().then((function(t){var r;r=t&&t.__esModule?t.default:t,n.register(e,r,t.options)})),new Hw((function(e,t){setTimeout((function(){t(new Error("timeout"))}),r)}))])},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 r=e._pluginInfoId;if(r&&this.pluginGroup[r]){this.pluginGroup[r]._plugins||(this.pluginGroup[r]._plugins={});var i=this.pluginGroup[r]._plugins,o=this.pluginGroup[r]._originalOptions;n.player=e;var a=n.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){n.config||(n.config={});for(var s=dk(o),l=0;l<s.length;l++)if(a.toLowerCase()===s[l].toLowerCase()){var u=o[s[l]];"Object"===kC.typeOf(u)?n.config=AE({},n.config,o[s[l]]):"Boolean"===kC.typeOf(u)&&(n.config.disable=!u);break}t.defaultConfig&&dk(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{i[a.toLowerCase()]&&(this.unRegister(r,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var c=new t(n);return i[a.toLowerCase()]=c,i[a.toLowerCase()].func=t,c&&"function"==typeof c.afterCreate&&c.afterCreate(),c}catch(h){throw console.error(h),h}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var n=this.pluginGroup[e]._plugins[t];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(i){var r;console.error(Nm(r="[unRegister:".concat(t,"] cgid:[")).call(r,e,"] error"),i)}},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 r=t.toLowerCase();return this.pluginGroup[n]._plugins[r]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Hw((function(e){e()}))}return new Hw((function(r){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Hw.all(e._loadingPlugins):Hw.resolve()).then((function(){var i,o=e._pluginInfoId;if(t.pluginGroup[o]){var a=t.pluginGroup[o]._plugins,s=[];dk(a).forEach((function(e){if(a[e]&&a[e].beforePlayerInit)try{var t=a[e].beforePlayerInit();s.push(n(t))}catch(r){throw s.push(n(null)),r}})),Hw.all(Nm(i=[]).call(i,s)).then((function(){r()})).catch((function(e){console.error(e),r()}))}else r()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;dk(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 r=this.pluginGroup[n]._plugins;dk(r).forEach((function(t){if(r[t].updateLang)r[t].updateLang(e);else try{r[t].lang=e}catch(oz){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var r=[],i=this.pluginGroup[n]._plugins;dk(i).forEach((function(e){"controls"!==e&&i[e]&&(r.push({plugin:i[e].func,options:i[e].__args}),t.unRegister(n,e))})),r.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||{};dk(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,r;n=e.root,tx.unObserver(n,r);for(var i=this.pluginGroup[t]._plugins,o=0,a=dk(i);o<a.length;o++){var s=a[o];this.unRegister(t,s)}delete this.pluginGroup[t],delete e._pluginInfoId}}},rx="xgplayer",ix="xgplayer-is-enter",ox="xgplayer-pause",ax="xgplayer-playing",sx="xgplayer-ended",lx="xgplayer-isloading",ux="xgplayer-is-error",cx="xgplayer-replay",hx="xgplayer-nostart",fx="xgplayer-inactive",dx="xgplayer-is-fullscreen",px="xgplayer-is-cssfullscreen",vx="xgplayer-rotate-fullscreen",gx="xgplayer-rotate-parent",yx="xgplayer-fullscreen-parent",mx="xgplayer-fullscreen-inner",_x="no-controls",bx="flex-controls",wx="controls-autohide",kx="top-bar-autohide",Ex="not-allow-autoplay",Sx="seeking";function Tx(){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:TC(),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 Cx=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onMouseEnter",(function(e){var t=MS(r),n=t.player;t.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),IS(MS(r),"onMouseLeave",(function(e){MS(r).player.focus()})),r}return PS(n,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==PC.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e,t=this,n=this.config,r=n.disable,i=n.height,o=n.mode;if(!r){"flex"===o&&this.player.addClass(bx);var a={height:"".concat(i,"px")};Vw(e=dk(a)).call(e,(function(e){t.root.style[e]=a[e]})),this.left=Xm(this).call(this,"xg-left-grid"),this.center=Xm(this).call(this,"xg-center-grid"),this.right=Xm(this).call(this,"xg-right-grid"),this.innerRoot=Xm(this).call(this,"xg-inner-controls"),this.on(lA,(function(e){e?kC.addClass(t.root,"mini-controls"):kC.removeClass(t.root,"mini-controls")}));var s=this.playerConfig.isMobileSimulateMode;"mobile"!==PC.device&&"mobile"!==s&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&kC.addClass(this.root,wx)}},{key:"pauseAutoHide",value:function(){kC.removeClass(this.root,wx)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(this.root){var i=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:i.position){case XA.CONTROLS_LEFT:t.root=this.left;break;case XA.CONTROLS_RIGHT:t.root=this.right;break;case XA.CONTROLS_CENTER:t.root=this.center;break;case XA.CONTROLS:t.root=this.root;break;default:t.root=this.left}return US(DS(n.prototype),"registerPlugin",this).call(this,e,t,r)}}}},{key:"destroy",value:function(){"mobile"!==PC.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,r=e.initShow;if(!e.disable){var i=kC.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},IS({},wx,n),{"xgplayer-controls-initshow":r||!n});return'<xg-controls class="'.concat(i,'" 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}(QA),Ax={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"}},xx={lang:{},langKeys:[],textKeys:[]};function Px(e,t){return dk(t).forEach((function(n){var r,i=kC.typeOf(t[n]),o=kC.typeOf(e[n]);"Array"===i?("Array"!==o&&(e[n]=[]),(r=e[n]).push.apply(r,BS(t[n]))):"Object"===i?("Object"!==o&&(e[n]={}),Px(e[n],t[n])):e[n]=t[n]})),e}function Ix(){var e;Vw(e=dk(xx.lang.en)).call(e,(function(e){xx.textKeys[e]=e}))}function Rx(e,t){var n=e.LANG;if(t||(t=xx),t.lang){var r=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?Px(t.lang[n],r):(t.langKeys.push(n),t.lang[n]=r),Ix()}}Rx(Ax);var Dx={get textKeys(){return xx.textKeys},get langKeys(){return xx.langKeys},get lang(){var e,t={};return Vw(e=xx.langKeys).call(e,(function(e){t[e]=xx.lang[e]})),xx.lang["zh-cn"]&&(t.zh=xx.lang["zh-cn"]||{}),t},extend:function(e,t){var n=[];if(t||(t=xx),t.lang){var r;if("Array"!==kC.typeOf(e))n=Vw(r=dk(e)).call(r,(function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}}));else n=e;var i=t.lang;Vw(n).call(n,(function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?Px(i[e.LANG]||{},e.TEXT||{}):Rx(e,t)})),Ix()}},use:Rx,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return Px(n.lang,xx.lang),(t=n.langKeys).push.apply(t,BS(xx.langKeys)),Px(n.textKeys,xx.textKeys),n}},Ox=1,Mx=2,Lx=3,Fx=4,Ux=5,Bx=6,Nx=7,Vx=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Hx={},Gx=null,jx=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"add",value:function(e){e&&(Hx[e.playerId]=e,1===dk(Hx).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Hx[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in Hx)if(Object.prototype.hasOwnProperty.call(Hx,n)){var r=Hx[n];if(t){if(e(r))break}else e(r)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(n){var r=e(n);return r&&(t=n),r}),!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(Hx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Hx[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=dk(Hx),t=0;t<e.length;t++){var n=Hx[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(Hx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Hx[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Gx||(Gx=new n),Gx}}]),n}(GS.EventEmitter);var zx=["play","pause","replay","retry"],Kx=0,Wx=0,qx=null,Xx=function(e){RS(n,e);var t=FS(n);function n(e){var r;AS(this,n);var i,o=kC.deepMerge(Tx(),e);IS(MS(r=t.call(this,o)),"canPlayFunc",(function(){if(r.config){var e=r.config,t=e.autoplay,n=e.defaultPlaybackRate;bC.logInfo("player","canPlayFunc, startTime",r.__startTime),r.__startTime>0&&r.duration>0&&(r.currentTime=r.__startTime>r.duration?r.duration:r.__startTime,r.__startTime=-1),r.playbackRate=n,(t||r._useAutoplay)&&r.mediaPlay(),r.off(HC,r.canPlayFunc),r.removeClass(ix)}})),IS(MS(r),"onFullscreenChange",(function(e,t){var n=function(){kC.setTimeout(MS(r),(function(){r.resize()}),100)},i=kC.getFullScreenEl();r._fullActionFrom?r._fullActionFrom="":r.emit(yA,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:r.currentTime,duration:r.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var r=e.getAttribute(n);return!(!r||r!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(i,r.playerId,PA);if(t||i&&(i===r._fullscreenEl||o))n(),!r.config.closeFocusVideoFocus&&r.media.focus(),r.fullscreen=!0,r.changeFullStyle(r.root,i,dx),r.emit(aA,!0,r._fullScreenOffset),r.cssfullscreen&&r.exitCssFullscreen();else if(r.fullscreen){n();var a=MS(r),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),kC.setTimeout(MS(r),(function(){r.fullscreen=!1,r._fullScreenOffset=null}),100)):(!r.config.closeFocusVideoFocus&&r.media.focus(),r.fullscreen=!1,r._fullScreenOffset=null),r.cssfullscreen)r.removeClass(dx);else{var l=r._fullscreenEl;l||!r.root.contains(e.target)&&e.target!==r.root||(l=e.target),r.recoverFullStyle(r.root,l,dx)}r._fullscreenEl=null,r.emit(aA,!1)}})),IS(MS(r),"_onWebkitbeginfullscreen",(function(e){r._fullscreenEl=r.media,r.onFullscreenChange(e,!0)})),IS(MS(r),"_onWebkitendfullscreen",(function(e){r.onFullscreenChange(e,!1)})),FA(MS(r),zx),r.config=o,r._pluginInfoId=kC.generateSessionId(),(i=MS(r)).logInfo=bC.logInfo.bind(i),i.logWarn=bC.logWarn.bind(i),i.logError=bC.logError.bind(i);var a=r.constructor.defaultPreset;if(r.config.presets.length){var s,l=fk(s=r.config.presets).call(s,"default");l>=0&&a&&(r.config.presets[l]=a)}else a&&r.config.presets.push(a);if(r.userTimer=null,r.waitTimer=null,r.handleSource=!0,r._state=Ox,r.isError=!1,r._hasStart=!1,r.isSeeking=!1,r.isCanplay=!1,r._useAutoplay=!1,r.__startTime=-1,r.rotateDeg=0,r.isActive=!1,r.fullscreen=!1,r.cssfullscreen=!1,r.isRotateFullscreen=!1,r._fullscreenEl=null,r.timeSegments=[],r._cssfullscreenEl=null,r.curDefinition=null,r._orgCss="",r._fullScreenOffset=null,r._videoHeight=0,r._videoWidth=0,r.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},r.sizeInfo={width:0,height:0,left:0,top:0},r._accPlayed={t:0,acc:0,loopAcc:0},r._offsetInfo={currentTime:-1,duration:0},r.innerContainer=null,r.controls=null,r.topBar=null,r.root=null,r.__i18n=Dx.init(r._pluginInfoId),PC.os.isAndroid&&PC.osVersion>0&&PC.osVersion<6&&(r.config.autoplay=!1),r.database=new TA,r.isUserActive=!1,r._onceSeekCanplay=null,r._isPauseBeforeSeek=0,r.innerStates={isActiveLocked:!1},r.instManager=qx,!r._initDOM())return console.error(new Error("can't find the dom which id is ".concat(r.config.id," or this.config.el does not exist"))),LS(r);var u=r.config,c=u.definition,h=void 0===c?{}:c;if(!u.url&&h.list&&h.list.length>0){var f,d=Xm(f=h.list).call(f,(function(e){return e.definition&&e.definition===h.defaultDefinition}));d||(h.defaultDefinition=h.list[0].definition,d=h.list[0]),r.config.url=d.url,r.curDefinition=d}return r._bindEvents(),r._registerPresets(),r._registerPlugins(),nx.onPluginsReady(MS(r)),r.getInitDefinition(),r.setState(Mx),kC.setTimeout(MS(r),(function(){r.emit(XC)}),0),r.onReady&&r.onReady(),(r.config.videoInit||r.config.autoplay)&&(!r.hasStart||r.state<Fx)&&r.start(),r}return PS(n,[{key:"_initDOM",value:function(){var e,t,n,r,i=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var o=this.config.el;if(!o||1!==o.nodeType)return this.emit(UC,new OC("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=o}var a=function(e){for(var t=dk(Hx),n=0;n<t.length;n++){var r=Hx[t[n]];if(r.root===e)return r}return null}(this.root);a&&(bC.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),a.destroy()),this.root.setAttribute(PA,this.playerId),null===(r=qx)||void 0===r||r.add(this),nx.init(this),this._initBaseDoms();var s=this.constructor.XgVideoProxy;if(s&&this.mediaConfig.mediaType===s.mediaType){var l=this.innerContainer||this.root;this.detachVideoEvents(this.media);var u=new s(l,this.config,this.mediaConfig);this.attachVideoEvents(u),this.media=u}if(this.media.setAttribute(PA,this.playerId),this.config.controls){var c=this.config.controls.root||null,h=nx.register(this,Cx,{root:c});this.controls=h}var f="mobile"===this.config.isMobileSimulateMode?"mobile":PC.device;if(this.addClass(Nm(e=Nm(t=Nm(n="".concat(rx," ")).call(n,fx," xgplayer-")).call(t,f," ")).call(e,this.config.controls?"":_x)),this.config.autoplay?this.addClass(ix):this.addClass(hx),this.config.fluid){var d=this.config,p=d.width,v=d.height;"number"==typeof p&&"number"==typeof v||(p=600,v=337.5);var g={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*v/p,"%")};dk(g).forEach((function(e){i.root.style[e]=g[e]}))}else["width","height"].forEach((function(e){i.config[e]&&("number"!=typeof i.config[e]?i.root.style[e]=i.config[e]:i.root.style[e]="".concat(i.config[e],"px"))}));var y=this.root.getBoundingClientRect(),m=y.width,_=y.height,b=y.left,w=y.top;return this.sizeInfo.width=m,this.sizeInfo.height=_,this.sizeInfo.left=b,this.sizeInfo.top=w,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=kC.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+pk(t).call(t,1)])})),CA.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),PC.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(zC,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(MC,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),CA.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(MC,this.playFunc),this.off(HC,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(kC.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this;if(this.media&&(e&&""!==e&&("Array"!==kC.typeOf(e)||0!==e.length)||(e="",this.emit(YC),bC.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this.handleSource&&(this._detachSourceEvents(this.media),"Array"===kC.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e),"Number"===kC.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var r=this.media.readyState;bC.logInfo("_startInit readyState",r),this.config.autoplay&&(!kC.isMSE(this.media)&&this.load(),(PC.os.isIpad||PC.os.isPhone)&&this.mediaPlay());var i=this.config.startTime;this.__startTime=i>0?i:-1,this.config.startTime=0,r>=2&&this.duration>0?this.canPlayFunc():this.on(HC,this.canPlayFunc),(!this.hasStart||this.state<Fx)&&nx.afterInit(this),this.hasStart=!0,this.setState(Fx),kC.setTimeout(this,(function(){t.emit(JC)}),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||[],r=this.config.plugins||[],i=this.config.i18n||[];t&&Dx.extend(i,this.__i18n);var o=n.join("||").toLowerCase().split("||"),a=this.plugins;r.forEach((function(n){try{var r=n.plugin?n.plugin.pluginName:n.pluginName;if(r&&fk(o).call(o,r.toLowerCase())>-1)return null;if(!t&&a[r.toLowerCase()])return;if(n.lazy&&n.loader){var i=nx.lazyRegister(e,n);return void(n.forceBeforeInit&&(i.then((function(){var t,n;Lk(t=e._loadingPlugins).call(t,fk(n=e._loadingPlugins).call(n,i),1)})).catch((function(t){var n,r;bC.logError("_registerPlugins:loadingPlugin",t),Lk(n=e._loadingPlugins).call(n,fk(r=e._loadingPlugins).call(r,i),1)})),e._loadingPlugins.push(i)))}return e.registerPlugin(n)}catch(s){bC.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,r,i,o=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),a=o.plugins,s=void 0===a?[]:a,l=o.ignores,u=void 0===l?[]:l,c=o.icons,h=void 0===c?{}:c,f=o.i18n,d=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(r=e.config.plugins).push.apply(r,BS(s)),(i=e.config.ignores).push.apply(i,BS(u)),Vw(n=dk(h)).call(n,(function(t){e.config.icons[t]||(e.config.icons[t]=h[t])}));var p=e.config.i18n||[];d.push.apply(d,BS(p)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case XA.ROOT_RIGHT:this.rightBar||(this.rightBar=kC.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case XA.ROOT_LEFT:this.leftBar||(this.leftBar=kC.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case XA.ROOT_TOP:this.topBar||(this.topBar=kC.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&kC.addClass(this.topBar,kx)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=nx.formatPluginInfo(e,t),r=n.PLUFGIN,i=n.options,o=this.config.plugins;!nx.checkPluginIfExits(r.pluginName,o)&&o.push(r);var a=nx.getRootByConfig(r.pluginName,this.config);a.root&&(i.root=a.root),a.position&&(i.position=a.position);var s=i.position?i.position:i.config&&i.config.position||r.defaultConfig&&r.defaultConfig.position;return!i.root&&"string"==typeof s&&fk(s).call(s,"controls")>-1?this.controls&&this.controls.registerPlugin(r,i,r.pluginName):(i.root||(i.root=this._getRootByPosition(s)),nx.register(this,r,i))}},{key:"deregister",value:function(e){"string"==typeof e?nx.unRegister(this,e):e instanceof VA&&nx.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 VA&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){var r;Lk(r=this.config.plugins).call(r,n,1);break}}}},{key:"plugins",get:function(){return nx.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=nx.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(kC.hasClass(this.root,e)||kC.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&kC.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return kC.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>Lx))return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(Lx),this._registerPlugins(!1),nx.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",bC.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e,t){var n=this,r=e;"Object"===kC.typeOf(e)&&(r=e.url),r=this._preProcessUrl(r).url;var i=this.currentTime;this.__startTime=i;var o=this.paused&&!this.isError;return this.src=r,new Hw((function(e,t){var i=function(e){n.off("timeupdate",a),n.off("canplay",a),t(e)},a=function(){n.duration>0&&n.__startTime>0&&(n.currentTime=n.__startTime,n.__startTime=-1),o&&n.pause(),n.off("error",i),e(!0)};n.once("error",i),r?(PC.os.isAndroid?n.once("timeupdate",a):n.once("canplay",a),n.play()):n.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<Fx)return this.removeClass(hx),this.addClass(ix),this.start(),void(this._useAutoplay=!0);this.state<Bx&&(this.removeClass(hx),!this.isCanplay&&this.addClass(ix));var t=US(DS(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Ex),e.addClass(ax),e.state<Bx&&(bC.logInfo(">>>>playPromise.then"),e.setState(Bx),e.emit($C))})).catch((function(t){if(bC.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(ix);"NotAllowedError"===t.name&&(e._errorTimer=kC.setTimeout(e,(function(){e._errorTimer=null,e.emit(ZC),e.addClass(Ex),e.removeClass(ix),e.pause(),e.setState(Ux)}),0))})):(bC.logWarn("video.play not return promise"),this.state<Bx&&(this.setState(Bx),this.removeClass(Ex),this.removeClass(hx),this.removeClass(ix),this.addClass(ax),this.emit($C))),t}},{key:"mediaPause",value:function(){US(DS(n.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){US(DS(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(ox),BA(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;BA(this,"pause",(function(){US(DS(n.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var n=this;if(this.media&&!Fk(Number(e))&&this.hasStart){var r=this.config,i=r.isSeekedPlay,o=r.seekedStatus,a=t||(i?"play":o);e=e<0?0:e>this.duration?iE(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(BC,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(ix),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(BC,this._onceSeekCanplay),this.state<Bx?(this.removeClass(hx),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e,t=this,n=this.config,r=n.definition;!n.url&&r&&r.list&&r.list.length>0&&r.defaultDefinition&&Vw(e=r.list).call(e,(function(e){e.definition===r.defaultDefinition&&(t.config.url=e.url,t.curDefinition=e)}))}},{key:"changeDefinition",value:function(e,t){var n=this,r=this.config.definition;if(Array.isArray(null==r?void 0:r.list)&&r.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=iE(e.bitrate,10)||0),this.emit(uA,{from:t,to:e}),this.hasStart){var i=this.switchURL(e.url,TS({seamless:!1!==r.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));i&&i.then?i.then((function(){n.emit(hA,{from:t,to:e})})):this.emit(hA,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(zC,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Ex,ax,hx,ox,cx,ix,sx,ux,lx];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(hx),this.emit(mA)}},{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&&(Vw(t).call(t,(function(t){e.deregister(t)})),n)){var r,i=Tx();fE(r=dk(this.config)).call(r,(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,r=this,i=this.innerContainer,o=this.root,a=this.media;if(o&&a){if(this.hasStart=!1,this._useAutoplay=!1,o.removeAttribute(PA),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),kC.clearAllTimers(this),this.emit(eA),null===(t=qx)||void 0===t||t.remove(this),nx.destroy(this),UA(this),US(DS(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),i)for(var s=i.children,l=0;l<s.length;l++)i.removeChild(s[l]);!i&&a instanceof window.Node&&o.contains(a)&&o.removeChild(a),Vw(e=["topBar","leftBar","rightBar","innerContainer"]).call(e,(function(e){r[e]&&o.removeChild(r[e]),r[e]=null}));var u=o.className.split(" ");u.length>0?o.className=Gw(u).call(u,(function(e){return fk(e).call(e,"xgplayer")<0})).join(" "):o.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){r[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(sx),this.currentTime=0,this.isSeeking=!1,BA(this,"replay",(function(){e.once(BC,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(QC),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(ux),this.addClass(lx),BA(this,"retry",(function(){var t=e.currentTime,n=e.config.url,r=kC.isMSE(e.media)?{url:n}:e._preProcessUrl(n);e.src=r.url,!e.config.isLive&&(e.currentTime=t),e.once(HC,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,r){e&&(r||(r=yx),this._orgCss||(this._orgCss=kC.filterStyleFromText(e)),kC.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=kC.filterStyleFromText(t),kC.addClass(t,r),t.setAttribute(PA,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,r){r||(r=yx),this._orgCss&&(kC.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),kC.removeClass(e,n),t&&t!==e&&this._orgPCss&&(kC.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",kC.removeClass(t,r),t.removeAttribute(PA))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:kC.scrollTop(),left:kC.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",kC.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Hw.resolve();try{for(var r=0;r<AA.length;r++){var i=AA[r];if(e[i]){var o="webkitRequestFullscreen"===i?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[i]();return o&&o.then?o:Hw.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Hw.resolve()):Hw.reject(new Error("call getFullscreen fail"))}catch(a){return Hw.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||kC.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var n=0;n<xA.length;n++){var r=xA[n];if(document[r]){var i=document[r]();return i&&i.then?i:Hw.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Hw.resolve()):Hw.reject(new Error("call exitFullscreen fail"))}catch(o){return Hw.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var n=t?Nm(e="".concat(mx," ")).call(e,px):px;this.changeFullStyle(this.root,t,n);var r=this.config.fullscreen,i=void 0===r?{}:r;(!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen())&&(this.fullscreen=!0,this.emit(aA,!0)),this._cssfullscreenEl=t,this.cssfullscreen=!0,this.emit(sA,!0)}},{key:"exitCssFullscreen",value:function(){var e,t=this._cssfullscreenEl?Nm(e="".concat(mx," ")).call(e,px):px;if(this.fullscreen){var n=this.config.fullscreen,r=void 0===n?{}:n;!0===r.useCssFullscreen||"function"==typeof r.useCssFullscreen&&r.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,t),this.fullscreen=!1,this.emit(aA,!1)):this.removeClass(t)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,t);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(sA,!1)}},{key:"getRotateFullscreen",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(t);var n=t?Nm(e="".concat(mx," ")).call(e,vx):vx;this._fullscreenEl=t||this.root,this.changeFullStyle(this.root,t,n,gx),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style"),this.root.style.width="".concat(window.innerHeight,"px"),this.emit(aA,!0)}},{key:"exitRotateFullscreen",value:function(e){var t,n=this._fullscreenEl!==this.root?Nm(t="".concat(mx," ")).call(t,vx):vx;this.recoverFullStyle(this.root,this._fullscreenEl,n,gx),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(aA,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(WC,TS({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?(this._clearUserTimer(),this.emit(qC,TS({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(fx),this._clearUserTimer(),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this._clearUserTimer();else{var r=t&&t.delay?t.delay:this.config.inactive;this.userTimer=kC.setTimeout(this,(function(){e.userTimer=null,e.blur()}),r)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var n=this.config.closePauseVideoFocus;this.isActive=!1,(t||n||!this.paused&&!this.ended)&&this.addClass(fx)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(ix),this.removeClass(ux),this.removeClass(lx),this.isCanplay=!0,this.waitTimer&&kC.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1,this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime,this.__startTime=-1)}},{key:"onLoadstart",value:function(){this.removeClass(ux),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===Nx&&this.setState(Bx),this.removeClass(ox),this.ended&&this.removeClass(sx),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(ox),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(sx),this.setState(Nx)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Ex),this.removeClass(hx),this.removeClass(ix),this.removeClass(lx),this.addClass(ux)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Sx)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&kC.clearTimeout(this,this.waitTimer),this.removeClass(lx),this.removeClass(Sx)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&kC.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=kC.setTimeout(this,(function(){e.addClass(lx),e.emit(oA),kC.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[hx,ox,sx,ux,cx,lx].forEach((function(t){e.removeClass(t)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(lx))&&this.media.readyState>2&&(this.removeClass(lx),kC.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===Ux&&this.duration&&(this.setState(Bx),this.emit($C)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===kC.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,n){if(this.media&&t&&e){var r="String"===kC.typeOf(e)?e:e.type||"";n.props&&"Array"!==kC.typeOf(n.props)&&(n.props=[n.props]),this.emit(yA,TS({eventType:r,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=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},n=t.startDiff,r=void 0===n?0:n,i=t.endDiff,o=void 0===i?0:i,a=this.media.buffered;if(!a||0===a.length||!this.duration)return!0;for(var s=e||this.media.currentTime||.2,l=a.length,u=0;u<l;u++)if(a.start(u)+r<=s&&a.end(u)-o>s)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.vy,n=e.vx,r=e.h,i=e.w,o=this.videoPos.rotate;if(!(o<0&&r<0&&i<0)){var a=this.videoPos._pi;if(!a&&this.media.videoHeight&&(a=this.media.videoWidth/this.media.videoHeight*100),a){this.videoPos.pi=a;var s={rotate:o=o<0?0:o},l=0,u=0,c=1,h=Math.abs(o/90),f=this.root,d=this.innerContainer,p=f.offsetWidth,v=d?d.offsetHeight:f.offsetHeight,g=v,y=p;if(h%2==0)c=r>0?100/r:i>0?100/i:1,s.scale=c,l=t>0?(100-r)/2-t:0,s.y=2===h?0-l:l,u=n>0?(100-i)/2-n:0,s.x=2===h?0-u:u,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(g,"px");else if(h%2==1){g=p;var m=v-p;u=-m/2/(y=v)*100,s.x=3===h?u+t/2:u-t/2,l=m/2/g*100,s.y=3===h?l+n/2:l-n/2,s.scale=c,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(g,"px")}var _=kC.getTransformStyle(s,this.media.style.transform||this.media.style.webkitTransform);this.media.style.transform=_,this.media.style.webkitTransform=_}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t,n=this;e&&Vw(t=dk(e)).call(t,(function(t){if("plugins"!==t){n.config[t]=e[t];var r=n.plugins[t.toLowerCase()];r&&"Function"===kC.typeOf(r.setConfig)&&r.setConfig(e[t])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,BA(this,"playnext",(function(){t.start(),t.emit(vA,e)}))}},{key:"resize",value:function(){var e=this;if(this.media){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var n=this.media,r=n.videoWidth,i=n.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),i&&r){this._videoHeight=i,this._videoWidth=r;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,c=t.height-l,h=iE(r/i*1e3,10),f=iE(u/c*1e3,10),d=u,p=c,v={};"auto"===a&&f>h||"fixWidth"===a?(p=u/h*1e3,this.config.fluid?v.paddingTop="".concat(100*p/d,"%"):v.height="".concat(p+l,"px")):("auto"===a&&f<h||"fixHeight"===a)&&(d=h*c/1e3,v.width="".concat(d,"px")),this.fullscreen||this.cssfullscreen||dk(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===s&&f<h||"fillWidth"===s&&f>h)&&this.setAttribute("data-xgfill","cover");var g={videoScale:h,vWidth:d,vHeight:p,cWidth:d,cHeight:p+l};this.resizePosition(),this.emit(dA,g)}}}},{key:"updateObjectPosition",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(t,n):this.media.style.objectPosition=Nm(e="".concat(100*t,"% ")).call(e,100*n,"%")}},{key:"setState",value:function(e){var t;bC.logInfo("setState",Nm(t="state from:".concat(Vx[this.state]," to:")).call(t,Vx[e])),this._state=e}},{key:"_preProcessUrl",value:function(e,t){var n=this.config,r=n.preProcessUrl,i=n.preProcessUrlOptions,o=AE({},i,t);return kC.isBlob(e)||"function"!=typeof r?{url:e}:r(e,o)}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(Mx),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===Bx||this._state===Nx},set:function(e){e?this.setState(Bx):this._state>=Bx&&this.setState(Fx)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition,r=null,i=null;n.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(r=e),n.defaultDefinition===e.definition&&(i=e)})),!i&&e.length>0&&(i=e[0]),r?this.changeDefinition(r):i&&this.changeDefinition(i)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=iE(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var t,n;0!==Gw(t=Dx.langKeys).call(t,(function(t){return t===e})).length||"zh"===e?(this.config.lang=e,nx.setLang(e,this)):console.error(Nm(n="Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [")).call(n,Dx.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 IC}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return US(DS(n.prototype),"readyState",this)}},{key:"error",get:function(){var e=US(DS(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return US(DS(n.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,n=e.t;return n?(new Date).getTime()-n+t:t}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=kC.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Wx},set:function(e){Wx=e}},{key:"realTimeSpeed",get:function(){return Kx},set:function(e){Kx=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,t){var n;return RA.call.apply(RA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){var n;return DA.call.apply(DA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){var n;return OA.call.apply(OA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var r,i=arguments.length,o=new Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];return MA.call.apply(MA,Nm(r=[this]).call(r,pk(Array.prototype).call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var r,i=arguments.length,o=new Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];return LA.call.apply(LA,Nm(r=[this]).call(r,pk(Array.prototype).call(arguments)))}},{key:"setUserActive",value:function(e,t){var n;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),kC.typeOf(t)===Boolean&&(this.muted=t)),null===(n=qx)||void 0===n||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return bC.config.debug},set:function(e){bC.config.debug=e}},{key:"instManager",get:function(){return qx},set:function(e){qx=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=qx)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var n;null===(n=qx)||void 0===n||n.setActive(e,t)}},{key:"isHevcSupported",value:function(){return PC.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return PC.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}(SA);IS(Xx,"defaultPreset",null),IS(Xx,"XgVideoProxy",null),Xx.instManager=jx.getInstance();function Yx(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var $x=qE;Dn({target:"Function",proto:!0,forced:Function.bind!==$x},{bind:$x});var Zx,Jx,Qx=Wc("Function").bind,eP=ce,tP=Qx,nP=Function.prototype,rP=o((function(e){var t=e.bind;return e===nP||eP(nP,e)&&t===nP.bind?tP:t}));function iP(e,t){var n;return(iP=gh?rP(n=gh).call(n):function(e,t){return e.__proto__=t,e})(e,t)}function oP(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Lc(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Oc(e,"prototype",{writable:!1}),t&&iP(e,t)}function aP(e){var t;return(aP=gh?rP(t=Vc).call(t):function(e){return e.__proto__||Vc(e)})(e)}function sP(){if("undefined"==typeof Reflect||!uS)return!1;if(uS.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(uS(Boolean,[],(function(){}))),!0}catch(e){return!1}}function lP(e){var t=sP();return function(){var n,r=aP(e);if(t){var i=aP(this).constructor;n=uS(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Tc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Yx(e)}(this,n)}}function uP(e,t,n){var r;sP()?uP=rP(r=uS).call(r):uP=function(e,t,n){var r=[null];ph(r).apply(r,t);var i=new(rP(Function).apply(e,r));return n&&iP(i,n.prototype),i};return uP.apply(null,arguments)}function cP(e){var t="function"==typeof Ow?new Ow:void 0;return cP=function(e){if(null===e||(n=e,-1===$y(r=Function.toString.call(n)).call(r,"[native code]")))return e;var n,r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return uP(e,arguments,aP(this).constructor)}return i.prototype=Lc(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),iP(i,e)},cP(e)}var hP=function(e){return e.Fatal="Fatal",e.Error="Error",e}(hP||{}),fP=function(e){return e[e.MANIFEST_HLS_ERROR=1100]="MANIFEST_HLS_ERROR",e[e.MANIFEST_DASH_ERROR=1200]="MANIFEST_DASH_ERROR",e[e.NETWORK=2100]="NETWORK",e[e.NETWORK_TIMEOUT=2101]="NETWORK_TIMEOUT",e[e.NETWORK_FORBIDDEN=2103]="NETWORK_FORBIDDEN",e[e.NETWORK_NOTFOUND=2104]="NETWORK_NOTFOUND",e[e.NETWORK_RANGE_NOT_SATISFIABLE=2116]="NETWORK_RANGE_NOT_SATISFIABLE",e[e.DEMUX_FLV_ERROR=3100]="DEMUX_FLV_ERROR",e[e.DEMUX_HLS_ERROR=3200]="DEMUX_HLS_ERROR",e[e.DEMUX_MP4_ERROR=3300]="DEMUX_MP4_ERROR",e[e.DEMUX_FMP4_ERROR=3400]="DEMUX_FMP4_ERROR",e[e.DEMUX_SIDX_ERROR=3410]="DEMUX_SIDX_ERROR",e[e.REMUX_FMP4_ERROR=4100]="REMUX_FMP4_ERROR",e[e.REMUX_MP4_ERROR=4200]="REMUX_MP4_ERROR",e[e.MEDIA_ERR_ABORTED=5101]="MEDIA_ERR_ABORTED",e[e.MEDIA_ERR_NETWORK=5102]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=5103]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=5104]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MEDIA_ERR_CODEC_NOT_SUPPORTED=5105]="MEDIA_ERR_CODEC_NOT_SUPPORTED",e[e.MEDIA_ERR_URL_EMPTY=5106]="MEDIA_ERR_URL_EMPTY",e[e.MEDIA_MSE_ADD_SB=5200]="MEDIA_MSE_ADD_SB",e[e.MEDIA_MSE_APPEND_BUFFER=5201]="MEDIA_MSE_APPEND_BUFFER",e[e.MEDIA_MSE_OTHER=5202]="MEDIA_MSE_OTHER",e[e.MEDIA_MSE_FULL=5203]="MEDIA_MSE_FULL",e[e.MEDIA_MSE_HIJACK=5204]="MEDIA_MSE_HIJACK",e[e.MEDIA_EME_HIJACK=5301]="MEDIA_EME_HIJACK",e[e.DRM_LICENSE=7100]="DRM_LICENSE",e[e.DRM_CUSTOM_LICENSE=7200]="DRM_CUSTOM_LICENSE",e[e.OTHER=8e3]="OTHER",e[e.RUNTIME_NO_CANPLAY_ERROR=9001]="RUNTIME_NO_CANPLAY_ERROR",e[e.RUNTIME_BUFFERBREAK_ERROR=9002]="RUNTIME_BUFFERBREAK_ERROR",e[e.RUNTIME_BWAITING_TIMEOUT_ERROR=9002]="RUNTIME_BWAITING_TIMEOUT_ERROR",e[e.MODULE_LOAD_ERROR=110]="MODULE_LOAD_ERROR",e.UNKNOWN="UNKNOWN",e}(fP||{}),dP=(Uy(Zx={},2100,{messageTextKey:"NETWORK",level:"Error"}),Uy(Zx,2101,{messageTextKey:"NETWORK_TIMEOUT",level:"Error"}),Uy(Zx,2103,{messageTextKey:"NETWORK_FORBIDDEN",level:"Error"}),Uy(Zx,2104,{messageTextKey:"NETWORK_NOTFOUND",level:"Error"}),Uy(Zx,5101,{messageTextKey:"MEDIA_ERR_ABORTED",level:"Error"}),Uy(Zx,5102,{messageTextKey:"MEDIA_ERR_NETWORK",level:"Error"}),Uy(Zx,5103,{messageTextKey:"MEDIA_ERR_DECODE",level:"Error"}),Uy(Zx,5104,{messageTextKey:"MEDIA_ERR_SRC_NOT_SUPPORTED",level:"Error"}),Uy(Zx,5105,{messageTextKey:"MEDIA_ERR_CODEC_NOT_SUPPORTED",level:"Error"}),Uy(Zx,5106,{messageTextKey:"MEDIA_ERR_URL_EMPTY",level:"Error"}),Uy(Zx,110,{messageTextKey:"MODULE_LOAD_ERROR",level:"Fatal"}),Uy(Zx,7100,{messageTextKey:"DRM_LICENSE",level:"Fatal"}),Zx),pP=(Uy(Jx={},"manifest",{messageTextKey:"MANIFEST",level:"Error"}),Uy(Jx,"network",{messageTextKey:"NETWORK",level:"Error"}),Uy(Jx,"demux",{messageTextKey:"DEMUX",level:"Error"}),Uy(Jx,"remux",{messageTextKey:"REMUX",level:"Error"}),Uy(Jx,"media",{messageTextKey:"MEDIA",level:"Error"}),Uy(Jx,"drm",{messageTextKey:"DRM",level:"Error"}),Uy(Jx,"other",{messageTextKey:"OTHER",level:"Error"}),Uy(Jx,"runtime",{messageTextKey:"RUNTIME",level:"Error"}),Jx),vP=function(e){oP(n,e);var t=lP(n);function n(e,r){var i,o,a,s,l,u,c;Ry(this,n);var h="string"==typeof e?{message:e}:e,f=null!==(i=null!==(o=null!==(a=null==r?void 0:r.getText(null==h?void 0:h.messageTextKey))&&void 0!==a?a:null==h?void 0:h.message)&&void 0!==o?o:null==h||null===(s=h.error)||void 0===s?void 0:s.message)&&void 0!==i?i:null==r?void 0:r.getText("UNKNOWN");return Uy(Yx(c=t.call(this,f)),"errorCode",void 0),Uy(Yx(c),"level",void 0),Uy(Yx(c),"ext",void 0),c.errorCode=null!==(l=null==h?void 0:h.errorCode)&&void 0!==l?l:"UNKNOWN",c.level=null!==(u=null==h?void 0:h.level)&&void 0!==u?u:"Error",c.ext=null==h?void 0:h.ext,c}return Fy(n)}(cP(Error));function gP(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new vP(Mm(Mm({errorCode:e},dP[e]),t),n)}function yP(e,t){var n,r,i=dP[e.errorCode]||pP[e.errorType],o=e.errorCode;return new vP({messageTextKey:null==i?void 0:i.messageTextKey,message:null!==(n=null==e?void 0:e.message)&&void 0!==n?n:o,errorCode:o,level:null!==(r=null==i?void 0:i.level)&&void 0!==r?r:"Error",ext:e},t)}var mP=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){kC.addClass(this.root,"hide")}},{key:"show",value:function(e){kC.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(LC,(function(){e.isEndedShow&&kC.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(NC,(function(){e.onTimeUpdate()})),this.on(tA,(function(){kC.removeClass(e.root,"hide"),kC.addClass(e.root,"xg-showplay"),e.once(NC,(function(){e.onTimeUpdate()}))}))):this.on(MC,(function(){kC.addClass(e.root,"hide")}))}},{key:"setConfig",value:function(e){var t=this;dk(e).forEach((function(n){t.config[n]=e[n]}));var n=this.config.poster;this.update(n)}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?kC.removeClass(this.root,"xg-showplay"):this.once(NC,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"getBgSize",value:function(e){var t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;default:t=""}return t?"background-size: ".concat(t,";"):""}},{key:"render",value:function(){var e,t,n=this.config,r=n.poster,i=n.hideCanplay,o=n.fillMode,a=n.notHidden,s=this.getBgSize(o),l=r?Nm(e="background-image:url(".concat(r,");")).call(e,s):s;return Nm(t='<xg-poster class="xgplayer-poster '.concat(a?"xg-not-hidden":i?"xg-showplay":"",'" style="')).call(t,l,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),n}(QA);function _P(){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 bP(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var wP={};function kP(e){var t;e?window.clearTimeout(e):Vw(t=dk(wP)).call(t,(function(e){window.clearTimeout(wP[e].id),delete wP[e]}))}var EP=function(e){RS(n,e);var t=FS(n);function n(e){var r;return AS(this,n),IS(MS(r=t.call(this,e)),"onPlayerReset",(function(){r.autoPlayStart=!1;var e="auto"===r.config.mode?"auto-hide":"hide";r.setAttr("data-state","play"),kC.removeClass(r.root,e),r.show()})),IS(MS(r),"onAutoplayStart",(function(){if(!r.autoPlayStart){var e="auto"===r.config.mode?"auto-hide":"hide";kC.addClass(r.root,e),r.autoPlayStart=!0,r.onPlayPause("play")}})),r.autoPlayStart=!1,r}return PS(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(XC,(function(){n&&(n.lang&&"en"===n.lang?kC.addClass(t.root,"lang-is-en"):"jp"===n.lang&&kC.addClass(t.root,"lang-is-jp"))})),this.on($C,this.onAutoplayStart),n.autoplay||this.show(),this.on(ZC,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),kC.removeClass(e.root,t),e.show()})),this.on(MC,(function(){e.onPlayPause("play")})),this.on(FC,(function(){e.onPlayPause("pause")})),this.on(mA,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var n=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:n,to:!n})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:_P,class:"xg-icon-play"},startPause:{icon:bP,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(){kC.addClass(this.root,"hide")}},{key:"show",value:function(e){kC.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){kC.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){kC.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return wP[e]&&window.clearTimeout(wP[e].id),wP[e]={},n.start&&n.start(),wP[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(wP[e].id),delete wP[e]}),t),wP[e].id}("pauseplay",400,{start:function(){kC.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){kC.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){kC.removeClass(this.root,"interact"),kP(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<Mx)||(this.player.paused||t.state!==Bx?t.play():t.pause())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n&&!(n.state<Bx)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),kP(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(QA),SP=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=kC.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="",r=1;r<=12;r++)n+='<div class="xgplayer-enter-bar'.concat(r,'"></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}(QA);function TP(e,t,n){try{var r,i;return Nm(r=Nm(i=' <div class="xg-tips '.concat(n?"hide":" ",'" lang-key="')).call(i,e.i18nKeys[t],'">\n ')).call(r,e.i18n[t],"\n </div>")}catch(o){return'<div class="xg-tips hide"></div>'}}var CP=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(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,t="MINISCREEN";return Nm(e='\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[t],'">')).call(e,this.i18n[t],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_RIGHT,index:10}}}]),n}(QA);function AP(e){var t=wT(e);return-1===fk(e).call(e,"%")&&!Fk(t)&&t}var xP=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],PP=xP.length;function IP(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===CS(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<PP;t++)e[xP[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var r=n.isBorderBox="border-box"===t.boxSizing,i=0;i<PP;i++){var o=xP[i],a=t[o],s=wT(a);n[o]=Fk(s)?0:s}var l=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,c=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,f=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=r,v=AP(t.width);!1!==v&&(n.width=v+(p?0:l+f));var g=AP(t.height);return!1!==g&&(n.height=g+(p?0:u+d)),n.innerWidth=n.width-(l+f),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+c,n.outerHeight=n.height+h,n}}function RP(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.identifier===t)return r}}var DP="dragStart",OP="dragMove",MP="dragEnded",LP={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},FP=function(e){RS(n,e);var t=FS(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return AS(this,n),(r=t.call(this)).isEnabled=!0,r.isDragging=!1,r.isDown=!1,r.position={},r.downPoint={},r.dragPoint={x:0,y:0},r.startPos={x:0,y:0},r._root=e instanceof Element?e:document.querySelector(e),r._handlerDom=i.handle instanceof Element?i.handle:document.querySelector(i.handle),r._root&&r._handlerDom?(r._bindStartEvent(),r):LS(r)}return PS(n,[{key:"_bindStartEvent",value:function(){var e,t=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)]),Vw(e=LP[this._startKey]).call(e,(function(e){t["on".concat(e)]=t["on".concat(e)].bind(t)}))}},{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=LP[this._startKey];Vw(n).call(n,(function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e,t=this;this._boundPointerEvents&&(Vw(e=this._boundPointerEvents).call(e,(function(e){window.removeEventListener(e,t["on".concat(e)])})),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,t=Nm(e="translate3d(".concat(this.dragPoint.x,"px, ")).call(e,this.dragPoint.y,"px, 0)");this._root.style.transform=t,this._root.style.webKitTransform=t}},{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=RP(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=RP(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=RP(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=IP(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(DP,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(MP)),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,r=n.x,i=n.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,r),s=this.checkContain("y",s,i),this.position.x=r+a,this.position.y=i+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(OP,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=Fk(t)?0:t,this.position.y=Fk(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===fk(t).call(t,"matrix")){var n=t.split(","),r=0===fk(t).call(t,"matrix3d")?12:4,i=iE(n[r],10),o=iE(n[r+1],10);this.position.x+=i,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==fk(e).call(e,"%")){var n=IP(this._root.parentNode);return n?wT(e)/100*n[t]:0}return iE(e,10)}}]),n}(jS),UP=function(e){RS(n,e);var t=FS(n);function n(e){var r;AS(this,n),IS(MS(r=t.call(this,e)),"onCancelClick",(function(e){r.exitMini(),r.isClose=!0})),IS(MS(r),"onCenterClick",(function(e){var t=MS(r).player;t.paused?t.play():t.pause()})),IS(MS(r),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-r.pos.scrollY)<50)){var t=iE(kC.getCss(r.player.root,"height"));t+=r.config.scrollTop,r.pos.scrollY=window.scrollY,window.scrollY>t+5?!r.isMini&&!r.isClose&&r.getMini():window.scrollY<=t&&(r.isMini&&r.exitMini(),r.isClose=!1)}})),r.isMini=!1,r.isClose=!1;var i=MS(r).config;return r.pos={left:i.left<0?window.innerWidth-i.width-20:i.left,top:i.top<0?window.innerHeight-i.height-20:i.top,height:r.config.height,width:r.config.width,scrollY:window.scrollY||0},r.lastStyle=null,r}return PS(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(FC,(function(){e.setAttr("data-state","pause")})),this.on(MC,(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(CP,n,CP.pluginName)}var r=kC.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",r,this.onCancelClick),this.bind(".play-icon",r,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new FP(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:_P,class:"xg-icon-play"},pause:{icon:bP,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,t=this;if(!this.isMini){var n=this.player,r=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},kC.addClass(n.root,"xgplayer-mini"),Vw(e=["width","height","top","left"]).call(e,(function(e){t.lastStyle[e]=i.style[e],i.style[e]="".concat(t.pos[e],"px")})),r.fluid&&(i.style["padding-top"]=""),this.emit(lA,!0),n.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t,n=this.player,r=this.playerConfig,i=this.config.target||this.player.root;(kC.removeClass(n.root,"xgplayer-mini"),this.lastStyle)&&Vw(t=dk(this.lastStyle)).call(t,(function(t){i.style[t]=e.lastStyle[t]}));this.lastStyle=null,r.fluid&&(n.root.style.width="100%",n.root.style.height="0",n.root.style["padding-top"]="".concat(100*r.height/r.width,"%")),this.emit(lA,!1),this.isMini=n.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=kC.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(TP(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(QA),BP={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},NP=["videoClick","videoDbClick"],VP=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onMouseMove",(function(e){var t=MS(r),n=t.player,i=t.playerConfig;n.isActive||(n.focus({autoHide:!i.closeDelayBlur}),!i.closeFocusVideoFocus&&n.media.focus())})),IS(MS(r),"onMouseEnter",(function(e){var t=MS(r),n=t.playerConfig,i=t.player;!n.closeFocusVideoFocus&&i.media.focus(),n.closeDelayBlur?i.focus({autoHide:!1}):i.focus(),r.emit(iA)})),IS(MS(r),"onMouseLeave",(function(e){var t=r.playerConfig,n=t.closePlayerBlur,i=t.leavePlayerTime,o=t.closeDelayBlur;n||o||(i?r.player.focus({autoHide:!0,delay:i}):r.player.blur({ignorePaused:!0})),r.emit(rA)})),IS(MS(r),"onVideoClick",(function(e){var t=MS(r),n=t.player,i=t.playerConfig;e.target&&i.closeVideoClick||e.target!==n.root&&e.target!==n.media&&e.target!==n.innerContainer&&e.target!==n.media.__canvas||(e.preventDefault(),i.closeVideoStopPropagation||e.stopPropagation(),r._clickCount++,r.clickTimer&&(clearTimeout(r.clickTimer),r.clickTimer=null),r.clickTimer=setTimeout((function(){r._clickCount&&(r._clickCount--,BA(MS(r),NP[0],(function(e,t){r.switchPlayPause(t.e)}),{e:e,paused:n.paused}),clearTimeout(r.clickTimer),r.clickTimer=null)}),300))})),IS(MS(r),"onVideoDblClick",(function(e){var t=MS(r),n=t.player,i=t.playerConfig;i.closeVideoDblclick||!e.target||e.target!==n.media&&e.target!==n.media.__canvas||(!i.closeVideoClick&&r._clickCount<2?r._clickCount=0:(r._clickCount=0,r.clickTimer&&(clearTimeout(r.clickTimer),r.clickTimer=null),e.preventDefault(),e.stopPropagation(),BA(MS(r),NP[1],(function(e,t){r.emitUserAction(t.e,"switch_fullscreen",{props:"fullscreen",from:n.fullscreen,to:!n.fullscreen}),n.fullscreen?n.exitFullscreen():n.getFullscreen()}),{e:e,fullscreen:n.fullscreen})))})),r}return PS(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Vw(NP).call(NP,(function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===PC.device&&!PC.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e,t=this,n=this.player,r=n.media,i=n.root,o=this.playerConfig.enableContextmenu;i&&i.addEventListener("click",this.onVideoClick,!1),i&&i.addEventListener("dblclick",this.onVideoDblClick,!1),Vw(e=dk(BP)).call(e,(function(e){i.addEventListener(e,t[BP[e]],!1)})),!o&&r&&r.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e,t=this,n=this.player,r=n.video,i=n.root;this.clickTimer&&clearTimeout(this.clickTimer),i.removeEventListener("click",this.onVideoClick,!1),i.removeEventListener("dblclick",this.onVideoDblClick,!1),r.removeEventListener("contextmenu",this.onContextmenu,!1),Vw(e=dk(BP)).call(e,(function(e){i.removeEventListener(e,t[BP[e]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(VA),HP="press",GP="pressend",jP="doubleclick",zP="click",KP="touchmove",WP="touchstart",qP="touchend",XP={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},YP={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function $P(e){return e&&e.length>0?e[e.length-1]:null}var ZP=function(){function e(t){var n,r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};AS(this,e),IS(this,"onTouchStart",(function(e){var t=r._pos,n=r.root,i=$P(e.touches);t.x=i?iE(i.pageX,10):e.pageX,t.y=i?iE(i.pageX,10):e.pageX,t.start=!0,r.__setPress(e),n.addEventListener(r.events.end,r.onTouchEnd),n.addEventListener(r.events.cancel,r.onTouchCancel),n.addEventListener(r.events.move,r.onTouchMove),r.trigger(WP,e)})),IS(this,"onTouchCancel",(function(e){r.onTouchEnd(e)})),IS(this,"onTouchEnd",(function(e){var t=r._pos,n=r.root;r.__clearPress(),n.removeEventListener(r.events.cancel,r.onTouchCancel),n.removeEventListener(r.events.end,r.onTouchEnd),n.removeEventListener(r.events.move,r.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&r.trigger(GP,e),r.trigger(qP,e),!t.press&&!t.moving&&r.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),IS(this,"onTouchMove",(function(e){var t=r._pos,n=r.config,i=$P(e.touches),o=i?iE(i.pageX,10):e.pageX,a=i?iE(i.pageY,10):e.pageX,s=o-t.x,l=a-t.y;Math.abs(l)<n.miniStep&&Math.abs(s)<n.miniStep||(r.__clearPress(),t.press&&r.trigger(GP,e),t.press=!1,t.moving=!0,r.trigger(KP,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},Vw(n=dk(i)).call(n,(function(e){r.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?YP:XP,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return PS(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(HP,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(jP,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(zP,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,r=this.__handlers[e],i=-1,o=0;o<r.length;o++)if(r[o]===t){i=o;break}if(i>=0)Lk(n=this.__handlers[e]).call(n,i,1)}}},{key:"trigger",value:function(e,t){var n;this.__handlers[e]&&Vw(n=this.__handlers[e]).call(n,(function(n){try{n(t)}catch(oz){console.error("trigger>>:".concat(e),oz)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};dk(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}();function JP(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var QP="auto",eI="seeking",tI="playbackrate",nI=["videoClick","videoDbClick"],rI=function(e){RS(n,e);var t=FS(n);function n(e){var r;return AS(this,n),IS(MS(r=t.call(this,e)),"onTouchStart",(function(e){var t=MS(r),n=t.player,i=t.config,o=t.pos,a=t.playerConfig,s=r.getTouche(e);if(s&&!i.disableGesture&&r.duration>0&&!n.ended){o.isStart=!0,r.timer&&clearTimeout(r.timer),kC.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),Xm(r).call(r,".xg-dur").innerHTML=kC.format(r.duration);var l=r.root.getBoundingClientRect();90===n.rotateDeg?(o.top=l.left,o.left=l.top,o.width=l.height,o.height=l.width):(o.top=l.top,o.left=l.left,o.width=l.width,o.height=l.height);var u=iE(s.pageX-o.left,10),c=iE(s.pageY-o.top,10);o.x=90===n.rotateDeg?c:u,o.y=90===n.rotateDeg?u:c,o.scopeL=i.scopeL*o.width,o.scopeR=(1-i.scopeR)*o.width,o.scopeM1=o.width*(1-i.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),IS(MS(r),"onTouchMove",(function(e){var t=r.getTouche(e),n=MS(r),i=n.pos,o=n.config,a=n.player;if(t&&!o.disableGesture&&r.duration&&i.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,u=iE(t.pageX-i.left,10),c=iE(t.pageY-i.top,10),h=90===a.rotateDeg?c:u,f=90===a.rotateDeg?u:c;if(Math.abs(h-i.x)>s||Math.abs(f-i.y)>s){var d=h-i.x,p=f-i.y,v=i.scope;if(-1===v&&(0===(v=r.checkScope(h,f,d,p,i))&&(l?a.blur():a.focus({autoHide:!1}),!i.time&&(i.time=iE(1e3*a.currentTime,10)+1e3*r.timeOffset)),i.scope=v),-1===v||v>0&&!o.gestureY||0===v&&!o.gestureX)return;r.executeMove(d,p,v,i.width,i.height),i.x=h,i.y=f}}})),IS(MS(r),"onTouchEnd",(function(e){var t=MS(r),n=t.player,i=t.pos,o=t.playerConfig;if(setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),i.isStart){i.scope>-1&&e.cancelable&&e.preventDefault();var a=r.config,s=a.disableGesture,l=a.gestureX;!s&&l?r.endLastMove(i.scope):i.time=0,i.scope=-1,r.resetPos(),kC.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),r.changeAction(QP)}})),IS(MS(r),"onRootTouchMove",(function(e){!r.config.disableGesture&&r.config.gestureX&&r.checkIsRootTarget(e)&&(e.stopPropagation(),r.pos.isStart?r.onTouchMove(e):r.onTouchStart(e))})),IS(MS(r),"onRootTouchEnd",(function(e){r.pos.scope>-1&&r.onTouchEnd(e)})),r.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},r.timer=null,r}return PS(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:JP,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e,t=this;Vw(nI).call(nI,(function(e){t.__hooks[e]=null}));var n=this.playerConfig,r=this.config,i=this.player;!0===n.closeVideoDblclick&&(r.closedbClick=!0),this.resetPos(),kC.isUndefined(n.disableGesture)||(r.disableGesture=!!n.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=kC.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var o="mouse"===this.domEventType?"mouse":"touch";this.touch=new ZP(this.root,{eventType:o,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),i.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var a=this.player.controls;a&&a.center&&(a.center.addEventListener("touchmove",this.onRootTouchMove,!0),a.center.addEventListener("touchend",this.onRootTouchEnd,!0),a.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(GC,(function(){var e=t.player,n=t.config;1e3*e.duration<n.moveDuration&&(n.moveDuration=1e3*e.duration)})),this.on([HC,LC],(function(){var e=t.pos,n=e.time;!e.isStart&&n>0&&(t.pos.time=0)}));var s={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Vw(e=dk(s)).call(e,(function(e){t.touch.on(e,(function(n){t[s[e]](n)}))})),!r.disableActive){var l=i.plugins.progress;l&&(l.addCallBack("dragmove",(function(e){t.activeSeekNote(e.currentTime,e.forward)})),["dragend","click"].forEach((function(e){l.addCallBack(e,(function(){t.changeAction(QP)}))})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=Xm(this).call(this,".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor,r=e.timePreviewStyle,i=e.curTimeColor,o=e.durationColor;t&&(Xm(this).call(this,".xg-curbar").style.backgroundColor=t);n&&(Xm(this).call(this,".xg-bar").style.backgroundColor=n);if(r){var a=Xm(this).call(this,".time-preview");dk(r).forEach((function(e){a.style[e]=r[e]}))}var s=i||t,l=o;s&&(Xm(this).call(this,".xg-cur").style.color=s),l&&(Xm(this).call(this,".xg-dur").style.color=l),this.config.disableTimeProgress&&kC.addClass(Xm(this).call(this,".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e,t=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,Vw(e=["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"]).call(e,(function(e){t.pos[e]=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,r,i){var o=i.width,a=-1;if(e<0||e>o)return a;var s=0===r?Math.abs(n):Math.abs(n/r);return Math.abs(n)>0&&s>=1.73&&e>i.scopeM1&&e<i.scopeM2?a=0:(0===Math.abs(n)||s<=.57)&&(a=e<i.scopeL?1:e>i.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,n,r,i){switch(n){case 0:this.updateTime(e/r*this.config.scopeM);break;case 1:this.updateBrightness(t/i);break;case 2:PC.os.isIos||this.updateVolume(t/i)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,r=this.player,i=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)r.seek(Number(o).toFixed(1)),i.hideControlsEnd?r.blur():r.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(QP)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,n=this.config,r=this.playerConfig;t.state<Bx?r.closeVideoClick||(this.sendUseAction(kC.createEvent("click")),t.play()):!n.closedbClick||r.closeVideoClick?t.isActive?t.blur():t.focus():r.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.sendUseAction(kC.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.state>=Bx&&(this.sendUseAction(kC.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;BA(this,nI[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;BA(this,nI[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,r=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:r.playbackRate,to:n.pressRate}),r.playbackRate=n.pressRate,this.changeAction(tI))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,r=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:r.playbackRate,to:t.rate}),r.playbackRate=t.rate,t.rate=1,this.changeAction(QP))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,r=this.player.duration;e=Number(e.toFixed(4));var i=iE(e*n.moveDuration,10)+this.timeOffset;i=(i+=this.pos.time)<0?0:i>1e3*r?1e3*r-200:i,t.getPlugin("time")&&t.getPlugin("time").updateTime(i/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(i/1e3/this.duration,!0),this.activeSeekNote(i/1e3,e>0),n.isTouchingSeek&&t.seek(Number((i-this.timeOffset)/1e3).toFixed(1)),this.pos.time=i}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=iE(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var r=iE(10*t.volume,10)-iE(n.volume/10,10);r=r>10?10:r<1?0:r,t.volume=r/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,r=this.xgMask,i=t.light+.8*e;i=i>n.maxDarkness?n.maxDarkness:i<0?0:i,r&&(r.style.backgroundColor="rgba(0,0,0,".concat(i,")")),t.light=i}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,r=this.config,i=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!i&&!r.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(eI);var o=n.plugins.start;if(o&&o.focusHide(),Xm(this).call(this,".xg-dur").innerHTML=kC.format(this.duration),Xm(this).call(this,".xg-cur").innerHTML=kC.format(e),Xm(this).call(this,".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t)kC.removeClass(Xm(this).call(this,".xg-seek-show"),"xg-back");else kC.addClass(Xm(this).call(this,".xg-seek-show"),"xg-back");this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<Fx)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),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e,t,n,r="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return Nm(e=Nm(t=Nm(n='\n <xg-trigger class="trigger">\n <div class="'.concat(r,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ')).call(n,this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span class="xg-separator">/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>')).call(t,this.config.pressRate,"X</i>")).call(e,this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(QA);Dn({target:"String",proto:!0},{repeat:XS});var iI=Wc("String").repeat,oI=ce,aI=iI,sI=String.prototype,lI=o((function(e){var t=e.repeat;return"string"==typeof e||e===sI||oI(sI,e)&&t===sI.repeat?aI:t}));function uI(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var cI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onBodyKeyDown",(function(e){if(r.player){var t=e||window.event,n=t.keyCode,i=MS(r),o=i._keyState,a=i.player,s=r.config,l=s.disable,u=s.disableBodyTrigger,c=s.isIgnoreUserActive;l||u||!a.isUserActive&&!c||uI(t.target)||!r.checkIsVisible()||t.metaKey||t.altKey||t.ctrlKey?o.isBodyKeyDown=!1:(lI(e)||o.isKeyDown||((t.target===document.body||r.config.isGlobalTrigger&&!uI(t.target))&&r.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",r.onBodyKeyUp)),o.isBodyKeyDown&&r.handleKeyDown(t))}})),IS(MS(r),"onBodyKeyUp",(function(e){r.player&&(document.removeEventListener("keyup",r.onBodyKeyUp),r.handleKeyUp(e))})),IS(MS(r),"onKeydown",(function(e){if(r.player){var t=e||window.event,n=MS(r)._keyState;if(!lI(t)){if(r.config.disable||r.config.disableRootTrigger||t.metaKey||t.altKey||t.ctrlKey)return;!t||37!==t.keyCode&&!r.checkCode(t.keyCode)||t.target!==r.player.root&&t.target!==r.player.video&&t.target!==r.player.controls.el||(n.isKeyDown=!0),r.player.root.addEventListener("keyup",r.onKeyup)}n.isKeyDown&&r.handleKeyDown(t)}})),IS(MS(r),"onKeyup",(function(e){r.player&&(r.player.root.removeEventListener("keyup",r.onKeyup),r.handleKeyUp(e))})),r}return PS(n,[{key:"mergekeyCodeMap",value:function(){var e,t=this,n=this.config.keyCodeMap;n&&Vw(e=dk(n)).call(e,(function(e){var r;t.keyCodeMap[e]?Vw(r=["keyCode","action","disable","pressAction","disablePress","isBodyTarget"]).call(r,(function(r){n[e][r]&&(t.keyCodeMap[e][r]=n[e][r])})):t.keyCodeMap[e]=n[e]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var t=this;dk(e).forEach((function(n){t.config[n]=e[n]}))}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,r=e.bottom,i=window.innerHeight;return!(n<0&&n<0-.9*t||r>0&&r-i>.9*t)}},{key:"checkCode",value:function(e,t){var n,r=this,i=!1;return Vw(n=dk(this.keyCodeMap)).call(n,(function(n){r.keyCodeMap[n]&&e===r.keyCodeMap[n].keyCode&&!r.keyCodeMap[n].disable&&(i=!t||t&&!r.keyCodeMap[n].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var n=wT((t.volume-.1).toFixed(1)),r={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:r}),t.volume=n>=0?n:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var n=wT((t.volume+.1).toFixed(1)),r={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:r}),t.volume=n<=1?n:1}}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,r=t.offsetCurrentTime,i=t.duration,o=t.offsetDuration,a=t.timeSegments,s=r>-1?r:n,l=o||i,u=lI(e)&&this.seekStep>=4?iE(this.seekStep/2,10):this.seekStep;s+u<=l?s+=u:s=l;var c=kC.getCurrentTimeByOffset(s,a),h={currentTime:{from:n,to:c}};this.emitUserAction(e,"seek",{props:h}),this.player.currentTime=c}},{key:"seekBack",value:function(e){var t=this.player,n=t.currentTime,r=t.offsetCurrentTime,i=t.timeSegments,o=(r>-1?r:n)-(lI(e)?iE(this.seekStep/2,10):this.seekStep);o<0&&(o=0);var a={currentTime:{from:n,to:o=kC.getCurrentTimeByOffset(o,i)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,r=this.player;0===t.playbackRate&&(t.playbackRate=r.playbackRate,r.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,r=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),r&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:r,to:!r}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(lI(e)){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}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 r,i=dk(this.keyCodeMap),o=0;o<i.length;o++){var a=this.keyCodeMap[i[o]],s=a.action,l=a.keyCode,u=a.disable,c=a.pressAction,h=a.disablePress;if(l===e){if(!(u||n&&h)){var f=n&&c||s;"function"==typeof f?s(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(gA,TS({key:i[o],target:t.target,isPress:n},this.keyCodeMap[i[o]]))}(r=t).preventDefault(),r.returnValue=!1,t.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),n}(VA);function hI(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var fI=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"registerIcons",value:function(){return{loadingIcon:hI}}},{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:XA.ROOT}}}]),n}(QA),dI=Dn,pI=ra.findIndex,vI="findIndex",gI=!0;vI in[]&&Array(1)[vI]((function(){gI=!1})),dI({target:"Array",proto:!0,forced:gI},{findIndex:function(e){return pI(this,e,arguments.length>1?arguments[1]:void 0)}});var yI=Wc("Array").findIndex,mI=ce,_I=yI,bI=Array.prototype,wI=o((function(e){var t=e.findIndex;return e===bI||mI(bI,e)&&t===bI.findIndex?_I:t})),kI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_onMouseenter",(function(e){r.emit("icon_mouseenter",{pluginName:r.pluginName})})),IS(MS(r),"_onMouseLeave",(function(e){r.emit("icon_mouseleave",{pluginName:r.pluginName})})),r}return PS(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}(QA),EI=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"afterCreate",value:function(){var e=this;US(DS(n.prototype),"afterCreate",this).call(this);var t=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on([FC,UC,KC],(function(){e.animate(t.paused)})),this.on(MC,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:_P,class:"xg-icon-play"},pause:{icon:bP,class:"xg-icon-pause"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player;return this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t.paused,to:!t.paused}),t.ended?t.replay():t.paused?(t.play(),this.animate(!1)):(t.pause(),this.animate(!0)),!1}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,n=Xm(this).call(this,".xg-tips");e?(this.setAttr("data-state","pause"),n&&this.changeLangTextKey(n,t.PLAY_TIPS)):(this.setAttr("data-state","play"),n&&this.changeLangTextKey(n,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){US(DS(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(TP(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(kI);function SI(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var TI=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(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:SI,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){kC.addClass(this.root,"show")}},{key:"hide",value:function(){kC.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:XA.ROOT_TOP,index:0}}}]),n}(QA);function CI(){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 AI(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var xI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_onOrientationChange",(function(e){r.player.fullscreen&&r.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?r.player.setRotateDeg(0):r.player.setRotateDeg(90))})),r}return PS(n,[{key:"afterCreate",value:function(){var e=this;US(DS(n.prototype),"afterCreate",this).call(this);var t=this.config,r=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var i=kC.getFullScreenEl();r.fullscreenTarget===i&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var n=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:n,to:!n})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(aA,(function(t){var n=Xm(e).call(e,".xg-tips");n&&e.changeLangTextKey(n,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:TI,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===PC.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:CI,class:"xg-get-fullscreen"},exitFullscreen:{icon:AI,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){US(DS(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===PC.device?"touchend":"click",this.handleFullscreen),"mobile"===PC.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player,n=this.config;!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):n.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):n.switchCallback&&"function"==typeof n.switchCallback?n.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),n.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),n.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(n.lockOrientationType))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(TP(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(t){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(e){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(kI);function PI(){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 II(){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 RI(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var DI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onBarMousedown",(function(e){var t=MS(r).player,n=Xm(r).call(r,".xgplayer-bar");kC.event(e);var i=n.getBoundingClientRect(),o=kC.getEventPos(e,t.zoom),a=i.height-(o.clientY-i.top);if(o.h=a,o.barH=i.height,r.pos=o,!(a<-2))return r.updateVolumePos(a,e),document.addEventListener("mouseup",r.onBarMouseUp),r._d.isStart=!0,!1})),IS(MS(r),"onBarMouseMove",(function(e){var t=MS(r)._d;if(t.isStart){var n=MS(r),i=n.pos,o=n.player;e.preventDefault(),e.stopPropagation(),kC.event(e);var a=kC.getEventPos(e,o.zoom);t.isMoving=!0;var s=i.h-a.clientY+i.clientY;s>i.barH||r.updateVolumePos(s,e)}})),IS(MS(r),"onBarMouseUp",(function(e){kC.event(e),document.removeEventListener("mouseup",r.onBarMouseUp);var t=MS(r)._d;t.isStart=!1,t.isMoving=!1})),IS(MS(r),"onMouseenter",(function(e){r._d.isActive=!0,r.focus(),r.emit("icon_mouseenter",{pluginName:r.pluginName})})),IS(MS(r),"onMouseleave",(function(e){r._d.isActive=!1,r.unFocus(100,!1,e),r.emit("icon_mouseleave",{pluginName:r.pluginName})})),IS(MS(r),"onVolumeChange",(function(e){if(r.player){var t=r.player,n=t.muted,i=t.volume;r._d.isMoving||(Xm(r).call(r,".xgplayer-drag").style.height=n||0===i?"4px":"".concat(100*i,"%"),r.config.showValueLabel&&r.updateVolumeValue()),r.animate(n,i)}})),r}return PS(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:II,class:"xg-volume-small"},volumeLarge:{icon:PI,class:"xg-volume"},volumeMuted:{icon:RI,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,n=t.commonStyle,r=t.volume;if(n.volumeColor)Xm(this).call(this,".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"!==PC.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(jC,this.onVolumeChange),this.once(zC,this.onVolumeChange),"Number"!==kC.typeOf(r)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var n=this.player,r=Xm(this).call(this,".xgplayer-drag"),i=Xm(this).call(this,".xgplayer-bar");if(i&&r){var o=iE(e/i.getBoundingClientRect().height*1e3,10);r.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:n.volume,to:a}};n.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:s}),n.volume=Math.max(Math.min(o/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,r=Xm(this).call(this,".xgplayer-value-label"),i=Math.max(Math.min(t,1),0);r.innerText=n?0:Math.round(100*i)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(kC.clearTimeout(this,this._timerId),this._timerId=null),kC.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],r=arguments.length>2?arguments[2]:void 0,i=this._d,o=this.player;i.isActive||(this._timerId&&(kC.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=kC.setTimeout(this,(function(){i.isActive||(n?o.blur():o.focus(),kC.removeClass(e.root,"slide-show"),i.isStart&&e.onBarMouseUp(r)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(kC.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"===PC.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){var e;if(!this.config.disable){var t=this.config.default||this.player.volume,n=this.config.showValueLabel;return Nm(e='\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(n?'<div class="xgplayer-value-label">'.concat(100*t,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ')).call(e,100*t,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(QA);function OI(){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 MI(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var LI="picture-in-picture",FI="inline",UI="fullscreen",BI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"switchPIP",(function(e){if(!r.isPIPAvailable())return!1;e.stopPropagation&&e.stopPropagation(),r.isPip?(r.exitPIP(),r.emitUserAction(e,"change_pip",{props:"pip",from:!0,to:!1}),r.setAttr("data-state","normal")):4===r.player.media.readyState&&(r.requestPIP(),r.emitUserAction(e,"change_pip",{props:"pip",from:!1,to:!0}),r.setAttr("data-state","pip"))})),r}return PS(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()&&(US(DS(n.prototype),"afterCreate",this).call(this),this.pMode=FI,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(JC,(function(){e.config.showIcon&&(kC.removeClass(Xm(e).call(e,".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:OI,class:"xg-get-pip"},pipIconExit:{icon:MI,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;kC.setTimeout(e,(function(){!n&&t.mediaPlay()}),0),!n&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(pA,!1)},this.enterPIPCallback=function(n){t.emit(pA,!0),null!=n&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var r=t.media.webkitPresentationMode;e.pMode===UI&&r!==UI&&t.onFullscreenChange(null,!1),e.pMode=r,r===LI?e.enterPIPCallback(n):r===FI&&e.leavePIPCallback(n)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t,n,r=Gw(t=Vw(n=BS(document.styleSheets)).call(n,(function(t){try{var n;return Vw(n=BS(t.cssRules)).call(n,(function(e){return e.cssText})).join("")}catch(i){var r=document.createElement("link");r.rel="stylesheet",r.type=t.type,r.media=t.media,r.href=t.href,e.document.head.appendChild(r)}return""}))).call(t,Boolean).join("\n"),i=document.createElement("style");i.textContent=r,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,r=this.playerConfig,i=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=r.poster;if(o&&(t.media.poster="String"===kC.typeOf(o)?o:o.poster),i.preferDocument&&this.isDocPIPAvailable()){var a={};if(i.width&&i.height)a.width=i.width,a.height=i.height;else{var s=t.root.getBoundingClientRect();a.width=s.width,a.height=s.height}documentPictureInPicture.requestWindow(a).then((function(n){var r=i.docPiPNode,o=i.docPiPStyle;e.enterPIPCallback();var a=r||t.root,s=a.parentElement,l=a.previousSibling,u=a.nextSibling;e.copyStyleIntoPiPWindow(n);var c=document.createElement("style");if(c.append("body{padding:0; margin:0;}"),o){var h="";"string"==typeof o?h=o:"function"==typeof o&&(h=o.call(i)),h&&c.append(h)}else a===t.root&&c.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");n.document.head.append(c),n.document.body.append(a),n.addEventListener("pagehide",(function(t){s&&(u?s.insertBefore(a,u):l?s.insertBefore(a,l.nextSibling):s.appendChild(a)),e.leavePIPCallback()}),{once:!0})}))}else n.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(l){return console.error("requestPiP",l),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;if(this.isPIPAvailable()&&this.isPip)this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(r){return console.error("exitPIP",r),!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===LI}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return("Boolean"!==kC.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===kC.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===kC.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){US(DS(n.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(TP(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:XA.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}(kI),NI=l,VI=vt("iterator"),HI=!NI((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,r){t.delete("b"),n+=r+e})),!e.toJSON||!t.size&&true||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[VI]||"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})),GI=_,jI=2147483647,zI=/[^\0-\u007E]/,KI=/[.\u3002\uFF0E\uFF61]/g,WI="Overflow: input needs wider integers to process",qI=RangeError,XI=GI(KI.exec),YI=Math.floor,$I=String.fromCharCode,ZI=GI("".charCodeAt),JI=GI([].join),QI=GI([].push),eR=GI("".replace),tR=GI("".split),nR=GI("".toLowerCase),rR=function(e){return e+22+75*(e<26)},iR=function(e,t,n){var r=0;for(e=n?YI(e/700):e>>1,e+=YI(e/t);e>455;)e=YI(e/35),r+=36;return YI(r+36*e/(e+38))},oR=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=ZI(e,n++);if(i>=55296&&i<=56319&&n<r){var o=ZI(e,n++);56320==(64512&o)?QI(t,((1023&i)<<10)+(1023&o)+65536):(QI(t,i),n--)}else QI(t,i)}return t}(e);var n,r,i=e.length,o=128,a=0,s=72;for(n=0;n<e.length;n++)(r=e[n])<128&&QI(t,$I(r));var l=t.length,u=l;for(l&&QI(t,"-");u<i;){var c=jI;for(n=0;n<e.length;n++)(r=e[n])>=o&&r<c&&(c=r);var h=u+1;if(c-o>YI((jI-a)/h))throw qI(WI);for(a+=(c-o)*h,o=c,n=0;n<e.length;n++){if((r=e[n])<o&&++a>jI)throw qI(WI);if(r==o){for(var f=a,d=36;;){var p=d<=s?1:d>=s+26?26:d-s;if(f<p)break;var v=f-p,g=36-p;QI(t,$I(rR(p+v%g))),f=YI(v/g),d+=36}QI(t,$I(rR(f))),s=iR(a,h,u==l),a=0,u++}}a++,o++}return JI(t,"")},aR=Dn,sR=s,lR=L,uR=_,cR=D,hR=HI,fR=ao,dR=lo,pR=F_,vR=Oo,gR=Kl,yR=Yo,mR=Jf,_R=I,bR=tt,wR=Qt,kR=ir,ER=an,SR=re,TR=$r,CR=Gi,AR=G,xR=nf,PR=Yh,IR=ud,RR=FT,DR=vt("iterator"),OR="URLSearchParams",MR=OR+"Iterator",LR=yR.set,FR=yR.getterFor(OR),UR=yR.getterFor(MR),BR=Object.getOwnPropertyDescriptor,NR=function(e){if(!cR)return sR[e];var t=BR(sR,e);return t&&t.value},VR=NR("fetch"),HR=NR("Request"),GR=NR("Headers"),jR=HR&&HR.prototype,zR=GR&&GR.prototype,KR=sR.RegExp,WR=sR.TypeError,qR=sR.decodeURIComponent,XR=sR.encodeURIComponent,YR=uR("".charAt),$R=uR([].join),ZR=uR([].push),JR=uR("".replace),QR=uR([].shift),eD=uR([].splice),tD=uR("".split),nD=uR("".slice),rD=/\+/g,iD=Array(4),oD=function(e){return iD[e-1]||(iD[e-1]=KR("((?:%[\\da-f]{2}){"+e+"})","gi"))},aD=function(e){try{return qR(e)}catch(oz){return e}},sD=function(e){var t=JR(e,rD," "),n=4;try{return qR(t)}catch(oz){for(;n;)t=JR(t,oD(n--),aD);return t}},lD=/[!'()~]|%20/g,uD={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},cD=function(e){return uD[e]},hD=function(e){return JR(XR(e),lD,cD)},fD=gR((function(e,t){LR(this,{type:MR,iterator:xR(FR(e).entries),kind:t})}),"Iterator",(function(){var e=UR(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n}),!0),dD=function(e){this.entries=[],this.url=null,void 0!==e&&(SR(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===YR(e,0)?nD(e,1):e:TR(e)))};dD.prototype={type:OR,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,i,o,a,s,l=PR(e);if(l)for(n=(t=xR(e,l)).next;!(r=lR(n,t)).done;){if(o=(i=xR(ER(r.value))).next,(a=lR(o,i)).done||(s=lR(o,i)).done||!lR(o,i).done)throw WR("Expected sequence with length 2");ZR(this.entries,{key:TR(a.value),value:TR(s.value)})}else for(var u in e)bR(e,u)&&ZR(this.entries,{key:u,value:TR(e[u])})},parseQuery:function(e){if(e)for(var t,n,r=tD(e,"&"),i=0;i<r.length;)(t=r[i++]).length&&(n=tD(t,"="),ZR(this.entries,{key:sD(QR(n)),value:sD($R(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],ZR(n,hD(e.key)+"="+hD(e.value));return $R(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var pD=function(){mR(this,vD);var e=LR(this,new dD(arguments.length>0?arguments[0]:void 0));cR||(this.length=e.entries.length)},vD=pD.prototype;if(pR(vD,{append:function(e,t){IR(arguments.length,2);var n=FR(this);ZR(n.entries,{key:TR(e),value:TR(t)}),cR||this.length++,n.updateURL()},delete:function(e){IR(arguments.length,1);for(var t=FR(this),n=t.entries,r=TR(e),i=0;i<n.length;)n[i].key===r?eD(n,i,1):i++;cR||(this.length=n.length),t.updateURL()},get:function(e){IR(arguments.length,1);for(var t=FR(this).entries,n=TR(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){IR(arguments.length,1);for(var t=FR(this).entries,n=TR(e),r=[],i=0;i<t.length;i++)t[i].key===n&&ZR(r,t[i].value);return r},has:function(e){IR(arguments.length,1);for(var t=FR(this).entries,n=TR(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){IR(arguments.length,1);for(var n,r=FR(this),i=r.entries,o=!1,a=TR(e),s=TR(t),l=0;l<i.length;l++)(n=i[l]).key===a&&(o?eD(i,l--,1):(o=!0,n.value=s));o||ZR(i,{key:a,value:s}),cR||(this.length=i.length),r.updateURL()},sort:function(){var e=FR(this);RR(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=FR(this).entries,r=wR(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new fD(this,"keys")},values:function(){return new fD(this,"values")},entries:function(){return new fD(this,"entries")}},{enumerable:!0}),fR(vD,DR,vD.entries,{name:"entries"}),fR(vD,"toString",(function(){return FR(this).serialize()}),{enumerable:!0}),cR&&dR(vD,"size",{get:function(){return FR(this).entries.length},configurable:!0,enumerable:!0}),vR(pD,OR),aR({global:!0,constructor:!0,forced:!hR},{URLSearchParams:pD}),!hR&&_R(GR)){var gD=uR(zR.has),yD=uR(zR.set),mD=function(e){if(SR(e)){var t,n=e.body;if(kR(n)===OR)return t=e.headers?new GR(e.headers):new GR,gD(t,"content-type")||yD(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),CR(e,{body:AR(0,TR(n)),headers:AR(0,t)})}return e};if(_R(VR)&&aR({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return VR(e,arguments.length>1?mD(arguments[1]):{})}}),_R(HR)){var _D=function(e){return mR(this,jR),new HR(e,arguments.length>1?mD(arguments[1]):{})};jR.constructor=_D,_D.prototype=jR,aR({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_D})}}var bD,wD=Dn,kD=D,ED=HI,SD=s,TD=Qt,CD=_,AD=ao,xD=lo,PD=Jf,ID=tt,RD=TE,DD=Ty,OD=Ji,MD=pc.codeAt,LD=function(e){var t,n,r=[],i=tR(eR(nR(e),KI,"."),".");for(t=0;t<i.length;t++)n=i[t],QI(r,XI(zI,n)?"xn--"+oR(n):n);return JI(r,".")},FD=$r,UD=Oo,BD=ud,ND={URLSearchParams:pD,getState:FR},VD=Yo,HD=VD.set,GD=VD.getterFor("URL"),jD=ND.URLSearchParams,zD=ND.getState,KD=SD.URL,WD=SD.TypeError,qD=SD.parseInt,XD=Math.floor,YD=Math.pow,$D=CD("".charAt),ZD=CD(/./.exec),JD=CD([].join),QD=CD(1..toString),eO=CD([].pop),tO=CD([].push),nO=CD("".replace),rO=CD([].shift),iO=CD("".split),oO=CD("".slice),aO=CD("".toLowerCase),sO=CD([].unshift),lO="Invalid scheme",uO="Invalid host",cO="Invalid port",hO=/[a-z]/i,fO=/[\d+-.a-z]/i,dO=/\d/,pO=/^0x/i,vO=/^[0-7]+$/,gO=/^\d+$/,yO=/^[\da-f]+$/i,mO=/[\0\t\n\r #%/:<>?@[\\\]^|]/,_O=/[\0\t\n\r #/:<>?@[\\\]^|]/,bO=/^[\u0000-\u0020]+/,wO=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,kO=/[\t\n\r]/g,EO=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)sO(t,e%256),e=XD(e/256);return JD(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=QD(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},SO={},TO=RD({},SO,{" ":1,'"':1,"<":1,">":1,"`":1}),CO=RD({},TO,{"#":1,"?":1,"{":1,"}":1}),AO=RD({},CO,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),xO=function(e,t){var n=MD(e,0);return n>32&&n<127&&!ID(t,e)?e:encodeURIComponent(e)},PO={ftp:21,file:null,http:80,https:443,ws:80,wss:443},IO=function(e,t){var n;return 2==e.length&&ZD(hO,$D(e,0))&&(":"==(n=$D(e,1))||!t&&"|"==n)},RO=function(e){var t;return e.length>1&&IO(oO(e,0,2))&&(2==e.length||"/"===(t=$D(e,2))||"\\"===t||"?"===t||"#"===t)},DO=function(e){return"."===e||"%2e"===aO(e)},OO={},MO={},LO={},FO={},UO={},BO={},NO={},VO={},HO={},GO={},jO={},zO={},KO={},WO={},qO={},XO={},YO={},$O={},ZO={},JO={},QO={},eM=function(e,t,n){var r,i,o,a=FD(e);if(t){if(i=this.parse(a))throw WD(i);this.searchParams=null}else{if(void 0!==n&&(r=new eM(n,!0)),i=this.parse(a,null,r))throw WD(i);(o=zD(new jD)).bindURL(this),this.searchParams=o}};eM.prototype={type:"URL",parse:function(e,t,n){var r,i,o,a,s,l=this,u=t||OO,c=0,h="",f=!1,d=!1,p=!1;for(e=FD(e),t||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,e=nO(e,bO,""),e=nO(e,wO,"$1")),e=nO(e,kO,""),r=DD(e);c<=r.length;){switch(i=r[c],u){case OO:if(!i||!ZD(hO,i)){if(t)return lO;u=LO;continue}h+=aO(i),u=MO;break;case MO:if(i&&(ZD(fO,i)||"+"==i||"-"==i||"."==i))h+=aO(i);else{if(":"!=i){if(t)return lO;h="",u=LO,c=0;continue}if(t&&(l.isSpecial()!=ID(PO,h)||"file"==h&&(l.includesCredentials()||null!==l.port)||"file"==l.scheme&&!l.host))return;if(l.scheme=h,t)return void(l.isSpecial()&&PO[l.scheme]==l.port&&(l.port=null));h="","file"==l.scheme?u=WO:l.isSpecial()&&n&&n.scheme==l.scheme?u=FO:l.isSpecial()?u=VO:"/"==r[c+1]?(u=UO,c++):(l.cannotBeABaseURL=!0,tO(l.path,""),u=ZO)}break;case LO:if(!n||n.cannotBeABaseURL&&"#"!=i)return lO;if(n.cannotBeABaseURL&&"#"==i){l.scheme=n.scheme,l.path=OD(n.path),l.query=n.query,l.fragment="",l.cannotBeABaseURL=!0,u=QO;break}u="file"==n.scheme?WO:BO;continue;case FO:if("/"!=i||"/"!=r[c+1]){u=BO;continue}u=HO,c++;break;case UO:if("/"==i){u=GO;break}u=$O;continue;case BO:if(l.scheme=n.scheme,i==bD)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.query=n.query;else if("/"==i||"\\"==i&&l.isSpecial())u=NO;else if("?"==i)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.query="",u=JO;else{if("#"!=i){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.path.length--,u=$O;continue}l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.query=n.query,l.fragment="",u=QO}break;case NO:if(!l.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,u=$O;continue}u=GO}else u=HO;break;case VO:if(u=HO,"/"!=i||"/"!=$D(h,c+1))continue;c++;break;case HO:if("/"!=i&&"\\"!=i){u=GO;continue}break;case GO:if("@"==i){f&&(h="%40"+h),f=!0,o=DD(h);for(var v=0;v<o.length;v++){var g=o[v];if(":"!=g||p){var y=xO(g,AO);p?l.password+=y:l.username+=y}else p=!0}h=""}else if(i==bD||"/"==i||"?"==i||"#"==i||"\\"==i&&l.isSpecial()){if(f&&""==h)return"Invalid authority";c-=DD(h).length+1,h="",u=jO}else h+=i;break;case jO:case zO:if(t&&"file"==l.scheme){u=XO;continue}if(":"!=i||d){if(i==bD||"/"==i||"?"==i||"#"==i||"\\"==i&&l.isSpecial()){if(l.isSpecial()&&""==h)return uO;if(t&&""==h&&(l.includesCredentials()||null!==l.port))return;if(a=l.parseHost(h))return a;if(h="",u=YO,t)return;continue}"["==i?d=!0:"]"==i&&(d=!1),h+=i}else{if(""==h)return uO;if(a=l.parseHost(h))return a;if(h="",u=KO,t==zO)return}break;case KO:if(!ZD(dO,i)){if(i==bD||"/"==i||"?"==i||"#"==i||"\\"==i&&l.isSpecial()||t){if(""!=h){var m=qD(h,10);if(m>65535)return cO;l.port=l.isSpecial()&&m===PO[l.scheme]?null:m,h=""}if(t)return;u=YO;continue}return cO}h+=i;break;case WO:if(l.scheme="file","/"==i||"\\"==i)u=qO;else{if(!n||"file"!=n.scheme){u=$O;continue}if(i==bD)l.host=n.host,l.path=OD(n.path),l.query=n.query;else if("?"==i)l.host=n.host,l.path=OD(n.path),l.query="",u=JO;else{if("#"!=i){RO(JD(OD(r,c),""))||(l.host=n.host,l.path=OD(n.path),l.shortenPath()),u=$O;continue}l.host=n.host,l.path=OD(n.path),l.query=n.query,l.fragment="",u=QO}}break;case qO:if("/"==i||"\\"==i){u=XO;break}n&&"file"==n.scheme&&!RO(JD(OD(r,c),""))&&(IO(n.path[0],!0)?tO(l.path,n.path[0]):l.host=n.host),u=$O;continue;case XO:if(i==bD||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&IO(h))u=$O;else if(""==h){if(l.host="",t)return;u=YO}else{if(a=l.parseHost(h))return a;if("localhost"==l.host&&(l.host=""),t)return;h="",u=YO}continue}h+=i;break;case YO:if(l.isSpecial()){if(u=$O,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=bD&&(u=$O,"/"!=i))continue}else l.fragment="",u=QO;else l.query="",u=JO;break;case $O:if(i==bD||"/"==i||"\\"==i&&l.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=aO(s=h))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(l.shortenPath(),"/"==i||"\\"==i&&l.isSpecial()||tO(l.path,"")):DO(h)?"/"==i||"\\"==i&&l.isSpecial()||tO(l.path,""):("file"==l.scheme&&!l.path.length&&IO(h)&&(l.host&&(l.host=""),h=$D(h,0)+":"),tO(l.path,h)),h="","file"==l.scheme&&(i==bD||"?"==i||"#"==i))for(;l.path.length>1&&""===l.path[0];)rO(l.path);"?"==i?(l.query="",u=JO):"#"==i&&(l.fragment="",u=QO)}else h+=xO(i,CO);break;case ZO:"?"==i?(l.query="",u=JO):"#"==i?(l.fragment="",u=QO):i!=bD&&(l.path[0]+=xO(i,SO));break;case JO:t||"#"!=i?i!=bD&&("'"==i&&l.isSpecial()?l.query+="%27":l.query+="#"==i?"%23":xO(i,SO)):(l.fragment="",u=QO);break;case QO:i!=bD&&(l.fragment+=xO(i,TO))}c++}},parseHost:function(e){var t,n,r;if("["==$D(e,0)){if("]"!=$D(e,e.length-1))return uO;if(t=function(e){var t,n,r,i,o,a,s,l=[0,0,0,0,0,0,0,0],u=0,c=null,h=0,f=function(){return $D(e,h)};if(":"==f()){if(":"!=$D(e,1))return;h+=2,c=++u}for(;f();){if(8==u)return;if(":"!=f()){for(t=n=0;n<4&&ZD(yO,f());)t=16*t+qD(f(),16),h++,n++;if("."==f()){if(0==n)return;if(h-=n,u>6)return;for(r=0;f();){if(i=null,r>0){if(!("."==f()&&r<4))return;h++}if(!ZD(dO,f()))return;for(;ZD(dO,f());){if(o=qD(f(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;h++}l[u]=256*l[u]+i,2!=++r&&4!=r||u++}if(4!=r)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;l[u++]=t}else{if(null!==c)return;h++,c=++u}}if(null!==c)for(a=u-c,u=7;0!=u&&a>0;)s=l[u],l[u--]=l[c+a-1],l[c+--a]=s;else if(8!=u)return;return l}(oO(e,1,-1)),!t)return uO;this.host=t}else if(this.isSpecial()){if(e=LD(e),ZD(mO,e))return uO;if(t=function(e){var t,n,r,i,o,a,s,l=iO(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=l[r]))return e;if(o=10,i.length>1&&"0"==$D(i,0)&&(o=ZD(pO,i)?16:8,i=oO(i,8==o?1:2)),""===i)a=0;else{if(!ZD(10==o?gO:8==o?vO:yO,i))return e;a=qD(i,o)}tO(n,a)}for(r=0;r<t;r++)if(a=n[r],r==t-1){if(a>=YD(256,5-t))return null}else if(a>255)return null;for(s=eO(n),r=0;r<n.length;r++)s+=n[r]*YD(256,3-r);return s}(e),null===t)return uO;this.host=t}else{if(ZD(_O,e))return uO;for(t="",n=DD(e),r=0;r<n.length;r++)t+=xO(n[r],SO);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return ID(PO,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&IO(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=n+(r?":"+r:"")+"@"),u+=EO(i),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+JD(a,"/"):"",null!==s&&(u+="?"+s),null!==l&&(u+="#"+l),u},setHref:function(e){var t=this.parse(e);if(t)throw WD(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new tM(e.path[0]).origin}catch(oz){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+EO(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(FD(e)+":",OO)},getUsername:function(){return this.username},setUsername:function(e){var t=DD(FD(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=xO(t[n],AO)}},getPassword:function(){return this.password},setPassword:function(e){var t=DD(FD(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=xO(t[n],AO)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?EO(e):EO(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,jO)},getHostname:function(){var e=this.host;return null===e?"":EO(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,zO)},getPort:function(){var e=this.port;return null===e?"":FD(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=FD(e))?this.port=null:this.parse(e,KO))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+JD(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,YO))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=FD(e))?this.query=null:("?"==$D(e,0)&&(e=oO(e,1)),this.query="",this.parse(e,JO)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=FD(e))?("#"==$D(e,0)&&(e=oO(e,1)),this.fragment="",this.parse(e,QO)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var tM=function(e){var t=PD(this,nM),n=BD(arguments.length,1)>1?arguments[1]:void 0,r=HD(t,new eM(e,!1,n));kD||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},nM=tM.prototype,rM=function(e,t){return{get:function(){return GD(this)[e]()},set:t&&function(e){return GD(this)[t](e)},configurable:!0,enumerable:!0}};if(kD&&(xD(nM,"href",rM("serialize","setHref")),xD(nM,"origin",rM("getOrigin")),xD(nM,"protocol",rM("getProtocol","setProtocol")),xD(nM,"username",rM("getUsername","setUsername")),xD(nM,"password",rM("getPassword","setPassword")),xD(nM,"host",rM("getHost","setHost")),xD(nM,"hostname",rM("getHostname","setHostname")),xD(nM,"port",rM("getPort","setPort")),xD(nM,"pathname",rM("getPathname","setPathname")),xD(nM,"search",rM("getSearch","setSearch")),xD(nM,"searchParams",rM("getSearchParams")),xD(nM,"hash",rM("getHash","setHash"))),AD(nM,"toJSON",(function(){return GD(this).serialize()}),{enumerable:!0}),AD(nM,"toString",(function(){return GD(this).serialize()}),{enumerable:!0}),KD){var iM=KD.createObjectURL,oM=KD.revokeObjectURL;iM&&AD(tM,"createObjectURL",TD(iM,KD)),oM&&AD(tM,"revokeObjectURL",TD(oM,KD))}UD(tM,"URL"),wD({global:!0,constructor:!0,forced:!ED,sham:!kD},{URL:tM});var aM=Dn,sM=l,lM=ud,uM=$r,cM=HI,hM=ue("URL");aM({target:"URL",stat:!0,forced:!(cM&&sM((function(){hM.canParse()})))},{canParse:function(e){var t=lM(arguments.length,1),n=uM(e),r=t<2||void 0===arguments[1]?void 0:uM(arguments[1]);try{return!!new hM(n,r)}catch(oz){return!1}}});var fM=o(ie.URL),dM=function(){function e(t){AS(this,e),this.config=t.config,this.parent=t.root,this.root=kC.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var n=this.config.maxHeight;n&&this.setStyle({maxHeight:n}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var r="touch"===this.config.domEventType?"touchend":"click";this._delegates=QA.delegate.call(this,this.root,"li",r,this.onItemClick)}return PS(e,[{key:"renderItemList",value:function(e){var t,n=this,r=this.config,i=this.root;(e?r.data=e:e=r.data,r.style)&&Vw(t=dk(r.style)).call(t,(function(e){i.style[e]=r[e]}));e.length>0&&(this.attrKeys=dk(e[0])),this.root.innerHTML="",Vw(e).call(e,(function(e,t){var r=e.selected?"option-item selected":"option-item";e["data-index"]=t,n.root.appendChild(kC.createDom("li","<span>".concat(e.showText,"</span>"),e,r))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&kC.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,r=this.root.querySelector(".selected");kC.addClass(t,"selected"),r&&kC.removeClass(r,"selected"),n(e,{from:r?this.getAttrObj(r,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};Vw(t).call(t,(function(t){n[t]=e.getAttribute(t)}));var r=e.getAttribute("data-index");return r&&(n.index=Number(r)),n}},{key:"show",value:function(){kC.removeClass(this.root,"hide"),kC.addClass(this.root,"active")}},{key:"hide",value:function(){kC.removeClass(this.root,"active"),kC.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;dk(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){var e;this._delegates&&(Vw(e=this._delegates).call(e,(function(e){e.destroy&&e.destroy()})),this._delegates=null);this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),pM=ie,vM=p;pM.JSON||(pM.JSON={stringify:JSON.stringify});var gM=function(e,t,n){return vM(pM.JSON.stringify,null,arguments)},yM=o(gM),mM=o(uo.f("toStringTag")),_M=Dn,bM=C;R.f;var wM=Hn,kM=$r,EM=$w,SM=Z,TM=Jw,CM=bM("".startsWith),AM=bM("".slice),xM=Math.min;_M({target:"String",proto:!0,forced:!TM("startsWith")},{startsWith:function(e){var t=kM(SM(this));EM(e);var n=wM(xM(arguments.length>1?arguments[1]:void 0,t.length)),r=kM(e);return CM?CM(t,r,n):AM(t,n,n+r.length)===r}});var PM=Wc("String").startsWith,IM=ce,RM=PM,DM=String.prototype,OM=o((function(e){var t=e.startsWith;return"string"==typeof e||e===DM||IM(DM,e)&&t===DM.startsWith?RM:t})),MM=Je,LM=ti,FM=jn,UM=function(e){for(var t=MM(this),n=FM(t),r=arguments.length,i=LM(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:LM(o,n);a>i;)t[i++]=e;return t};Dn({target:"Array",proto:!0},{fill:UM});var BM,NM=Wc("Array").fill,VM=ce,HM=NM,GM=Array.prototype,jM=o((function(e){var t=e.fill;return e===GM||VM(GM,e)&&t===GM.fill?HM:t})),zM={SEI:"sei",PLAYER_CREATE_FINISH:"playerCreateFinish",FALLBACK_ERROR:"fallbackError",FALLBACK:"fallback",AUTOPLAY_STARTED:"autoplayStarted",AUTOPLAY_PREVENTED:"autoplayWasPrevented",DOWNLOAD_SPEED_CHANGE:"downloadSpeedChange",FULLSCREEN_CHANGE:"fullscreenChange",CSS_FULLSCREEN_CHANGE:"cssFullscreenChange",MINI_STATE_CHANGE:"miniStateChange",DEFINITION_CHANGE:"definitionChange",BEFORE_DEFINITION_CHANGE:"beforeDefinitionChange",AFTER_DEFINITION_CHANGE:"afterDefinitionChange",VIDEO_RESIZE:"videoResize",PIP_CHANGE:"pipChange",USER_ACTION:"userAction",AUTOPLAY_UNMUTE:"autoplayUnmute",LONG_WAITING:"longWaiting",DEFINITION_FALLBACK:"definitionFallback",AUTOPLAY_FAIL:"autoplayFail",AUTOPLAY_SUCCESS:"autoplaySuccess",ERROR_REFRESH_CLICK:"errorRefreshClick",SOURCE_CHANGE:"sourceChange",ABR_SWITCH_START:"abrSwitchStart",ABR_SWITCH_SUCCESS:"abrSwitchSuccess",ABR_SWITCH_FAILED:"abrSwitchFailed"},KM=Mm(Mm({},kA),zM),WM=(Uy(BM={},zM.SEI,{event:"core_event",shouldCallback:function(e){return"core.sei"===(null==e?void 0:e.eventName)}}),Uy(BM,zM.AUTOPLAY_STARTED,{event:$C}),Uy(BM,zM.AUTOPLAY_PREVENTED,{event:ZC}),Uy(BM,zM.FULLSCREEN_CHANGE,{event:aA}),Uy(BM,zM.CSS_FULLSCREEN_CHANGE,{event:sA}),Uy(BM,zM.MINI_STATE_CHANGE,{event:lA}),Uy(BM,zM.DEFINITION_CHANGE,{event:uA}),Uy(BM,zM.BEFORE_DEFINITION_CHANGE,{event:cA}),Uy(BM,zM.AFTER_DEFINITION_CHANGE,{event:hA}),Uy(BM,zM.VIDEO_RESIZE,{event:dA}),Uy(BM,zM.PIP_CHANGE,{event:pA}),Uy(BM,zM.USER_ACTION,{event:yA}),Uy(BM,zM.DOWNLOAD_SPEED_CHANGE,{event:nA}),Uy(BM,zM.ABR_SWITCH_START,{event:"switch_definition_start"}),Uy(BM,zM.ABR_SWITCH_SUCCESS,{event:"switch_definition_success"}),Uy(BM,zM.ABR_SWITCH_FAILED,{event:"switch_definition_fail"}),BM);var qM=/["'&<>]/;function XM(e,t){return function(e){if(ly(e))return e}(e)||function(e,t){var n=null==e?null:void 0!==oc&&hy(e)||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(ph(s).call(s,r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||Py(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var YM=D,$M=_,ZM=yi,JM=ee,QM=$M(F.f),eL=$M([].push),tL=function(e){return function(t){for(var n,r=JM(t),i=ZM(r),o=i.length,a=0,s=[];o>a;)n=i[a++],YM&&!QM(r,n)||eL(s,e?[n,r[n]]:r[n]);return s}},nL={entries:tL(!0),values:tL(!1)},rL=nL.entries;Dn({target:"Object",stat:!0},{entries:function(e){return rL(e)}});var iL=o(ie.Object.entries);var oL=Me,aL=Je,sL=q,lL=jn,uL=TypeError,cL=function(e){return function(t,n,r,i){oL(n);var o=aL(t),a=sL(o),s=lL(o),l=e?s-1:0,u=e?-1:1;if(r<2)for(;;){if(l in a){i=a[l],l+=u;break}if(l+=u,e?l<0:s<=l)throw uL("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=u)l in a&&(i=n(i,a[l],l,o));return i}},hL={left:cL(!1),right:cL(!0)}.left;Dn({target:"Array",proto:!0,forced:!zf&&me>79&&me<83||!Gc("reduce")},{reduce:function(e){var t=arguments.length;return hL(this,e,t,t>1?arguments[1]:void 0)}});var fL=Wc("Array").reduce,dL=ce,pL=fL,vL=Array.prototype,gL=o((function(e){var t=e.reduce;return e===vL||dL(vL,e)&&t===vL.reduce?pL:t}));var yL=function(){function e(t){var n;Ry(this,e),Uy(this,"definition",void 0),Uy(this,"source",void 0),Uy(this,"text",void 0),Uy(this,"fallbackUrl",void 0),Uy(this,"urls",void 0),Uy(this,"_currentUrlRef",void 0);var r=t.url,i=t.definition,o=t.text,a=t.source,s=t.fallbackUrls;this.definition=i,this.text=o,this.source=a,this.urls=Nm(n=[r]).call(n,Iy(null!=s?s:[])),this.fallbackUrl=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={url:e[0],next:null},n=t,r=1;r<e.length;r++){var i=r===e.length-1?t:null,o={url:e[r],next:i};n.next=o,n=o}return t}(this.urls),this._currentUrlRef=this.fallbackUrl}return Fy(e,[{key:"url",get:function(){return this._currentUrlRef.url},set:function(e){this._currentUrlRef.url=e}},{key:"next",value:function(){var e=this._currentUrlRef.next;return e&&(this._currentUrlRef=e),this._currentUrlRef}}]),e}(),mL=function(){function e(t,n,r){var i=this;Ry(this,e),Uy(this,"name",void 0),Uy(this,"text",void 0),Uy(this,"definitions",void 0),this.definitions=Vw(t).call(t,(function(e){return new yL(AE({},e,{source:i}))})),this.name=n,this.text=r}return Fy(e,[{key:"defaultDefinition",get:function(){return this.definitions[0]}},{key:"add",value:function(e){this.definitions.push(e)}}],[{key:"normalize",value:function(t){if(void 0===t)throw new Error('"input" cannot be undefined');var n=void 0,r=void 0,i=void 0;if("string"==typeof t?n=t:Array.isArray(t)?i=t:(n=t.url,r=t.fallbackUrls,i=t.sources),"string"==typeof n)return e.normalizeUrl(n,r);if(Array.isArray(i)){if(0===i.length)throw new Error('"sources" cannot be an empty array');return Vw(i).call(i,(function(t){var n;return new e(Vw(n=t.definitions).call(n,(function(e){return"string"==typeof e?{url:e,definition:"unknown"}:e})),t.name,t.text)}))}return[]}},{key:"normalizeUrl",value:function(t,n){var r=new e([],"unknown");return r.add(new yL({definition:"unknown",url:t,source:r,fallbackUrls:n})),[r]}}]),e}(),_L=function(){function e(t){var n,r,i,o;Ry(this,e),Uy(this,"defaultSource",void 0),Uy(this,"defaultDefinition",void 0),Uy(this,"maxFallbackRound",void 0),Uy(this,"_currentDefinition",void 0),Uy(this,"_sources",void 0),Uy(this,"_fallbackCount",0);var a=t.url,s=t.defaultDefinition,l=t.defaultSource,u=t.sources,c=t.maxFallbackRound;this.defaultDefinition=s,this.defaultSource=l,this.maxFallbackRound=null!=c?c:1,this._sources=u;var h=a?Xm(this).call(this,a):null===(n=Xm(r=this.sources).call(r,(function(e){return void 0===l||e.name===l})))||void 0===n?void 0:Xm(i=n.definitions).call(i,(function(e){return void 0===s||e.definition===s}));this._currentDefinition=null!=h?h:null===(o=this._sources)||void 0===o||null===(o=o[0])||void 0===o||null===(o=o.definitions)||void 0===o?void 0:o[0]}return Fy(e,[{key:"sources",get:function(){return this._sources}},{key:"definition",get:function(){return this._currentDefinition}},{key:"source",get:function(){var e;return null===(e=this.definition)||void 0===e?void 0:e.source}},{key:"url",get:function(){var e;return null===(e=this.definition)||void 0===e?void 0:e.url},set:function(e){this.definition&&(this.definition.url=e)}},{key:"find",value:function(e,t){var n,r,i,o,a,s=this;if("string"==typeof e)return Xm(o=gL(a=this.sources).call(a,(function(e,t){return Nm(e).call(e,t.definitions)}),[])).call(o,(function(t){return t.url===e}));var l=Xm(n=this.sources).call(n,(function(t){var n,r;return t.name===(null!==(n=null==e?void 0:e.source)&&void 0!==n?n:null===(r=s.source)||void 0===r?void 0:r.name)})),u=null==l?void 0:Xm(r=l.definitions).call(r,(function(t){var n,r;return t.definition===(null!==(n=null==e?void 0:e.definition)&&void 0!==n?n:null===(r=s.definition)||void 0===r?void 0:r.definition)}));return u||(null!=t&&t.fallbackToFirstDefinition&&null!=l&&null!==(i=l.definitions)&&void 0!==i&&i.length?null==l?void 0:l.definitions[0]:void 0)}},{key:"fallback",value:function(){var e;if(this._fallbackCount++,!(this._fallbackCount>=this.maxFallbackRound*this.definition.urls.length)){var t=null===(e=this._currentDefinition)||void 0===e?void 0:e.next();return null==t?void 0:t.url}this.resetFallback()}},{key:"switch",value:function(e){return this._currentDefinition=e,this.resetFallback(),e}},{key:"updateSources",value:function(e,t){var n,r,i,o,a;return this._sources=mL.normalize(e),this._currentDefinition=null!==(n=Xm(this).call(this,null!=t?t:{source:null!==(r=this.defaultSource)&&void 0!==r?r:null===(i=this._currentDefinition)||void 0===i?void 0:i.source.name,definition:null!==(o=this.defaultDefinition)&&void 0!==o?o:null===(a=this._currentDefinition)||void 0===a?void 0:a.definition}))&&void 0!==n?n:this._sources[0].definitions[0],this.resetFallback(),this}},{key:"resetFallback",value:function(){this._fallbackCount=0}}]),e}();function bL(){var e;"undefined"!=typeof Reflect&&_S?bL=rP(e=_S).call(e):bL=function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=aP(e)););return e}(e,t);if(r){var i=mm(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}};return bL.apply(this,arguments)}function wL(){return(new DOMParser).parseFromString('<svg width="150" height="162" viewBox="0 0 150 162" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M127.718 112.831H6.13675C4.19663 112.831 2.25651 108.974 2.90322 104.475C3.54993 99.9761 8.07687 99.9761 13.8972 99.9761C11.9571 97.4052 9.37028 88.4069 15.8373 81.3369C22.3044 74.2668 25.5379 74.2668 34.5918 75.5526C33.9451 63.9837 47.526 34.4178 77.2744 35.0605C107.023 35.7032 116.077 54.3421 119.957 63.3404C129.011 62.6976 147.765 66.554 149.706 87.1214C151.258 103.575 135.694 111.117 127.718 112.831Z" fill="#F1F4F8"/>\n<path d="M44.9346 91.6022L43.6782 99.8032" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M47.3545 125.695L48.6109 117.494" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M31.5347 97.7378L38.7295 101.869" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M60.7544 119.559L53.5595 115.428" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M69.6755 44.5318L138.35 26.0209C139.115 25.8148 139.804 26.5367 139.563 27.2909L121.081 85.1146C120.982 85.4243 120.739 85.6665 120.429 85.7641L52.0645 107.28C51.2996 107.521 50.5766 106.809 50.8062 106.04L68.9776 45.2111C69.0768 44.879 69.3409 44.622 69.6755 44.5318Z" fill="#D0D6E0" stroke="#D0D6E0" stroke-width="4" stroke-linecap="round"/>\n<path d="M83.1285 52.7415C91.6454 54.3438 107.322 62.0019 101.894 79.8155" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<path d="M84.138 62.3385C88.3894 63.1384 96.2148 66.9611 93.5053 75.8531" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<ellipse cx="83.6417" cy="71.98" rx="3.08443" ry="3.07025" transform="rotate(12.6375 83.6417 71.98)" fill="white"/>\n<path d="M43.4699 110.358C39.5425 109.114 30.6316 108.203 26.4077 114.511C21.1278 122.397 36.5031 152.755 2.11053 160.141" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n</svg>\n',"image/svg+xml").firstChild}var kL=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_error",void 0),r}return Fy(n,[{key:"_errorTip",get:function(){var e,t,n,r=this.player.config.i18nManager,i=null===(e=this._error)||void 0===e?void 0:e.errorCode;return this.config.errorTipsText?r.normalize(this.config.errorTipsText):Nm(t="".concat(i?"[".concat(i,"] "):"")).call(t,null===(n=this._error)||void 0===n?void 0:n.message)}},{key:"afterCreate",value:function(){this._handleRefresh=this._handleRefresh.bind(this),this._focus=this._focus.bind(this),this._initEvents(),this._initIcons(),"mobile"===PC.device&&this.bind("touchend",this._focus),this.bind(".veplayer-error-refresh","click",this._handleRefresh)}},{key:"registerIcons",value:function(){return{error:{icon:wL,class:"veplayer-error-svg"}}}},{key:"updateLang",value:function(){this.config.showRefresh&&this._renderRefresh(),this._renderExtraTips()}},{key:"showError",value:function(e){this._error=e instanceof vP?e:yP(e),this.config.showErrorTip&&this._renderText(this._errorTip),this._renderExtraTips(),bL(aP(n.prototype),"show",this).call(this)}},{key:"hideError",value:function(){bL(aP(n.prototype),"hide",this).call(this)}},{key:"destroy",value:function(){"mobile"===PC.device&&this.unbind("touchend",this._focus),this.unbind(".veplayer-error-refresh","click",this._handleRefresh),this.off(KM.FALLBACK_ERROR,this.showError.bind(this)),this.off(HC,this.hideError.bind(this))}},{key:"render",value:function(){var e,t=this.player.config.i18nManager;return Nm(e='<veplayer-error class="veplayer-error">\n <div class="veplayer-error-cover">\n '.concat(this.config.showErrorImg?'<div class="veplayer-error-img"></div>':"",'\n <div class="veplayer-error-tips"></div>\n ')).call(e,this.config.showRefresh?'<div class="veplayer-error-refresh">'.concat(t.getText("ERROR_REFRESH"),"</div>"):"",'\n <div class="veplayer-error-extra"></div>\n </div>\n </veplayer-error>')}},{key:"_focus",value:function(){this.player.focus({autoHide:!0})}},{key:"_initIcons",value:function(){this.config.showErrorImg&&this.appendChild(".veplayer-error-img",this.icons.error)}},{key:"_initEvents",value:function(){this.on(KM.FALLBACK_ERROR,this.showError.bind(this)),this.on(HC,this.hideError.bind(this)),this.on(MC,this.hideError.bind(this)),this.on(fA,this.hideError.bind(this))}},{key:"_renderText",value:function(e){var t=Xm(this).call(this,".veplayer-error-tips");t&&(t.innerText=e)}},{key:"_renderExtraTips",value:function(){var e,t=this,n=Xm(this).call(this,".veplayer-error-extra");n&&(n.innerHTML="");var r=this.player.config.i18nManager;null===(e=this.config.extraTips)||void 0===e||e.forEach((function(e){if(e){var n,i=kC.createDom("div",Nm(n="".concat(r.normalize(e.label),": ")).call(n,r.normalize(e.value)),void 0,"veplayer-error-detail-info");t.appendChild(".veplayer-error-extra",i)}}))}},{key:"_handleRefresh",value:function(){var e,t;null===(e=this.player)||void 0===e||e.emit(KM.ERROR_REFRESH_CLICK),null===(t=this.player)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.veplayer)||void 0===t||t.retry(),this.hideError()}},{key:"_renderRefresh",value:function(){var e,t=this.player.config.i18nManager,n=Xm(this).call(this,".veplayer-error-refresh");n&&(n.innerHTML=null!==(e=t.getText("ERROR_REFRESH"))&&void 0!==e?e:"")}}],[{key:"pluginName",get:function(){return"error"}},{key:"defaultConfig",get:function(){return{showErrorImg:!0,showErrorTip:!0,showRefresh:!0,errorTipsText:"",extraTips:[],position:QA.POSITIONS.ROOT}}}]),n}(QA),EL=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_toastNumber",0),Uy(Yx(r),"_toastMap",{}),r}return Fy(n,[{key:"toast",value:function(e,t){var n=this,r=t||{},i=r.duration,o=void 0===i?2e3:i,a=r.closable,s=void 0!==a&&a,l=this._toastNumber+1;this._toastNumber=l;var u=this._renderToast(e,s,l);return this.root.appendChild(u),this._toastMap[l]=u,setTimeout((function(){n.remove(l)}),o),l}},{key:"remove",value:function(e){var t=this._toastMap[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this._toastMap[e])}},{key:"render",value:function(){return'<veplayer-toast class="veplayer-toast"></veplayer-toast>'}},{key:"_renderToast",value:function(e,t,n){var r=this,i=kC.createDom("div","",void 0,"veplayer-toast-container"),o=kC.checkIsObject(e)?e:kC.createDom("div",e,void 0,"veplayer-toast-txt");if(i.appendChild(o),t){var a=kC.createDom("span","×",void 0,"veplayer-toast-close");a.addEventListener("click",(function(){r.remove(n)})),i.appendChild(a)}return i}}],[{key:"pluginName",get:function(){return"toast"}},{key:"defaultConfig",get:function(){return{index:5}}}]),n}(QA);function SL(){return(new DOMParser).parseFromString('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7123 1C11.85 1 11.1173 1.55472 10.8516 2.32675L4.94973 2.32675C3.16413 2.32675 1.71662 3.77427 1.71662 5.55987C1.71662 7.34547 3.16413 8.79298 4.94973 8.79298L11.0483 8.79298L11.1134 8.79418C11.9936 8.82748 12.697 9.55166 12.697 10.44C12.697 11.3497 11.9596 12.0871 11.05 12.0871H5.01323C4.67882 11.4781 4.03143 11.0654 3.28763 11.0654C2.20111 11.0654 1.32031 11.9462 1.32031 13.0327C1.32031 14.1192 2.20111 15 3.28763 15C4.14992 15 4.88264 14.4452 5.14834 13.6732H11.05C12.8356 13.6732 14.2831 12.2256 14.2831 10.44C14.2831 8.65444 12.8356 7.20693 11.05 7.20693L4.94973 7.20693C4.04009 7.20693 3.30267 6.46951 3.30267 5.55987C3.30267 4.65022 4.04009 3.91281 4.94973 3.91281L10.9866 3.91281C11.321 4.52183 11.9685 4.93464 12.7123 4.93464C13.7988 4.93464 14.6796 4.05384 14.6796 2.96732C14.6796 1.8808 13.7988 1 12.7123 1ZM12.7123 2.18954C12.2827 2.18954 11.9345 2.53777 11.9345 2.96732C11.9345 3.39688 12.2827 3.7451 12.7123 3.7451C13.1418 3.7451 13.4901 3.39688 13.4901 2.96732C13.4901 2.53777 13.1418 2.18954 12.7123 2.18954ZM2.50986 13.0327C2.50986 12.6031 2.85808 12.2549 3.28763 12.2549C3.71719 12.2549 4.06541 12.6031 4.06541 13.0327C4.06541 13.4622 3.71719 13.8105 3.28763 13.8105C2.85808 13.8105 2.50986 13.4622 2.50986 13.0327Z" fill="#FFFFFF"/>\n</svg>',"image/svg+xml").firstChild}var TL=function(){function e(t){Ry(this,e),Uy(this,"_root",void 0),Uy(this,"_config",void 0),Uy(this,"_parent",void 0),Uy(this,"_listDom",void 0),Uy(this,"_container",void 0),Uy(this,"_titleDom",void 0),Uy(this,"_player",void 0),Uy(this,"_delegates",void 0),Uy(this,"_listType",void 0);var n=t.config,r=t.root,i=t.player;this._config=n,this._parent=r,this._player=i,this._listType=n.listType,this.renderPanel(),this._initEvents(),this._bindDomEvent()}return Fy(e,[{key:"changeMode",value:function(e){this.updatePanel(e),this._listType=e}},{key:"renderItemList",value:function(e){var t,n=this,r=this._config;return e&&(r.list=e),this._listDom||(this._listDom=kC.createDom("div","",{},"item-list-panel-content")),this._listDom.innerHTML="",null===(t=r.list)||void 0===t||Vw(t).call(t,(function(e,t){var r,i,o=e.selected?"panel-item select-in":"panel-item ".concat(null!==(r=e.className)&&void 0!==r?r:"");e["data-index"]=t;var a=kC.createDom("div","",e,o);e.showText&&("string"==typeof e.showText?a.innerHTML=e.showText:a.appendChild(e.showText)),null===(i=n._listDom)||void 0===i||i.appendChild(a)})),this._listDom}},{key:"renderTitle",value:function(){var e,t,n=this._player.config.i18nManager;if(null!==(e=this._config.panel)&&void 0!==e&&e.title&&this._listType!==CL.Inner)return this._titleDom||(this._titleDom=kC.createDom("div","",{},"xg-mobile-panel-title")),this._titleDom.innerHTML=n.normalize(null===(t=this._config.panel)||void 0===t?void 0:t.title),this._titleDom}},{key:"updatePanel",value:function(e){this._root&&kC.removeClass(this._root,"panel-".concat(this._listType)),this._root&&kC.addClass(this._root,"panel-".concat(e));var t="mobile"===PC.device?"touchend":"click";e===CL.Inner?this._container&&this._bind(this._container,t,this._handleHide.bind(this)):this._container&&this._unbind(this._container,t,this._handleHide.bind(this))}},{key:"renderPanel",value:function(){var e,t,n,r=Nm(e="xg-mobile-panel panel-".concat(this._config.listType," ")).call(e,null!==(t=null===(n=this._config)||void 0===n||null===(n=n.panel)||void 0===n?void 0:n.className)&&void 0!==t?t:"");this._root=kC.createDom("div","",{},r),this._parent&&this._parent.appendChild(this._root);var i=this.renderTitle(),o=this.renderItemList();this._container=kC.createDom("div","",{},"xg-mobile-panel-content"),this._root.appendChild(this._container),i&&this._container.appendChild(i),o&&this._container.appendChild(o)}},{key:"show",value:function(){this._root&&(kC.removeClass(this._root,"hide"),kC.addClass(this._root,"active"))}},{key:"hide",value:function(){this._root&&(kC.removeClass(this._root,"active"),kC.addClass(this._root,"hide"))}},{key:"destroy",value:function(){this._parent&&this._root&&this._parent.removeChild(this._root),this._unbindDomEvent(),this._unbindEvents()}},{key:"_bind",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&"on".concat(t)in e&&"function"==typeof n&&e.addEventListener(t,n,r)}},{key:"_unbind",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&"on".concat(t)in e&&"function"==typeof n&&e.removeEventListener(t,n,r)}},{key:"_initEvents",value:function(){var e;this._config.isAutoChange&&(window.addEventListener("orientationchange",this._handleOrientationChange.bind(this)),null===(e=this._player)||void 0===e||e.on(aA,this._handleOrientationChange.bind(this)))}},{key:"_unbindEvents",value:function(){var e;window.removeEventListener("orientationchange",this._handleOrientationChange.bind(this)),null===(e=this._player)||void 0===e||e.off(aA,this._handleOrientationChange.bind(this))}},{key:"_handleOrientationChange",value:function(){var e,t,n,r=hk(e=[90,-90,"90","-90"]).call(e,window.orientation);if(null!==(t=this._player)&&void 0!==t&&t.fullscreen&&r)this.changeMode(CL.Fullscreen);else if(this._listType!==(null===(n=this._config)||void 0===n?void 0:n.listType)){var i;this.changeMode(null===(i=this._config)||void 0===i?void 0:i.listType)}}},{key:"_bindDomEvent",value:function(){var e="mobile"===PC.device?"touchend":"click";this._listType===CL.Inner&&this._container&&this._bind(this._container,e,this._handleHide.bind(this)),this._root&&this._bind(this._root,e,this._handleHide.bind(this)),this._container&&this._bind(this._container,e,this._stopPropagation),this._listDom&&(this._delegates=QA.delegate.call(this,this._listDom,".panel-item",e,this._onItemClick.bind(this),!0))}},{key:"_unbindDomEvent",value:function(){var e,t="mobile"===PC.device?"touchend":"click";(this._root&&this._unbind(this._root,t,this._handleHide.bind(this)),this._container&&this._unbind(this._container,t,this._handleHide.bind(this)),this._container&&this._unbind(this._container,t,this._stopPropagation),this._delegates)&&(Vw(e=this._delegates).call(e,(function(e){e.destroy&&e.destroy()})),this._delegates=null)}},{key:"_stopPropagation",value:function(e){e.stopPropagation(),e.preventDefault()}},{key:"_onItemClick",value:function(e){var t,n,r,i,o=e.delegateTarget,a="function"==typeof this._config.onOptionClick?this._config.onOptionClick:null,s="function"==typeof this._config.onItemClick?this._config.onItemClick:null,l=null===(t=this._root)||void 0===t?void 0:t.querySelector(".selected");kC.addClass(o,"selected"),l&&(kC.removeClass(l,"selected"),i=Number(l.getAttribute("data-index")));var u=Number(o.getAttribute("data-index")),c={from:void 0!==Tc(i)?null===(n=this._config.list)||void 0===n?void 0:n[i]:void 0,to:null===(r=this._config.list)||void 0===r?void 0:r[u]};null==a||a(e,c),o&&i===u||null==s||s(e,c)}},{key:"_handleHide",value:function(e){var t,n;e.stopPropagation(),e.preventDefault(),null===(t=(n=this._config).hide)||void 0===t||t.call(n)}}]),e}(),CL=function(e){return e.Middle="middle",e.Bottom="bottom",e.Fullscreen="fullscreen",e.Inner="inner",e}(CL||{}),AL=function(e){return e.Icon="Icon",e.Text="Text",e}(AL||{}),xL="mobile"===PC.device,PL=["bottom","fullscreen","inner"],IL=["middle"],RL=["bottom","inner","fullscreen"],DL=["bottom","inner","fullscreen"],OL=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),Uy(Yx(r=t.call(this,e)),"optionsList",void 0),Uy(Yx(r),"_isIcon",void 0),Uy(Yx(r),"_isActive",void 0),Uy(Yx(r),"_curIndex",void 0),Uy(Yx(r),"activeEvent",void 0),Uy(Yx(r),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),r.emit("icon_mouseenter",{pluginName:r.pluginName}),r.toggle(!0)})),Uy(Yx(r),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),r.emit("icon_mouseleave",{pluginName:r.pluginName}),r._isActive&&r.toggle(!1)})),r._isIcon=!1,r._isActive=!1,r._curIndex=0,r}return Fy(n,[{key:"updateLang",value:function(){this.config.list&&this.renderItemList(this.config.list,this._curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.config.listType=this._getListType(),this.initIcons(),t.hidePortrait&&kC.addClass(this.root,"portrait"),xL&&this.on(WC,(function(){e._isActive&&(e.optionsList&&e.optionsList.hide(),e._isActive=!1)})),t.list&&this.renderItemList(t.list),this.activeEvent=xL?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=dk(t);if(n.length>0&&"Icon"===this.config.renderType)return n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n])})),void(this._isIcon=!0);var r=this.appendChild(".xgplayer-icon",kC.createDom("span","",{},"icon-text"));r&&kC.addClass(r,"btn-text")}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||this.config.hideOnSingleOption&&1===this.config.list.length||kC.addClass(this.root,"show")}},{key:"hide",value:function(){kC.removeClass(this.root,"show")}},{key:"toggle",value:function(e){if(e!==this._isActive){var t=this.player.controls,n=this.config.listType;e?(n&&hk(RL).call(RL,n)?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(n&&hk(RL).call(RL,n)?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this._isActive=e}}},{key:"onItemClick",value:function(e,t){var n;e.preventDefault(),e.stopPropagation();var r=this.config.listType;this._curIndex=null===(n=t.to)||void 0===n?void 0:n.index,this.changeCurrentText(),(this.config.isItemClickHide||r&&hk(RL).call(RL,r))&&this.toggle(!1)}},{key:"onOptionClick",value:function(e,t){e.preventDefault(),e.stopPropagation()}},{key:"changeCurrentText",value:function(){if(!this._isIcon){var e=this.config.list,t=e&&this._curIndex<e.length?this._curIndex:0,n=null==e?void 0:e[t];if(n){var r,i=Xm(this).call(this,".icon-text"),o=this.player.config.i18nManager;if(i)i.innerHTML=o.normalize(null!==(r=null==n?void 0:n.iconText)&&void 0!==r?r:null==n?void 0:n.text)}}}},{key:"renderItemList",value:function(e,t){var r,i=this,o=this.config,a=this.optionsList,s=this.player;if("number"==typeof t&&(this._curIndex=t),a)return a.renderItemList(e),this.changeCurrentText(),void(a instanceof TL&&a.renderTitle());this.config.isShowIcon&&(this.optionsList=o.listType&&hk(DL).call(DL,o.listType)?new TL({config:{list:e||[],onItemClick:function(e,t){i.onItemClick(e,t)},onOptionClick:function(e,t){i.onOptionClick(e,t)},panel:this.config.panel,listType:null!==(r=o.listType)&&void 0!==r?r:n.defaultConfig.listType,isAutoChange:o.isAutoChange,hide:function(){return i.toggle(!1)}},root:s.root,player:s}):new dM({config:{data:e||[],onItemClick:function(e,t){i.onItemClick(e,t)}},root:this.root}),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.activeEvent&&this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave),this.optionsList&&(this.optionsList.destroy(),this.optionsList=void 0)}},{key:"render",value:function(){return this.config.isShowIcon?'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>'):""}},{key:"_getListType",value:function(){var e,t=this.config.listType;return null!==(e=this.player)&&void 0!==e&&null!==(e=e.config)&&void 0!==e&&e.listType&&(t=this.player.config.listType),xL||t&&hk(PL).call(PL,t)||(t="bottom"),xL||t&&hk(IL).call(IL,t)||(t="middle"),t}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:xL?eU.ROOT_TOP_RIGHT:eU.CONTROLS_RIGHT,listType:xL?"bottom":"middle",index:100,list:[],listStyle:{},hidePortrait:!0,isShowIcon:!1,renderType:xL?"Icon":"Text",isItemClickHide:!0,hideOnSingleOption:!0,isAutoChange:!0}}}]),n}(QA),ML=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"updateLang",value:function(){this.renderItemList()}},{key:"beforeCreate",value:function(e){var t=e.player.config.sources.sourceManager;e.config.list=t.sources}},{key:"afterCreate",value:function(){bL(aP(n.prototype),"afterCreate",this).call(this),this.config.sourceManager.sources.length<2?this.hide():this.renderItemList()}},{key:"registerIcons",value:function(){return{source:{icon:SL}}}},{key:"renderItemList",value:function(){var e=this.config.sourceManager,t=e.sources,r=e.source,i=this.player.config.i18nManager,o=Vw(t).call(t,(function(e){var t;return Mm(Mm({},e),{},{showText:null!==(t=i.normalize(e.text))&&void 0!==t?t:e.name,selected:!1})})),a=wI(o).call(o,(function(e){return e.name===(null==r?void 0:r.name)}));this.config.list=t,a>-1&&(o[a].selected=!0),bL(aP(n.prototype),"renderItemList",this).call(this,o,a)}},{key:"onItemClick",value:function(e,t){var r,i=this;bL(aP(n.prototype),"onItemClick",this).call(this,e,t),null===(r=this.player.config)||void 0===r||r.veplayer.switch({source:t.to.name},{fallbackToFirstDefinition:!0}).catch((function(){i.renderItemList()}))}}],[{key:"pluginName",get:function(){return"sources"}},{key:"defaultConfig",get:function(){return Mm(Mm({},OL.defaultConfig),{},{index:4,panel:{title:{jp:"ライン選ぶ",en:"Line Choose","zh-cn":"线路选择","zh-hk":"線路選擇"}},list:[],className:"xgplayer-sources",hidePortrait:!1,isShowIcon:!0})}},{key:"textTips",get:function(){return{jp:"ライン",en:"Line","zh-cn":"线路","zh-hk":"線路"}}}]),n}(OL);function LL(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 3.8001H4C3.55817 3.8001 3.2 4.15827 3.2 4.6001V12.6001C3.2 13.0419 3.55817 13.4001 4 13.4001H16C16.4418 13.4001 16.8 13.0419 16.8 12.6001V4.6001C16.8 4.15827 16.4418 3.8001 16 3.8001ZM4 2.6001C2.89543 2.6001 2 3.49553 2 4.6001V12.6001C2 13.7047 2.89543 14.6001 4 14.6001H16C17.1046 14.6001 18 13.7047 18 12.6001V4.6001C18 3.49553 17.1046 2.6001 16 2.6001H4ZM5.0249 6.24509V11.6001H5.9024V9.23009H8.6174V11.6001H9.4949V6.24509H8.6174V8.48009H5.9024V6.24509H5.0249ZM10.5474 6.24509V11.6001H12.5049C13.3749 11.6001 14.0274 11.3601 14.4774 10.8801C14.9049 10.4226 15.1224 9.77009 15.1224 8.92259C15.1224 8.06759 14.9049 7.41509 14.4774 6.96509C14.0274 6.48509 13.3749 6.24509 12.5049 6.24509H10.5474ZM11.4249 6.99509H12.3399C13.0074 6.99509 13.4949 7.14509 13.8024 7.45259C14.1024 7.75259 14.2524 8.24759 14.2524 8.92259C14.2524 9.58259 14.1024 10.0701 13.8024 10.3851C13.4949 10.6926 13.0074 10.8501 12.3399 10.8501H11.4249V6.99509ZM4.15 16.1001C3.79101 16.1001 3.5 16.3911 3.5 16.7501C3.5 17.1091 3.79101 17.4001 4.15 17.4001H15.85C16.209 17.4001 16.5 17.1091 16.5 16.7501C16.5 16.3911 16.209 16.1001 15.85 16.1001H4.15Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}var FL={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",a="[object Boolean]",s="[object Date]",l="[object Function]",u="[object GeneratorFunction]",c="[object Map]",h="[object Number]",f="[object Object]",d="[object Promise]",p="[object RegExp]",v="[object Set]",g="[object String]",y="[object Symbol]",m="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",S="[object Int16Array]",T="[object Int32Array]",C="[object Uint8Array]",A="[object Uint8ClampedArray]",x="[object Uint16Array]",P="[object Uint32Array]",I=/\w*$/,R=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,O={};O[o]=O["[object Array]"]=O[_]=O[b]=O[a]=O[s]=O[w]=O[k]=O[E]=O[S]=O[T]=O[c]=O[h]=O[f]=O[p]=O[v]=O[g]=O[y]=O[C]=O[A]=O[x]=O[P]=!0,O["[object Error]"]=O[l]=O[m]=!1;var M="object"==Tc(i)&&i&&i.Object===Object&&i,L="object"==("undefined"==typeof self?"undefined":Tc(self))&&self&&self.Object===Object&&self,F=M||L||Function("return this")(),U=t&&!t.nodeType&&t,B=U&&e&&!e.nodeType&&e,N=B&&B.exports===U;function V(e,t){return e.set(t[0],t[1]),e}function H(e,t){return e.add(t),e}function G(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function j(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}function z(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function K(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var q,X=Array.prototype,Y=Function.prototype,$=Object.prototype,Z=F["__core-js_shared__"],J=(q=/[^.]+$/.exec(Z&&fE(Z)&&fE(Z).IE_PROTO||""))?"Symbol(src)_1."+q:"",Q=Y.toString,ee=$.hasOwnProperty,te=$.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=N?F.Buffer:void 0,ie=F.Symbol,oe=F.Uint8Array,ae=K(FE,Object),se=Object.create,le=$.propertyIsEnumerable,ue=Lk(X),ce=xE,he=re?re.isBuffer:void 0,fe=K(dk,Object),de=Be(F,"DataView"),pe=Be(F,"Map"),ve=Be(F,"Promise"),ge=Be(F,"Set"),ye=Be(F,"WeakMap"),me=Be(Object,"create"),_e=je(de),be=je(pe),we=je(ve),ke=je(ge),Ee=je(ye),Se=ie?ie.prototype:void 0,Te=Se?Se.valueOf:void 0;function Ce(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pe(e){this.__data__=new Ae(e)}function Ie(e,t){var n=Ke(e)||function(e){return function(e){return function(e){return!!e&&"object"==Tc(e)}(e)&&We(e)}(e)&&ee.call(e,"callee")&&(!le.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||He(a,r))||n.push(a);return n}function Re(e,t,n){var r=e[t];ee.call(e,t)&&ze(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function De(e,t){for(var n=e.length;n--;)if(ze(e[n][0],t))return n;return-1}function Oe(e,t,n,r,i,d,m){var R;if(r&&(R=d?r(e,i,d,m):r(e)),void 0!==R)return R;if(!Ye(e))return e;var D=Ke(e);if(D){if(R=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,R)}else{var M=Ve(e),L=M==l||M==u;if(qe(e))return function(e,t){if(t)return pk(e).call(e);var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(M==f||M==o||L&&!d){if(j(e))return d?e:{};if(R=function(e){return"function"!=typeof e.constructor||Ge(e)?{}:(t=ae(e),Ye(t)?se(t):{});var t}(L?{}:e),!t)return function(e,t){return Fe(e,Ne(e),t)}(e,function(e,t){return e&&Fe(t,$e(t),e)}(R,e))}else{if(!O[M])return d?e:{};R=function(e,t,n,r){var i=e.constructor;switch(t){case _:return Le(e);case a:case s:return new i(+e);case b:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case k:case E:case S:case T:case C:case A:case x:case P:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case c:return function(e,t,n){var r=t?n(z(e),!0):z(e);return G(r,V,new e.constructor)}(e,r,n);case h:case g:return new i(e);case p:return function(e){var t=new e.constructor(e.source,I.exec(e));return t.lastIndex=e.lastIndex,t}(e);case v:return function(e,t,n){var r=t?n(W(e),!0):W(e);return G(r,H,new e.constructor)}(e,r,n);case y:return o=e,Te?Object(Te.call(o)):{}}var o}(e,M,Oe,t)}}m||(m=new Pe);var F=m.get(e);if(F)return F;if(m.set(e,R),!D)var U=n?function(e){return function(e,t,n){var r=t(e);return Ke(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,$e,Ne)}(e):$e(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(U||e,(function(i,o){U&&(i=e[o=i]),Re(R,o,Oe(i,t,n,r,o,e,m))})),R}function Me(e){return!(!Ye(e)||(t=e,J&&J in t))&&(Xe(e)||j(e)?ne:R).test(je(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function Fe(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r?r(n[a],e[a],a,n,e):void 0;Re(n,a,void 0===s?e[a]:s)}return n}function Ue(e,t){var n,r,i=e.__data__;return("string"==(r=Tc(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:Vw(i)}function Be(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Ce.prototype.clear=function(){this.__data__=me?me(null):{}},Ce.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ce.prototype.get=function(e){var t=this.__data__;if(me){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Ce.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},Ae.prototype.clear=function(){this.__data__=[]},Ae.prototype.delete=function(e){var t=this.__data__,n=De(t,e);return!(n<0)&&(n==t.length-1?t.pop():ue.call(t,n,1),!0)},Ae.prototype.get=function(e){var t=this.__data__,n=De(t,e);return n<0?void 0:t[n][1]},Ae.prototype.has=function(e){return De(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var n=this.__data__,r=De(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},xe.prototype.clear=function(){this.__data__={hash:new Ce,map:new(pe||Ae),string:new Ce}},xe.prototype.delete=function(e){return Ue(this,e).delete(e)},xe.prototype.get=function(e){return Ue(this,e).get(e)},xe.prototype.has=function(e){return Ue(this,e).has(e)},xe.prototype.set=function(e,t){return Ue(this,e).set(e,t),this},Pe.prototype.clear=function(){this.__data__=new Ae},Pe.prototype.delete=function(e){return this.__data__.delete(e)},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ae){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new xe(r)}return n.set(e,t),this};var Ne=ce?K(ce,Object):function(){return[]},Ve=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||D.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||$)}function je(e){if(null!=e){try{return Q.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function ze(e,t){return e===t||e!=e&&t!=t}(de&&Ve(new de(new ArrayBuffer(1)))!=b||pe&&Ve(new pe)!=c||ve&&Ve(ve.resolve())!=d||ge&&Ve(new ge)!=v||ye&&Ve(new ye)!=m)&&(Ve=function(e){var t=te.call(e),n=t==f?e.constructor:void 0,r=n?je(n):void 0;if(r)switch(r){case _e:return b;case be:return c;case we:return d;case ke:return v;case Ee:return m}return t});var Ke=Array.isArray;function We(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Xe(e)}var qe=he||function(){return!1};function Xe(e){var t=Ye(e)?te.call(e):"";return t==l||t==u}function Ye(e){var t=Tc(e);return!!e&&("object"==t||"function"==t)}function $e(e){return We(e)?Ie(e):function(e){if(!Ge(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Oe(e,!0,!0)}}(FL,FL.exports);var UL=o(FL.exports),BL=function(e){oP(r,e);var t,n=lP(r);function r(){var e,t;Ry(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(t=n.call.apply(n,Nm(e=[this]).call(e,o))),"_waitingStartTime",0),Uy(Yx(t),"_timer",void 0),Uy(Yx(t),"_toastId",void 0),t}return Fy(r,[{key:"updateLang",value:function(){this.renderItemList()}},{key:"beforeCreate",value:function(e){var t,n=e.player.config.sources.sourceManager;e.config.list=null===(t=n.source)||void 0===t?void 0:t.definitions}},{key:"afterCreate",value:function(){var e,t;bL(aP(r.prototype),"afterCreate",this).call(this),(null!==(e=null===(t=this.player.config.sourceManager.source)||void 0===t?void 0:t.definitions)&&void 0!==e?e:[]).length<2?this.hide():(this.renderItemList(),this.on(KM.WAITING,this._waiting.bind(this)),this.on(KM.PLAYING,this._clearTimer.bind(this)),this.on(KM.PAUSE,this._clearTimer.bind(this)),this.on(KM.PLAY,this._clearTimer.bind(this)),this._initTimeUpdateEvent())}},{key:"registerIcons",value:function(){return{source:{icon:LL}}}},{key:"renderItemList",value:function(){var e,t,n,i=this,o=this.player.config.sourceManager,a=null!==(e=null===(t=o.source)||void 0===t?void 0:t.definitions)&&void 0!==e?e:[],s=Vw(a).call(a,(function(e){var t;return{url:e.url,definition:e.definition||"",showText:null!==(t=i.player.config.i18nManager.normalize(e.text))&&void 0!==t?t:e.definition,selected:!1}})),l=wI(a).call(a,(function(e){var t;return e.definition===(null===(t=o.definition)||void 0===t?void 0:t.definition)}));this.config.list=null===(n=o.source)||void 0===n?void 0:n.definitions,l>-1&&(s[l].selected=!0),bL(aP(r.prototype),"renderItemList",this).call(this,s,l)}},{key:"onItemClick",value:function(e,t){var n,i=this;this._showToast(t.to),bL(aP(r.prototype),"onItemClick",this).call(this,e,t),null===(n=this.player.config)||void 0===n||n.veplayer.switch({definition:t.to.definition}).catch((function(){i.renderItemList()}))}},{key:"fallback",value:(t=sy(oy().mark((function e(){var t,n,r,i,o,a,s,l=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=l.length>0&&void 0!==l[0]?l[0]:{toast:!0},i=this.player.config.sourceManager,!((o=wI(t=this.config.demotePriority).call(t,(function(e){var t;return e===(null===(t=i.definition)||void 0===t?void 0:t.definition)})))<0)){e.next=5;break}return e.abrupt("return");case 5:if(a=UL(i.definition),s=this._getNextDefinition(o)){e.next=9;break}return e.abrupt("return");case 9:if(!r.toast){e.next=15;break}return e.next=12,this._toast(s);case 12:if(e.sent){e.next=15;break}return e.abrupt("return");case 15:this.player.emit(KM.DEFINITION_FALLBACK,{from:a,to:s}),null===(n=this.player.config)||void 0===n||n.veplayer.switch({definition:s.definition}).catch((function(){}));case 17:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_waiting",value:function(){var e=this;if(!this._timer){this._waitingStartTime=Date.now();var t=this.player.currentTime;this._timer=window.setTimeout((function(){e.player&&e.player.currentTime<=t+.1&&(e.player.emit(KM.LONG_WAITING),e.config.needFallback&&e.fallback({toast:!0}),e._clearTimer())}),this.config.longWaitingTime)}}},{key:"_clearTimer",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=void 0),this._waitingStartTime&&(this._waitingStartTime=0)}},{key:"_toast",value:function(e){var t=this,n=this.player.config.i18nManager;return new Hw((function(r){var i,o,a=null===(i=t.player)||void 0===i?void 0:i.getPlugin("toast");if(a){var s=kC.createDom("div",n.getText("DEFINITION_FALLBACK_TOAST"),void 0,"veplayer-toast-txt"),l=null!==(o=t.player.config.i18nManager.normalize(e.text))&&void 0!==o?o:e.definition,u=kC.createDom("span",l,void 0,"veplayer-toast-txt-bt");s.appendChild(u);var c=a.toast(s,{duration:5e3,closable:!0});u.addEventListener("click",(function(){a.remove(c),r(!0)}))}else r(!1)}))}},{key:"_getNextDefinition",value:function(e){var t,n=this.player.config.sourceManager;if(null!==(t=n.source)&&void 0!==t&&t.definitions.length&&!(e+1>=this.config.demotePriority.length)){var r=e+1,i=Xm(n).call(n,{definition:this.config.demotePriority[r]});return i||this._getNextDefinition(r)}}},{key:"_initTimeUpdateEvent",value:function(){var e=this,t=this.player.currentTime;this.on(KM.TIME_UPDATE,(function(){var n=e.player.currentTime;n!==t?(t=n,e._clearTimer()):t=n}))}},{key:"_showToast",value:function(e){var t,n,r,i=this,o=null===(t=this.player)||void 0===t?void 0:t.getPlugin("toast"),a=this.player.config.i18nManager;o&&(this._toastId&&o.remove(this._toastId),this._toastId=o.toast(Nm(n="".concat(a.getText("DEFINITION_SWITCHING")," ")).call(n,null!==(r=e.showText)&&void 0!==r?r:e.definition," ..."),{duration:2e3,closable:!0}),this.player.once(KM.AFTER_DEFINITION_CHANGE,(function(){void 0!==i._toastId&&o.remove(i._toastId)})))}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return Mm(Mm({},OL.defaultConfig),{},{index:3,list:[],panel:{title:{jp:"クラリティセレクション",en:"Definition Choose","zh-cn":"清晰度选择","zh-hk":"清晰度選擇"}},className:"xgplayer-definition",hidePortrait:!1,isShowIcon:!0,longWaitingTime:5e3,needFallback:!1,demotePriority:["uhd","hd","sd","ld","ao"]})}},{key:"textTips",get:function(){return{jp:"明快さ",en:"Definition","zh-cn":"清晰度","zh-hk":"清晰度"}}}]),r}(OL),NL={"biz:vod":"veplayer.biz.vod.[env].[ext]","biz:live":"veplayer.biz.live.[env].[ext]","plugin:flv":"veplayer.plugin.flv.[env].[ext]","plugin:mp4":"veplayer.plugin.mp4.[env].[ext]","plugin:hls":"veplayer.plugin.hls.[env].[ext]","plugin:shaka":"veplayer.plugin.shaka.[env].[ext]","plugin:rtm":"veplayer.plugin.rtm.[env].[ext]","plugin:xgvideo":"veplayer.plugin.xgvideo.[env].[ext]","plugin:drm":"veplayer.plugin.drm.[env].[ext]","plugin:abr":"veplayer.plugin.abr.[env].[ext]"},VL=function(e){return e.BizVod="biz:vod",e.BizLive="biz:live",e.PluginFlv="plugin:flv",e.PluginMp4="plugin:mp4",e.PluginHls="plugin:hls",e.PluginShaka="plugin:shaka",e.PluginRtm="plugin:rtm",e.PluginXgvideo="plugin:xgvideo",e.PluginDrm="plugin:drm",e.PluginAbr="plugin:abr",e}(VL||{}),HL=function(){function e(t){var n=this;Ry(this,e),Uy(this,"modules",{}),Uy(this,"mountPromiseMap",{}),Uy(this,"_baseUrl",void 0),Uy(this,"_moduleSystem",void 0),Uy(this,"load",function(){var e=sy(oy().mark((function e(t,r){var i,o,a,s,l;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n._moduleSystem){e.next=2;break}throw new Error('You have to specify moduleSystem first, call "setModuleSystem(moduleSystem)" to set module system');case 2:if(NL[t]){e.next=4;break}throw new Error('Invalid module name: "'.concat(t,'"'));case 4:if("esm"!==n._moduleSystem){e.next=11;break}if(n.modules[t]){e.next=9;break}throw new Error('Dynamic module "'.concat(t,'" not found, you have to register it first under ESM'));case 9:return o=n.modules[t].exports,e.abrupt("return",null!==(i=o.default)&&void 0!==i?i:o);case 11:if(!n.modules[t]){e.next=21;break}if(1!==n.modules[t].state){e.next=16;break}return e.abrupt("return",n.modules[t].exports);case 16:if(0!==n.modules[t].state){e.next=20;break}return e.abrupt("return",n.mountPromiseMap[t].then((function(e){var t;return null!==(t=e.default)&&void 0!==t?t:e})));case 20:throw null!==(a=n.modules[t].error)&&void 0!==a?a:new Error('Dynamic module "'.concat(t,'" load failed.'));case 21:return s=[n._baseUrl,NL[t]].join("/").replace("[env]","production").replace("[ext]","js"),l={src:null!=r?r:s,name:t,state:0,exports:{__PLUGIN_NAME__:t}},n.modules[t]=l,n.mountPromiseMap[t]=n._mount(l),e.abrupt("return",n.mountPromiseMap[t]);case 26:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),Uy(this,"registerPlugin",(function(e,t){if(!n._moduleSystem)throw new Error("You have to specify moduleSystem first, call setModuleSystem(moduleSystem) to set module system");return"esm"===n._moduleSystem?(n.modules[e]={src:"esm:".concat(e),name:e,state:1,exports:t},n.modules[e].exports):(n.modules[e]?n.modules[e].exports=t:n.modules[e]={src:"umd:".concat(e),name:e,state:1,exports:t},n.modules[e].exports)})),Uy(this,"register",(function(e){return Vw(e).call(e,(function(e){return n.registerPlugin(e.__PLUGIN_NAME__,e)}))})),this._baseUrl=t.baseUrl}return Fy(e,[{key:"baseUrl",get:function(){return this._baseUrl}},{key:"moduleSystem",get:function(){return this._moduleSystem}},{key:"setModuleSystem",value:function(e){this._moduleSystem=e}},{key:"setBaseUrl",value:function(e){this._baseUrl=e}},{key:"_mount",value:function(e){var t=this.modules;return new Hw((function(n,r){var i=document.createElement("script");i.src=e.src,i.onload=function(){e.state=1,n(t[e.name].exports),i.onload=null},i.onerror=function(t){e.state=2,e.error=t,r(t),i.onerror=null},document.body.appendChild(i)}))}}]),e}(),GL=p,jL=ee,zL=Bn,KL=jn,WL=Gc,qL=Math.min,XL=[].lastIndexOf,YL=!!XL&&1/[1].lastIndexOf(1,-0)<0,$L=WL("lastIndexOf"),ZL=YL||!$L?function(e){if(YL)return GL(XL,this,arguments)||0;var t=jL(this),n=KL(t),r=n-1;for(arguments.length>1&&(r=qL(r,zL(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:XL;Dn({target:"Array",proto:!0,forced:ZL!==[].lastIndexOf},{lastIndexOf:ZL});var JL,QL,eF=Wc("Array").lastIndexOf,tF=ce,nF=eF,rF=Array.prototype,iF=o((function(e){var t=e.lastIndexOf;return e===rF||tF(rF,e)&&t===rF.lastIndexOf?nF:t})),oF=null!==(JL=null===(QL=document.currentScript)||void 0===QL?void 0:QL.src)&&void 0!==JL?JL:"https://tosv.byted.org/obj/lux/sdk/@byted/veplayer/".concat("2.4.2-rc.4","/object/umd/"),aF=new HL({baseUrl:pk(oF).call(oF,0,iF(oF).call(oF,"/"))}),sF=aF.registerPlugin,lF=aF.register;function uF(e,t){return cF.apply(this,arguments)}function cF(){return(cF=sy(oy().mark((function e(t,n){var r;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,aF.load(t,n);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),gP(fP.MODULE_LOAD_ERROR,{ext:{name:t,cdn:null===e.t0||void 0===e.t0||null===(r=e.t0.target)||void 0===r?void 0:r.src},error:e.t0});case 9:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var hF=function(e,t){var n,r=fF(e);if(!e||!r)return null!==(n=e)&&void 0!==n?n:"";var i,o=OM(e).call(e,"//");for(var a in t){var s,l,u=t[a];if(null!=r&&r.searchParams.has(a))null==r||null===(s=r.searchParams)||void 0===s||s.set(a,u);else null==r||null===(l=r.searchParams)||void 0===l||l.append(a,u)}return e=r.toString(),o?null===(i=e)||void 0===i?void 0:i.replace(location.protocol,""):e},fF=function(e){if(e){OM(e).call(e,"//")&&(e=location.protocol+e);try{return new fM(e)}catch(oz){return}}};function dF(e){return function(t){var n;return null==t?void 0:hk(n=t.split("?")[0].toLowerCase()).call(n,e)}}var pF=dF(".m3u8"),vF=dF(".mp4"),gF=dF(".flv"),yF=dF(".sdp"),mF=dF(".mpd");function _F(e){return pF(e)?"hls":gF(e)?"flv":yF(e)?"rtm":vF(e)?"mp4":mF(e)?"dash":"unknown"}function bF(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.H264)===t.H265?PC.isHevcSupported():PC.isMSESupport()}function wF(){return(wF=sy(oy().mark((function e(){var t,n;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uF(VL.PluginXgvideo);case 2:return t=e.sent,n=t.XGVideoPlugin,e.abrupt("return",null==n?void 0:n.isSupported());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var kF=Mm(Mm({},kC),{},{getStreamType:_F,isMseSupported:bF,isSoftDecodeSupported:function(){return wF.apply(this,arguments)},appendSearchParams:hF,getUrlObject:fF}),EF=PC.isWeixin,SF=PC.os,TF=PC.device,CF=SF.isAndroid,AF=SF.isIos,xF="mobile"===TF,PF=0,IF=!1,RF=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),Uy(Yx(r=t.call(this,e)),"_hasSetUserAutoplay",void 0),Uy(Yx(r),"_timer",void 0),Uy(Yx(r),"_wxTimer",void 0),Uy(Yx(r),"_state",{mode:0,showUnmuteBt:!1}),Uy(Yx(r),"userClickPlay",(function(){if(!IF){var e=r.player.play();e&&e.then?e.then((function(){console.log("user action autoplay success"),IF=!0})).catch((function(e){console.warn("user action autoplay fail:",e)})):(console.warn("no play promise"),IF=!0)}})),r}return Fy(n,[{key:"afterCreate",value:function(){this.initState(),this.initEvents(),this.setWXAutoPlay()}},{key:"updateLang",value:function(){this.renderUnmuteBt()}},{key:"initState",value:function(){this._state.mode=this.player.muted?1:0}},{key:"initEvents",value:function(){this.player.on(ZC,this.handleAutoplayPrevented.bind(this)),this.player.on($C,this.handleAutoplayStart.bind(this)),this.player.on(jC,this.handleVolumechange.bind(this)),this.setUserActionAutoPlay()}},{key:"setWXAutoPlay",value:function(){EF&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1))}},{key:"wxCanPlayFn",value:function(){var e=this;window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(function(){e._wxTimer=window.setTimeout((function(){e._wxTimer&&clearTimeout(e._wxTimer);var t=e.player.play();t&&t.then?t.then((function(){console.log("wechat autoplay success")})).catch((function(t){console.warn("wechat autoplay fail:",t),e._state.showUnmuteBt=!1,e.renderUnmuteBt()})):console.warn("wechat browser no play promise")}))}))}},{key:"wxPlay",value:function(){this.player.readyState>=2?this.wxCanPlayFn():CF?this.player.once(HC,this.wxCanPlayFn.bind(this)):AF&&this.player.once(JC,this.wxCanPlayFn.bind(this))}},{key:"setUserActionAutoPlay",value:function(){var e=this;this.config.enableUserActionAutoplay&&this.player.once(zM.AUTOPLAY_FAIL,(function(){e._hasSetUserAutoplay=!0,(e.config.userActionDom instanceof window.Node?e.config.userActionDom:window.document.body).addEventListener("click",e.userClickPlay,!1)}))}},{key:"handleAutoplayPrevented",value:function(){return 0===this._state.mode?(console.warn("unmute autoplay fail"),this.player.emit(zM.AUTOPLAY_FAIL,{mode:"unmute"}),CF&&EF?void(this._state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this._state.mode?(console.warn("mute autoplay fail"),this.player.emit(zM.AUTOPLAY_FAIL,{mode:"mute"}),void(this._state.mode=2)):2===this._state.mode?(this.player.emit(zM.AUTOPLAY_FAIL,{mode:"noSupport"}),void console.warn("not support autoplay")):void 0}},{key:"changeMuteMode",value:function(){var e=this;this.player.muted=!0,this._state.showUnmuteBt=!0,this._state.mode=1,this.renderUnmuteBt(),this._timer=window.setTimeout((function(){e._timer&&window.clearTimeout(e._timer);var t=e.player.play();t&&t.then?t.then((function(){console.log("degrade mute autoplay success")})).catch((function(t){console.warn("degrade mute autoplay fail:",t),e.player.muted=!1,e._state.showUnmuteBt=!1,e.renderUnmuteBt()})):console.warn("no play promise")}))}},{key:"handleAutoplayStart",value:function(){if(0!==this._state.mode)return 1===this._state.mode?(this.player.emit(zM.AUTOPLAY_SUCCESS,{mode:"mute"}),this._state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this._state.mode?(this.player.emit(zM.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this._state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(zM.AUTOPLAY_SUCCESS,{mode:"unmute"})}},{key:"handleVolumechange",value:function(){this._state.showUnmuteBt&&(this._state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())}},{key:"renderUnmuteBt",value:function(){var e=this.root,t=this.player.config.i18nManager;if(e&&(e.innerHTML="",this._state.showUnmuteBt)){var n=t.getText("UNMUTE"),r=kC.createDom("div",n,void 0,"veplayer-unmute-bt");e.appendChild(r),this.bind(".veplayer-unmute-bt","click",this.cancelUnmute.bind(this)),this.bind(".veplayer-unmute-bt","touchend",this.cancelUnmute.bind(this))}}},{key:"cancelUnmute",value:function(){var e=Date.now();if(e-PF>200){PF=e,this.player.muted=!1,this._state.showUnmuteBt=!1,this.renderUnmuteBt(),this.emit(zM.AUTOPLAY_UNMUTE);var t="mobile"===PC.device,n=yF(this.player.config.url);t&&n&&(this.player.volume>.5?this.player.volume=this.player.volume-.1:this.player.volume=this.player.volume+.1)}}},{key:"destroy",value:function(){if(this.player.off(ZC,this.handleAutoplayPrevented.bind(this)),this.player.off($C,this.handleAutoplayStart.bind(this)),this.player.off(jC,this.handleVolumechange.bind(this)),this._timer&&window.clearTimeout(this._timer),this._wxTimer&&window.clearTimeout(this._wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1),this._hasSetUserAutoplay){var e=xF?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}},{key:"render",value:function(){return'<div class="veplayer-unmute"></div>'}}],[{key:"pluginName",get:function(){return"autoplayPlugin"}},{key:"defaultConfig",get:function(){return{position:QA.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1}}}]),n}(QA),DF=nL.values;Dn({target:"Object",stat:!0},{values:function(e){return DF(e)}});var OF=o(ie.Object.values);function MF(){return(new DOMParser).parseFromString('<svg width="18" height="18" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 11C5.75 11.9665 4.9665 12.75 4 12.75C3.0335 12.75 2.25 11.9665 2.25 11C2.25 10.0335 3.0335 9.25 4 9.25C4.9665 9.25 5.75 10.0335 5.75 11ZM13.25 11C13.25 11.9665 12.4665 12.75 11.5 12.75C10.5335 12.75 9.75 11.9665 9.75 11C9.75 10.0335 10.5335 9.25 11.5 9.25C12.4665 9.25 13.25 10.0335 13.25 11ZM19 12.75C19.9665 12.75 20.75 11.9665 20.75 11C20.75 10.0335 19.9665 9.25 19 9.25C18.0335 9.25 17.25 10.0335 17.25 11C17.25 11.9665 18.0335 12.75 19 12.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var LF,FF,UF=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"onItemClick",value:function(){}},{key:"onOptionClick",value:function(){this.toggle(!1)}},{key:"updateLang",value:function(){var e,t=this,n=this.player.config.i18nManager;null===(e=this.config.plugins)||void 0===e||e.forEach((function(e){var r,i=null!==(r=n.normalize(e.textTips))&&void 0!==r?r:e.pluginName;if(t.player.root){var o=kC.findDom(t.player.root,".panel-plugin-".concat(e.pluginName," .panel-icon-bt-text"));o&&(o.innerHTML=i)}}))}},{key:"beforeCreate",value:function(e){var t,n=e.player.config.i18nManager;e.config.list=null===(t=e.config.plugins)||void 0===t?void 0:Vw(t).call(t,(function(t,r){var i,o=kC.createDom("div","",{},"panel-icon-bt panel-plugin-".concat(t.pluginName)),a=kC.createDom("div","",{},"panel-icon-svg"),s=null!==(i=n.normalize(t.textTips))&&void 0!==i?i:t.pluginName;return o.appendChild(a),o.appendChild(kC.createDom("span",s,{"plugin-index":r},"panel-icon-bt-text")),{showText:o,plugin:e.player.registerPlugin({plugin:t,options:{root:a}})}}))}},{key:"hideChild",value:function(e){if(e){var t;null===(t=e.hide)||void 0===t||t.call(e);var n=document.querySelector(".panel-plugin-".concat(e.pluginName));n&&kC.addClass(n,"hide")}}},{key:"showChild",value:function(e){if(e){var t;null===(t=e.show)||void 0===t||t.call(e);var n=document.querySelector(".panel-plugin-".concat(e.pluginName));n&&kC.removeClass(n,"hide")}}},{key:"registerIcons",value:function(){return{more:{icon:MF}}}}],[{key:"pluginName",get:function(){return"more"}},{key:"defaultConfig",get:function(){return Mm(Mm({},OL.defaultConfig),{},{index:1,plugins:[],list:[],hideOnSingleOption:!1,isShowIcon:!0,hidePortrait:!1,renderType:AL.Icon,panel:{className:"more-panel-content"}})}}]),n}(OL),BF=function(e){return e.ROOT_TOP_RIGHT="rootTopRight",e.ROOT_TOP_RIGHT_COLLAPSE="rootTopRightCollapse",e}(BF||{}),NF=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"registerIcons",value:function(){return{more:{icon:MF,class:"xgplayer-more-svg"}}}},{key:"children",value:function(){var e=this,t=this._getPlugins(),n=t.plugins,r=t.collapsePlugins,i={};return n.forEach((function(t){i[t.pluginName]={plugin:t,options:{root:e.root}}})),r.length&&(i[UF.pluginName]={plugin:UF,options:{root:this.root,plugins:r}}),i}},{key:"render",value:function(){return'<xg-right-grid class="xg-right-grid xgplayer-rightTop-iconList"></xg-right-grid>'}},{key:"_getPlugins",value:function(){var e,t=this,n=[],r=[],i=null===(e=this.player.config.ignores)||void 0===e?void 0:Vw(e).call(e,(function(e){return e.toLowerCase()}));return this.config.plugins.forEach((function(e){var o,a=e.pluginName.toLowerCase();null!=i&&hk(i).call(i,a)||("rootTopRight"===(null!==(o=t.player.config[a].position)&&void 0!==o?o:e.defaultConfig.position)?n.push(e):r.push(e))})),{plugins:null!=n?n:[],collapsePlugins:null!=r?r:[]}}}],[{key:"pluginName",get:function(){return"topRightBar"}},{key:"defaultConfig",get:function(){return{position:QA.POSITIONS.ROOT_TOP,plugins:[]}}},{key:"isTopRightPlugin",value:function(e,t){var n,r,i,o,a,s=null!==(r=null===(i=t[null==e||null===(n=e.pluginName)||void 0===n?void 0:n.toLowerCase()])||void 0===i?void 0:i.position)&&void 0!==r?r:null==e||null===(o=e.defaultConfig)||void 0===o?void 0:o.position;return!!hk(a=OF(BF)).call(a,s)}}]),n}(QA),VF=[EI,xI,DI,UP,BI,mP,EP,fI,SP,kL,EL,ML,BL,RF],HF=Nm(LF=[]).call(LF,VF,[cI,VP,NF]),GF=Nm(FF=[]).call(FF,VF,[rI,NF]),jF="pc"===PC.device?HF:GF;function zF(){return(new DOMParser).parseFromString('<svg width="21" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.892 2h4.445v1.778H3.892v4.444H2.114V3.778C2.114 2.796 2.91 2 3.892 2zm4.445 16v-4.444c0-.982-.796-1.778-1.778-1.778H2.114v1.778h2.944L2.264 16.35a.9.9 0 001.272 1.273l2.988-2.987a.918.918 0 00.035-.037V18h1.778zm8-6.222v4.444h-4.445V18h4.445c.981 0 1.777-.796 1.777-1.778v-4.444h-1.777zM11.892 2v4.445c0 .981.796 1.777 1.778 1.777h4.444V6.445H15.17l2.568-2.568a.9.9 0 10-1.273-1.273L13.67 5.4V2h-1.778z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function KF(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.778 2h4.444v1.778H3.778v4.444H2V3.778C2 2.796 2.796 2 3.778 2zM2 11.778v4.444C2 17.204 2.796 18 3.778 18h4.444v-1.778H4.823l2.313-2.313a.9.9 0 00-1.272-1.273l-2.086 2.086v-2.944H2zm14.222 0v4.444h-4.444V18h4.444c.982 0 1.778-.796 1.778-1.778v-4.444h-1.778zM18 8.222V3.778C18 2.796 17.204 2 16.222 2h-4.444v1.778h2.945l-2.587 2.586a.9.9 0 101.273 1.273l2.813-2.813v3.398H18z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var WF={startPlay:function(){return(new DOMParser).parseFromString('<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="60" height="60" rx="30" fill="#000" fill-opacity=".4"/><path d="M40.243 28.3a2 2 0 010 3.401L24.06 41.712c-1.332.825-3.052-.134-3.052-1.7V19.988c0-1.566 1.72-2.525 3.052-1.7l16.184 10.01z" fill="#fff"/></svg>',"image/svg+xml").firstChild},play:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.121 8.299a2 2 0 010 3.402l-7.94 4.91c-1.332.825-3.051-.133-3.051-1.7V5.09c0-1.567 1.72-2.525 3.052-1.701l7.939 4.911z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.313" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/><rect x="11.563" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:KF,exitFullscreen:zF,replay:function(){return(new DOMParser).parseFromString('<svg width="72" height="72" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF" fill-rule="evenodd"><circle fill-opacity=".3" cx="36" cy="36" r="36"/><path d="M40.167 32.667a.833.833 0 01-.834-.834v-1.666c0-.46.373-.834.834-.834h5.409a11.653 11.653 0 00-9.576-5c-6.443 0-11.667 5.224-11.667 11.667S29.557 47.667 36 47.667c5.285 0 9.749-3.514 11.183-8.333h3.445C49.112 46.014 43.138 51 36 51c-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 4.713 0 8.918 2.173 11.668 5.572l-.001-4.739c0-.46.373-.833.833-.833h1.667c.46 0 .833.373.833.833V31c0 .879-.68 1.598-1.542 1.662l-.125.005h-9.166z"/></g></svg>',"image/svg+xml").firstChild},volumeLarge:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zm6.767 2.278A7.474 7.474 0 0118.75 10a7.477 7.477 0 01-2.128 5.234.4.4 0 01-.57-.004l-.587-.586a.442.442 0 01.005-.617A5.812 5.812 0 0017.083 10c0-1.557-.61-2.97-1.603-4.017a.442.442 0 01-.003-.615l.586-.586a.4.4 0 01.57-.004zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild},volumeMuted:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.045 2.5h.55c.44 0 .8.34.831.771l.003.062v13.334c0 .44-.34.799-.771.83l-.063.003h-.55a.833.833 0 01-.443-.128l-.065-.045-4.866-3.744a.831.831 0 01-.323-.59l-.003-.07V7.077c0-.235.1-.458.272-.615l.054-.045 4.866-3.744a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.68 6.667c.23 0 .416.186.416.416v5.834c0 .23-.186.416-.416.416h-.834a.417.417 0 01-.416-.416V7.083c0-.23.186-.416.416-.416h.834zm10.467.294a.417.417 0 01.59 0l1.767 1.768L17.27 6.96a.417.417 0 01.589 0l.59.59a.417.417 0 010 .589L16.68 9.908l1.768 1.767c.15.15.162.387.035.55l-.035.04-.589.589a.417.417 0 01-.59 0l-1.767-1.768-1.768 1.768a.417.417 0 01-.59 0l-.588-.59a.417.417 0 010-.589l1.767-1.768-1.767-1.767a.417.417 0 01-.035-.55l.035-.04.589-.589z" fill="#fff"/></svg>',"image/svg+xml").firstChild},volumeSmall:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}},qF=Mm(Mm({},WF),{},{fullscreen:KF,exitFullscreen:zF}),XF=Mm(Mm({},WF),{},{fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.125 3a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375H15.5v3.375c0 .207.168.375.375.375h.75A.375.375 0 0017 7.875v-4.5A.375.375 0 0016.625 3h-4.5zm0 12.5a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-4.5a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375V15.5h-3.375zM3 3.375C3 3.168 3.168 3 3.375 3h4.5c.207 0 .375.168.375.375v.75a.375.375 0 01-.375.375H4.5v3.375a.375.375 0 01-.375.375h-.75A.375.375 0 013 7.875v-4.5zM7.875 15.5H4.5v-3.375a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375v4.5c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-.75a.375.375 0 00-.375-.375z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 8.333h-4.167c-.92 0-1.666-.746-1.666-1.666V2.5h1.666v4.167H17.5v1.666zM2.5 6.667v1.666h4.167c.92 0 1.666-.746 1.666-1.666V2.5H6.667v4.167H2.5zM2.5 13.333h4.167V17.5h1.666v-4.167c0-.92-.746-1.666-1.666-1.666H2.5v1.666zM13.333 17.5v-4.167H17.5v-1.666h-4.167c-.92 0-1.666.746-1.666 1.666V17.5h1.666z" fill="#fff"/></svg>',"image/svg+xml").firstChild}}),YF="pc"===PC.device?qF:XF,$F=Mm(Mm({},Ax.TEXT),{},{DEFINITION_FALLBACK_TOAST:"The current network is unstable, it is recommended to switch to ",DEFINITION_SWITCHING:"Switching to",ERROR_REFRESH:"Refresh",UNMUTE:"Click to unmute",MANIFEST:"Video parsing error",NETWORK:"Network error",NETWORK_TIMEOUT:"Network timeout",NETWORK_FORBIDDEN:"Authentication error",NETWORK_NOTFOUND:"Stream does not exist",DEMUX:"Video parsing error",REMUX:"Video parsing error",MEDIA:"An error occurred, Please try again",MEDIA_ERR_CODEC_NOT_SUPPORTED:"Audio/video codec is not supported",MEDIA_ERR_URL_EMPTY:"The stream address is not specified",DRM:"Permission verification failed",DRM_LICENSE:"Commercial DRM Permission verification failed",OTHER:"Unknown error",RUNTIME:"An error occurred, Please try again",MODULE_LOAD_ERROR:"CDN fetch error",UNKNOWN:"Unknown error"}),ZF=Mm(Mm({},{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:"直播"}),{},{DEFINITION_FALLBACK_TOAST:"当前网络不稳定,建议切换到",DEFINITION_SWITCHING:"正在切换至",ERROR_REFRESH:"刷新",UNMUTE:"点击取消静音",MANIFEST:"视频解析错误",NETWORK:"网络错误",NETWORK_TIMEOUT:"网络超时",NETWORK_FORBIDDEN:"鉴权异常",NETWORK_NOTFOUND:"播放地址不存在",DEMUX:"视频解析错误",REMUX:"视频解析错误",MEDIA:"播放异常,请重试",MEDIA_ERR_CODEC_NOT_SUPPORTED:"不支持的音频/视频格式",MEDIA_ERR_URL_EMPTY:"当前播放地址为空",DRM:"权限验证失败",DRM_LICENSE:"商业 DRM LICENSE 鉴权失败",OTHER:"其他报错",RUNTIME:"播放异常,请重试",MODULE_LOAD_ERROR:"插件模块加载异常",UNKNOWN:"未知报错"}),JF=function(){function e(t){var n;if(Ry(this,e),Uy(this,"_lang",void 0),this._lang=(null==t?void 0:t.lang)||TC()||"en","zh"===this._lang&&(this._lang="zh-cn"),null!=t&&null!==(n=t.i18n)&&void 0!==n&&n.texts){var r,i,o=Vw(r=iL(null==t||null===(i=t.i18n)||void 0===i?void 0:i.texts)).call(r,(function(e){var t=XM(e,2);return{LANG:t[0],TEXT:t[1]}}));e.extend(o)}}return Fy(e,[{key:"setLang",value:function(e){this._lang=e}},{key:"getLang",value:function(){return this._lang}},{key:"normalize",value:function(e){return e?"string"==typeof e?e:e[this._lang]:""}},{key:"getText",value:function(e){var t,n,r;if(e){var i=null==Dx?void 0:Dx.lang;return null!==(t=null==i||null===(n=i[this._lang])||void 0===n?void 0:n[e])&&void 0!==t?t:null==i||null===(r=i.en)||void 0===r?void 0:r[e]}}}],[{key:"langKeys",get:function(){return Dx.langKeys}},{key:"isLangValid",value:function(e){var t;return hk(t=Dx.langKeys).call(t,e)||"zh"===e}},{key:"extend",value:function(e,t){Dx.extend(e,t)}}]),e}(),QF=["autoplay"],eU=Mm(Mm({},QA.POSITIONS),BF),tU={id:"veplayer",width:"100%",height:"100%",decodeType:r.Hardware,fullscreen:{useCssFullscreen:!1}},nU=function(e){var t,n,r,i=e.autoplay,o=tm(e,QF);(o.poster&&(o.poster=function(e){var t,n=""+e,r=qM.exec(n);if(!r)return n;var i,o="",a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==i&&(o+=n.substring(a,i)),a=i+1,o+=t}return a!==i?o+n.substring(a,i):o}(o.poster)),o.icons=Mm(Mm({},YF),o.icons?(t=o.icons,n={},iL(null!=t?t:{}).forEach((function(e){var t=XM(e,2),r=t[0],i=t[1];"string"==typeof i?console.warn("icons.".concat(r," has been removed")):n[r]=i})),n):{}),o.autoplay=Boolean(i),i&&"boolean"!=typeof i)&&(o.autoplayMuted=null==i?void 0:i.muted,o.videoAttributes=Mm(Mm({},null!==(r=o.videoAttributes)&&void 0!==r?r:{}),{},{muted:null==i?void 0:i.muted}),o.autoplayPlugin=i);return delete o.i18n,o},rU=function(){function e(){var t,n,r,i,o,a,s,l,u,c,h,f,d=this,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ry(this,e),Uy(this,"_player",void 0),Uy(this,"_sourceManager",void 0),Uy(this,"_preparePlugins",void 0),Uy(this,"_previousPrepareResult",void 0),Uy(this,"_i18nManager",void 0),Uy(this,"_events",{}),Uy(this,"_errorCallback",void 0),this._sourceManager=p.sourceManager,this._preparePlugins=p.preparePlugins,this._previousPrepareResult=p.prepareResult,this._i18nManager=null!==(t=p.i18nManager)&&void 0!==t?t:new JF({i18n:p.i18n});var v=nU(Mm(Mm({},p),null===(n=this._previousPrepareResult)||void 0===n?void 0:n.options)),g=Nm(r=[]).call(r,Iy(null!==(i=null===(o=this._previousPrepareResult)||void 0===o?void 0:o.plugins)&&void 0!==i?i:[]),Iy(null!==(a=p.plugins)&&void 0!==a?a:jF)),y=[],m=[];g.forEach((function(e){NF.isTopRightPlugin(e,p)?y.push(e):m.push(e)})),this._player=new Xx(Mm(Mm(Mm({},tU),v),{},{definition:Mm({list:null!==(s=null===(l=this._sourceManager.source)||void 0===l?void 0:l.definitions)&&void 0!==s?s:[],defaultDefinition:null===(u=this._sourceManager.definition)||void 0===u?void 0:u.definition},null!==(c=p.definition)&&void 0!==c?c:{}),url:null===(h=this._sourceManager.definition)||void 0===h?void 0:h.url,sources:Mm(Mm({},null!==(f=p.sources)&&void 0!==f?f:{}),{},{sourceManager:this._sourceManager}),topRightBar:{plugins:y},plugins:m,i18nManager:this._i18nManager,veplayer:this})),this.emit(KM.PLAYER_CREATE_FINISH,this._player),this._errorCallback=function(e){return d._handleFallback(e)},this._player.on(UC,this._errorCallback)}var t,n,r,i,o,a;return Fy(e,[{key:"readyState",get:function(){return this._player.readyState}},{key:"buffered",get:function(){return this._player.buffered}},{key:"played",get:function(){return this._player.played}},{key:"cumulateTime",get:function(){return this._player.cumulateTime}},{key:"isFocused",get:function(){return this._player.isActive}},{key:"isFullscreen",get:function(){return this._player.isFullscreen}},{key:"isCssFullscreen",get:function(){return this._player.isCssfullScreen}},{key:"networkState",get:function(){return this._player.networkState}},{key:"paused",get:function(){return this._player.paused}},{key:"ended",get:function(){return this._player.ended}},{key:"state",get:function(){return this._player.state}},{key:"url",get:function(){return this._player.config.url}},{key:"source",get:function(){var e;return null===(e=this._sourceManager.source)||void 0===e?void 0:e.name}},{key:"playerVersion",get:function(){return"2.4.2-rc.4"}},{key:"definition",get:function(){var e;return null===(e=this._sourceManager.definition)||void 0===e?void 0:e.definition}},{key:"crossOrigin",get:function(){return this._player.crossOrigin},set:function(e){this._player.crossOrigin=e}},{key:"volume",get:function(){return this._player.volume},set:function(e){this._player.volume=e}},{key:"muted",get:function(){return this._player.muted},set:function(e){this._player.muted=e}},{key:"lang",get:function(){return this._i18nManager.getLang()},set:function(e){if(this._player.lang!==e)if(JF.isLangValid(e))this._i18nManager.setLang(e),this._player.lang=e;else{var t,n,r,i,o=JF.langKeys.join(","),a={en:Nm(t="Sorry, we couldn't set the language to ".concat(e," because it's not currently supported. The list of supported languages includes ")).call(t,o,"."),"zh-cn":Nm(n="不支持当前设置的语言".concat(e,", 支持的语言有")).call(n,o,", 请重新设置")};console.error((null===(r=this._i18nManager)||void 0===r||null===(i=r.normalize)||void 0===i?void 0:i.call(r,a))||a.en)}}},{key:"_src",get:function(){return this._player.currentSrc}},{key:"switch",value:(a=sy(oy().mark((function e(t,n){var r,i,o,a;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t||1!==this._sourceManager.sources.length||1!==(null===(r=this._sourceManager.sources)||void 0===r||null===(r=r[0].definitions)||void 0===r?void 0:r.length)){e.next=5;break}return this._sourceManager.updateSources(t),e.next=4,this._switchUrl(t,{seamless:null==n?void 0:n.seamless});case 4:return e.abrupt("return",this._sourceManager.definition);case 5:if(o=Xm(i=this._sourceManager).call(i,t,n)){e.next=8;break}throw new Error("string"==typeof t?"No definition found for url: ".concat(t):Nm(a="No definition found for source: ".concat(t.source,", definition: ")).call(a,t.definition));case 8:return e.next=10,this._switch(o);case 10:return e.abrupt("return",o);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"updatePlaylist",value:function(e,t){var n=this._sourceManager.updateSources(e,t);return this._switch(n.definition)}},{key:"once",value:function(e,t){var n,r=this._transformEvent(e,t),i=r.xgCallback,o=r.xgEventName;i&&(null!==(n=this._events)&&void 0!==n&&n[e]||(this._events[e]=new Mw),this._events[e].set(t,i),this._player.once(o,i))}},{key:"off",value:function(e,t){var n,r=null===(n=this._events[e])||void 0===n?void 0:n.get(t),i=this._transformEvent(e).xgEventName;r&&(this._player.off(i,r),this._events[e].delete(t))}},{key:"emit",value:function(e,t){var n=this._transformEvent(e).xgEventName;this._player.emit(n,t)}},{key:"offAll",value:function(){this._events={},this._player.offAll()}},{key:"on",value:function(e,t){var n,r=this._transformEvent(e,t),i=r.xgCallback,o=r.xgEventName;i&&(null!==(n=this._events)&&void 0!==n&&n[e]||(this._events[e]=new Mw),this._events[e].set(t,i),this._player.on(o,i))}},{key:"play",value:function(){return this._player.play()}},{key:"pause",value:function(){return this._player.pause()}},{key:"requestPIP",value:function(){var e;null===(e=this._player.plugins.pip)||void 0===e||e.requestPIP()}},{key:"exitPIP",value:function(){var e;null===(e=this._player.plugins.pip)||void 0===e||e.exitPIP()}},{key:"retry",value:function(){return this._player.retry()}},{key:"focus",value:function(e){return this._player.focus(e)}},{key:"blur",value:function(e){return this._player.blur(e)}},{key:"canPlayType",value:function(e){return this._player.canPlayType(e)}},{key:"requestFullscreen",value:function(e){return this._player.getFullscreen(e)}},{key:"exitFullscreen",value:function(e){return this._player.exitFullscreen(e)}},{key:"requestCssFullscreen",value:function(e){return this._player.getCssFullscreen(e)}},{key:"exitCssFullscreen",value:function(){return this._player.exitCssFullscreen()}},{key:"registerPlugin",value:function(e,t){return this._player.registerPlugin(e,t)}},{key:"unRegisterPlugin",value:function(e){return this._player.unRegisterPlugin(e)}},{key:"showIcon",value:function(e){var t=this,n=this._player.getPlugin("more");e.forEach((function(e){var r=t._player.getPlugin(e);r&&null!=r&&r.root&&(r.config.position===eU.ROOT_TOP_RIGHT_COLLAPSE?null==n||n.showChild(r):r.show())}))}},{key:"hideIcon",value:function(e){var t=this,n=this._player.getPlugin("more");e.forEach((function(e){var r=t._player.getPlugin(e);r&&null!=r&&r.root&&(r.config.position===eU.ROOT_TOP_RIGHT_COLLAPSE?null==n||n.hideChild(r):r.hide())}))}},{key:"destroy",value:function(){this._player.off(UC,this._errorCallback),this._player.destroy()}},{key:"prepare",value:(o=sy(oy().mark((function e(t){var n,r,i,o,a,s,l,u,c=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(n=this._preparePlugins)||void 0===n?void 0:n.call(this,t);case 2:return a=e.sent,s=this._diffPlugins(null!==(r=null===(i=this._previousPrepareResult)||void 0===i?void 0:i.plugins)&&void 0!==r?r:[],null!==(o=null==a?void 0:a.plugins)&&void 0!==o?o:[]),l=s.removedPlugins,u=s.addedPlugins,null==l||l.forEach((function(e){c._player.unRegisterPlugin(e)})),this._previousPrepareResult=a,null!=a&&a.options&&this._player.setConfig(a.options),e.abrupt("return",{plugins:Vw(u).call(u,(function(e){return c._player.registerPlugin(e)})),options:null==a?void 0:a.options});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_handleFallback",value:(i=sy(oy().mark((function e(t){var n,r,i=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._player.addClass(ix),n=this._sourceManager.url,r=this._sourceManager.fallback()){e.next=7;break}return this._player.removeClass(ix),this.emit(KM.FALLBACK_ERROR,yP(t,this._i18nManager)),e.abrupt("return");case 7:this._player.once("canplay",(function(){i._sourceManager.resetFallback()})),this.emit(KM.FALLBACK,{from:{url:n},to:{url:r}}),this._switchUrl(r);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_transformEvent",value:function(e,t){var n=this;return e===UC?{xgCallback:t?function(e){t(yP(e,n._i18nManager))}:void 0,xgEventName:e}:function(e,t){var n=WM[e];if(n)return{xgEventName:n.event,xgCallback:t?n.shouldCallback?function(){for(var e,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];null!==(e=n.shouldCallback)&&void 0!==e&&e.call.apply(e,Nm(r=[n]).call(r,o))&&(null==t||t.apply(void 0,o))}:t:void 0};return{xgEventName:e,xgCallback:t}}(e,t)}},{key:"_switch",value:(r=sy(oy().mark((function e(t){var n,r,i,o,a,s,l,u;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=UL(this._sourceManager.definition),e.next=3,this.prepare(t.url);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(s=e.t0,l=s.plugins,null!=(u=s.options)&&u.url&&(t.url=null==u?void 0:u.url),this._sourceManager.switch(t),null===(n=this._player)||void 0===n||null===(n=n.plugins)||void 0===n||n.sources.renderItemList(),null===(r=this._player)||void 0===r||null===(r=r.plugins)||void 0===r||r.definition.renderItemList(),(null==t||null===(i=t.source)||void 0===i?void 0:i.name)!==(null==a||null===(o=a.source)||void 0===o?void 0:o.name)&&this.emit(KM.SOURCE_CHANGE),null==l||!l.length){e.next=21;break}return this.emit(KM.DEFINITION_CHANGE),e.next=18,this._callBeforePlayerInitForUrl(l,t.url);case 18:this.emit(KM.AFTER_DEFINITION_CHANGE),e.next=22;break;case 21:this._player.changeDefinition(t,a);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_switchUrl",value:(n=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.prepare(t);case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0={};case 5:if(i=e.t0,o=i.plugins,a=i.options,s=null!==(r=null==a?void 0:a.url)&&void 0!==r?r:t,this._sourceManager.url=s,null==o||!o.length){e.next=14;break}this._callBeforePlayerInitForUrl(o,s),e.next=21;break;case 14:if(l=this._player.switchURL(s,{seamless:null==n?void 0:n.seamless}),u=this._player.currentTime,!l||!l.then){e.next=20;break}return e.abrupt("return",l);case 20:return e.abrupt("return",new Hw((function(e){var t=c._player.paused&&!c._player.isError,n=function(){c._player.currentTime=u,t&&c._player.once(HC,(function(){c._player.pause()})),e()};PC.os.isAndroid?c.once(NC,(function(){n()})):c.once(HC,(function(){n()})),c._player.play()})));case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"_diffPlugins",value:function(e,t){var n=Vw(e).call(e,(function(e){return e.pluginName})),r=Vw(t).call(t,(function(e){return e.pluginName}));return{removedPlugins:Gw(n).call(n,(function(e){return!hk(r).call(r,e)})),addedPlugins:Gw(t).call(t,(function(e){return!hk(n).call(n,e.pluginName)}))}}},{key:"_callBeforePlayerInitForUrl",value:function(e,t){var n=this;return new Hw((function(r){n._player.config.url=t,null==e||e.forEach((function(e){e.beforePlayerInit()})),n._player.on(KM.CANPLAY,(function(){r(void 0)}))}))}}],[{key:"create",value:(t=sy(oy().mark((function t(){var n,r,i,o,a,s,l,u,c=arguments;return oy().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=c.length>0&&void 0!==c[0]?c[0]:{},a=c.length>1?c[1]:void 0,s=new _L({sources:mL.normalize({url:o.url,fallbackUrls:o.fallbackUrls,sources:o.playlist}),url:o.url,defaultSource:o.defaultSource,defaultDefinition:o.defaultDefinition,maxFallbackRound:o.maxFallbackRound}),t.next=5,null==o||null===(n=o.preparePlugins)||void 0===n?void 0:n.call(o,null!==(r=s.url)&&void 0!==r?r:"");case 5:return null!=(l=t.sent)&&null!==(i=l.options)&&void 0!==i&&i.url&&(s.url=null==l||null===(u=l.options)||void 0===u?void 0:u.url),o.url=s.url,t.abrupt("return",new(null!=a?a:e)(Mm(Mm({},o),{},{prepareResult:l,sourceManager:s})));case 9:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})}]),e}();function iU(e){var t=gL(e).call(e,(function(e,t){return e+t.byteLength}),0),n=new Uint8Array(t),r=0;return e.forEach((function(e){n.set(e,r),r+=e.byteLength})),n}function oU(e,t){return wT(null==e?void 0:e.toFixed(t||4))}var aU,sU,lU=DE,uU=function(e,t,n){return function(e,t,n){t in e?lU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},cU="ScriptData",hU="Sequence_Header",fU="RawData",dU=[5500,11e3,22e3,44e3],pU="aac",vU="pcma",gU="pcmu",yU="avc",mU="bytevc1",_U=function(){function e(t){var n=this;Ry(this,e),uU(this,"type",0),uU(this,"tagSize",0),uU(this,"timestamp",0),uU(this,"duration",0),uU(this,"header",null),uU(this,"body",null),uU(this,"bodyView",null),uU(this,"tailsize",null),dk(t).forEach((function(e){n[e]=t[e]}))}return Fy(e,[{key:"streamType",get:function(){switch(this.type){case 18:return"scriptData";case 9:return"video";case 8:return"audio"}}},{key:"packetType",get:function(){var e;return null==(e=this.bodyView)?void 0:e.packetType}},{key:"frameType",get:function(){var e;return null==(e=this.bodyView)?void 0:e.frameType},set:function(e){this.bodyView.frameType=e}},{key:"dts",get:function(){return this.timestamp}},{key:"pts",get:function(){var e;return((null==(e=this.bodyView)?void 0:e.cts)||0)+this.timestamp}},{key:"ptsTime",get:function(){return this.pts?oU(this.pts/1e3):0}},{key:"dtsTime",get:function(){return this.dts?oU(this.dts/1e3):0}},{key:"sampleView",get:function(){var e,t,n;if("Sequence_Header"!==(null==(e=this.bodyView)?void 0:e.packetType)&&18!==this.type)return{dts:this.timestamp,pts:((null==(t=this.bodyView)?void 0:t.cts)||0)+this.timestamp,data:this._getSampleData(),units:null==(n=this.bodyView)?void 0:n.units}}},{key:"size",get:function(){var e,t;return null==(t=null==(e=this.sampleView)?void 0:e.data)?void 0:t.length}},{key:"data",get:function(){return this._getSampleData()}},{key:"nalTypes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.type}))}},{key:"nalSizes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.unit.length}))}},{key:"keyframe",get:function(){return"I"===this.frameType}},{key:"isSample",get:function(){return"scriptData"!==this.streamType&&"Sequence_Header"!==this.packetType}},{key:"isVideo",get:function(){return this.isSample&&"video"===this.streamType}},{key:"isAudio",get:function(){return this.isSample&&"audio"===this.streamType}},{key:"isSqHeader",get:function(){return"Sequence_Header"===this.packetType}},{key:"timescale",get:function(){return 1e3}},{key:"isHevc",get:function(){var e;return"bytevc1"===(null==(e=this.bodyView)?void 0:e.codecType)}},{key:"_getSampleData",value:function(){var e,t;if("audio"===this.streamType)return this.bodyView.sample;var n=(null==(t=this.bodyView)?void 0:Gw(e=t.units).call(e,(function(e){return!e.isSei})))||[],r=gL(n).call(n,(function(e,t){return e+(t.unit.byteLength+4)}),0),i=new Uint8Array(r),o=0;return n.forEach((function(e){i.set([0,0,0,1],o),o+=4,i.set(e.unit,o),o+=e.unit.byteLength})),i}}]),e}(),bU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"decode",value:function(t){for(var n=[],r=t,i=0,o=t.length;i<o;)if(r[i]<128)n.push(String.fromCharCode(r[i])),++i;else{if(r[i]<192);else if(r[i]<224){if(e._checkContinuation(r,i,1)){var a=(31&r[i])<<6|63&r[i+1];if(a>=128){n.push(String.fromCharCode(65535&a)),i+=2;continue}}}else if(r[i]<240){if(e._checkContinuation(r,i,2)){var s=(15&r[i])<<12|(63&r[i+1])<<6|63&r[i+2];if(s>=2048&&55296!=(63488&s)){n.push(String.fromCharCode(65535&s)),i+=3;continue}}}else if(r[i]<248&&e._checkContinuation(r,i,3)){var l=(7&r[i])<<18|(63&r[i+1])<<12|(63&r[i+2])<<6|63&r[i+3];if(l>65536&&l<1114112){l-=65536,n.push(String.fromCharCode(l>>>10|55296)),n.push(String.fromCharCode(1023&l|56320)),i+=4;continue}}n.push(String.fromCharCode(65533)),++i}return n.join("")}},{key:"_checkContinuation",value:function(e,t,n){var r=e;if(t+n<r.length){for(;n--;)if(128!=(192&r[++t]))return!1;return!0}return!1}}]),e}(),wU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parse",value:function(t){if(!(t.length<3)){var n={},r=e._parseValue(new DataView(t.buffer,t.byteOffset,t.byteLength));try{var i=e._parseValue(new DataView(t.buffer,t.byteOffset+r.size,t.byteLength-r.size));n[r.data]=i.data}catch(o){}return n}}},{key:"_parseValue",value:function(t){var n,r=t.byteLength,i=1,o=!1;switch(t.getUint8(0)){case 0:n=t.getFloat64(1),i+=8;break;case 1:n=!!t.getUint8(1),i+=1;break;case 2:var a=e._parseString(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i));n=a.data,i+=a.size;break;case 3:n={};var s=0;for(9==(16777215&t.getUint32(r-4))&&(s=3);i<r-4;){var l=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-s)),u=l.size,c=l.data;if(l.isEnd)break;n[c.name]=c.value,i+=u}if(i<=r-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 8:n={},i+=4;var h=0;for(9==(16777215&t.getUint32(r-4))&&(h=3);i<r-8;){var f=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-h)),d=f.size,p=f.data;if(f.isEnd)break;n[p.name]=p.value,i+=d}if(i<=r-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 9:n=void 0,i=1,o=!0;break;case 10:n=[];var v=t.getUint32(1);i+=4;for(var g=0;g<v;g++){var y=e._parseValue(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i)),m=y.data,_=y.size;n.push(m),i+=_}break;case 11:var b=t.getFloat64(i)+6e4*t.getInt16(i+8);n=new Date(b),i+=10;break;case 12:var w=t.getUint32(1);i+=4,n="",w>0&&(n=bU.decode(new Uint8Array(t.buffer,t.byteOffset+i,w))),i+=w;break;default:i=r}return{data:n,size:i,isEnd:o}}},{key:"_parseString",value:function(e){var t=e.getUint16(0),n="";return t>0&&(n=bU.decode(new Uint8Array(e.buffer,e.byteOffset+2,t))),{data:n,size:2+t}}},{key:"_parseObject",value:function(t){if(!(t.byteLength<3)){var n=e._parseString(t),r=e._parseValue(new DataView(t.buffer,t.byteOffset+n.size,t.byteLength-n.size));return{data:{name:n.data,value:r.data},size:n.size+r.size,isEnd:r.isEnd}}}}]),e}(),kU="undefined"!=typeof window,EU=kU&&navigator.userAgent.toLocaleLowerCase(),SU=kU&&hk(EU).call(EU,"firefox"),TU=kU&&hk(EU).call(EU,"android"),CU=DE,AU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseADTS",value:function(t,n){for(var r=t.length,i=0;i+2<r&&(255!==t[i]||240!=(246&t[i+1]));)i++;if(!(i>=r)){var o=i,a=[],s=(60&t[i+2])>>>2,l=e.FREQ[s];if(!l)throw new Error("Invalid sampling index: ".concat(s));for(var u,c,h=1+((192&t[i+2])>>>6),f=(1&t[i+2])<<2|(192&t[i+3])>>>6,d=e._getConfig(s,f,h),p=d.config,v=d.codec,g=0,y=e.getFrameDuration(l);i+7<r;)if(255===t[i]&&240==(246&t[i+1])){if(r-i<(c=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5))break;u=2*(1&~t[i+1]);var m=oU(n+g*y);a.push({pts:m,dts:m,ptsTime:oU(m/9e4),dtsTime:oU(m/9e4),data:t.subarray(i+7+u,i+c)}),g++,i+=c}else i++;return{skip:o,remaining:i>=r?void 0:t.subarray(i),frames:a,nbFrame:a.length,samplingFrequencyIndex:s,sampleRate:l,objectType:h,channelCount:f,codec:v,config:p,originCodec:"mp4a.40.".concat(h)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var n=t[0]>>>3,r=(7&t[0])<<1|t[1]>>>7,i=(120&t[1])>>>3,o=e.FREQ[r];if(!o)throw new Error("Invalid sampling index: ".concat(r));var a=e._getConfig(r,i,n);return{samplingFrequencyIndex:r,sampleRate:o,objectType:n,channelCount:i,config:a.config,codec:a.codec,originCodec:"mp4a.40.".concat(n)}}}},{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"_getConfig",value:function(e,t,n){var r,i,o=[];return SU?e>=6?(r=5,i=e-3):(r=2,i=e):TU?(r=2,i=e):(r=n,i=e,e>=6?i=e-3:1===t&&(r=2,i=e)),o[0]=r<<3,o[0]|=(14&e)>>1,o[1]=(1&e)<<7,o[1]|=t<<3,5===r&&(o[1]|=(14&i)>>1,o[2]=(1&i)<<7,o[2]|=8,o[3]=0),{config:o,codec:"mp4a.40.".concat(r)}}},{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),e}(),xU=AU;sU=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],function(e,t,n){t in e?CU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(xU,"symbol"!==Tc(aU="FREQ")?aU+"":aU,sU);var PU=DE,IU=function(e,t,n){return function(e,t,n){t in e?PU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},RU=function(){function e(t){if(Ry(this,e),IU(this,"_bytesAvailable"),IU(this,"_bitsAvailable",0),IU(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return Fy(e,[{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw new Error("No bytes available");var n=new Uint8Array(4);n.set(this._data.subarray(e,e+t)),this._word=new DataView(n.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{e-=this._bitsAvailable;var t=Math.floor(e/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw new Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),n=this._word>>>32-t;return this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable?n<<t|this.readBits(t):n}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if(0!=(this._word&2147483648>>>e))return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,n=8,r=0;r<e;r++)0!==n&&(n=(t+this.readEG()+256)%256),t=0===n?t:n}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}},{key:"firstMbInSlice",value:function(){return this.readUByte(),this.readUEG()}}]),e}();function DU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}var OU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseAnnexB",value:function(e){for(var t=e.length,n=2,r=0;null!==e[n]&&1!==e[n];)n++;if((r=++n+2)>=t)return[];for(var i=[];r<t;)switch(e[r]){case 0:if(0!==e[r-1]){r+=2;break}if(0!==e[r-2]){r++;break}n!==r-2&&i.push(e.subarray(n,r-2));do{r++}while(1!==e[r]&&r<t);r=(n=r+1)+2;break;case 1:if(0!==e[r-1]||0!==e[r-2]){r+=3;break}n!==r-2&&i.push(e.subarray(n,r-2)),r=(n=r+1)+2;break;default:r+=3}return n<t&&i.push(e.subarray(n)),i}},{key:"parseNalu",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var n,r=e.length,i=[],o=0;o+t<r;)if(n=DU(e,o),3===t&&(n>>>=8),o+=t,n){if(o+n>r)break;i.push(e.subarray(o,o+n)),o+=n}return i}}},{key:"parseNaluType",value:function(e,t){return null==e?void 0:Vw(e).call(e,(function(e){var n=t?e[0]>>>1&63:31&e[0],r=t&&(39===n||40===n),i={type:n,unit:e,isSei:r=r||!t&&6===n};switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!t&&5!==n||t&&5===n)break;i.frameType="I"}return t||1!==n||(i.frameType=function(e){var t=new RU(e).readSliceType();return 2===t||4===t||7===t||9===t?"I":0===t||3===t||5===t||8===t?"P":1===t||6===t?"B":void 0}(e)),!t||0!==n&&1!==n||(i.frameType="P"),!t&&n<=5&&(i.firstMbInSlice=new RU(e).firstMbInSlice()),t&&n<=21&&(i.firstMbInSlice=128==(128&e[2])),i}))}},{key:"parseSEI",value:function(e){for(var t=e.length,n=1,r=0,i=0,o="";255===e[n];)r+=255,n++;for(r+=e[n++];255===e[n];)i+=255,n++;if(i+=e[n++],5===r&&t>n+16)for(var a=0;a<16;a++)o+=e[n].toString(16),n++;return{payload:e.subarray(n),type:r,size:i,uuid:o}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,n=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(!n.length)return e;var i=t-n.length,o=new Uint8Array(i),a=0;for(r=0;r<i;a++,r++)a===n[0]&&(a++,n.shift()),o[r]=e[a];return o}}]),e}(),MU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var n,r,i=1+(3&t[4]),o=[],a=[],s=6,l=31&t[5],u=0;u<l;u++)if(r=t[s]<<8|t[s+1],s+=2,r){var c=t.subarray(s,s+r);s+=r,o.push(c),n||(n=e.parseSPS(OU.removeEPB(c)))}var h,f=t[s];s++;for(var d=0;d<f;d++)h=t[s]<<8|t[s+1],s+=2,h&&(a.push(t.subarray(s,s+h)),s+=h);return{sps:n,spsArr:o,ppsArr:a,nalUnitSize:i}}}},{key:"parseSPS",value:function(e){var t=new RU(e);t.readUByte();var n=t.readUByte(),r=t.readUByte(),i=t.readUByte();t.skipUEG();var o=420;if(100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||144===n){var a=t.readUEG();if(a<=3&&(o=[0,420,422,444][a]),3===a&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var s=3!==a?8:12,l=0;l<s;l++)t.readBool()&&(l<6?t.skipScalingList(16):t.skipScalingList(64))}t.skipUEG();var u=t.readUEG();if(0===u)t.readUEG();else if(1===u){t.skipBits(1),t.skipUEG(),t.skipUEG();for(var c=t.readUEG(),h=0;h<c;h++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var f=t.readUEG(),d=t.readUEG(),p=t.readBits(1);0===p&&t.skipBits(1),t.skipBits(1);var v,g,y,m,_,b=0,w=0,k=0,E=0;if(t.readBool()&&(b=t.readUEG(),w=t.readUEG(),k=t.readUEG(),E=t.readUEG()),t.readBool()){if(t.readBool())switch(t.readUByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUByte()<<8|t.readUByte(),t.readUByte()<<8|t.readUByte()]}if(t.readBool()&&t.readBool(),t.readBool()&&(t.readBits(4),t.readBool()&&t.readBits(24)),t.readBool()&&(t.readUEG(),t.readUEG()),t.readBool()){var S=t.readBits(32),T=t.readBits(32);g=t.readBool(),_=(y=T)/(m=2*S)}}for(var C=e.subarray(1,4),A="avc1.",x=0;x<3;x++){var P=C[x].toString(16);P.length<2&&(P="0".concat(P)),A+=P}return{codec:A,profileIdc:n,profileCompatibility:r,levelIdc:i,chromaFormat:o,width:Math.ceil(16*(f+1)-2*(b+w)),height:(2-p)*(d+1)*16-(p?2:4)*(k+E),sarRatio:v,fpsNum:y,fpsDen:m,fps:_,fixedFrame:g}}}]),e}(),LU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(t){if(!(t.length<23)){for(var n,r,i,o,a=1+(3&t[21]),s=[],l=[],u=[],c=23,h=t[22],f=0;f<h;f++){r=63&t[c],i=t[c+1]<<8|t[c+2],c+=3;for(var d=0;d<i;d++)if(o=t[c]<<8|t[c+1],c+=2,o){switch(r){case 32:u.push(t.subarray(c,c+o));break;case 33:var p=t.subarray(c,c+o);n||(n=e.parseSPS(OU.removeEPB(p))),s.push(p);break;case 34:l.push(t.subarray(c,c+o))}c+=o}}return{sps:n,spsArr:s,ppsArr:l,vpsArr:u,nalUnitSize:a}}}},{key:"parseSPS",value:function(e){var t=new RU(e);t.readUByte(),t.readUByte(),t.readBits(4);var n=t.readBits(3);t.readBits(1);var r=this._parseProfileTierLevel(t,n);t.readUEG();var i=t.readUEG(),o=420;i<=3&&(o=[0,420,422,444][i]);var a=0;3===i&&(a=t.readBits(1));var s,l,u,c,h=t.readUEG(),f=t.readUEG(),d=t.readBits(1);(1===d&&(s=t.readUEG(),l=t.readUEG(),u=t.readUEG(),c=t.readUEG()),1===d)&&(h-=(1!==i&&2!==i||0!==a?1:2)*(l+s),f-=(1===i&&0===a?2:1)*(c+u));return{codec:"hev1.1.6.L93.B0",width:h,height:f,chromaFormat:o,bitDepthLumaMinus8:t.readUEG(),bitDepthChromaMinus8:t.readUEG(),generalProfileSpace:r.generalProfileSpace,generalTierFlag:r.generalTierFlag,generalProfileIdc:r.generalProfileIdc,generalLevelIdc:r.generalLevelIdc}}},{key:"_parseProfileTierLevel",value:function(e,t){var n,r,i;(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)&&(n=e.readBits(2),r=e.readBits(1),i=e.readBits(5)),e.readBits(32),e.readBits(1),e.readBits(1),e.readBits(1),e.readBits(1),e.readBits(16),e.readBits(16),e.readBits(12);for(var o=e.readUByte(),a=[],s=[],l=0;l<t;l++)a[l]=e.readBits(1),s[l]=e.readBits(1);t>0&&e.readBits(2*(8-t));for(var u=0;u<t;u++)0!==a[u]&&(e.readBits(2),e.readBits(1),e.readBits(5),e.readBits(16),e.readBits(16),e.readBits(4),e.readBits(16),e.readBits(16),e.readBits(12)),0!==s[u]&&e.readBits(8);return{generalProfileSpace:n,generalTierFlag:r,generalProfileIdc:i,generalLevelIdc:o}}}]),e}();function FU(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Gw(t=e.items).call(t,(function(e){return e.isSample&&e.isVideo}))[0],o=Gw(n=e.items).call(n,(function(e){return e.isSample&&e.isAudio}))[0],a=Math.min((null==o?void 0:o.dtsTime)||0,(null==i?void 0:i.dtsTime)||0);return a-=r,e.items.forEach((function(e){e.time=oU(e.dtsTime-a)})),e}function UU(e){var t,n=Gw(t=e.items).call(t,(function(e){return e.isVideo})),r=[],i=-1,o={},a={};return n.forEach((function(e,t){(e.keyframe||t===n.length-1)&&(i=-1===i?e.time:i,r.push({time:e.time,value:oU(e.time-i)}),i=e.time);var s=Math.ceil(e.time+1e-5);o[s]?o[s]++:o[s]=1,a[s]?a[s]+=8*e.size:a[s]=8*e.size})),{bitRates:BU(a),gops:Gw(r).call(r,(function(e){return e.value})),frameRates:BU(o)}}function BU(e){var t=dk(e);return Vw(t).call(t,(function(t){return{time:Number(t),value:e[t]}}))}function NU(e){var t,n,r,i,o=gL(t=pk(n=pC(r=Gw(i=pk(e).call(e)).call(i,(function(e){return e.isSample}))).call(r,(function(e,t){return e.time>t.time?1:-1}))).call(n,0,3)).call(t,(function(e,t){return e+t.size}),0);return o>1e3?oU(o/1e3)+"KB":o+"B"}function VU(e){return gL(e).call(e,(function(e,t){return e+t.size}),0)/gL(e).call(e,(function(e,t){return e+t.duration}),0)*8e3}function HU(e){if(null==e?void 0:e.profileIdc)switch(e.profileIdc){case 66:return"66(Baseline)";case 77:return"77(Main)";case 100:return"100(High)"}}var GU=DE,jU=function(e,t,n){return function(e,t,n){t in e?GU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},zU=function(){function e(){Ry(this,e),jU(this,"_nalUnitSize",0),jU(this,"_lastAudio",null),jU(this,"_lastVideo",null),jU(this,"_videoStartDts",-1),jU(this,"_audioStartDts",-1)}return Fy(e,[{key:"parse",value:function(e){for(var t=e.byteLength,n=e.subarray(0,13),r=13,i=Mm(Mm({header:n},this._parseHeader(n)),{},{items:[]});r+11<t;){var o=e.subarray(r,r+11),a=o[1]<<16|o[2]<<8|o[3],s=r+11+a;if(s>t)break;var l=e.subarray(r+11,s),u=new _U(Mm({tagSize:11+a+4,header:o,body:l,tailsize:e.subarray(s,s+4)},this._parseTag(o,l)));u.isAudio&&(this._lastAudio&&(this._lastAudio.duration=u.dts-this._lastAudio.dts),this._lastAudio=u),u.isVideo&&(this._lastVideo&&(this._lastVideo.duration=u.dts-this._lastVideo.dts),this._lastVideo=u),i.items.push(u),r=s+4}var c=FU(i);return c.rates=UU(c),this._addMetadataToFirstKeyFrame(c),c}},{key:"getSnapshoot",value:function(t,n){var r,i,o,a,s=Gw(r=t.items).call(r,(function(e){return 8===e.type}))[0],l=Gw(i=t.items).call(i,(function(e){return 9===e.type}))[0],u=s&&s.bodyView||s,c=l&&l.bodyView||l,h=Gw(o=t.items).call(o,(function(e){return e.isVideo})).length,f=this._getNbFrame(t,"I"),d=this._getNbFrame(t,"P"),p=this._getNbFrame(t,"B"),v=0;if(null==n?void 0:n.gopCacheBuffer){var g,y=(new e).parse(n.gopCacheBuffer),m=Gw(g=y.items).call(g,(function(e){return e.isVideo})),_=null==(a=m[m.length-1])?void 0:a.time;_&&(v=_-n.take/1e3)}return{rates:t.rates,audio:u?AE({},u,this._getExt(t,"audio")):null,video:c?AE({},c,this._getExt(t,"video"),{topThreeFrameSize:NU(t.items),gopCache:oU(v),profile:HU(c.sps),iFrames:f,pFrames:d,bFrames:p,iPercent:oU(f/h*100),pPercent:oU(d/h*100),bPercent:oU(p/h*100)}):null}}},{key:"_addMetadataToFirstKeyFrame",value:function(e){var t,n,r,i=Gw(t=e.items).call(t,(function(e){return 9===e.type}))[0];if(i&&(null==(r=i.bodyView)?void 0:r.sps)){var o=Gw(n=e.items).call(n,(function(e){return e.isVideo&&e.keyframe}))[0];o&&(o.bodyView.sps=i.bodyView.sps,o.bodyView.vpsArr=i.bodyView.vpsArr,o.bodyView.spsArr=i.bodyView.spsArr,o.bodyView.ppsArr=i.bodyView.ppsArr)}}},{key:"_getExt",value:function(e,t){var n,r,i,o=Gw(n=e.items).call(n,(function(e){return e.streamType===t&&e.isSample})),a=Gw(r=e.items).call(r,(function(e){var n;return e.streamType===t&&(null==(n=e.bodyView)?void 0:n.packetType)===hU}))[0];if(!o.length)return 0;var s=o[0],l=o[o.length-1],u=0;return"audio"===t&&(u=a&&1024/(null==(i=a.bodyView)?void 0:i.sampleRate)*1e3),"video"===t&&(u=s.duration),{avgBits:VU(o),startDts:o[0].dts,duration:(l.timestamp-s.timestamp)/1e3,refDuration:u,frameLength:o.length}}},{key:"_getNbFrame",value:function(e,t){var n;return Gw(n=e.items).call(n,(function(e){return e.isVideo&&e.frameType===t})).length}},{key:"_parseHeader",value:function(e){return{hasAudio:!!(e[4]>>2&1),hasVideo:!!(1&e[4])}}},{key:"_parseTag",value:function(e,t){var n,r=31&e[0],i=(e[7]<<24>>>0)+(e[4]<<16)+(e[5]<<8)+e[6];switch(r){case 18:n=AE({packetType:cU},wU.parse(t));break;case 9:n=this._parseVideo(t,i);break;case 8:n=this._parseAudio(t,i)}return{type:r,timestamp:i,bodyView:n}}},{key:"_parseAudio",value:function(e){if(e.length){var t=(240&e[0])>>>4;if(10===t||7===t||8===t){if(10!==t){var n=(12&e[0])>>2,r=(2&e[0])>>1,i=1&e[0];return Mm({format:t,sampleRate:dU[n],sampleSize:r?2:1,channelCount:i+1},this._parseG711(e))}return this._parseAac(e,t)}console.warn("Unsupported sound format: ".concat(t))}}},{key:"_parseG711",value:function(e,t){return{codecType:7===t?vU:gU,sampleRate:8e3,sample:e.subarray(1),packetType:fU}}},{key:"_parseAac",value:function(e,t){if(0===e[1]){var n=e.subarray(2);return Mm(Mm({},xU.parseAudioSpecificConfig(n)),{},{format:t,timescale:1e3,codecType:pU,packetType:hU,sequenceData:[n],frameType:"A"})}if(1===e[1])return{sample:e.subarray(2),format:t,codecType:pU,packetType:fU,frameType:"A"}}},{key:"_parseVideo",value:function(e,t){if(!(e.length<6)){var n=(240&e[0])>>>4,r=15&e[0];if(7===r||12===r){var i=12===r,o=e[1],a=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===o){var s=e.subarray(5),l=i?LU.parseHEVCDecoderConfigurationRecord(s):MU.parseAVCDecoderConfigurationRecord(s);return this._nalUnitSize=l.nalUnitSize,Mm({codecId:r,codecType:i?mU:yU,packetType:hU,timescale:1e3,sequenceData:[s]},l)}if(1===o){var u=OU.parseNalu(e.subarray(5),this._nalUnitSize);if(!u||!u.length)return;var c={dts:t,cts:a,units:u=OU.parseNaluType(u,i)};return 1===n&&(c.keyframe=!0),u.forEach((function(e){var t=e.type,n=e.unit,r=e.frameType;switch(t){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!i&&5!==t||i&&5===t)break;c.keyframe=!0,c.frameType="I";break;case 6:case 39:case 40:if(!i&&6!==t||i&&6===t)break;c.seis?c.seis.push(OU.parseSEI(OU.removeEPB(n))):c.seis=[OU.parseSEI(OU.removeEPB(n))];break;case 32:if(!i)break;c.vpsArr?c.vpsArr.push(n):c.vpsArr=[n];break;case 7:case 33:if(!i&&7!==t||i&&7===t)break;c.spsArr?c.spsArr.push(n):c.spsArr=[n];var o=OU.removeEPB(n);c.sps=i?LU.parseSPS(o):MU.parseSPS(o);break;case 8:case 34:if(!i&&8!==t||i&&8===t)break;c.ppsArr?c.ppsArr.push(n):c.ppsArr=[n];break;case 1:case 0:c.frameType=r}})),Mm({codecId:r,codecType:i?mU:yU,packetType:fU},c)}}else console.warn("Unsupported codecId: ".concat(r))}}}]),e}(),KU="FLV",WU="MPEG-TS",qU="MP4";function XU(e,t){var n;return Vw(n=[e[t],e[t+1],e[t+2],e[t+3]]).call(n,(function(e){return String.fromCharCode(e)})).join("")}var YU=DE,$U=function(e,t,n){return function(e,t,n){t in e?YU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},ZU=Fy((function e(t){var n=t.startIndictor,r=t.packetType,i=t.pid,o=t.afc;Ry(this,e),$U(this,"startIndictor",0),$U(this,"pid",0),$U(this,"afc",0),$U(this,"eleInfo",null),$U(this,"packetType",""),this.startIndictor=n,this.packetType=r,this.pid=i,this.afc=o})),JU=function(){function e(t){var n=t.header,r=t.headerObject,i=t.body,o=t.eleInfo,a=t.bodyView,s=t.headerView;Ry(this,e),$U(this,"header",null),$U(this,"headerView",null),$U(this,"body",null),$U(this,"bodyView",null),$U(this,"eleInfo",null),$U(this,"duration",0),this.header=n,this.headerView=s||new ZU(r),this.eleInfo=o,this.body=i,this.bodyView=a}return Fy(e,[{key:"type",get:function(){var e;return null==(e=this.headerView)?void 0:e.packetType}},{key:"streamType",get:function(){return this.eleInfo?this.eleInfo[this.headerView.pid]:""}},{key:"packetType",get:function(){var e;return null==(e=this.headerView)?void 0:e.packetType}},{key:"frameType",get:function(){var e;return null==(e=this.bodyView)?void 0:e.frameType}},{key:"pts",get:function(){var e;return null==(e=this.bodyView)?void 0:e.pts}},{key:"ptsTime",get:function(){return this.pts?oU(this.pts/9e4):0}},{key:"dtsTime",get:function(){return this.dts?oU(this.dts/9e4):0}},{key:"dts",get:function(){var e;return null==(e=this.bodyView)?void 0:e.dts}},{key:"keyframe",get:function(){return"I"===this.frameType}},{key:"nalTypes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.type}))}},{key:"nalSizes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.unit.length}))}},{key:"isSample",get:function(){return"PES"===this.packetType}},{key:"timescale",get:function(){return 9e4}},{key:"isHevc",get:function(){var e,t;return"bytevc1"===(null==(t=null==(e=this.eleInfo)?void 0:e.video)?void 0:t.codecType)}},{key:"sampleView",get:function(){var e;if("PES"===this.type)return{dts:this.dts,pts:this.pts,units:null==(e=this.bodyView)?void 0:e.units,data:this._getSampleData()}}},{key:"data",get:function(){return this._getSampleData()}},{key:"size",get:function(){var e,t;return null==(t=null==(e=this.sampleView)?void 0:e.data)?void 0:t.length}},{key:"isVideo",get:function(){return this.isSample&&"video"===this.streamType}},{key:"isAudio",get:function(){return this.isSample&&"audio"===this.streamType}},{key:"_getSampleData",value:function(){var e,t;if("audio"===this.streamType)return this.bodyView.data;var n=(null==(t=this.bodyView)?void 0:Gw(e=t.units).call(e,(function(e){return!e.isSei&&!e.isDivision})))||[],r=gL(n).call(n,(function(e,t){return e+(t.unit.byteLength+4)}),0),i=new Uint8Array(r),o=0;return n.forEach((function(e){i.set([0,0,0,1],o),o+=4,i.set(e.unit,o),o+=e.unit.byteLength})),i}}]),e}(),QU=function(){function e(){Ry(this,e)}return Fy(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=function(e){for(var t=Math.min(1e3,e.byteLength-564),n=0;n<t;n++)if(71===e[n]&&71===e[n+188]&&71===e[n+376])return n;return-1}(e);if(-1===n)throw new Error("invalid ts file");var r=e.byteLength;r-=(r-n)%188;for(var i,o=[],a=[],s=[],l=0,u=n;u<r;){var c=e.subarray(u,u+188),h=c.subarray(0,4),f=this._parseTsHeader(c.subarray(0,4));u+=188;var d=void 0,p=void 0,v=4,g="";switch((null==f?void 0:f.afc)>1&&(v+=1+Math.min(c[v],183)),f.pid){case 0:v+=1+c[v],d=c.subarray(v),g="PAT",p={pmtId:l=this._parsePAT(d)};break;default:if(f.pid===l){v+=1+c[v],d=c.subarray(v),p=i=this._parsePMT(d),g="PMT";break}if(!i||!i[f.pid])continue;d=c.subarray(v),g="PES"}if(f.packetType=g,"PES"===g){var y="video"===i[f.pid]?a:s;f.startIndictor&&y.length&&(o.push(new JU(Mm(Mm({},this._concatPesChunk(y)),{},{eleInfo:i}))),y="video"===i[f.pid]?a=[]:s=[]),y.push({header:h,headerObject:f,body:d})}else o.push(new JU({header:h,headerObject:f,body:d,eleInfo:i,bodyView:p}))}a.length&&(o.push(new JU(Mm(Mm({},this._concatPesChunk(a)),{},{eleInfo:i}))),a=[]),s.length&&(o.push(new JU(Mm(Mm({},this._concatPesChunk(s)),{},{eleInfo:i}))),s=[]);var m=FU({items:this._parsePES(o)},t);return m.rates=UU(m),m}},{key:"getSnapshoot",value:function(e){var t,n,r,i=e.items,o=e.rates,a=Gw(i).call(i,(function(e){return"video"===e.streamType})),s=Gw(i).call(i,(function(e){return"audio"===e.streamType})),l=Xm(i).call(i,(function(e){return"PMT"===e.type})),u=a[0],c=s[0],h=a.length,f=this._getNbFrame(a,"I"),d=this._getNbFrame(a,"P"),p=this._getNbFrame(a,"B"),v={rates:o,video:u?AE({},null==u?void 0:u.bodyView,{codecType:u.eleInfo.video.codecType,frameLength:h,topThreeFrameSize:NU(i),avgBits:VU(a),profile:HU(null==(t=null==u?void 0:u.bodyView)?void 0:t.sps),iFrames:f,pFrames:d,bFrames:p,iPercent:oU(f/h*100),pPercent:oU(d/h*100),bPercent:oU(p/h*100),timescale:9e4},this._getDuration(a,"video")):null,audio:c?AE({},null==c?void 0:c.bodyView,{codecType:c.eleInfo.audio.codecType,frameLength:s.length,timescale:9e4,avgBits:VU(s)},this._getDuration(s,"audio")):null};return l&&(null==(n=l.bodyView)?void 0:n.noSupported)&&(v.noSupported=null==(r=l.bodyView)?void 0:r.noSupported),v}},{key:"getRates",value:function(e){return UU(e)}},{key:"_getDuration",value:function(e,t){var n,r=e[0],i=e[e.length-1],o=0;return"audio"===t&&(o=1024/(null==(n=r.bodyView)?void 0:n.sampleRate)*1e3),"video"===t&&(o=r.duration),{duration:(i.pts-r.pts)/9e4,refDuration:o}}},{key:"_getNbKeyFrame",value:function(e){return Gw(e).call(e,(function(e){var t;return null==(t=e.bodyView)?void 0:t.keyframe})).length}},{key:"_getNbFrame",value:function(e,t){return Gw(e).call(e,(function(e){return e.frameType===t})).length}},{key:"_parseTsHeader",value:function(e){if(71===e[0]){var t={};return t.startIndictor=(64&e[1])>>6,t.pid=((31&e[1])<<8)+e[2],t.afc=(48&e[3])>>4,t}return null}},{key:"_parsePAT",value:function(e){return(31&e[10])<<8|e[11]}},{key:"_parsePMT",value:function(e){var t=0,n=3+((15&e[1])<<8|e[2])-4;e[3],e[4],t=t+11+((15&e[10])<<8|e[11])+1;for(var r,i={video:null,audio:null,noSupported:0};t<n;){r=e[t];var o=(31&e[t+1])<<8|e[t+2];switch(r){case 27:case 36:i.video={elePid:o,streamType:r,codecType:27===r?"avc":"bytevc1"},i[o]="video";break;case 15:i.audio={elePid:o,streamType:r,codecType:"aac"},i[o]="audio";break;default:i.noSupported=r,console.warn("unsupported streamType,",r)}t+=5+((15&e[t+3])<<8|e[t+4])}return i}},{key:"_concatPesChunk",value:function(e){var t=gL(e).call(e,(function(e,t){return e+t.body.byteLength}),0),n=new Uint8Array(t),r=0;return e.forEach((function(e){var t=e.body;n.set(t,r),r+=t.byteLength})),Mm(Mm({},e[0]),{},{body:n,packetType:"PES"})}},{key:"_parsePES",value:function(e){var t=this,n=[];return e.forEach((function(e,r){if(e.isSample){var i=e,o=t._parsePESInternal(i.body)||{},a=o.data,s=o.pts,l=o.dts;if(a){if(e.isVideo&&(i.bodyView=t._parseVideoFrame(a,s,l,"bytevc1"===i.eleInfo.video.codecType),t._lastVideo&&(t._lastVideo.duration=1e3*(e.dtsTime-t._lastVideo.dtsTime)),t._lastVideo=i),e.isAudio){var u=xU.parseADTS(a,s),c=u.frames;return delete u.frames,void(null==c||c.forEach((function(e){var r=new JU(AE({},i,{bodyView:Mm(Mm(Mm({},u),e),{},{frameType:"A"})}));n.push(r),t._lastAudio&&(t._lastAudio.duration=1e3*(r.dtsTime-t._lastAudio.dtsTime)),t._lastAudio=r})))}n.push(e)}}else n.push(e)})),n}},{key:"_parsePESInternal",value:function(e){var t=e[8];if(!(0===t||e.length<t+9)&&1===(e[0]<<16|e[1]<<8|e[2])){var n=(e[4]<<8)+e[5];if(!(n&&n>e.length-6)){var r,i,o=e[7];return 192&o&&(r=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&o?r-(i=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(r=i):i=r),i=i||r,{data:e.subarray(9+t),pts:r,dts:i}}}}},{key:"_parseVideoFrame",value:function(e,t,n,r){var i=OU.parseAnnexB(e);if(i.length){var o={units:i=OU.parseNaluType(i,r),pts:t,dts:n};return i.forEach((function(e){var t=e.unit,n=e.type,i=e.frameType;switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!r&&5!==n||r&&5===n)break;o.keyframe=!0,o.frameType="I";break;case 6:case 39:case 40:if(!r&&6!==n||r&&6===n)break;o.seis?o.seis.push(OU.parseSEI(OU.removeEPB(t))):o.seis=[OU.parseSEI(OU.removeEPB(t))];break;case 32:if(!r)break;o.vpsArr?o.vpsArr.push(t):o.vpsArr=[t];break;case 7:case 33:if(!r&&7!==n||r&&7===n)break;o.spsArr?o.spsArr.push(t):o.spsArr=[t];var a=OU.removeEPB(t);o.sps=r?LU.parseSPS(a):MU.parseSPS(a);break;case 8:case 34:if(!r&&8!==n||r&&8===n)break;o.ppsArr?o.ppsArr.push(t):o.ppsArr=[t];break;case 9:case 35:break;case 0:case 1:o.frameType=i}})),o}}}]),e}(),eB=Wc("Array").entries,tB=ir,nB=tt,rB=ce,iB=eB,oB=Array.prototype,aB={DOMTokenList:!0,NodeList:!0},sB=o((function(e){var t=e.entries;return e===oB||rB(oB,e)&&t===oB.entries||nB(aB,tB(e))?iB:t})),lB=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ry(this,e),this._offset=n,this._buffer=t,this._length=t.byteLength}return Fy(e,[{key:"offset",get:function(){return this._offset},set:function(e){this._offset=e}},{key:"forward",value:function(e){this._offset+=e}},{key:"subarray",value:function(e){return e?this._buffer.subarray(this._offset,this._offset+e):this._buffer.subarray(this._offset,e)}},{key:"slice",value:function(e){for(var t=this._offset,n=this._buffer,r=[],i=0;i<e;i++)r.push(n[t+i]);return new Uint8Array(r)}},{key:"readU8",value:function(){return this._buffer[this._offset]}},{key:"readU16",value:function(){var e=this._offset,t=this._buffer;return t[e]<<8|t[e+1]}},{key:"readU24",value:function(){var e=this._offset,t=this._buffer;return t[e]<<16|t[e+1]<<8|t[e+12]}},{key:"readU32",value:function(){var e=this._offset,t=this._buffer;return t[e]*(1<<24)+65536*t[e+1]+256*t[e+2]+t[e+3]}},{key:"read32",value:function(){var e=this._offset,t=this._buffer;return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}}]),e}(),uB=DE,cB=function(e,t,n){return function(e,t,n){t in e?uB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},hB=function(){function e(t,n,r,i,o,a,s,l,u,c){Ry(this,e),cB(this,"dts",0),cB(this,"pts",0),cB(this,"units",null),cB(this,"timescale",0),cB(this,"offset",0),cB(this,"duration",0),cB(this,"data",null),cB(this,"size",0),cB(this,"streamType",""),cB(this,"_frameType",""),cB(this,"isHevc",!1),this.dts=t,this.pts=n,this.units=r,this.timescale=i,this.offset=o,this.data=a,this.size=s,this.duration=l,this.streamType=u,this.isHevc=c}return Fy(e,[{key:"isSample",get:function(){return!0}},{key:"dtsTime",get:function(){return this.dts/this.timescale}},{key:"ptsTime",get:function(){return this.pts/this.timescale}},{key:"frameType",get:function(){var e,t;return"audio"===this.streamType?"A":this._frameType||(null==(t=this.units)?void 0:Gw(e=Vw(t).call(t,(function(e){return e.frameType}))).call(e,Boolean)[0])},set:function(e){this._frameType=e}},{key:"nalTypes",get:function(){var e;return null==(e=this.units)?void 0:Vw(e).call(e,(function(e){return e.type}))}},{key:"nalSizes",get:function(){var e;return null==(e=this.units)?void 0:Vw(e).call(e,(function(e){return e.unit.length}))}},{key:"keyframe",get:function(){return"I"===this.frameType}},{key:"isVideo",get:function(){return"video"===this.streamType}},{key:"isAudio",get:function(){return"audio"===this.streamType}}]),e}(),fB={ftyp:"file type and compatibility",free:"free box",moov:"container for all metadata",mvhd:"movie header,overall declarations",trak:"container for an individual track or stream",tkhd:"track header,overall information about the track",tref:"track reference container",mdia:"container for the media information in a track",mdhd:"media header,oervall information about the media",hdlr:"declares the media type",minf:"media information container",vmhd:"video media header",smhd:"sound media header",dinf:"data information box",stbl:"sample table box",stsd:"sample descriptions(codec types, etc)",stts:"decoding time to sample",ctts:"compostion time to sample",cslg:"compostion to decode timeline mapping",stsc:"sample to chunk",stsz:"sample size",stco:"chunk offset",stss:"sync sample table",sdtp:"independent abd disposable samples",sbgp:"sample to group",mvex:"movid extends box",moof:"movie fragment",mfhd:"movie fragment header",traf:"track fragment",tfhd:"track fragment header",trun:"track fragment run",tfdt:"track fragment decode time",mdat:"media data",meta:"metadata",avc1:"h264 codec info box",hev1:"hevc codec info box"};function dB(e,t){return{isLeading:(12&e[t])>>2,dependsOn:3&e[t],isDenpendedOn:(192&e[t+1])>>6,hasRedundancy:(48&e[t+1])>>4,padding:(14&e[t+1])>>1,nonSync:1&e[t+1],degradationPriority:e[t+2]<<8|e[t+3]}}function pB(e,t){var n;return Vw(n=[e[t],e[t+1],e[t+2],e[t+3]]).call(n,(function(e){return String.fromCharCode(e)})).join("")}function vB(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0;r<e.byteLength;){var i,o=e[r]*(1<<24)+65536*e[r+1]+256*e[r+2]+e[r+3];if(1===o){var a=pB(e,r+4);if("mdat"===a){var s,l=new DataView(e.buffer),u=l.getUint32(r+8)*Math.pow(2,32)+l.getUint32(r+12);console.log(Nm(s="".concat(a,": largesize=")).call(s,u)),o=u}}if(o){var c=e.subarray(r,r+o),h=pB(c,4);n.push({size:o,length:c.byteLength,start:r+t,type:h,sizetypeRepresent:pk(i=c.subarray(0,8)).call(i),body:c.subarray(8),typeDes:fB[h]||""}),r+=o}else r+=4}return n}function gB(e,t,n){if(e)for(var r=0;r<e.length;r++){var i=e[r];if(i.type===t){if(!n)return i;if(n(i))return i}if(i.bodyView instanceof Array){var o=gB(i.bodyView,t,n);if(o){if(!n)return o;if(n(o))return o}}}}function yB(e,t){return gB(e,"trak",(function(e){var n=gB(e.bodyView,"hdlr");return n&&n.bodyView.handlerType===t}))}function mB(e,t,n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w,k=yB(e,t);if(!k)return null;var E=gB(k.bodyView,"stbl"),S=gB(k.bodyView,"mdhd")||{},T=(null==(c=null==(u=Gw(r=E.bodyView).call(r,(function(e){return"stts"===e.type}))[0])?void 0:u.bodyView)?void 0:sB(c))||[];null==(f=null==(h=Gw(i=E.bodyView).call(i,(function(e){return"stss"===e.type}))[0])?void 0:h.bodyView)||sB(f);var C=(null==(p=null==(d=Gw(o=E.bodyView).call(o,(function(e){return"ctts"===e.type}))[0])?void 0:d.bodyView)?void 0:sB(p))||[],A=(null==(g=null==(v=Gw(a=E.bodyView).call(a,(function(e){return"stsc"===e.type}))[0])?void 0:v.bodyView)?void 0:sB(g))||[],x=(null==(m=null==(y=Gw(s=E.bodyView).call(s,(function(e){return"stsz"===e.type}))[0])?void 0:y.bodyView)?void 0:sB(m))||[],P=(null==(b=null==(_=Gw(l=E.bodyView).call(l,(function(e){return"stco"===e.type}))[0])?void 0:_.bodyView)?void 0:sB(b))||[],I=!!gB(E.bodyView,"hvcC"),R="vide"===t;if(!A.length||!P.length||!x.length)return[];for(var D,O=S.bodyView,M=O.timescale,L=void 0===M?1:M,F=O.duration,U=x.length,B=P.length,N=1,V=0,H=[],G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0,i=0,o=0,a=0,s=0,l=[];t=Vw(t).call(t,(function(e){return Mm({},e)})),n=Vw(n).call(n,(function(e){return Mm({},e)}));for(;o<e;){var u=t[r],c=n[i];u.sampleCount&&(a+=u.sampleDelta),u.sampleCount--,u.sampleCount||r++,c&&(s=c.sampleOffset,c.sampleCount--,c.sampleCount||i++),l.push({dts:a,pts:a+s}),o++}return l}(U,T,C);N<=B;){var j=A[V];(null==j?void 0:j.firstChunk)!==N?(H.push(AE({},D,{firstChunk:N,offset:P[N-1]})),N++):(H.push(Mm(Mm({},j),{},{offset:P[N-1]})),D=j,N++,V++)}var z=Vw(x).call(x,(function(e,t){var r=H[0],i=r.offset;r.offset+=e,r.samplesPreChunk--,r.samplesPreChunk||H.shift();var o=G[t],a=n.subarray(i,i+e);if(R){var s=OU.parseNalu(a);return new hB(o.dts,o.pts,OU.parseNaluType(s,I),L,i,a,e,0,"video",I)}return new hB(o.dts,o.pts,null,L,i,a,e,0,"audio")}));gL(z).call(z,(function(e,t){return e?(e.duration=(t.dts-e.dts)/L*1e3,t):t}),null);var K=null==(w=gB(null==k?void 0:k.bodyView,"vide"===t?I?"hvcC":"avcC":"mp4a"))?void 0:w.bodyView;return Mm(Mm(Mm({samples:z,iFrames:Gw(z).call(z,(function(e){return"I"===e.frameType})).length,pFrames:Gw(z).call(z,(function(e){return"P"===e.frameType})).length,bFrames:Gw(z).call(z,(function(e){return"B"===e.frameType})).length},S.bodyView),{},{frameLength:U,duration:F/L,timescale:L},K),null==K?void 0:K.ests)}function _B(e,t){var n=function(e){var t,n,r,i,o=yB(e,"vide"),a=yB(e,"soun"),s=gB(null==o?void 0:o.bodyView,"tkhd"),l=gB(null==a?void 0:a.bodyView,"tkhd"),u=gB(null==o?void 0:o.bodyView,"mdhd"),c=gB(null==a?void 0:a.bodyView,"mdhd"),h=gB(null==o?void 0:o.bodyView,"avcC")||gB(null==o?void 0:o.bodyView,"hvcC"),f=gB(null==a?void 0:a.bodyView,"mp4a"),d=a?Mm(Mm(Mm({type:"audio",trackId:null==(n=l.bodyView)?void 0:n.trackId},c.bodyView),null==f?void 0:f.bodyView),null==(r=null==f?void 0:f.bodyView)?void 0:r.ests):null,p=o?Mm(Mm({type:"video",trackId:null==(i=s.bodyView)?void 0:i.trackId},null==u?void 0:u.bodyView),null==h?void 0:h.bodyView):null;return Uy(t={},(null==d?void 0:d.trackId)||0,d),Uy(t,(null==p?void 0:p.trackId)||0,p),t}(e),r=wI(e).call(e,(function(e){return"moof"===e.type}));if(-1===r)return!1;n.lastVdts=-1,n.lastAdts=-1;for(var i=r;i<e.length&&"moof"===e[i].type;i+=2){var o=e[i];e[i+1].bodyView=bB(o,t,n)}return!0}function bB(e,t,n){var r,i,o=Gw(r=e.bodyView).call(r,(function(e){return"traf"===e.type})),a=Gw(i=Vw(o).call(o,(function(e){var t=gB(e.bodyView,"tfhd"),r=gB(e.bodyView,"tfdt"),i=gB(e.bodyView,"trun");if(t&&i){var o=t.bodyView.trackId;return Mm({trackId:o,baseDataOffset:t.bodyView.baseDataOffset,defaultSampleDuration:t.bodyView.defaultSampleDuration,defaultSampleSize:t.bodyView.defaultSampleSize,baseMediaDecodeTime:r.bodyView.baseMediaDecodeTime,dataOffset:i.bodyView.dataOffset,samples:i.bodyView.samples,sampleCount:i.bodyView.sampleCount},n[o])}}))).call(i,Boolean);return Vw(a).call(a,(function(e){var n,r,i,o=e.baseDataOffset,a=e.defaultSampleDuration,s=void 0===a?0:a,l=e.defaultSampleSize,u=void 0===l?0:l,c=e.dataOffset,h=e.baseMediaDecodeTime,f=void 0===h?0:h,d=e.samples,p=e.sps,v=e.timescale,g=e.type,y=o+c,m=0;return e.samples=Vw(d).call(d,(function(e){var n=t.subarray(y,y+e.size);m+=e.duration||s;var r=f+m;if("video"===g){var i="hev1.1.6.L93.B0"===(null==p?void 0:p.codec),o=OU.parseNalu(n);return y+=e.size,new hB(r,r+(e.ctOffset||0),OU.parseNaluType(o,i),v,y,n,e.size||u,(e.duration||s)/v*1e3,"video",i)}return y+=e.size,new hB(r,r+(e.ctOffset||0),null,v,y,n,e.size||u,(e.duration||s)/v*1e3,"audio")})),e.frameLength=e.samples.length,e.duration=m/v,e.iFrames=Gw(n=e.samples).call(n,(function(e){return"I"===e.frameType})).length,e.pFrames=Gw(r=e.samples).call(r,(function(e){return"P"===e.frameType})).length,e.bFrames=Gw(i=e.samples).call(i,(function(e){return"B"===e.frameType})).length,e}))}var wB=Math.pow(2,32);var kB=an,EB=L,SB=tt,TB=ce,CB=function(){var e=kB(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},AB=RegExp.prototype,xB=ce,PB=function(e){var t=e.flags;return void 0!==t||"flags"in AB||SB(e,"flags")||!TB(AB,e)?t:EB(CB,e)},IB=RegExp.prototype,RB=o((function(e){return e===IB||xB(IB,e)?PB(e):e.flags})),DB=function(){var e=[];e[3]="ES_Descriptor",e[4]="DecoderConfigDescriptor",e[5]="DecoderSpecificInfo",e[6]="SLConfigDescriptor",this.getDescriptorName=function(t){return e[t]};var t=this,n={};return this.parseOneDescriptor=function(t){var r,i,o=0,a=t.readU8();for(t.forward(1),i=t.readU8(),t.forward(1);128&i;)o=(127&i)<<7,i=t.readU8(),t.forward(1);return o+=127&i,(r=e[a]?new n[e[a]](o):new n.Descriptor(o)).parse(t),r},n.Descriptor=function(e,t){this.tag=e,this.size=t,this.descs=[]},n.Descriptor.prototype.parse=function(e){this.data=pk(e).call(e,this.size),e.forward(this.size)},n.Descriptor.prototype.findDescriptor=function(e){for(var t=0;t<this.descs.length;t++)if(this.descs[t].tag===e)return this.descs[t];return null},n.Descriptor.prototype.parseRemainingDescriptors=function(e){for(var n=e.offset;e.offset<n+this.size;){var r=t.parseOneDescriptor(e);this.descs.push(r)}},n.ES_Descriptor=function(e){n.Descriptor.call(this,3,e)},n.ES_Descriptor.prototype=new n.Descriptor,n.ES_Descriptor.prototype.parse=function(e){if(this.ES_ID=e.readU16(),e.forward(2),this.flags=e.readU8(),e.forward(1),this.size-=3,128&RB(this)?(this.dependsOn_ES_ID=e.readU16(),e.forward(2),this.size-=2):this.dependsOn_ES_ID=0,64&RB(this)){var t,n=e.readU8();e.forward(1),this.URL=Vw(t=kS(pk(e).call(e,n))).call(t,(function(e){return String.fromCharCode(e)})),e.forward(n),this.size-=n+1}else this.URL="";32&RB(this)?(this.OCR_ES_ID=e.readU16(),e.forward(2),this.size-=2):this.OCR_ES_ID=0,this.parseRemainingDescriptors(e)},n.ES_Descriptor.prototype.getOTI=function(e){var t=this.findDescriptor(4);return t?t.oti:0},n.ES_Descriptor.prototype.getAudioConfig=function(e){var t=this.findDescriptor(4);if(!t)return null;var n=t.findDescriptor(5);if(n&&n.data){var r=(248&n.data[0])>>3;return 31===r&&n.data.length>=2&&(r=32+((7&n.data[0])<<3)+((224&n.data[1])>>5)),r}return null},n.DecoderConfigDescriptor=function(e){n.Descriptor.call(this,4,e)},n.DecoderConfigDescriptor.prototype=new n.Descriptor,n.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readU8(),e.forward(1),this.streamType=e.readU8(),e.forward(1),this.bufferSize=e.readU24(),e.forward(3),this.maxBitrate=e.readU32(),e.forward(4),this.avgBitrate=e.readU32(),e.forward(4),this.size-=13,this.parseRemainingDescriptors(e)},n.DecoderSpecificInfo=function(e){n.Descriptor.call(this,5,e)},n.DecoderSpecificInfo.prototype=new n.Descriptor,n.SLConfigDescriptor=function(e){n.Descriptor.call(this,6,e)},n.SLConfigDescriptor.prototype=new n.Descriptor,this};function OB(e){var t,n,r,i=Xm(t=e.descs).call(t,(function(e){return 4===e.tag}));i&&(n=Xm(r=i.descs).call(r,(function(e){return 5===e.tag})));var o=AE({},i);return delete o.descs,o.config=(null==n?void 0:n.data.length)?kS(null==n?void 0:n.data):[],o}function MB(e){return Vw(e).call(e,(function(e){return e.toString(16)})).join("")}function LB(e){var t=e.body,n={},r=t[0],i=new lB(t);if(i.forward(4),n.systemId=MB(pk(i).call(i,16)),i.forward(16),r>0){var o=i.readU32();n.kids=[];var a=0;for(i.forward(4);a<o;)n.kids.push(MB(pk(i).call(i,16))),i.forward(16),a++}var s,l=i.readU32();return i.forward(4),n.dataSize=l,n.data=pk(i).call(i,l),n.dataToBase64=btoa((s=n.data,Vw(s).call(s,(function(e){return String.fromCharCode(e)})).join(""))),n}var FB=Math.pow(2,32);var UB=Math.pow(2,32);function BB(e){var t=e.body,n={samples:[]},r=new lB(t);n.version=r.readU8(),r.forward(1),n.flags=pk(r).call(r,3);var i,o,a,s,l=(i=RB(n),o=XM(i,3),a=o[1],{dataOffsetPresent:!!(1&(s=o[2])),firstSampleFlagsPresent:!!(4&s),sampleDurationPresent:!!(1&a),sampleSizePresent:!!((2&a)>>1),sampleFlagsPresent:!!((4&a)>>2),sampleCompositionTimeOffsetPresent:!!((8&a)>>3)}),u=l.dataOffsetPresent,c=l.firstSampleFlagsPresent,h=l.sampleDurationPresent,f=l.sampleSizePresent,d=l.sampleFlagsPresent,p=l.sampleCompositionTimeOffsetPresent;n.trFlags=l,r.forward(3),n.sampleCount=r.readU32(),r.forward(4),u&&(n.dataOffset=r.readU32(),r.forward(4)),c&&(n.firstSampleFlags=dB(t,r.offset),r.forward(4));for(var v=0;v<n.sampleCount;){var g={};h&&(g.duration=r.readU32(),r.forward(4)),f&&(g.size=r.readU32(),r.forward(4)),d&&(g.flags=dB(t,r.offset),r.forward(4)),p&&(g.ctOffset=r.readU32(),r.forward(4)),n.samples.push(g),v++}return n}function NB(e){var t=vB(e instanceof ArrayBuffer?new Uint8Array(e):e,0);if(VB(t),!_B(t,e)){var n,r=gB(t,"mdat");if(r)r.bodyView=Gw(n=[Mm({type:"video"},mB(t,"vide",e)),Mm({type:"audio"},mB(t,"soun",e))]).call(n,(function(e){return!!e.samples}))}return t}function VB(e){var t=0;e.forEach((function(e){switch(e.type){case"ftyp":case"styp":e.bodyView=function(e){var t=e.body,n=e.length,r=new lB(t),i={compatible:[]};i.major=XU(t,0),r.forward(4),i.version=r.readU32(),r.forward(4);for(var o=r.offset;o<n-8;)i.compatible.push(XU(t,o)),o+=4;return i}(e);break;case"moov":case"trak":case"mvex":case"mdia":case"minf":case"dinf":case"moof":case"traf":case"stbl":e.bodyView=vB(e.body,e.start+8),VB(e.bodyView);break;case"stsd":var n=function(e){var t=e.body,n=e.start,r=new lB(t);r.forward(4);var i=r.readU32();return r.forward(4),{entryCount:i,childData:vB(r.subarray(),n+8+8)}}(e),r=n.entryCount,i=n.childData;e.entryCount=r,e.bodyView=i,VB(e.bodyView);break;case"mvhd":e.bodyView=(h=e.body,f=new lB(h),d={},f.forward(4),d.createTime=f.readU32(),f.forward(4),d.modifyTime=f.readU32(),f.forward(4),d.timescale=f.readU32(),f.forward(4),d.duration=f.readU32(),f.forward(4),d.rate=f.readU32(),f.forward(4),f.forward(2),f.forward(70),d.nextTrackId=f.readU32(),d);break;case"tkhd":e.bodyView=function(e){var t=e.body,n=new lB(t,4),r={},i=n.readU8();r.version=i,1===i?n.forward(16):n.forward(8),r.trackId=n.readU32(),n.forward(4),1===i?(r.duration=n.readU32()*UB,n.forward(4),r.duration+=n.readU32()):r.duration=n.readU32();var o=t.byteLength;return o-=8,n.offset=o,r.width=n.readU32()>>16,n.forward(4),r.height=n.readU32()>>16,r}(e);break;case"mehd":e.bodyView=function(e){var t,n=e.body,r=new lB(n);if(r.forward(4),1===n[0]){var i=r.readU32();r.forward(4),t=i*(1<<30)*2+r.readU32()}else t=r.readU32();return{fragDuration:t}}(e);break;case"mdhd":e.bodyView=function(e){var t=e.body,n={},r=new lB(t),i=t[0];return r.forward(4),1===i?(r.forward(16),n.timescale=r.readU32(),r.forward(4),n.duration=r.readU32()*wB,r.forward(4),n.duration+=r.readU32()):(r.forward(8),n.timescale=r.readU32(),r.forward(4),n.duration=r.readU32()),n}(e);break;case"hdlr":e.bodyView=function(e){return{handlerType:XU(e.body,8)}}(e);break;case"trex":e.bodyView=function(e){var t=e.body,n={},r=new lB(t);return r.forward(4),n.trackId=r.readU32(),r.forward(4),n.defaultSdescriptionIndex=r.readU32(),r.forward(4),n.defaultSampleDuration=r.readU32(),r.forward(4),n.defaultSampleSize=r.readU32(),r.forward(4),n.defaultSampleFlags=dB(t,r.offset),n}(e);break;case"trun":e.bodyView=BB(e),t=e.bodyView.samples.length;break;case"tfdt":e.bodyView=function(e){var t=e.body,n=new lB(t),r=0;return n.forward(4),1===t[0]?(r=n.readU32()*FB,n.forward(4),r+=n.readU32()):r=n.readU32(),{baseMediaDecodeTime:r}}(e);break;case"avc1":case"hvc1":case"hev1":e.bodyView=function(e){var t=e.body,n=e.start,r=new lB(t);return r.forward(78),vB(r.subarray(),n+78+8)}(e),VB(e.bodyView);break;case"mp4a":e.bodyView=function(e){var t=e.body,n=pk(t).call(t,28),r=(new DB).parseOneDescriptor(new lB(pk(n).call(n,12),0)),i=(null==r?void 0:r.getAudioConfig)&&r.getAudioConfig();return{channelCount:t[17],samplesize:t[19],sampleRate:t[24]<<8|t[25],objectType:i,codec:"mp4a.40."+i,ests:OB(r)}}(e),e.bodyView&&(e.bodyView.codecType="aac");break;case"avcC":e.bodyView=function(e){var t=e.body,n={spsArr:[],ppsArr:[]},r=new lB(t);n.configVersion=t[0],n.avcProfile=t[1],n.profileComptibility=t[2],n.avcLevel=t[3],r.forward(4),r.forward(1);var i=31&pk(r).call(r,1);r.forward(1);for(var o=0;o<i;o++){var a=r.readU16();r.forward(2),n.spsArr.push(r.subarray(a)),r.forward(a)}var s=pk(r).call(r,1);r.forward(1);for(var l=0;l<s;l++){var u=r.readU16();r.forward(2),n.ppsArr.push(r.subarray(u)),r.forward(u)}return n}(e);var o=e.bodyView;if(o.codecType="avc",!(null==o?void 0:o.sps)){var a=o.spsArr[0],s=OU.removeEPB(a);o.sps=MU.parseSPS(s)}break;case"hvcC":e.bodyView=function(e){var t=e.body;if(!(t.length<23)){t[21];for(var n,r,i,o=[],a=[],s=[],l=23,u=t[22],c=0;c<u;c++){n=63&t[l],r=t[l+1]<<8|t[l+2],l+=3;for(var h=0;h<r;h++)if(i=t[l]<<8|t[l+1],l+=2,i){switch(n){case 32:s.push(t.subarray(l,l+i));break;case 33:o.push(t.subarray(l,l+i));break;case 34:a.push(t.subarray(l,l+i))}l+=i}}return{spsArr:o,ppsArr:a,vpsArr:s}}}(e);var l=e.bodyView;if(l.codecType="bytevc1",!(null==l?void 0:l.sps)){var u=l.spsArr[0],c=OU.removeEPB(u);l.sps=LU.parseSPS(c)}break;case"btrt":e.bodyView=function(e){var t=e.body,n=new lB(t),r=n.readU32();n.forward(4);var i=n.readU32();return n.forward(4),{bufferSizeDB:r,maxBitrate:i,avgBitrate:n.readU32()}}(e);break;case"stts":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=n.readU32(),i=[];n.forward(4);for(var o=0;o<r;o++){var a=n.readU32();n.forward(4);var s=n.readU32();n.forward(4),i.push({sampleCount:a,sampleDelta:s})}return{entries:i,count:i.length}}(e),sB(e.bodyView).length&&(t=sB(e.bodyView)[0].sampleCount);break;case"ctts":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=n.readU32(),i=[];n.forward(4);for(var o=0;o<r;o++){var a=n.readU32();n.forward(4);var s=n.readU32();n.forward(4),i.push({sampleCount:a,sampleOffset:s})}return{entries:i,count:i.length}}(e);break;case"cslg":e.bodyView=function(e){var t,n,r,i,o=e.body,a=new lB(o);return a.forward(4),t=a.read32(),a.forward(4),n=a.read32(),a.forward(4),r=a.read32(),a.forward(4),i=a.read32(),a.forward(4),{compositionToDTSShift:t,leastDecodeToDisplayDelta:n,greatestDecodeToDisplayDelta:r,compositionStartTime:i,compositionEndTime:a.read32()}}(e);break;case"stss":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=[],i=n.readU32();n.forward(4);for(var o=0;o<i;o++){var a=n.readU32();r.push(a),n.forward(4)}return{entries:r,count:r.length}}(e);break;case"stsz":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=[],i=n.readU32();n.forward(4);var o=n.readU32();if(n.forward(4),0===i)for(var a=0;a<o;a++){var s=n.readU32();r.push(s),n.forward(4)}else console.warn("parse stsz, sample size not equal 0");return{entries:r,count:r.length}}(e);break;case"stsc":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=[],i=n.readU32();n.forward(4);for(var o=0;o<i;o++){var a=n.readU32();n.forward(4);var s=n.readU32();n.forward(4);var l=n.readU32();n.forward(4),r.push({firstChunk:a,samplesPreChunk:s,sampleDesIndex:l})}return{entries:r,count:r.length}}(e);break;case"stco":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=n.readU32(),i=[];n.forward(4);for(var o=0;o<r;o++){var a=n.readU32();i.push(a),n.forward(4)}return{entries:i,count:i.length}}(e);break;case"sdtp":e.bodyView=function(e,t){var n=e.body,r=new lB(n);r.forward(4);for(var i,o,a,s,l=[],u=0;u<t;u++){var c=r.readU8();i=(192&c)>>6,o=(48&c)>>4,a=(12&c)>>2,s=3&c,l.push({isLeading:i,dependsOn:o,isDenpendedOn:a,hasRedundancy:s}),r.forward(1)}return{entries:l}}(e,t);break;case"mfhd":e.bodyView=function(e){var t=e.body,n=new lB(t);return n.forward(4),{seqNumber:n.readU32()}}(e);break;case"tfhd":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(1);var r=pk(n).call(n,3),i=r[0]<<16|r[1]<<8|r[2],o={flags:r},a={baseDataOffsetPresent:!!(1&i),sampleDescriptionIndexPresent:!!(2&i),defaultSampleDurationPresent:!!(8&i),defaultSampleSizePresent:!!(16&i),defaultSampleFlagsPresent:!!(32&i),durationIsEmpty:!!(65536&i),defaultBaseIsMoof:!!(131072&i)};if(o.tfFlags=a,n.forward(3),o.trackId=n.readU32(),a.baseDataOffsetPresent){n.forward(4);var s=n.readU32();n.forward(4);var l=n.readU32();o.baseDataOffset=s<<32|l}else o.baseDataOffset=0,console.warn("base data offset not detected in tfhd");return a.sampleDescriptionIndexPresent&&(n.forward(4),o.sampleDescriptionIndex=n.readU32()),a.defaultSampleDurationPresent&&(n.forward(4),o.defaultSampleDuration=n.readU32()),a.defaultSampleSizePresent&&(n.forward(4),o.defaultSampleSize=n.readU32()),a.defaultSampleFlagsPresent&&(n.forward(4),o.defaultSampleFlags=n.readU32()),o}(e);break;case"pssh":e.bodyView=LB(e)}var h,f,d}))}var HB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"parse",value:function(e){return NB(e)}},{key:"parseV2",value:function(e,t){var n,r,i,o,a,s,l=Gw(e).call(e,(function(e){return"mdat"===e.type})),u=[],c=null==(r=null==(n=l[0])?void 0:n.bodyView)?void 0:Gw(r).call(r,(function(e){return"video"===e.type}))[0],h=null==(o=null==(i=l[0])?void 0:i.bodyView)?void 0:Gw(o).call(o,(function(e){return"audio"===e.type}))[0],f=Math.min((null==(a=null==h?void 0:h.samples[0])?void 0:a.dtsTime)||0,(null==(s=null==c?void 0:c.samples[0])?void 0:s.dtsTime)||0);l.forEach((function(e){e.bodyView.forEach((function(e){e.samples.forEach((function(e){e.time=oU(e.dtsTime-f),u.push(e)}))}))}));var d={items:pC(u).call(u,(function(e,t){return e.time>t.time?1:-1}))};return this._addMetadataToFirstKeyFrame(c),d.rates=UU(d),d}},{key:"getSnapshoot",value:function(e){return function(e){var t,n,r,i,o,a,s=Gw(e).call(e,(function(e){return"mdat"===e.type}));if(!s.length){var l=yB(e,"vide"),u=yB(e,"soun"),c=null==(n=gB(null==l?void 0:l.bodyView,"mdhd"))?void 0:n.bodyView,h=(null==(r=gB(null==l?void 0:l.bodyView,"avcC"))?void 0:r.bodyView)||(null==(i=gB(null==l?void 0:l.bodyView,"hvcC"))?void 0:i.bodyView),f=null==(o=gB(null==u?void 0:u.bodyView,"mdhd"))?void 0:o.bodyView,d=null==(a=gB(null==u?void 0:u.bodyView,"mp4a"))?void 0:a.bodyView;try{return{video:Mm(Mm({},c),{},{duration:(null==c?void 0:c.duration)/c.timescale},h),audio:Mm(Mm(Mm({},f),{},{duration:(null==f?void 0:f.duration)/f.timescale},d),d.ests)}}catch(w){}return{}}var p=gL(t=Vw(s).call(s,(function(e){return e.bodyView}))).call(t,(function(e,t){return Nm(e).call(e,t)}),[]),v=gL(p).call(p,(function(e,t){var n,r=t.type,i=t.frameLength,o=t.iFrames,a=t.pFrames,s=t.bFrames,l=t.duration;return e[r]?(e[r].frameLength+=i,e[r].iFrames+=o,e[r].pFrames+=a,e[r].bFrames+=s,e[r].duration+=l,e):(e[r]=AE({},t),e[r].refDuration||(e[r].refDuration=null==(n=t.samples[0])?void 0:n.duration),e)}),{}),g=v.video;if(g){var y=g.frameLength,m=g.iFrames,_=g.pFrames,b=g.bFrames;g.iPercent=oU(m/y*100),g.pPercent=oU(_/y*100),g.bPercent=oU(b/y*100)}return v}(e)}},{key:"_addMetadataToFirstKeyFrame",value:function(e){var t;if(e){var n=Gw(t=e.samples).call(t,(function(e){return e.keyframe}))[0];n&&(n.sps=e.sps,n.vpsArr=e.vpsArr,n.spsArr=e.spsArr,n.ppsArr=e.ppsArr)}}}]),e}(),GB=.2,jB=40,zB=.3,KB=.5,WB=.1,qB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType}));if(t&&n){var r,i,o,a=t.pts-n.pts,s=oU(a/t.timescale);if(a/t.timescale>=GB)return[{description:Nm(r=Nm(i=Nm(o="【音视频首帧gap差距过大】视频首帧pts: ".concat(t.pts,", 音频首帧pts: ")).call(o,n.pts,", delta: ")).call(i,a,"(")).call(r,s,"s)"),tips:"".concat(s>10?"可能造成无法起播问题":"")}]}}}]),e}(),XB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType})),r=!!e[0]&&e[0]instanceof _U;return[this._checkBreak(t,"video"),this._checkBreak(n,"audio"),r&&this._checkConsecutiveFrameBreak(null==e?void 0:Gw(e).call(e,(function(e){return e.isSample})))]}},{key:"_checkBreak",value:function(e,t){var n=e.length;if(n)for(var r=0;r<n-1;r++){var i,o,a,s;if(Math.abs(e[r].dtsTime-e[r+1].dtsTime)>KB)return{description:Nm(i=Nm(o=Nm(a=Nm(s="【".concat(t,"时间戳发生跳变】,当前帧dts: ")).call(s,e[r].dts,", time:")).call(a,e[r].time,", 后一帧dts: ")).call(o,e[r+1].dts,", time:")).call(i,e[r+1].time)}}}},{key:"_checkConsecutiveFrameBreak",value:function(e){var t=e.length;if(t)for(var n=0;n<t-1;n++)if(Math.abs(e[n].dtsTime-e[n+1].dtsTime)>WB){var r,i,o,a,s,l=e[n],u=e[n+1];return{description:Nm(r=Nm(i=Nm(o=Nm(a=Nm(s="【前后帧dts差距过大】,当前帧(".concat(l.streamType,")dts: ")).call(s,l.dts,", time:")).call(a,l.time,", 后一帧(")).call(o,u.streamType,")dts: ")).call(i,u.dts,", time:")).call(r,u.time),tips:"可能造成播放画面卡顿或者声音卡顿"}}}}]),e}(),YB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){return[this._checkKeyFrame(e),this._checkAudioFrameDataFull(e)]}},{key:"_checkKeyFrame",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType}))[0];if(t&&"I"!==t.frameType)return{description:"【视频首帧非关键帧】",tips:"可能播放花屏或者报解码错误"}}},{key:"_checkAudioFrameDataFull",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType})),n=t.length;if(n)for(var r=0;r<n;r++){var i,o=t[r].data;if((null==o?void 0:o.length)<jB)return{description:Nm(i="【音频帧数据较少】 pts=".concat(t[r].pts,", time=")).call(i,t[r].time),tips:"可能由于音频数据原因导致解码报错"}}}}]),e}(),$B=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e,t){return[this._hasVideoMetadata(e),this._hasAudioMetadata(e),this._checkRepeatedSps(e),this._metadataOnlyInSequeceHeader(e,t)]}},{key:"_hasVideoMetadata",value:function(e){var t,n=null==(t=null==e?void 0:Gw(e).call(e,(function(e){return"video"===e.streamType}))[0])?void 0:t.bodyView;if(n&&!n.sps)return{description:"【未检测到视频metadata信息】",tips:"可能视频无法播放或者报解码错误"}}},{key:"_hasAudioMetadata",value:function(e){var t,n=null==(t=null==e?void 0:Gw(e).call(e,(function(e){return"audio"===e.streamType}))[0])?void 0:t.bodyView;if(n&&(!n.config||!n.sampleRate||!n.channelCount))return{description:"【未检测到音频metadata信息】",tips:"可能视频无法播放或者报解码错误"}}},{key:"_checkRepeatedSps",value:function(e){var t,n=null==e?void 0:Gw(e).call(e,(function(e){return"video"===e.streamType}))[0],r=(null==(t=null==n?void 0:n.bodyView)?void 0:t.spsArr)||[];if(n&&r.length>1&&r[0].join(",")!==r[1].join(","))return{description:"【关键帧前包含多个sps信息】"}}},{key:"_metadataOnlyInSequeceHeader",value:function(e,t){var n;if("FLV"===t){var r=null==e?void 0:Xm(e).call(e,(function(e){return e.keyframe}));if(r){var i=r.isHevc;return-1===fk(n=r.nalTypes).call(n,i?33:7)?{description:"【sps、pps信息只存在于Sequence Header中】"}:void 0}}}}]),e}(),ZB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"video"===e.streamType}));if(t)return t.isHevc?[{id:1,description:"【H265编码格式】",tips:"对于不支持H265解码的设备无法播放"}]:void 0}}]),e}(),JB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){if(null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"B"===e.frameType})))return[{description:"【存在B帧】"}]}}]),e}(),QB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType}));if(t.length&&n.length){var r,i,o=t[t.length-1].ptsTime-t[0].ptsTime,a=n[n.length-1].ptsTime-n[0].ptsTime;if(Math.abs(o-a)>=zB)return[{description:Nm(r=Nm(i="【音视频时长存在差距】, video=".concat(o,"s, audio=")).call(i,a,"s, delta=")).call(r,oU(o-a),"s"),tips:"可能造成播放画面卡顿或者声音卡顿"}]}}}]),e}(),eN=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType}));if(t.length||n.length)return t.length&&n.length?void 0:[{description:"【流开始只包含".concat(t.length?"音频":"视频","】"),tips:"可能播放没有声音或者没有画面"}]}}]),e}();function tN(e,t){var n,r,i;return Gw(n=gL(r=Vw(i=[new ZB,new qB,new XB,new YB,new $B,new QB,new JB,new eN]).call(i,(function(n){return n.detect(e,t)}))).call(r,(function(e,t){return Nm(e).call(e,t)}),[])).call(n,Boolean)}var nN=DE,rN=function(e,t,n){return function(e,t,n){t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},iN=function(){function e(t){var n=this;Ry(this,e),rN(this,"_opts",null),rN(this,"_controller",null),rN(this,"_reader",null),rN(this,"_loading",!1),rN(this,"_chunks",[]),rN(this,"_readStream",(function(e,t){var r=0;n._reader=e.getReader();var i=n._chunks;return function e(){var o;return null==(o=n._reader)?void 0:o.read().then((function(n){var o=n.value,a=n.done;return i.push(o),t(r,o),a?Hw.resolve(iU(Gw(i).call(i,Boolean))):(r+=o.byteLength,e())}))}()})),this._opts=t}return Fy(e,[{key:"request",value:function(){var e=this,t=this._opts,n=t.url,r=t.onProgress,i=t.contentType,o=void 0===i?"ArrayBuffer":i,a=t.loadTimeout,s=void 0===a?5e3:a,l=t.headers;return this._controller=new AbortController,Hw.race([fetch(n,{signal:this._controller.signal,headers:l}),new Hw((function(t,n){setTimeout((function(){var t;e._loading||(n({code:0,message:"timeout"}),null==(t=e._controller)||t.abort())}),s)}))]).then((function(t){return t.ok&&t.status>=200&&t.status<300?(e._loading=!0,t):Hw.reject({code:t.status,message:t.statusText})})).then((function(t){switch(o){case"TEXT":return t.text();case"JSON":return t.json();case"ArrayBuffer":return r?e._readStream(t.clone().body,r):t.arrayBuffer()}})).catch((function(t){if(e._loading=!1,"AbortError"!==t.name)return Hw.reject({code:t.code||0,message:t.message})}))}},{key:"cancel",value:function(){var e,t;try{null==(e=this._reader)||e.cancel(),null==(t=this._controller)||t.abort(),this._reader=null,this._controller=null}catch(n){}}}]),e}(),oN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parse",value:(t=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d,p=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=[],this._loader=new iN(Mm(Mm({url:t},n),{},{onProgress:function(e,t){u.push(t),e>n.probeSize&&p._loader.cancel()}})),e.next=4,this._loader.request();case 4:return c=new zU,h=c.parse(iU(u)),f=c.getSnapshoot(h),d=null==(r=f.video)?void 0:r.sps,e.abrupt("return",{codec:null==(i=f.video)?void 0:i.codecType,codecStr:null==d?void 0:d.codec,width:null==d?void 0:d.width,height:null==d?void 0:d.height,vDration:null==(o=null==f?void 0:f.video)?void 0:o.duration,aDuration:null==(a=null==f?void 0:f.audio)?void 0:a.duration,sampleRate:null==(s=null==f?void 0:f.audio)?void 0:s.sampleRate,channelCount:null==(l=null==f?void 0:f.audio)?void 0:l.channelCount,views:h,snap:f});case 9:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}(),aN={exports:{}};aN.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||DE(e,t,{enumerable:!0,get:r})},n.r=function(e){void 0!==OE&&mM&&DE(e,mM,{value:"Module"}),DE(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==Tc(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),DE(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function r(e,t){var n=dk(e);if(xE){var r=xE(e);t&&(r=Gw(r).call(r,(function(t){return PE(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){return(i="function"==typeof OE&&"symbol"==Tc(ME)?function(e){return Tc(e)}:function(e){return e&&"function"==typeof OE&&e.constructor===OE&&e!==OE.prototype?"symbol":Tc(e)})(e)}function o(e,t,n){return t in e?DE(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t),n.d(t,"m3u8Parser",(function(){return h})),n.d(t,"mpdParser",(function(){return g}));var a=/EXT(?:-X-)?([^:]+):?(.*)$/,s=/([^,="]+)((="[^"]+")|(=[^,]+))*/g;function l(e){var t;return gL(t=e.split("-")).call(t,(function(e,t){return e+(e?t.charAt(0)+pk(t).call(t,1).toLowerCase():t.toLowerCase())}),"")}function u(e){if(!/^#EXT/.test(e)&&/^\s*#/.test(e))return null;var t,n,u=a.exec(e);return u?(t=l(u[1]),n=function(e,t){if(!e)return null;var n=Vw(t=e.match(s)).call(t,(function(e){return function(e){var t=IT(e).call(e).replace("=","|").split("|");if(2==t.length)return o({},l(t[0]),t[1].replace(/("|')/g,""));var n=wT(t[0]);return Fk(n)?t[0]:n}(e)}));return 1===n.length?n[0]:0===Gw(n).call(n,(function(e){return"object"===i(e)})).length?n:gL(n).call(n,(function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):IE?RE(e,IE(n)):r(Object(n)).forEach((function(t){DE(e,t,PE(n,t))}))}return e}({},e,{},t)}),{})}(u[2])):(t="url",n=e),o({},t,n)}function c(e,t){if(/^https?/.test(e)||/^data:/.test(e)||/^sdk:/.test(e))return e;for(t=pk(n=t.split("/")).call(n,0,-1),e=e.split("/");e.length;){var n,r=e.shift();-1==fk(t).call(t,r)&&t.push(r)}return t.join("/")}var h=function(e,t,n){var r,i,o;if(!e||!t)return{error:1,msg:"invalid input"};var a,s=Gw(r=Vw(i=Gw(o=e.split("\n")).call(o,Boolean)).call(i,(function(e){return u(IT(e).call(e))}))).call(r,Boolean);if(!s.length)return{error:1,msg:"invalid m3u8"};a=0!==Gw(s).call(s,(function(e){return!!e.streamInf})).length?{master:!0,m3u8Url:t,levels:[],medias:[]}:{master:!1,m3u8Url:t,duration:0,startSN:0,endSN:0,segments:[],live:!0};try{a=function(e,t,n){for(var r=t.master,i=e.length,o=0,a=0,s=0,l=0,u=0,h=-1,f=0;f<i;f++){var d=e[f];for(var p in d){var v=d[p];switch(v&&v.uri&&(v.url=c(v.uri,t.m3u8Url)),p){case"inf":var g={start:a,end:a+(Array.isArray(v)?v[0]:v),cc:o,sn:s+l};h>=0&&(g.keyIndex=h),l++,a=g.end,t.segments.push(g);break;case"start":a=v;break;case"discontinuity":o++;break;case"mediaSequence":s=v;break;case"streamInf":u++,v.levelId=u,t.levels.push(v);break;case"media":t.medias.push(v);break;case"endlist":t.live=!1;break;case"key":h++,t.key?t.key.push(v):t.key=[v];break;case"url":var y=r?t.levels:t.segments;if(!y.length)throw new Error("invalid m3u8");r?y[u-1].url=c(v,t.m3u8Url):y[l-1].url=c(v,t.m3u8Url);break;default:v&&(t[p]=v)}}n&&(t=n(d,t))}return r||(t.startSN=s,t.endSN=s+l-1,t.duration=a),t}(s,a,n)}catch(l){return{error:1,msg:l.message}}return a},f=/\s*(<\/?[^>]+>)/,d=/\s*(?:<\/?([^\s>]+))?\s*([^>]+)*(?:\/?>)?/,p=/\s*([^=]+)="([^"]+)"/g;function v(e,t){for(var n,r,i,o=[],a=e.length,s=0;s<a;s++)if((n=e[s]).closed)if(r=o.pop(),"pureValue"!==n.tagName){if(r&&r.tagName===n.tagName?i=o.pop():(i=r,r=n),!i){o.push(r);break}var l=r,u=l.tagName,c=l.attrs,h=i.attrs[u];t&&(c=t(u,c)),i.attrs[u]=h?Array.isArray(h)?Nm(h).call(h,c):[h,c]:c,o.push(i)}else r.attrs?r.attrs.value=n.attrs.value:r.attrs=n.attrs,o.push(r);else o.push(n);var f,d,p,v=o[0];return v?"undefined"!=v.tagName?(f={},d=v.tagName,p=v.attrs,d in f?DE(f,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):f[d]=p,f):v.tagName:null}var g=function(e,t){if(!e)return{error:1,msg:"invalid input"};try{var n,r,i;return v(Gw(n=Vw(r=Gw(i=e.split(f)).call(i,Boolean)).call(r,(function(e){return function(e){var t,n,r=e.match(d),i={},o=(t=r&&r[1])?gL(n=t.split("_")).call(n,(function(e,t){return e?e+=t.charAt(0).toUpperCase()+pk(t).call(t,1):e=t.charAt(0).toLowerCase()+pk(t).call(t,1)}),""):"";if(r&&r[1]&&r[2]){for(var a,s={};null!=(a=p.exec(r[2]));)s[a[1]]=a[2];return"?xml"===o?null:(i.tagName=o,i.attrs=s,i.closed=/\/$/.test(r[2]),i)}return r?/^<\//.test(r[0])?(i.tagName=o,i.closed=!0,i):/^</.test(r[0])?(i.tagName=o,i.attrs={},i):(i.tagName="pureValue",i.attrs={value:r[2]},i.closed=!0,i):null}(e)}))).call(n,Boolean),t)}catch(o){return{error:1,msg:o.message}}}}]);var sN=aN.exports;function lN(e){return uN.apply(this,arguments)}function uN(){return uN=sy(oy().mark((function e(t){var n,r,i,o=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new iN(Mm(Mm({url:t},o.length>1&&void 0!==o[1]?o[1]:{}),{},{contentType:"TEXT"})),e.next=4,n.request();case 4:return r=e.sent,i=sN.m3u8Parser(r,t,(function(e,t){var n;if(!e.url||!/^\//.test(e.url))return t;var r=e.url,i=t.segments[t.segments.length-1];return i.url=pk(n=i.url.split("/")).call(n,0,3).join("/")+r,t})),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)}))),uN.apply(this,arguments)}var cN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parse",value:(t=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lN(t,n);case 2:if(!(u=e.sent).master){e.next=7;break}return e.next=6,lN(u.levels[0].url);case 6:u=e.sent;case 7:if(null==u?void 0:u.segments.length){e.next=9;break}throw new Error("invalid m3u8");case 9:c=[],h=n.nbSegment,f=0,d=oy().mark((function e(){var t;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new iN(Mm(Mm({url:u.segments[f].url},n),{},{onProgress:function(e,r){c.push(r),e>n.probeSize&&t.cancel()}})),e.next=3,t.request();case 3:h--,f++;case 5:case"end":return e.stop()}}),e)}));case 13:if(!h){e.next=17;break}return e.delegateYield(d(),"t0",15);case 15:e.next=13;break;case 17:return p=new Uint8Array(iU(Gw(c).call(c,Boolean))),v=new QU,g=v.parse(p),y=v.getSnapshoot(g),m=null==(r=y.video)?void 0:r.sps,e.abrupt("return",{codec:null==(i=y.video)?void 0:i.codecType,codecStr:null==m?void 0:m.codec,width:null==m?void 0:m.width,height:null==m?void 0:m.height,vDration:null==(o=null==y?void 0:y.video)?void 0:o.duration,aDuration:null==(a=null==y?void 0:y.audio)?void 0:a.duration,sampleRate:null==(s=null==y?void 0:y.audio)?void 0:s.sampleRate,channelCount:null==(l=null==y?void 0:y.audio)?void 0:l.channelCount,views:g,snap:y});case 23:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})}]),e}(),hN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parse",value:(t=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=new iN(Mm(Mm({url:t},n),{},{contentType:"ArrayBuffer",headers:{Range:"bytes=0-1499"}})),h=[],e.next=4,c.request();case 4:return f=e.sent,d=new Uint8Array(f),p=(new HB).parse(d),v=Xm(p).call(p,(function(e){return"mdat"===e.type})),(g=Xm(p).call(p,(function(e){return"moov"===e.type})))?(h.push(g.start),h.push(g.start+g.size)):v&&h.push(v.start+v.size),c=new iN(Mm(Mm({url:t},n),{},{contentType:"ArrayBuffer",headers:{Range:Nm(r="bytes=".concat(h[0],"-")).call(r,h[1]||"")}})),e.next=13,c.request();case 13:return y=e.sent,m=new HB,_=m.parse(y),b=m.getSnapshoot(_),w=null==(i=b.video)?void 0:i.sps,e.abrupt("return",{codec:null==(o=b.video)?void 0:o.codecType,codecStr:null==w?void 0:w.codec,width:null==w?void 0:w.width,height:null==w?void 0:w.height,vDration:null==(a=null==b?void 0:b.video)?void 0:a.duration,aDuration:null==(s=null==b?void 0:b.audio)?void 0:s.duration,sampleRate:null==(l=null==b?void 0:b.audio)?void 0:l.sampleRate,channelCount:null==(u=null==b?void 0:b.audio)?void 0:u.channelCount,views:m.parseV2(_,!0),snap:b});case 19:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})}]),e}(),fN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parseUrl",value:(t=sy(oy().mark((function e(t){var n,r,i,o,a=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=AE({timeout:5e3,probeSize:8e4,nbSegment:1},r=a.length>1&&void 0!==a[1]?a[1]:{}),!/flv/.test(t)){e.next=9;break}return e.next=5,(new oN).parse(t,r);case 5:i=e.sent,o=KU,e.next=20;break;case 9:if(!/m3u8?/.test(t)){e.next=16;break}return e.next=12,(new cN).parse(t,r);case 12:i=e.sent,o=WU,e.next=20;break;case 16:return e.next=18,(new hN).parse(t,r);case 18:i=e.sent,o=qU;case 20:return i.exceps=Gw(n=tN(i.views.items,o)).call(n,(function(e){return 1!==e.id})),e.abrupt("return",i);case 22:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),dN=function(){var e=sy(oy().mark((function e(n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w,k,E;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=(null==n||null===(r=n.flv)||void 0===r?void 0:r.enableLowLatency)&&"pc"===PC.device,v=null===(i=null==n||null===(o=n.flv)||void 0===o||null===(o=o.lowLatency)||void 0===o?void 0:o.enableFrameChasing)||void 0===i||i,g=null!==(a=null==n||null===(s=n.flv)||void 0===s||null===(s=s.lowLatency)||void 0===s?void 0:s.abrPts)&&void 0!==a?a:"-800",e.next=5,_N(n);case 5:return y=e.sent,e.next=8,EN(n,y);case 8:if(e.sent&&(d=y===t.H265?mN():yN(),f=vN(n)),bF("unknown"===y?t.H264:y)&&(f=vN(n)),f||d){e.next=13;break}return e.abrupt("return",{});case 13:return e.next=15,Hw.all([(null===(l=f)||void 0===l?void 0:l.module)&&uF(f.module).catch((function(){})),(null===(u=d)||void 0===u?void 0:u.module)&&uF(d.module).catch((function(){}))]);case 15:return m=e.sent,_=XM(m,2),b=_[0],(null==(w=_[1])?void 0:w.XGVideoPlugin)&&(null===(c=d)||void 0===c||null===(h=c.afterLoad)||void 0===h||h.call(c,null==w?void 0:w.XGVideoPlugin)),k=TN([f,d]),E=[],p&&(k.url=hF(n.url,{abr_pts:g})),b&&(E.push(b.FlvPlugin),p&&v&&E.push(b.Adaptive)),e.abrupt("return",{options:k,plugins:E});case 25:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pN=function(){var e=sy(oy().mark((function e(n){var r,i,o,a,s,l,u,c,h,f,d,p,v;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_N(n);case 2:return c=e.sent,e.next=5,EN(n,c);case 5:if(e.sent&&(u=c===t.H265?mN():yN(),l=gN(n)),("mobile"!==PC.device||null!=n&&null!==(r=n.hls)&&void 0!==r&&r.enableMSE)&&bF("unknown"===c?t.H264:c)&&(l=gN(n)),l||u){e.next=10;break}return e.abrupt("return",{});case 10:return e.next=12,Hw.all([(null===(i=l)||void 0===i?void 0:i.module)&&uF(l.module).catch((function(){})),(null===(o=u)||void 0===o?void 0:o.module)&&uF(u.module).catch((function(){}))]);case 12:return h=e.sent,f=XM(h,2),d=f[0],(null==(p=f[1])?void 0:p.XGVideoPlugin)&&(null===(a=u)||void 0===a||null===(s=a.afterLoad)||void 0===s||s.call(a,null==p?void 0:p.XGVideoPlugin)),v=TN([l,u]),e.abrupt("return",{options:v,plugins:null!=d&&d.HlsPlugin?[d.HlsPlugin]:[]});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),vN=function(e){var t,n,r;return{options:{flv:Mm({retryCount:0,disconnectRetryCount:null!==(t=null==e||null===(n=e.flv)||void 0===n?void 0:n.retryCount)&&void 0!==t?t:void 0},null!==(r=null==e?void 0:e.flv)&&void 0!==r?r:{})},module:VL.PluginFlv}},gN=function(e){var t;return{options:{hls:Mm({retryCount:0,pollRetryCount:0},null!==(t=null==e?void 0:e.hls)&&void 0!==t?t:{})},module:VL.PluginHls}},yN=function(){return{options:{mediaType:"xg-video",innerDegrade:1,codecType:t.H264},module:VL.PluginXgvideo,afterLoad:function(e){e.isSupported()&&e.setDecodeCapacity({preloadDecoder:t.H264,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1})}}},mN=function(){return{options:{mediaType:"xg-video",innerDegrade:1,codecType:t.H265},module:VL.PluginXgvideo,afterLoad:function(e){e.isSupported()&&e.setDecodeCapacity({preloadDecoder:t.H265,wasmFallbackToAsm:!1,reuseWasmDecoder:!1})}}};function _N(e){return bN.apply(this,arguments)}function bN(){return(bN=sy(oy().mark((function e(t){return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.codec){e.next=2;break}return e.abrupt("return",t.codec);case 2:if(t.degradation!==n.SoftFirst||!t.url){e.next=6;break}return e.next=5,wN(t.url);case 5:return e.abrupt("return",e.sent);case 6:return e.abrupt("return","unknown");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wN(e){return kN.apply(this,arguments)}function kN(){return(kN=sy(oy().mark((function e(n){var r,i;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(new fN).parseUrl(n);case 3:if(r=e.sent,"bytevc1"!==(i=r.codec)){e.next=9;break}return e.abrupt("return",t.H265);case 9:if("avc"!==i){e.next=11;break}return e.abrupt("return",t.H264);case 11:return e.abrupt("return","unknown");case 14:return e.prev=14,e.t0=e.catch(0),console.error("detect codec error: ",e.t0),e.abrupt("return","unknown");case 18:case"end":return e.stop()}}),e,null,[[0,14]])})))).apply(this,arguments)}function EN(e,t){return SN.apply(this,arguments)}function SN(){return(SN=sy(oy().mark((function e(i,o){return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.decodeType!==r.Software){e.next=2;break}return e.abrupt("return",!0);case 2:if("unknown"!==o){e.next=4;break}return e.abrupt("return",!1);case 4:return e.next=6,_N(i);case 6:if(e.sent!==t.H265){e.next=12;break}if(!PC.isHevcSupported()){e.next=10;break}return e.abrupt("return",!1);case 10:if(i.degradation!==n.SoftFirst){e.next=12;break}return e.abrupt("return",!0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function TN(e){return gL(e).call(e,(function(e,t){return AE(e,null==t?void 0:t.options)}),{})}var CN=vP,AN=function(e){return e[e.INVALID_PARAMETER=210]="INVALID_PARAMETER",e}(AN||{}),xN=Mm(Mm({},AN),fP),PN=Mm(Mm({},dP),{},Uy({},210,{messageTextKey:"INVALID_PARAMETER",level:hP.Fatal}));function IN(e,t){return new CN(PN[e],t)}function RN(){return DN.apply(this,arguments)}function DN(){return(DN=sy(oy().mark((function e(){var t,n;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uF(VL.PluginRtm);case 2:return t=e.sent,n=t.RtmPlugin,e.abrupt("return",n.isSupported());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ON(){return MN.apply(this,arguments)}function MN(){return MN=sy(oy().mark((function e(){var t,n,r,i=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:Zj.H264,e.next=3,uF(VL.PluginRtm);case 3:if(n=e.sent,r=n.RtmPlugin,t!==Zj.H264){e.next=7;break}return e.abrupt("return",r.isSupportedH264());case 7:return e.abrupt("return",!1);case 8:case"end":return e.stop()}}),e)}))),MN.apply(this,arguments)}var LN=["fallbackUrl","enableFallback","enableRTMAutoTranscode"],FN={options:{},module:VL.PluginRtm},UN=function(e){return"pc"===PC.device?e.replace(".sdp",".flv"):e.replace(".sdp",".m3u8")},BN=function(){var e=sy(oy().mark((function e(n,r){var i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w,k,E,S;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.url,l=n.rtm||{},u=l.fallbackUrl,c=l.enableFallback,h=void 0===c||c,f=l.enableRTMAutoTranscode,d=tm(l,LN),p=h?!u&&s?UN(s):u:"","flv"===(v=p&&kF.getStreamType(p))&&kF.isMseSupported(t.H264)?a=vN(n):"hls"===v&&("mobile"!==PC.device||null!=n&&null!==(i=n.hls)&&void 0!==i&&i.enableMSE)&&kF.isMseSupported(t.H264)&&(a=gN(n)),e.next=7,Hw.all([uF(FN.module).then((function(e){return e.RtmPlugin})).catch((function(){})),a&&uF(a.module).then((function(e){var t,n;return(null===(t=a)||void 0===t?void 0:t.module)===VL.PluginFlv?e.FlvPlugin:(null===(n=a)||void 0===n?void 0:n.module)===VL.PluginHls?e.HlsPlugin:void 0})).catch((function(){}))]);case 7:return g=e.sent,y=XM(g,2),m=y[0],_=y[1],e.next=13,Hw.all([RN(),ON()]);case 13:if(b=e.sent,w=XM(b,2),k=w[0],E=w[1],k&&E){e.next=20;break}return r&&r.emit("degrade",{url:p,originRtmUrl:s,code:"NOT_SUPPORT",message:"not support rtm or h264",isRTMSupported:k,isRTMSupportCodec:E}),e.abrupt("return",{options:Mm(Mm({},(null===(S=a)||void 0===S?void 0:S.options)||{}),{},{url:p,_RTMdegrade:{_originRtmUrl:s,_isRTMSupported:k,_isRTMSupportCodec:E}}),plugins:_?[_]:[]});case 20:return e.abrupt("return",{options:Mm(Mm({},(null===(o=a)||void 0===o?void 0:o.options)||{}),{},{url:f?kF.appendSearchParams(s,{enableRTMAutoTranscode:"true"}):void 0,_RTMdegrade:void 0,rts:Mm(Mm({retryCount:0},d),{},{backupURL:p,backupConstruct:_})}),plugins:m?[m]:[]});case 21:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),NN=function(e){return e.Fairplay="fairplay",e}(NN||{});function VN(e){if(null!=e&&e.fairplay&&("safari"===PC.browser||PC.os.isIos))return"fairplay"}function HN(e){var t=e.drm,n=e.streamType,r=VN(t);return!r||("fairplay"!==r||"hls"!==n)}var GN=function(){var e=sy(oy().mark((function e(t,n){var r;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t.url?kF.getStreamType(t.url):"")&&"unknown"!==r){e.next=3;break}return e.abrupt("return",{options:{},plugins:[]});case 3:if("rtm"!==r){e.next=7;break}return e.next=6,BN(t,n);case 6:case 10:case 16:return e.abrupt("return",e.sent);case 7:if("flv"!==r){e.next=11;break}return e.next=10,dN(t);case 11:if("hls"!==r){e.next=17;break}if(HN({drm:t.drm,streamType:r})){e.next=14;break}return e.abrupt("return",{options:{},plugins:[]});case 14:return e.next=16,pN(t);case 17:return e.abrupt("return",{options:{},plugins:[]});case 18:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),jN=NaN,zN="[object Symbol]",KN=/^\s+|\s+$/g,WN=/^[-+]0x[0-9a-f]+$/i,qN=/^0b[01]+$/i,XN=/^0o[0-7]+$/i,YN=iE,$N="object"==Tc(i)&&i&&i.Object===Object&&i,ZN="object"==("undefined"==typeof self?"undefined":Tc(self))&&self&&self.Object===Object&&self,JN=$N||ZN||Function("return this")(),QN=Object.prototype.toString,eV=Math.max,tV=Math.min,nV=function(){return JN.Date.now()};function rV(e){var t=Tc(e);return!!e&&("object"==t||"function"==t)}function iV(e){return"symbol"==Tc(e)||function(e){return!!e&&"object"==Tc(e)}(e)&&QN.call(e)==zN}function oV(e){if("number"==typeof e)return e;if(iV(e))return jN;if(rV(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rV(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(KN,"");var n=qN.test(e);return n||XN.test(e)?YN(pk(e).call(e,2),n?2:8):WN.test(e)?jN:+e}var aV=function(e,t,n){var r,i,o,a,s,l,u=0,c=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var n=r,o=i;return r=i=void 0,u=t,a=e.apply(o,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=o}function v(){var e=nV();if(p(e))return g(e);s=setTimeout(v,function(e){var n=t-(e-l);return h?tV(n,o-(e-u)):n}(e))}function g(e){return s=void 0,f&&r?d(e):(r=i=void 0,a)}function y(){var e=nV(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(v,t),c?d(e):a}(l);if(h)return s=setTimeout(v,t),d(l)}return void 0===s&&(s=setTimeout(v,t)),a}return t=oV(t)||0,rV(n)&&(c=!!n.leading,o=(h="maxWait"in n)?eV(oV(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:g(nV())},y},sV=o(aV),lV=Mm(Mm({},KM),{},{TIME_SHIFT_CHANGE:"timeShiftChange",REFRESH_CLICK:"refreshClick"});function uV(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2.488a7.48 7.48 0 00-4.154 1.253.908.908 0 101.005 1.512 5.695 5.695 0 018.844 4.746h-.908a.33.33 0 00-.264.528l1.816 2.422a.33.33 0 00.529 0l1.815-2.422A.33.33 0 0018.42 10h-.908A7.511 7.511 0 0010 2.49zM2.489 10a7.511 7.511 0 0011.665 6.26.908.908 0 00-1.005-1.513A5.695 5.695 0 014.305 10h.908a.33.33 0 00.264-.528L3.66 7.05a.33.33 0 00-.528 0L1.317 9.47a.33.33 0 00.264.53h.908z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var cV=QA.POSITIONS,hV=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"afterCreate",value:function(){this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.refresh),this._initEvents())}},{key:"registerIcons",value:function(){return{refresh:{icon:uV,class:"xgplayer-refresh-svg"}}}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this._handleRefresh)}},{key:"render",value:function(){var e=this.player.config.i18nManager;return'\n <xg-icon class="veplayer-refresh">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="refresh">'.concat(e.getText("REFRESH"),"</div>\n </xg-icon>\n ")}},{key:"_handleRefresh",value:function(e){var t=this.player;if(t){var n,r;if(e.preventDefault(),e.stopPropagation(),t.addClass("xgplayer-is-enter"),t.pause(),t)t.emit(lV.REFRESH_CLICK),null===(n=this.player)||void 0===n||null===(n=n.config)||void 0===n||null===(n=n.veplayer)||void 0===n||n.retry(),null===(r=this.player)||void 0===r||null===(r=r.plugins)||void 0===r||null===(r=r.error)||void 0===r||r.hideError();t.once(HC,(function(){t.removeClass("xgplayer-is-enter")}))}}},{key:"_initEvents",value:function(){this._handleRefresh=sV(this._handleRefresh.bind(this),200);var e="mobile"===PC.device?"touchend":"click";this.bind(e,this._handleRefresh),this.show()}}],[{key:"pluginName",get:function(){return"refresh"}},{key:"defaultConfig",get:function(){return{position:cV.CONTROLS_LEFT,index:1,disable:!1}}}]),n}(QA),fV=o(ie.URLSearchParams),dV=rE;Dn({target:"Number",stat:!0,forced:Number.parseInt!=dV},{parseInt:dV});var pV=o(ie.Number.parseInt),vV=bT;Dn({target:"Number",stat:!0,forced:Number.parseFloat!=vV},{parseFloat:vV});var gV=o(ie.Number.parseFloat);function yV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),DE(e,r.key,r)}}function mV(e,t,n){return t&&yV(e.prototype,t),n&&yV(e,n),e}function _V(e,t,n){return t in e?DE(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bV(e,t){var n=dk(e);if(xE){var r=xE(e);t&&(r=Gw(r).call(r,(function(t){return PE(e,t).enumerable}))),n.push.apply(n,r)}return n}function wV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bV(Object(n),!0).forEach((function(t){_V(e,t,n[t])})):IE?RE(e,IE(n)):bV(Object(n)).forEach((function(t){DE(e,t,PE(n,t))}))}return e}var kV="xgplayer_device_id",EV="xgplayer_user_id",SV=function(e){if(!document.cookie)return null;for(var t=document.cookie.split(";"),n=0,r=t.length;n<r;n++){var i,o=t[n];if(fk(i=t[n]).call(i,e)>=0)return o.split("=")[1]||null}},TV=function(e){return String(Math.floor(Math.random()*Math.pow(10,e)))},CV=function(){var e=SV(kV);if(e)return e;var t=TV(11);return document.cookie=kV+"="+t+";max-age=31536000;path=/",t},AV=function(){var e=SV(EV);if(e)return e;var t=TV(12);return document.cookie=EV+"="+t+";max-age=31536000;path=/",t};var xV={get device(){return xV.os.isPc?"pc":"mobile"},get browser(){var e=function(){var e=navigator.userAgent.toLowerCase(),t={},n={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:fk(e).call(e,"chrome")>-1&&fk(e).call(e,"safari")>-1,Firefox:fk(e).call(e,"firefox")>-1,Opera:fk(e).call(e,"opera")>-1,Safari:fk(e).call(e,"safari")>-1&&-1==fk(e).call(e,"chrome"),Edge:fk(e).call(e,"edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var r in n)if(n[r]){var i="";if("IE"===r)i=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===r){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(r="360");var a=e.match(/chrome\/([\d.]+)/);i=a?a[1]:"-1"}else if("Firefox"===r){var s=e.match(/firefox\/([\d.]+)/);i=s?s[1]:"-1"}else if("Opera"===r){var l=e.match(/opera\/([\d.]+)/);i=l?l[1]:"-1"}else if("Safari"===r){var u=e.match(/version\/([\d.]+)/);i=u?u[1]:"-1"}else if("Edge"===r){var c=e.match(/edge\/([\d.]+)/);i=c?c[1]:"-1"}else if("QQBrowser"===r){var h=e.match(/qqbrowser\/([\d.]+)/);i=h?h[1]:"-1"}t.type=r,t.versions=iE(i)}return t}();return e.type+"_"+e.versions},get os(){var e=navigator.userAgent;navigator.platform.toLowerCase();var t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,r=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||r&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o;return{isTablet:o,isPhone:a,isAndroid:r,isPc:!(a||r||n||o),isSymbian:n,isWindowsPhone:t,isFireFox:i}},get operation_os(){for(var e=navigator.userAgent,t=[{s:"windows",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1|Windows 8.1|Windows NT 6.3|Windows 8|Windows NT 6.2|Windows 7|Windows NT 6.1)/},{s:"android",r:/Android/},{s:"linux",r:/(Linux|X11)/},{s:"ios",r:/(iPhone|iPad|iPod)/},{s:"mac",r:/Mac OS X/},{s:"mac",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<t.length;n++){var r=t[n];if(r.r.test(e))return r.s}return"unknown"}};function PV(){return Date.now()}function IV(e){var t="unknown";return"string"!=typeof e?t:fk(e).call(e,".flv")>-1?"flv":fk(e).call(e,".m3u8")>-1?"m3u8":fk(e).call(e,".mp4")>-1?"mp4":fk(e).call(e,".sdp")>-1?"rts":t}function RV(e){if(e.plugins){if(e.plugins.flv)return e.plugins.flv;if(e.plugins.hls)return e.plugins.hls;if(e.plugins.rts)return e.plugins.rts;if(e.plugins.rtm)return e.plugins.rtm}return null}var DV={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},OV=function(){function e(e){var t=e.Tea;if(!t)throw new Error("lack Tea option");t.event?this.Tea=t.event.bind(t):this.Tea=t,this.logOptions=e,this._player=e.player}mV(e,[{key:"videoSize",get:function(){return this._player&&this._player.video?{width:this._player.video.videoWidth,height:this._player.video.videoHeight}:{width:0,height:0}}}]);var t=e.prototype;return t.push=function(e){var t=this._player.config.url;this._player.video&&(e.play_current_time=this._player.currentTime),this.core&&this.core.loader&&this.core.loader.finnalUrl?e.cdn_play_url=this.core.loader.finnalUrl:e.cdn_play_url=t&&OM(t).call(t,"//")?window.location.protocol+t:t,e.live_stream_session_id=function(e,t,n){var r=new fV(e.split("?")[1]);return r.get(t)||r.get(n)}(e.cdn_play_url,"_session_id","session_id"),e.play_format=IV(e.cdn_play_url),e.timestamp=PV();var n=function(){var e={cpu_core_number:-1,memory_usage:-1,network_downlink:-1};try{e.cpu_core_number=navigator.hardwareConcurrency||-1,e.memory_usage=navigator.deviceMemory||-1,e.network_downlink=navigator.connection&&navigator.connection.downlink,null==e.network_downlink&&(e.network_downlink=-1)}catch(oz){}return e}(),r=n.cpu_core_number,i=n.memory_usage,o=n.network_downlink;e.cpu_core_number=r,e.memory_usage=i,e.network_downlink=o,AE(e,wV({},this.videoSize)),this.send(e)},t.send=function(e){e.event_key&&(this.logOptions.onReport&&this.logOptions.onReport(e.event_key,e),this.Tea(e.event_key,wV({},e)))},e}(),MV=function(){return void 0!==navigator.onLine?navigator.onLine?(e=navigator.connection)&&(e.effectiveType||e.type)||xV.device:"none":"unknown";var e},LV=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","ratechange","volumechange","loadeddata"],FV=function(){function e(e){var t;this.options=e,this.logger=new UV(e),this.restart=this.restart.bind(this),this.bindUrlChange(),hk(t=xV.browser).call(t,"Chrome")}var t=e.prototype;return t.restart=function(e){this.destroy("string"!=typeof e&&Boolean(e)),this.logger=new UV(this.options),this.bindUrlChange(),this.logger.reportStartPlay(),this.logger.handlePlayerComlete()},t.bindUrlChange=function(){this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.on("urlchange",this.restart)},t.setNTP=function(e){this.logger.setNTP(e)},t.updateExt=function(e){this.options.ext=AE(this.options.ext||{},e),this.logger&&this.logger.updateExt(e)},t.destroy=function(e){this.logger.destroy(e),this.logger=null,this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.off("urlchange",this.restart)},e}(),UV=function(){function e(e){if(!e.player)throw new Error("option player is necessary");this.options=AE({},e,function(e){return{device_id:e.device_id||CV(),user_id:e.user_id||AV(),error_report_stop:!!e.error_report_stop,project_key:e.project_key||"live",product_line:e.product_line||"live",onReport:e.onReport||function(){}}}(e)),this._player=this.options.player,this._url=this._player.config.url,this.project_key=e.project_key||"live",this.product_line=e.product_line||"live",this.ntpDelta=this.options.ntp?Date.now()-this.options.ntp:0,this.inWaitingStart=0,this.errorNumber=0,this.tempDroppedFrameCount=0,this.tempTotalFrameCount=0,this._logmanager=new OV(this.options),this.init(),this.started=!1,this.destroyed=!1,this.completed=!1,this.firstFrameViewed=!1,this.cacheRtcStats={}}mV(e,[{key:"videoSize",get:function(){return this.player?{width:this.player.video.videoWidth,height:this.player.video.videoHeight}:{width:0,height:0}}},{key:"player",get:function(){return this._player}},{key:"logmanager",get:function(){return this._logmanager}},{key:"ntpTime",get:function(){return Date.now()-this.ntpDelta}}]);var t=e.prototype;return t.setNTP=function(e){this.options&&(this.options.ntp=e,this.ntpDelta=Date.now()-this.options.ntp)},t.init=function(){this.bindCtx(),this.initLog(),this.initEvt()},t.bindCtx=function(){this.handlePlayerComlete=this.handlePlayerComlete.bind(this),this.handlePlayerPlaying=this.handlePlayerPlaying.bind(this),this.destroyFunc=this.destroyFunc.bind(this),this.handleUserLeave=this.handleUserLeave.bind(this),this.handlePlayerError=this.handlePlayerError.bind(this),this.handlePlayerReady=this.handlePlayerReady.bind(this),this.handlePlayerWaiting=this.handlePlayerWaiting.bind(this),this.handleAVUnsync=this.handleAVUnsync.bind(this),this.handlePlayerPause=this.handlePlayerPause.bind(this),this.handleTTFB=this.handleTTFB.bind(this),this.handleUrlChange=this.handleUrlChange.bind(this),this.handleKeyframe=this.handleKeyframe.bind(this),this.handleSourceOpen=this.handleSourceOpen.bind(this),this.handleBufferAppend=this.handleBufferAppend.bind(this),this.handleCoreEvent=this.handleCoreEvent.bind(this),this.handleDegrade=this.handleDegrade.bind(this)},t.initLog=function(){var e=this,t=this.options,n=t.player,r=void 0!==n.hlsOps;this.commonParams=wV({os:xV.operation_os},function(e){var t,n=e.player,r=n.config.mediaType;return wV({project_key:e.project_key,live_sdk_version:RV(n)||n.hlsOps?"2":"-1",player_sdk_version:n.version,logger_version:"1.1.0-alpha.10",report_version:"5",product_line:e.product_line,user_id:e.user_id,device_id:e.device_id,logger_id:TV(12),app_name:e.app_name,cdn_ip:e.cdn_ip,is_wasm:+(!!r&&"video"!==r),review_is_live:n.config.isLive?2:1,aid:e.aid,live_id:e.live_id||e.aid+"-"+e.user_id+"-"+Date.now(),is_preview:e.is_preview?1:0,codec_type:e.codec_type||"h264",width:Math.floor(n.config.width),height:Math.floor(n.config.height),browser:xV.browser,ua:navigator.userAgent,href:window.location.href,timestamp:0,fps:-1,logger_init_time:Date.now(),play_current_time:0,cdn_play_url:n.config.url&&OM(t=n.config.url).call(t,"//")?window.location.protocol+n.config.url:n.config.url,play_format:IV(n.config.url),codec_support:-1},e.ext)}(t)),this.log=AE({},{start_play:{start_play_time:0,event_key:"start_play"},first_frame:{start:0,first_frame_view:0,event_key:"first_frame",first_sei_delay:0,ntp_sync:0,ntp_delta:0,ttfb:-1,ttdb:-1,ttfb_end:0},first_frame_failed:{code:void 0,msg:"",event_key:"first_frame_failed"},stall_start:{ready_state:-1,stall_start_time:0,event_key:"stall_start"},stalling:{event_key:"stalling"},stall:{reason:0,stall_start:0,stall_end:0,ready_state:0,event_key:"stall"},play_stop:{code:0,stop_time:0,drop_percent:0,is_stream_received:0,stall_count:0,stall_time:0,retry_count:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0,event_key:"play_stop",dns_parse_time:-1,redirect:-1,ttfb:-1,buffered:[],is_firstframe_received:0,meta:null},playing:{index:0,stall_count:0,stall_time:0,play_time:1e4,retry_count:0,is_last:0,video_buffer_time:0,audio_buffer_time:0,speed_switch_count:0,speed_switch_info:"none",download_speed:0,decode_fps:0,render_fps:0,drop_count:0,drop_percent:0,sei_source:"",sei_delay:0,ntp_sync:0,ntp_delta:0,event_key:"playing",stop_time:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0},play_error:{code:void 0,info:"",event_key:"play_error"},play_low_decode:{fps:-1,decode_fps:-1,bitrate:-1,url:-1,msg:"",event_key:"play_low_decode"},play_av_unsync:{aDts:-1,vDts:-1,frameLength:-1,currentTime:-1,duration:0,event_key:"play_av_unsync"},play_loadstream:{loadstream_url:"",event_key:"play_loadstream"},play_stream_loaded:{event_key:"play_stream_loaded"},play_metadata_loaded:{metadata_type:"",event_key:"play_metadata_loaded"},stream_exception:{event_key:"stream_exception"},pause:{event_key:"pause"},play_url_change:{event_key:"play_url_change"},source_opened:{event_key:"source_opened"},source_updateend:{event_key:"source_updateend"},play_result:{event_key:"play_result",result:0,threshold:15e3,is_threshold:0},degrade:{event_key:"degrade",payload:{}},rtcstatechange:{event_key:"rtcstatechange"}});var i=this;for(var o in this.log){var a=function(t){DE(e.log[o],t,{get:function(){return null==this["_"+t]?i.commonParams[t]:this["_"+t]},set:function(e){this["_"+t]=e},enumerable:!0})};for(var s in this.commonParams)a(s);r&&DE(this.log[o],"m3u8",{get:function(){if(n.__core__){var e=n.__core__.m3u8Text;return e?pk(e).call(e,0,25e4):""}return""},enumerable:!0}),DE(this.log[o],"volume",{get:function(){if(n&&n.video)return n.volume||0},enumerable:!0}),DE(this.log[o],"access",{get:function(){return MV()},enumerable:!0})}},t.updateExt=function(e){for(var t in this.log)for(var n in e)this.log[t][n]=e[n]},t.reportStartPlay=function(){this.started||(this.core=RV(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),this.started=!0,this.log.start_play.start_play_time=this.log.start_play.timestamp=PV(),this.logmanager.push(this.log.start_play,!0))},t.initWindowListener=function(){"pc"===xV.device?window.addEventListener("beforeunload",this.handleUserLeave):"mobile"===xV.device&&(window.addEventListener("beforeunload",this.handleUserLeave),window.addEventListener("pagehide",this.handleUserLeave))},t.removeWindowListener=function(){"pc"===xV.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===xV.device&&(window.removeEventListener("beforeunload",this.handleUserLeave),window.removeEventListener("pagehide",this.handleUserLeave))},t.initEvt=function(){var e=this,t=this.player;LV.forEach((function(t){e["handleVideo"+t+"Evt"]=function(){e["handleVideo"+t]&&e["handleVideo"+t]()},e.initWindowListener(),e.bindVideoEvt(t,e["handleVideo"+t+"Evt"])})),t.once("error",this.handlePlayerError),t.once("complete",this.handlePlayerComlete),t.once("playing",this.handlePlayerPlaying),t.once("timeupdate",this.handlePlayerPlaying),t.once("destroy",this.destroyFunc),t.on("ready",this.handlePlayerReady),t.on("waiting",this.handlePlayerWaiting),t.on("pause",this.handlePlayerPause),t.on("urlchange",this.handleUrlChange),t.once("sourceopen",this.handleSourceOpen),t.once("bufferappend",this.handleBufferAppend),t.on("core_event",this.handleCoreEvent),t.on("degrade",this.handleDegrade),this.hiJackPlayerStart()},t.handleCoreEvent=function(e){var t=e.eventName,n=e.headers,r=e.pts,i=e.type,o=e.meta,a=e.sei,s=e.decodeFps,l=e.url,u=e.state;switch(t){case"core.ttfb":this.handleTTFB(e);break;case"core.loadresponseheaders":var c=n.get("X-Server-Ip");void 0!==this.player.hlsOps&&(this.log.play_stop.review_ts_count+=1),c&&(this.commonParams.cdn_ip=c);break;case"core.loadretry":this.log.play_stop.retry_count++;break;case"core.keyframe":this.handleKeyframe(r);break;case"core.metadataparsed":this.handleMetaDataLoaded(i,o);break;case"core.sei":this.handleSEIParsed(a);break;case"core.lowdecode":this.commonParams.is_wasm&&(AE(this.log.play_low_decode,e||{}),this.log.play_low_decode.decode_fps=s,this.log.play_low_decode.timestamp=PV(),this.logmanager.push(this.log.play_low_decode,!0),this.commonParams.is_wasm=0);break;case"core.largeavgap":this.handleAVUnsync(e);break;case"core.loadstart":this.handlePlayerLoadStream(e),this.reportStartPlay();break;case"core.loadcomplete":this.handlePlayerLoadedStream(e);break;case"core.streamexception":this.handleStreamException(e);break;case"core.rtcstatechange":this.logmanager.push(AE({url:l,state:u},this.log.rtcstatechange))}},t.handleDegrade=function(e){this.log.degrade.payload=e,this.logmanager.push(this.log.degrade,!0)},t.hiJackPlayerStart=function(){var e=arguments,t=this;this.player._start=this.player.start;var n=this.player;n.start=function(){try{if(n._start)return n._start.apply(n,pk(Array.prototype).call(e,0))}catch(r){}t.destroyed||t.handlePlayerComlete()}},t.handleTTFB=function(e){var t=e||{},n=t.end,r=t.elapsed;this.log.first_frame.ttfb=r||-1,this.log.first_frame.ttfb_end=n||0},t.handleUrlChange=function(e){this.logmanager.push(AE(this.log.play_url_change,{url:e,timestamp:PV()}))},t.handleKeyframe=function(e){this.log.play_stop.is_firstframe_received=1,this.log.play_stop.firstframe_pts=e},t.handleSourceOpen=function(){this.log.source_opened.timestamp=PV(),this.logmanager.push(this.log.source_opened)},t.handleBufferAppend=function(){this.log.source_updateend.timestamp=PV(),this.logmanager.push(this.log.source_updateend)},t.handlePlayerPause=function(){this.log.pause.timestamp=PV(),this.logmanager.push(this.log.pause,!0),this.stallEnd()},t.handlePlayerError=function(e){this.errorNumber=1;var t=e.errorType,n=e.errorCode;AE(this.log.play_error,wV({timestamp:PV(),code:e.httpCode||n||("parse"===t?31:21),info:e.message,detail:yM(e)},this.videoSize)),this.logmanager.push(this.log.play_error,!0),this.destroyed||(0===this.log.first_frame.first_frame_view&&(AE(this.log.first_frame_failed,{code:n||("parse"===t?31:21),msg:e.message}),void 0!==this.log.first_frame_failed.timestamp&&(this.log.first_frame_failed.timestamp=PV()),this.logmanager.push(this.log.first_frame_failed,!0),this.log.play_result.is_threshold||(this.clearPlayResultTimer(),this.log.play_result.reason=e.message||"first frame failed",this.log.play_result.code=this.log.play_error.code,this.logmanager.push(this.log.play_result,!0))),this.options.error_report_stop?this.handleUserLeave():this.updatePlayStopParams())},t.handlePlayerLoadStream=function(e){var t=e.url,n=e.offersdp,r=e.sessionId;if("string"==typeof t){var i=this.log.play_loadstream;i.timestamp=PV(),i.loadstream_url=t,i.offersdp=n,i.sessionId=r,this.logmanager.push(i)}},t.handlePlayerLoadedStream=function(e){var t=this.log.play_stream_loaded;t.timestamp=PV(),AE(t,e),this.logmanager.push(t)},t.handleSEIParsed=function(e){var t=this.log,n=t.playing,r=t.first_frame;if(100===e.code){var i=function(e){var t,n,r,i,o,a;for(t="",r=e.length,n=0;n<r;)switch((i=e[n++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(i);break;case 12:case 13:o=e[n++],t+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=e[n++],a=e[n++],t+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&a)<<0)}return t}(e.content);i=pk(i).call(i,fk(i).call(i,"{"),iF(i).call(i,"}")+1);try{var o=JSON.parse(i),a=this.getPlayerBuffer()+this.ntpTime-o.ts;n.sei_delay=a,n.sei_source=o.source,n.ntp_sync=this.options.ntp?1:0,n.ntp_delta=this.ntp_delta,r.first_sei_delay=a,r.ntp_sync=this.options.ntp?1:0,r.ntp_delta=this.ntp_delta}catch(s){}}},t.handleMetaDataLoaded=function(e,t){var n;this.log.play_stop.meta=this.log.play_stop.meta||{},e&&(this.log.play_stop.meta[e]=t),this.log.play_metadata_loaded.timestamp=PV(),this.log.play_metadata_loaded.metadata_type=e,t&&(this.log.play_metadata_loaded.meta=t,this.log.play_metadata_loaded.codec=t.codec,"video"===e&&(this.commonParams.codec_type=t.codec,this.commonParams.codec_support=(n=t.codec,"undefined"!=typeof MediaSource?+MediaSource.isTypeSupported("video/mp4; codecs="+n):0))),t||(this.log.play_metadata_loaded.meta=void 0,this.log.play_metadata_loaded.codec=void 0,"video"===e&&(this.commonParams.codec_type="unknown")),this.logmanager.push(this.log.play_metadata_loaded)},t.handleAVUnsync=function(e){AE(this.log.play_av_unsync,e||{}),this.log.play_av_unsync.timestamp=PV(),this.logmanager.push(this.log.play_av_unsync,!1)},t.handleStreamException=function(e){this.logmanager.push(AE({},this.log.stream_exception,e))},t.handlePlayerComlete=function(){this.completed||(this.completed=!0,this.core=RV(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),(this.player.config.autoplay||this.player.config.videoInit)&&this.reportStartPlay())},t.getPlayerBuffer=function(){var e=this.player.video.buffered;if(e){var t=Math.max(0,e.length-1);try{var n=pV(1e3*(e.end(t)-this.player.video.currentTime));return this.log.playing.audio_buffer_time=this.log.playing.video_buffer_time=n,n}catch(r){return 0}}},t.getPlayerDownloadSpeed=function(){if(this.core&&this.core.core&&"function"==typeof this.core.core.speedInfo)return this.core.core.speedInfo().speed},t.getPlayerQuality=function(){var e=this.player.video;if(e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();this.log.playing.drop_count=t.droppedVideoFrames-this.tempDroppedFrameCount,this.log.playing.drop_percent=gV(this.tempTotalFrameCount/t.totalVideoFrames).toFixed(1),this.log.play_stop.drop_percent=gV(t.droppedVideoFrames/t.totalVideoFrames).toFixed(1),this.tempDroppedFrameCount=t.droppedVideoFrames,this.tempTotalFrameCount=t.totalVideoFrames}},t.getRtcStats=function(e,t){try{var n=this,r=n.player.plugins.rts||n.player.plugins.rtm,i=r&&r.pc,o={};return i?Hw.resolve(i.getStats()).then((function(t){return t.forEach((function(t){var r=t.type,i=t.mediaType,a=t.bytesReceived,s=t.packetsReceived,l=t.audioLevel,u=t.concealmentEvents,c=t.remoteTimestamp,h=t.timestamp,f=t.framesDropped,d=t.keyFramesDecoded,p=t.totalDecodeTime,v=t.framesDecoded,g=t.frameHeight,y=t.frameWidth,m=t.framesReceived,_=t.jitterBufferDelay,b=t.jitterBufferEmittedCount,w=t.jitter,k=t.nackCount,E=t.packetsLost,S=t.pliCount,T=t.totalSamplesReceived,C=t.concealedSamples,A=t.currentRoundTripTime,x=t.decoderImplementation,P=t.mimeType,I=t.freezeCount,R=t.totalFreezesDuration,D=t.totalPausesDuration;switch(r){case"inbound-rtp":"audio"===i?(o.audio_bytes_received=a-(n.cacheRtcStats.audioBytesReceived||0),n.cacheRtcStats.audioBytesReceived=a,o.audio_packets_lost=E-(n.cacheRtcStats.audioPacketsLost||0),o.audio_packets_received=s-(n.cacheRtcStats.audioPacketsReceived||0),n.cacheRtcStats.audioPacketsLost=E,n.cacheRtcStats.audioPacketsReceived=s,o.audio_level=l,o.concealment_event=u,o.audio_fraction_lost=o.audio_packets_lost/o.audio_packets_received,void 0!==n.cacheRtcStats.totalSamplesReceived&&(o.audio_rec_sample_rate=(T-n.cacheRtcStats.totalSamplesReceived)/e),n.cacheRtcStats.totalSamplesReceived=T,o.concealed_samples=C,o.total_samples_received=T):(o.frames_dropped=f,o.iframes_decoded=d,o.video_bytes_received=a-(n.cacheRtcStats.videoBytesReceived||0),n.cacheRtcStats.videoBytesReceived=a,o.video_dec_time=p,o.video_decoded_delay_ms=o.video_dec_elapse/v,o.video_frame_height=g,o.video_frame_width=y,void 0!==n.cacheRtcStats.framesDecoded&&(o.video_decode_framerate=(v-n.cacheRtcStats.framesDecoded)/e),n.cacheRtcStats.framesDecoded=v,void 0!==n.cacheRtcStats.framesReceived&&(o.video_recv_framerate=(m-n.cacheRtcStats.framesReceived)/e),void 0!==n.cacheRtcStats.freezeCount&&(o.freeze_count=I-n.cacheRtcStats.freezeCount,o.freeze_duration=R-n.cacheRtcStats.totalFreezesDuration),n.cacheRtcStats.freezeCount=I,n.cacheRtcStats.totalFreezesDuration=R,n.cacheRtcStats.framesReceived=m,o.total_pauses_duration=D,o.video_jb_delay=_/b*1e3,o.video_jitter=1e3*w,o.video_nack_count=k,o.video_packets_lost=E-(n.cacheRtcStats.videoPacketsLost||0),o.video_packets_received=s-(n.cacheRtcStats.videoPacketsReceived||0),o.video_fraction_lost=o.video_packets_lost/o.video_packets_received,n.cacheRtcStats.videoPacketsLost=E,n.cacheRtcStats.videoPacketsReceived=s,o.video_pli_count=S,o.decoder_name=x);break;case"remote-outbound-rtp":o.e2e_delay_ms=h-c;break;case"track":void 0!==y&&(o.video_frame_width=y,o.video_frame_height=g);break;case"candidate-pair":o.rtt=1e3*A;break;case"codec":hk(P).call(P,"video")?o.video_codec=P:o.audio_codec=i}o.total_delay=o.e2e_delay_ms+(o.video_decoded_delay_ms||0)+(o.video_jb_delay||0)})),AE(n.log.playing,{video_download_size:o.video_bytes_received,decode_fps:o.video_decode_framerate,sei_delay:o.total_delay,sei_network_delay:o.e2e_delay_ms,width:o.video_frame_width,height:o.video_frame_height,current_speed:(o.audio_bytes_received+o.video_bytes_received)/e}),o})):Hw.resolve(o)}catch(a){return Hw.reject(a)}},t.reportPlaying=function(e){try{var t=this;t.commonParams.is_wasm&&(t.commonParams.fps=t.player.video.fps,t.log.playing.render_fps=t.player.video.fps,t.log.playing.decode_fps=t.player.video.decodeFps),t.log.playing.index++;var n,r=t.log.playing.timestamp;t.inWaitingStart&&t.inWaitingStart<PV()&&(n=Math.min(t.options.playingInterval||t.log.playing.play_time,PV()-Math.max(t.inWaitingStart,r))),t.getPlayerQuality(),t.getPlayerBuffer(),t.options.downloadSpeedInterval||(t.log.playing.current_speed=t.getPlayerDownloadSpeed());var i=PV(),o=i-r,a=(n>200?n:0)+t.log.playing.stall_time,s=(n>200?1:0)+t.log.playing.stall_count;return t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=(n>t.options.aggregationDowngradeStallTime?n:0)+(t.log.playing.aggregation_downgrade_stall||0)),AE(t.log.playing,wV({timestamp:i,stop_time:i,duration:e?0:o/1e3,stall_time_per_100sec:a/o*100,stall_count_per_100sec:1e3*s/o*100,stall_count:s,stall_time:a,play_current_time:t.player.currentTime},t.videoSize)),Hw.resolve(t.getRtcStats(o,e)).then((function(n){var r={};if(t.core){if(t.core.getStats){var i=t.core.getStats()||{},a=i.bitrate,s=i.avgSpeed;AE(r,{bitrate:a,avg_speed:s,rate:s/a})}if(t.core.getNetWorkInfo){var l,u=(t.core.getNetWorkInfo()||{}).lostRate,c=((null===(l=t.core.core)||void 0===l?void 0:l._opts)||{}).networkEvaluateInterval;AE(r,{lostRate:u,networkEvaluateInterval:c})}}t.logmanager.push(AE({},t.log.playing,wV(wV({play_time:e?0:o},n),r)),!0),t.log.playing.download_speed_array=[],t.log.playing.stall_time=0,t.log.playing.stall_count=0,t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=0)}))}catch(l){return Hw.reject(l)}},t.handlePlayerPlaying=function(){try{var e=this;if(e.player&&e.player.video.readyState<3)return Hw.resolve();if(e.player.off("playing",e.handlePlayerPlaying),e.player.off("timeupdate",e.handlePlayerPlaying),e.core){var t=(e.core.getStats()||{}).fps;e.commonParams.fps=t}return Hw.resolve(e.reportPlaying(!0)).then((function(){e.clearPlayingInterval();var t=e.options.playingInterval||e.log.playing.play_time;e.intervalId=setInterval((function(){try{var n=function(){if(Math.abs(Date.now()-e.log.playing.timestamp-t)<100||Date.now()-e.log.playing.timestamp>=t){var n=function(){if(e.player&&e.player.video){var t=function(){if(!e.player.paused)return Hw.resolve(e.reportPlaying()).then((function(){}));e.handleVideopause()}();if(t&&t.then)return t.then((function(){}))}else e.destroyFunc()}();if(n&&n.then)return n.then((function(){}))}}();return Hw.resolve(n&&n.then?n.then((function(){})):void 0)}catch(r){return Hw.reject(r)}}),1e3),e.clearStallTimer(),e.handleVideoplaying(),e.started||e.reportStartPlay(),e.saveBuffered()}))}catch(n){return Hw.reject(n)}},t.handlePlayerReady=function(){var e=this;this.log.start_play.start_play_time=PV(),this.player.config.autoplay&&this.reportStartPlay(),this.options.playResultThreshold&&(this.log.play_result.threshold=this.options.playResultThreshold),this.clearPlayResultTimer(),this.log.play_result.start=PV(),this.playResultTimer=setTimeout((function(){e.log.play_result.timestamp>=e.log.play_result.start||(e.log.play_result.is_threshold=1,e.logmanager.push(e.log.play_result,!0))}),this.log.play_result.threshold)},t.handlePlayerWaiting=function(){var e=this;!this.inWaitingStart&&this.log.first_frame.timestamp&&(this.log.stall.timestamp=this.inWaitingStart=this.log.stall.stall_start=PV(),this.log.stall_start.ready_state=this.log.stall.ready_state=this.player.video.readyState,this.log.stall_start.timestamp=PV(),this.log.stall_start.stall_start_time=PV(),this.log.stall_start.video_buffer_time=this.player.video.readyState,this.log.stall_start.play_current_time=this.player.currentTime,this.log.stall.play_current_time=this.player.currentTime,this.log.stall_start.buffered=this.getBuffered(),this.log.stall.buffered=this.log.stall_start.buffered,this.log.stall.current_speed=this.getPlayerDownloadSpeed(),AE(this.log.stall_start,this.videoSize),this.clearStallTimer(),this.stallStartTimer=setTimeout((function(){e.logmanager.push(e.log.stall_start,!0)}),205))},t.handleVideoseeking=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.clearStallTimer())},t.handleVideoseeked=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.log.play_stop.stall_count>0&&this.log.play_stop.stall_count--)},t.handleVideoplay=function(){this.reportStartPlay(),this.removeVideoEvt("play",this.handleVideoplay)},t.handleVideotimeupdate=function(){Math.abs(this.player.currentTime-this.log.stall_start.play_current_time)>.2&&this.stallEnd(),this.saveBuffered()},t.handleVideocanplay=function(){this.stallEnd(),this.reportFirstframe()},t.handleVideoplaying=function(){this.stallEnd(),this.log.play_stop.is_stream_received=1;var e=PV();this.reportStartPlay(),this.log.first_frame.start=e},t.stallEnd=function(){this.clearStallTimer();var e=PV();if(this.inWaitingStart){var t=e-this.inWaitingStart;t>200&&(this.log.play_stop.stall_count++,this.log.play_stop.stall_time+=e-this.inWaitingStart,this.log.playing.stall_time+=e-Math.max(this.inWaitingStart,this.log.playing.timestamp),this.log.stall.stall_end=e,this.log.stall.timestamp=PV(),this.log.playing.stall_count++,AE(this.log.stall,wV({},this.videoSize)),this.logmanager.push(this.log.stall,!0)),this.options.aggregationDowngradeStallTime&&t>this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=(this.log.playing.aggregation_downgrade_stall||0)+(e-Math.max(this.inWaitingStart,this.log.playing.timestamp)))}this.inWaitingStart=0},t.handleVideoloadeddata=function(){this.reportFirstframe()},t.handleVideoratechange=function(){this.log.playing.speed_switch_count++,this.log.playing.speed_switch_info=this.player.video.playbackRate},t.handleVideoended=function(){this.clearPlayingInterval(),this.clearStallTimer(),AE(this.log.playing,wV({timestamp:PV(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing)},t.handleVideoerror=function(){var e=this;this.errorNumber=1;var t=this.player.video.error;AE(this.log.play_error,wV(wV({timestamp:PV()},this.videoSize),t&&{code:t.code,info:t.message})),this.logmanager.push(this.log.play_error,!0),0!==e.log.first_frame.first_frame_view||e.log.first_frame_failed.code||t&&(e.log.first_frame_failed.code=t.code,e.log.first_frame_failed.msg=DV[t.code],void 0!==e.log.first_frame_failed.timestamp&&(e.log.first_frame_failed.timestamp=PV()),e.logmanager.push(e.log.first_frame_failed,!0),e.log.play_result.is_threshold||(e.log.play_result.reason=DV[t.code]||"first frame failed",e.log.play_result.code=t.code,e.clearPlayResultTimer(),e.logmanager.push(e.log.play_result,!0))),e.options.error_report_stop?e.handleUserLeave():e.updatePlayStopParams()},t.handleVideopause=function(){this.stallEnd(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.player.once("playing",this.handlePlayerPlaying),this.player.once("timeupdate",this.handlePlayerPlaying)},t.destroyFunc=function(e){var t=this;this.destroyed||(e||this.handleUserLeave(),this.destroyed=!0,"pc"===xV.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===xV.device&&window.removeEventListener("pagehide",this.handleUserLeave),LV.forEach((function(e){t.removeVideoEvt(e,t["handleVideo"+e+"Evt"])})),this.player&&(this.player._start&&(this.player.start=this.player._start,delete this.player._start),this.player.off("destroy",this.destroyFunc),this.player.off("complete",this.handlePlayerComlete),this.player.off("playing",this.handlePlayerPlaying),this.player.off("timeupdate",this.handlePlayerPlaying),this.player.off("ready",this.handlePlayerReady),this.player.off("waiting",this.handlePlayerWaiting),this.player.off("largeavgap",this.handleAVUnsync),this.player.off("error",this.handlePlayerError),this.player.off("SEI_PARSED",this.handleSEIParsed),this.player.off("pause",this.handlePlayerPause),this.player.off("ttfb",this.handleTTFB),this.player.off("urlchange",this.handleUrlChange),this.player.off("isKeyframe",this.handleKeyframe),this.player.off("sourceopen",this.handleSourceOpen),this.player.off("bufferappend",this.handleBufferAppend),this.player.off("core_event",this.handleCoreEvent),this.player.off("degrade",this.handleDegrade),this._player=null),this.clearPlayingInterval(),this.clearStallTimer(),this.clearPlayResultTimer(),clearTimeout(this.collectDownloadSpeedTimer))},t.handleUserLeave=function(){try{var e=this;return e.destroyed||!e.started?Hw.resolve():(e.destroyed=!0,Hw.resolve(e.updatePlayStopParams()).then((function(){e.reportPlayStop(),e.clearPlayingInterval(),e.clearStallTimer(),clearTimeout(e.collectDownloadSpeedTimer),e.removeWindowListener()})))}catch(t){return Hw.reject(t)}},t.saveBuffered=function(){try{var e=this.getBuffered();e&&e.length&&(this.log.play_stop.buffered=e)}catch(oz){}},t.getBuffered=function(){try{for(var e=[],t=this.player.video,n=0;n<t.buffered.length;n++)e.push([t.buffered.start(n),t.buffered.end(n)]);return e}catch(oz){}},t.reportPlayStop=function(){this.player&&(this.log.play_stop.play_current_time=this.player.currentTime||this.log.playing.play_current_time,this.saveBuffered()),this.logmanager.push(this.log.play_stop,!0)},t.reportFirstframe=function(){if(!this.firstFrameViewed){if(this.core){var e=(this.core.getStats()||{}).fps;this.commonParams.fps=e}this.firstFrameViewed=!0;var t=PV();AE(this.log.first_frame,wV({first_frame_view:t-this.log.start_play.start_play_time||t,timestamp:t},this.videoSize)),this.log.first_frame.ttfb_end&&(this.log.first_frame.ttdb=t-this.log.first_frame.ttfb_end),this.logmanager.push(this.log.first_frame,!0),this.clearPlayResultTimer(),this.log.play_result.result=1,this.logmanager.push(this.log.play_result,!0),this.log.play_stop.is_stream_received=1}},t.updatePlayStopParams=function(){try{var e,t=function(){AE(o,wV({timestamp:i,stop_time:i,duration:n.playedTime/1e3,play_time:n.playedTime/1e3},n.videoSize)),0===n.errorNumber&&(o.play_time_on_no_frame=o.stop_time-n.log.start_play.start_play_time)},n=this,r=function(e){var t,n=Gw(t=performance.getEntriesByType("resource")).call(t,(function(t){return t.name===e}));if(n.length){var r=n[0],i=n[n.length-1];return{dns_parse_time:pV(r.domainLookupEnd-r.domainLookupStart),redirect:pV(r.redirectEnd-r.redirectStart),ttfb:pV(i.responseStart-i.requestStart)}}return{dns_parse_time:-1,redirect:-1,ttfb:-1}}(n._url),i=PV();n.playedTime=i-n.log.start_play.start_play_time;var o=n.log.play_stop;if(AE(o,wV({},0===o.stall_count&&{stall_time:0})),n.inWaitingStart&&i-n.inWaitingStart>200&&(o.stall_time+=i-n.inWaitingStart),n.inWaitingStart=0,AE(o,wV({stall_time_per_100sec:o.stall_time/n.playedTime*100,stall_count_per_100sec:1e3*o.stall_count/n.playedTime*100},r)),0===n.log.play_stop.stall_count_per_100sec&&(n.log.play_stop.stall_time_per_100sec=0),n.log.play_stop.stall_time_per_100sec>100||n.log.play_stop.stall_time_per_100sec<0)return Hw.resolve();if(n.log.playing.index?(AE(n.log.playing,wV({timestamp:PV(),is_last:1},n.videoSize)),n.logmanager.push(n.log.playing,!0)):(n.log.play_stop.error_code=n.log.play_error.code,n.log.play_stop.error_info=n.log.play_error.info),i=PV(),null===(e=n.core)||void 0===e?void 0:e.getStats){var a=n.core.getStats()||{},s=a.totalReceivedByte,l=a.totalReceivedCost;AE(n.log.play_stop,{totalReceivedByte:s,totalReceivedCost:l,totalAverageSpeed:8*s/(l/1e3)})}var u=function(){var e;if(null===(e=n.core)||void 0===e?void 0:e.getStatsSnapshoot)return Hw.resolve(n.core.getStatsSnapshoot()).then((function(e){var t=e.video||{},n=t.packetsLost,r=t.packetsReceived;AE(o,{packetsLost:n,packetsReceived:r,totalLostRate:n/(n+r)})}))}();return Hw.resolve(u&&u.then?u.then(t):t())}catch(c){return Hw.reject(c)}},t.clearPlayingInterval=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},t.clearStallTimer=function(){clearTimeout(this.stallStartTimer)},t.clearPlayResultTimer=function(){clearTimeout(this.playResultTimer)},t.destroy=function(e){this.destroyFunc(!e)},t.bindVideoEvt=function(e,t){this.player&&this.player.video.addEventListener(e,t,!1)},t.removeVideoEvt=function(e,t){this.player&&this.player.video&&this.player.video.removeEventListener(e,t,!1)},t.send=function(e,t){this.logmanager.send(e,t)},e}(),BV=s;Dn({global:!0,forced:BV.globalThis!==BV},{globalThis:BV});var NV=o(s),VV=Dn,HV=r_,GV=l,jV=re,zV=__.onFreeze,KV=Object.freeze;VV({target:"Object",stat:!0,forced:GV((function(){KV(1)})),sham:!HV},{freeze:function(e){return KV&&jV(e)?KV(zV(e)):e}});var WV=o(ie.Object.freeze),qV=o(Ug),XV=pc.codeAt;Dn({target:"String",proto:!0},{codePointAt:function(e){return XV(this,e)}});var YV=Wc("String").codePointAt,$V=ce,ZV=YV,JV=String.prototype,QV=o((function(e){var t=e.codePointAt;return"string"==typeof e||e===JV||$V(JV,e)&&t===JV.codePointAt?ZV:t})),eH=Dn,tH=_,nH=ti,rH=RangeError,iH=String.fromCharCode,oH=String.fromCodePoint,aH=tH([].join);eH({target:"String",stat:!0,arity:1,forced:!!oH&&1!=oH.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,i=0;r>i;){if(t=+arguments[i++],nH(t,1114111)!==t)throw rH(t+" is not a valid code point");n[i]=t<65536?iH(t):iH(55296+((t-=65536)>>10),t%1024+56320)}return aH(n,"")}});var sH=o(ie.String.fromCodePoint),lH=function(){return lH=AE||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},lH.apply(this,arguments)};function uH(e,t){var n="function"==typeof OE&&wS(e);if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(oz){i={error:oz}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function cH(){for(var e=[],t=0;t<arguments.length;t++)e=Nm(e).call(e,uH(arguments[t]));return e}var hH,fH,dH=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;if(e&&t&&"function"==typeof t){this.on(e,(function r(i){t(i),n.off(e,r)}))}},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n,r,i=fk(n=this._hooks[e]).call(n,t);if(-1!==i)Lk(r=this._hooks[e]).call(r,i,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){var r;if(!e)return;-1!==fk(r=this._cache).call(r,n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&cH(this._hooks[e]).forEach((function(e){try{e(t)}catch(n){}}))},e.prototype.set=function(e){var t;e&&-1===fk(t=this._cache).call(t,e)&&this._cache.push(e)},e}(),pH=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},vH=(fH=+Date.now()+Number(pk(hH=""+Math.random()).call(hH,2,8)),function(){return fH+=1}),gH=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof t&&"number"==typeof n){var r,i=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);r=e.split(o);for(var a=0;a<r.length;a++){var s=iE(r[a],n);s=1*s^t;var l=String.fromCharCode(s);i.push(l)}return i.join("")}}(e,64,25)},yH=function(e){!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},mH=function(e){var t=document.createElement("a");return t.href=e,t},_H=function(e){var t={};try{var n=mH(e).search;(n=pk(n).call(n,1)).split("&").forEach((function(e){var n,r,i=e.split("=");i.length&&(n=i[0],r=i[1]);try{t[n]=decodeURIComponent(void 0===r?"":r)}catch(o){t[n]=r}}))}catch(r){}return t},bH=function(e){for(var t=0,n=0,r=(e+="").length,i=0;i<r;i++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t};var wH=function(e){var t,n,r=[],i=e.length;i%2!=0&&(n=i+1,e=(t=e).length>=n?t:new Array(n-t.length+1).join("0")+t),i=e.length;for(var o=0;o<i;o+=2)r.push(iE(e.substr(o,2),16));return r},kH=void 0!==NV?NV:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function EH(e,t){return e(t={exports:{}},t.exports),t.exports}var SH=EH((function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var t={read:function(e){return'"'===e[0]&&(e=pk(e).call(e,1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function n(t,r){function i(n,i,o){if("undefined"!=typeof document){"number"==typeof(o=e({},r,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in o)o[s]&&(a+="; "+s,!0!==o[s]&&(a+="="+o[s].split(";")[0]));return document.cookie=n+"="+t.write(i,n)+a}}function o(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),a=pk(o).call(o,1).join("=");try{var s=decodeURIComponent(o[0]);if(r[s]=t.read(a,s),e===s)break}catch(l){}}return e?r[e]:r}}return Object.create({set:i,get:o,remove:function(t,n){i(t,"",e({},n,{expires:-1}))},withAttributes:function(t){return n(this.converter,e({},this.attributes,t))},withConverter:function(t){return n(e({},this.converter,t),this.attributes)}},{attributes:{value:WV(r)},converter:{value:WV(t)}})}return n(t,{path:"/"})}()})),TH=SH,CH=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e){this.getItem(e)},e.prototype.setCookie=function(e,t){this.setItem(e,t)},e}();var AH,xH,PH,IH,RH={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(r){}return n||{}}catch(r){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:yM(t);localStorage.setItem(e,n)}catch(r){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){try{return TH.get(e,{domain:t||document.domain})}catch(n){return""}},setCookie:function(e,t,n,r){try{var i=r||document.domain,o=+new Date+n;TH.set(e,t,{expires:new Date(o),path:"/",domain:i})}catch(a){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},DH={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(r){}return n||{}}catch(r){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:yM(t);sessionStorage.setItem(e,n)}catch(r){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t){}},getCookie:function(e){this.getItem(e)},setCookie:function(e,t){this.setItem(e,t)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},OH=function(){function e(e,t){this._storage=t&&"session"===t?DH:!e&&RH.isSupportLS?RH:new CH}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,r){this._storage.setCookie(e,t,n,r)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),MH=function(){function e(e,t,n){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=n}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,r=n?mH(n).hostname:"",i=_H(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,n,r){var i=new OH(!1),o=new OH(!1,"session"),a=e?"_tea_utm_cache_"+e:"_tea_utm_cache",s=e?"_$utm_from_url_"+e:"_$utm_from_url",l={},u=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],c={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;for(var f in c)c[f]&&(-1!==fk(u).call(u,f)?(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data[f]=c[f]):l[f]=c[f],h=!0);if(h)o.setItem(s,"1"),i.setCookie(a,yM(l),r,n);else{var d=i.getCookie(a,n);d&&(l=JSON.parse(d))}o.getItem(s)&&(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data.$utm_from_url=1)}catch(p){return c}return l}(this.appid,i,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:n,referrer_host:r,utm:this.utm,latest_data:this.last(n,r)}},e.prototype.last=function(e,t){var n="",r="",i="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,r=t,a=!0;var s=_H(e);s.keyword&&(i=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:r,$latest_search_keyword:i,isLast:a}},e.prototype.browser=function(){var e,t,n="",r=""+wT(this.appVersion),i=this.userAgent;return-1!==fk(i).call(i,"Edge")||-1!==fk(i).call(i,"Edg")?(n="Microsoft Edge",-1!==fk(i).call(i,"Edge")?(e=fk(i).call(i,"Edge"),r=i.substring(e+5)):(e=fk(i).call(i,"Edg"),r=i.substring(e+4))):-1!==(e=fk(i).call(i,"MSIE"))?(n="Microsoft Internet Explorer",r=i.substring(e+5)):-1!==(e=fk(i).call(i,"Lark"))?(n="Lark",r=i.substring(e+5,e+11)):-1!==(e=fk(i).call(i,"MetaSr"))?(n="sougoubrowser",r=i.substring(e+7,e+10)):-1!==fk(i).call(i,"MQQBrowser")||-1!==fk(i).call(i,"QQBrowser")?(n="qqbrowser",-1!==fk(i).call(i,"MQQBrowser")?(e=fk(i).call(i,"MQQBrowser"),r=i.substring(e+11,e+15)):-1!==fk(i).call(i,"QQBrowser")&&(e=fk(i).call(i,"QQBrowser"),r=i.substring(e+10,e+17))):-1!==fk(i).call(i,"Chrome")?-1!==(e=fk(i).call(i,"MicroMessenger"))?(n="weixin",r=i.substring(e+15,e+20)):-1!==(e=fk(i).call(i,"360"))?(n="360browser",r=i.substring(fk(i).call(i,"Chrome")+7)):-1!==fk(i).call(i,"baidubrowser")||-1!==fk(i).call(i,"BIDUBrowser")?(-1!==fk(i).call(i,"baidubrowser")?(e=fk(i).call(i,"baidubrowser"),r=i.substring(e+13,e+16)):-1!==fk(i).call(i,"BIDUBrowser")&&(e=fk(i).call(i,"BIDUBrowser"),r=i.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=fk(i).call(i,"xiaomi"))?-1!==fk(i).call(i,"openlanguagexiaomi")?(n="openlanguage xiaomi",r=i.substring(e+7,e+13)):(n="xiaomi",r=i.substring(e-7,e-1)):-1!==(e=fk(i).call(i,"TTWebView"))?(n="TTWebView",r=i.substring(e+10,e+23)):(-1!==(e=fk(i).call(i,"Chrome"))||-1!==(e=fk(i).call(i,"Chrome")))&&(n="Chrome",r=i.substring(e+7)):-1!==fk(i).call(i,"Safari")?-1!==(e=fk(i).call(i,"QQ"))?(n="qqbrowser",r=i.substring(e+10,e+16)):-1!==(e=fk(i).call(i,"Safari"))&&(n="Safari",r=i.substring(e+7),-1!==(e=fk(i).call(i,"Version"))&&(r=i.substring(e+8))):-1!==(e=fk(i).call(i,"Firefox"))?(n="Firefox",r=i.substring(e+8)):-1!==(e=fk(i).call(i,"MicroMessenger"))?(n="weixin",r=i.substring(e+15,e+20)):-1!==(e=fk(i).call(i,"QQ"))?(n="qqbrowser",r=i.substring(e+3,e+8)):-1!==(e=fk(i).call(i,"Opera"))&&(n="Opera",r=i.substring(e+6),-1!==(e=fk(i).call(i,"Version"))&&(r=i.substring(e+8))),-1!==(t=fk(r).call(r,";"))&&(r=r.substring(0,t)),-1!==(t=fk(r).call(r," "))&&(r=r.substring(0,t)),-1!==(t=fk(r).call(r,")"))&&(r=r.substring(0,t)),{browser:n,browser_version:r}},e.prototype.os=function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],r=0;r<n.length;r++){var i=n[r];if(i.r.test(this.userAgent)){"Mac OS X"===(e=i.s)&&this.isNewIpad()&&(e="iOS");break}}var o=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},a=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?pk(n).call(n,1)[0]:""};/Windows/.test(e)&&(t=o(/Windows (.*)/,e),e="windows");var s,l;switch(e){case"Mac OS X":t=a("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":s=this.userAgent,(l=o(/Android ([\.\_\d]+)/,s))||(l=o(/Android\/([\.\_\d]+)/,s)),t=l,e="android";break;case"iOS":t=this.isNewIpad()?a("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){fk(e).call(e,"Build/")>-1&&(t=pk(e).call(e,0,fk(e).call(e,"Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),r=fk(n).call(n,";");t=pk(n).call(n,0,r)}}catch(i){return IT(t).call(t)}return IT(t).call(t)},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),LH={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},FH="0.1.0",UH=function(){function e(e,t){this.collector=e,this.config=t,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","_be_active","$bav2b_slide"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","$user_unique_id_type","_staging_flag","$exposure_type","$direction","$offsetY","$offsetX"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return e.prototype.checkVerify=function(e){var t=this;if(!e||!e.length)return!1;var n=e[0];if(!n)return!1;var r=n.events,i=n.header;if(!r||!r.length)return!1;var o=!0;return r.forEach((function(e){t.checkEventName(e.event)||(o=!1,e.checkEvent="事件名不能以 $ or __开头"),t.checkEventParams(e.params)||(o=!1,e.checkParams="属性名不能以 $ or __开头")})),this.checkEventParams(i)||(o=!1),o},e.prototype.checkEventName=function(e){return!!e&&this.calculate(e,"event")},e.prototype.checkEventParams=function(e){var t=e;"string"==typeof e&&(t=JSON.parse(t));var n=!0;if(!dk(t).length)return n;for(var r in t){if(!this.calculate(r,"params")){n=!1;break}if("string"==typeof t[r]&&t[r].length>1024){console.warn("params: "+r+" can not over 1024 byte, please check;"),n=!1;break}}return n},e.prototype.calculate=function(e,t){var n="event"===t?this.eventNameWhiteList:"params"===t?this.paramsNameWhiteList:[];return-1!==fk(n).call(n,e)||(!new RegExp("^\\$").test(e)&&!new RegExp("^__").test(e)||(console.warn(t+" name: "+e+" can not start with $ or __, pleace check;"),!1))},e}();(xH=AH||(AH={})).Init="init",xH.Config="config",xH.Start="start",xH.Ready="ready",xH.TokenComplete="token-complete",xH.TokenStorage="token-storage",xH.TokenFetch="token-fetch",xH.TokenError="token-error",xH.ConfigUuid="config-uuid",xH.ConfigWebId="config-webid",xH.ConfigDomain="config-domain",xH.CustomWebId="custom-webid",xH.AnonymousId="anonymous-id",xH.TokenChange="token-change",xH.TokenReset="token-reset",xH.ConfigTransform="config-transform",xH.EnvTransform="env-transform",xH.SessionReset="session-reset",xH.SessionResetTime="session-reset-time",xH.Event="event",xH.Events="events",xH.EventNow="event-now",xH.CleanEvents="clean-events",xH.BeconEvent="becon-event",xH.SubmitBefore="submit-before",xH.SubmitScuess="submit-scuess",xH.SubmitAfter="submit-after",xH.SubmitError="submit-error",xH.SubmitVerifyH="submit-verify-h5",xH.Stay="stay",xH.ResetStay="reset-stay",xH.StayReady="stay-ready",xH.SetStay="set-stay",xH.RouteChange="route-change",xH.RouteReady="route-ready",xH.Ab="ab",xH.AbVar="ab-var",xH.AbAllVars="ab-all-vars",xH.AbConfig="ab-config",xH.AbExternalVersion="ab-external-version",xH.AbVersionChangeOn="ab-version-change-on",xH.AbVersionChangeOff="ab-version-change-off",xH.AbOpenLayer="ab-open-layer",xH.AbCloseLayer="ab-close-layer",xH.AbReady="ab-ready",xH.AbComplete="ab-complete",xH.AbTimeout="ab-timeout",xH.Profile="profile",xH.ProfileSet="profile-set",xH.ProfileSetOnce="profile-set-once",xH.ProfileUnset="profile-unset",xH.ProfileIncrement="profile-increment",xH.ProfileAppend="profile-append",xH.ProfileClear="profile-clear",xH.TrackDuration="track-duration",xH.TrackDurationStart="track-duration-start",xH.TrackDurationEnd="track-duration-end",xH.TrackDurationPause="track-duration-pause",xH.TrackDurationResume="tracl-duration-resume",xH.Autotrack="autotrack",xH.AutotrackReady="autotrack-ready",xH.CepReady="cep-ready",xH.TracerReady="tracer-ready",(IH=PH||(PH={})).DEBUGGER_MESSAGE="debugger-message",IH.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",IH.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",IH.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",IH.DEBUGGER_MESSAGE_EVENT="debugger-message-event",IH.DEVTOOL_WEB_READY="devtool-web-ready";var BH=AH,NH=void 0,VH=(new Date).getTimezoneOffset(),HH=iE(""+-VH/60,10),GH=60*VH,jH=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var n=new MH(t.app_id,t.cookie_domain||"",t.cookie_expire||7776e6).init();this.eventCheck=new UH(e,t);var r="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new OH(!1,"session"),this.localStorage=new OH(!1,"local"),t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var i=this.localStorage.getItem(r);i&&1==i?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(r,"1")),this.envInfo={user:{user_unique_id:NH,user_type:NH,user_id:NH,user_is_auth:NH,user_is_login:NH,device_id:NH,web_id:NH,ip_addr_id:NH,user_unique_id_type:NH,anonymous_id:NH},header:{app_id:NH,app_name:NH,app_install_id:NH,install_id:NH,app_package:NH,app_channel:NH,app_version:NH,ab_version:NH,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:NH,traffic_type:NH,client_ip:NH,device_brand:NH,os_api:NH,access:NH,language:n.language,region:NH,app_language:NH,app_region:NH,creative_id:n.utm.creative_id,ad_id:n.utm.ad_id,campaign_id:n.utm.campaign_id,log_type:NH,rnd:NH,platform:n.platform,sdk_version:FH,sdk_lib:"js",province:NH,city:NH,timezone:HH,tz_offset:GH,tz_name:NH,sim_region:NH,carrier:NH,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:n.utm.utm_term,utm_content:n.utm.utm_content,utm_source:n.utm.utm_source,utm_medium:n.utm.utm_medium,utm_campaign:n.utm.utm_campaign,tracer_data:yM(n.utm.tracer_data),custom:{},wechat_unionid:NH,wechat_openid:NH}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(n),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=gH(LH[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.initABData=function(){var e="__tea_sdk_ab_version_"+this.initConfig.app_id,t=null;if(this.initConfig.ab_cross){var n=this.localStorage.getCookie(e,this.initConfig.ab_cookie_domain);t=n?JSON.parse(n):null}else t=this.localStorage.getItem(e);this.setAbCache(t)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.clearAbCache=function(){this.ab_cache={},this.ab_version=""},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t="/list";break;case"webid":t="/webid";break;case"tobid":t="/tobid";break;case"profile":t="/profile/list"}var n="";return this.initConfig.caller&&(n="?sdk_version=0.1.0&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),this.initConfig.enable_encryption&&"event"===e&&"sm"!==this.initConfig.encryption_type&&(n=this.initConfig.caller?n+"&encryption=1":n+"?encryption=1"),this.initConfig.report_url?""+this.initConfig.report_url+n:""+this.getDomain()+t+n},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.set=function(e){var t=this;dk(e).forEach((function(n){void 0!==e[n]&&null!==e[n]||t.delete(n);try{t.eventCheck.calculate(n,"config")}catch(u){}if("traffic_type"===n&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[n]),"evtParams"===n)t.evtParams=lH({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===n)t.evtParams=lH({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===n&&"function"==typeof e[n])t.reportErrorCallback=e[n];else{var r="",i="";if(fk(n).call(n,".")>-1){var o=n.split(".");r=o[0],i=o[1]}if(r)"user"===r||"header"===r?t.envInfo[r][i]=e[n]:t.envInfo.header.custom[i]=e[n];else if(Object.hasOwnProperty.call(t.envInfo.user,n)){var a,s,l;fk(a=["user_type","ip_addr_id"]).call(a,n)>-1?t.envInfo.user[n]=e[n]?Number(e[n]):e[n]:fk(s=["user_id","web_id","user_unique_id","user_unique_id_type","anonymous_id"]).call(s,n)>-1?t.envInfo.user[n]=e[n]?String(e[n]):e[n]:fk(l=["user_is_auth","user_is_login"]).call(l,n)>-1?t.envInfo.user[n]=Boolean(e[n]):"device_id"===n&&(t.envInfo.user[n]=e[n])}else Object.hasOwnProperty.call(t.envInfo.header,n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(yM(this.envInfo[e])):JSON.parse(yM(this.envInfo))}catch(t){console.log("get config stringify error "),this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&dk(e).length){var n=AE(e,t);this.storage.setItem(this.configKey,n)}}catch(r){console.log("setStore error"),this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&dk(e).length?e:null}catch(t){return this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(n){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),console.log("delete error")}},e}(),zH=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("[instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),KH=function(){function e(e,t){var n;this.native=e.enable_native||e[qV(n="evitaN".split("")).call(n).join("")],this.os=t.get("os_name")}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Hw((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):n(!1)})):n(!1)}catch(r){console.log("AppLogBridge, error:"+yM(r.stack)),n(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(yM(e)),console.log("change bridge appid, event report with appid: "+e)}catch(t){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{dk(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(n){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(t){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(n){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(yM(e))}catch(t){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(t){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t)}catch(n){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(oz){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(oz){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(oz){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(oz){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(oz){console.error("profileAppend error")}},t.setExternalAbVersion=function(e){try{AppLogBridge.setExternalAbVersion(e)}catch(oz){console.error("setExternalAbVersion error")}},t.getVar=function(e,t,n){try{"android"===this.os?n(AppLogBridge.getABTestConfigValueForKey(e,t)):AppLogBridge.getABTestConfigValueForKey(e,t,(function(e){n(e)}))}catch(oz){console.error("getVar error"),n(t)}},t.getAllVars=function(e){try{"android"===this.os?e(AppLogBridge.getAllAbTestConfigs()):AppLogBridge.getAllAbTestConfigs((function(t){e(t)}))}catch(oz){console.error("getAllVars error"),e(null)}},t.getAbSdkVersion=function(e){try{"android"===this.os?e(AppLogBridge.getAbSdkVersion()):AppLogBridge.getAbSdkVersion((function(t){e(t)}))}catch(oz){console.error("getAbSdkVersion error"),e("")}},e}(),WH=500,qH=5005;function XH(e,t,n,r,i,o,a,s,l,u){try{var c=new XMLHttpRequest,h=s||"POST";c.open(h,""+e,!0),l&&u?c.setRequestHeader("Content-Type","application/octet-stream;tt-data="+u):c.setRequestHeader("Content-Type","application/json; charset=utf-8"),a&&c.setRequestHeader("X-MCS-AppKey",""+a),r&&(c.withCredentials=!0),n&&(c.timeout=n,c.ontimeout=function(){o&&o(t,qH)}),c.onload=function(){if(i){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(n){e={}}i(e,t)}}},c.onerror=function(){c.abort(),o&&o(t,WH)},l?c.send(t):c.send(yM(t))}catch(f){}}var YH=4001,$H=4e3,ZH=4002,JH=4003,QH=function(e,t,n,r){try{var i=e.match(/\/v\d\//),o="";o=i?i[0]:-1!==fk(e).call(e,"/v1/")?"/v1/":"/v2/";var a=e.split(o)[0];if(!a)return void r(e,t,YH);t.forEach((function(i){var o=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t+="&"+n+"="+encodeURIComponent(yM(e[n])));return"&"===t[0]?pk(t).call(t,1):t}(i),s=new Image(1,1);s.onload=function(){s=null,n&&n()},s.onerror=function(){s=null,r&&r(e,t,$H)},s.src=a+"/gif?"+o}))}catch(s){r&&r(e,t,ZH,s.message)}},eG=function(e,t,n,r,i,o,a,s,l){var u=window.navigator.userAgent,c=window.navigator.appName;if(-1===fk(c).call(c,"Microsoft Internet Explorer")||-1===fk(u).call(u,"MSIE 8.0")&&-1===fk(u).call(u,"MSIE 9.0")){if(a)return window.navigator&&window.navigator.sendBeacon?void(window.navigator.sendBeacon(e,yM(t))?i():o(e,t,JH)):void QH(e,t,i,o)}else QH(e,t,i,o);XH(e,t,n,r,i,o,"","",s,l)},tG=function(){function e(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new OH(!0),this.localStorage=new OH(!1),this.eventCheck=new UH(e,t),this.maxReport=t.max_report||20,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.collect.on(BH.Ready,(function(){n.reportAll(!1)})),this.collect.on(BH.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on(BH.Event,(function(e){n.event(e)})),this.collect.on(BH.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on(BH.CleanEvents,(function(){n.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),yH((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var n=cH(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var r=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),r)}}catch(i){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}},e.prototype.beconEvent=function(e){var t=cH(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var r;r=pk(e).call(e,n,n+this.eventLimit);var i=this.split(this.merge(r));this.send(i,t)}else{i=this.split(this.merge(e));this.send(i,t)}},e.prototype.handleRefer=function(){var e="";try{if(this.config.spa||this.config.autotrack){var t=this.localStorage.getItem(this.refer_key)||{};e=t.routeChange?t.refer_key:this.configManager.get("referrer")}else e=this.configManager.get("referrer")}catch(n){e=document.referrer}return e},e.prototype.merge=function(e,t){var n=this,r=this.configManager.get(),i=r.header,o=r.user;i.referrer=this.handleRefer(),i.custom=yM(i.custom);var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),l=Vw(e).call(e,(function(e){try{if(dk(a).length&&!t&&(e.params=lH({},e.params,a)),n.collect.dynamicParamsFilter){var r=n.collect.dynamicParamsFilter();dk(r).length&&(e.params=lH({},e.params,r))}s&&(e.params.$user_unique_id_type=s);var i=n.configManager.getAbCache(),l=n.configManager.getAbVersion();return l&&i&&(n.config.disable_ab_reset||i.uuid===o.user_unique_id)&&(e.ab_sdk_version=l),e.session_id=n.collect.sessionManager.getSessionId(),e.params=yM(e.params),e}catch(u){return n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:u.message}),e}})),u=[];if(!dk(o).length)return console.warn("user info error,cant report"),u;this.config.enable_anonymousid&&delete o.web_id;var c=JSON.parse(yM({events:l,user:o,header:i}));return c.local_time=Math.floor(Date.now()/1e3),c.verbose=1,c.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,u.push(c),u},e.prototype.split=function(e){return e=Vw(e).call(e,(function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var n=this;e.length&&e.forEach((function(e){try{var r,i=JSON.parse(yM(e));if(Gw(n.config))(i=Gw(r=n.config).call(r,i))||console.warn("filter must return data !!");n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var o=i||e,a=JSON.parse(yM(o));if(n.eventCheck.checkVerify(a),!o.length)return;n.collect.emit(BH.SubmitBefore,o);var s=n.collect.cryptoData(o);eG(n.reportUrl,s,n.timeout,!1,(function(e,t){e&&0!==e.e?(n.collect.emit(BH.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:a,code:e.e,failType:"数据异常",status:"fail"})):(n.collect.emit(BH.SubmitScuess,{eventData:t,res:e}),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:a,code:200,status:"success"}))}),(function(e,t){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit(BH.SubmitError,{type:"f_net",eventData:e,errorCode:t}),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:a,code:t,failType:"网络异常",status:"fail"})}),t,n.config.enable_encryption,n.config.encryption_header),n.eventCheck.checkVerify(o),n.collect.emit(BH.SubmitVerifyH,o),n.collect.emit(BH.SubmitAfter,o)}catch(l){console.warn("something error, "+yM(l.stack)),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:l.message})}}))},e}(),nG=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},rG=function(){var e;return pk(e=nG().replace(/-/g,"")).call(e,0,19)},iG=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},oG=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new OH(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(BH.SessionReset,(function(){n.resetSessionId()})),this.collect.on(BH.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:iG(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:iG(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:iG(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&(Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:iG(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e)))},e}(),aG=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enableTTwebid=!1,this.enableCustomWebid=!1,this.enableAnonymousid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new OH(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enableAnonymousid=t.enable_anonymousid,this.enableTTwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(BH.AnonymousId,(function(e){n.setAnonymousId(e)})),this.collect.on(BH.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on(BH.ConfigWebId,(function(e){n.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid||this.enableAnonymousid?this.enableAnonymousid?this.completeAnonymous(this.cacheToken):this.enableCustomWebid?this.collect.on(BH.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(BH.TokenComplete)})):this.checkEnv()||(this.enableTTwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:rG(),user_unique_id:this.configManager.get("user_unique_id")||rG()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==fk(e).call(e,"miniProgram")||-1!==fk(e).call(e,"MiniProgram")){var t=_H(window.location.href);return!(!t||!t.Web_ID)&&(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),!0)}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:n});var r=rG();XH(t,this.collect.cryptoData(n),3e5,!1,(function(t){var n;t&&0===t.e?(n=t.web_id,e.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t})):(n=r,e.collect.configManager.set({localWebId:r}),e.collect.emit(BH.TokenError),e.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"WEBID请求返回值异常",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})}),(function(){e.complete({web_id:e.configManager.get("web_id")||r,user_unique_id:e.configManager.get("user_unique_id")||r}),e.collect.configManager.set({localWebId:r}),e.collect.emit(BH.TokenError),e.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")}),"","",this.config.enable_encryption,this.config.encryption_header)},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;if(!t&&!n)return this.collect.emit(BH.TokenError),void console.warn("token error");e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(BH.TokenComplete)},e.prototype.completeAnonymous=function(e){var t=e.anonymous_id||iG(),n=e.user_unique_id||this.configManager.get("user_unique_id");this.collect.configManager.set({anonymous_id:t,user_unique_id:n||t}),e.anonymous_id=t,e.user_unique_id=n||t,this.setStorage(e),this.tokenReady=!0,this.collect.emit(BH.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(BH.TokenComplete)},e.prototype.setUuid=function(e){var t;if(e&&-1===fk(t=["null","undefined","Null","None"]).call(t,e)){var n=String(e),r=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(n===r&&n===i)return;this.configManager.set({user_unique_id:n}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=n,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(BH.TokenChange,{type:"uuid",id:e}),this.collect.emit(BH.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){if(!this.config.enable_ttwebid){var e=this.enableAnonymousid?this.configManager.get("anonymous_id"):this.configManager.get("web_id");this.configManager.get("user_unique_id")!==e&&(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(BH.TokenReset))}},e.prototype.setAnonymousId=function(e){if(e&&this.enableAnonymousid){var t=this.configManager.get("anonymous_id"),n=this.configManager.get("user_unique_id");t!==e&&(t!==n&&n||(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.collect.emit(BH.TokenChange,{type:"uuid",id:e})),this.configManager.set({anonymous_id:e}),this.cacheToken.anonymous_id=e,this.collect.emit(BH.TokenChange,{type:"anonymous_id",id:e}),this.setStorage(this.cacheToken))}},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid&&!this.enableAnonymousid){var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.collect.emit(BH.TokenChange,{type:"uuid",id:e})),t!==e&&(this.configManager.set({web_id:e}),this.cacheToken.web_id=e,this.collect.emit(BH.TokenChange,{type:"webid",id:e})),this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){var t;e._type_=this.enableCustomWebid?"custom":"default",delete e[qV(t="diss".split("")).call(t).join("")],this.enableCookie||this.enableTTwebid?this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this,t=this.configManager.getUrl("tobid"),n={app_id:this.config.app_id,user_unique_id:this.configManager.get("user_unique_id"),user_unique_id_type:this.configManager.get("user_unique_id_type")};this.enableAnonymousid?n.anonymous_id=this.configManager.get("anonymous_id"):n.web_id=this.configManager.get("web_id");var r=this.collect.cryptoData(n);return new Hw((function(n){XH(t,r,3e4,e.enableTTwebid,(function(e){e&&0===e.e?n(e.tobid):n("")}),(function(){n("")}),"","",e.config.enable_encryption,e.config.encryption_header)}))},e}(),sG=EH((function(e,t){(function(){var t;function n(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function r(){return new n(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var l=32767&this[e],u=this[e++]>>15,c=s*l+u*a;i=((l=a*l+((32767&c)<<15)+n[r]+(1073741823&i))>>>30)+(c>>>15)+s*u+(i>>>30),n[r++]=1073741823&l}return i},t=30):i&&"Netscape"!=navigator.appName?(n.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},t=26):(n.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var l=16383&this[e],u=this[e++]>>14,c=s*l+u*a;i=((l=a*l+((16383&c)<<14)+n[r]+i)>>28)+(c>>14)+s*u,n[r++]=268435455&l}return i},t=28),n.prototype.DB=t,n.prototype.DM=(1<<t)-1,n.prototype.DV=1<<t;n.prototype.FV=Math.pow(2,52),n.prototype.F1=52-t,n.prototype.F2=2*t-52;var o,a,s="0123456789abcdefghijklmnopqrstuvwxyz",l=new Array;for(o="0".charCodeAt(0),a=0;a<=9;++a)l[o++]=a;for(o="a".charCodeAt(0),a=10;a<36;++a)l[o++]=a;for(o="A".charCodeAt(0),a=10;a<36;++a)l[o++]=a;function u(e){return s.charAt(e)}function c(e,t){var n=l[e.charCodeAt(t)];return null==n?-1:n}function h(e){var t=r();return t.fromInt(e),t}function f(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function d(e){this.m=e}function p(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function v(e,t){return e&t}function g(e,t){return e|t}function y(e,t){return e^t}function m(e,t){return e&~t}function _(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function b(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function k(e){return e}function E(e){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}d.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},d.prototype.revert=function(e){return e},d.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},d.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),gL(this).call(this,n)},d.prototype.sqrTo=function(e,t){e.squareTo(t),gL(this).call(this,t)},p.prototype.convert=function(e){var t=r();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(n.ZERO)>0&&this.m.subTo(t,t),t},p.prototype.revert=function(e){var t=r();return e.copyTo(t),gL(this).call(this,t),t},p.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},p.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),gL(this).call(this,n)},p.prototype.sqrTo=function(e,t){e.squareTo(t),gL(this).call(this,t)},n.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},n.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},n.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var i=e.length,o=!1,a=0;--i>=0;){var s=8==r?255&e[i]:c(e,i);s<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&n.ZERO.subTo(this,this)},n.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},n.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},n.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},n.prototype.lShiftTo=function(e,t){var n,r=e%this.DB,i=this.DB-r,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<<r;for(n=a-1;n>=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},n.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},n.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},n.prototype.multiplyTo=function(e,t){var r=this.abs(),i=e.abs(),o=r.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o<i.t;++o)t[o+r.t]=r.am(0,i[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&n.ZERO.subTo(t,t)},n.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},n.prototype.divRemTo=function(e,t,i){var o=e.abs();if(!(o.t<=0)){var a=this.abs();if(a.t<o.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=r());var s=r(),l=this.s,u=e.s,c=this.DB-f(o[o.t-1]);c>0?(o.lShiftTo(c,s),a.lShiftTo(c,i)):(o.copyTo(s),a.copyTo(i));var h=s.t,d=s[h-1];if(0!=d){var p=d*(1<<this.F1)+(h>1?s[h-2]>>this.F2:0),v=this.FV/p,g=(1<<this.F1)/p,y=1<<this.F2,m=i.t,_=m-h,b=null==t?r():t;for(s.dlShiftTo(_,b),i.compareTo(b)>=0&&(i[i.t++]=1,i.subTo(b,i)),n.ONE.dlShiftTo(h,b),b.subTo(s,s);s.t<h;)s[s.t++]=0;for(;--_>=0;){var w=i[--m]==d?this.DM:Math.floor(i[m]*v+(i[m-1]+y)*g);if((i[m]+=s.am(0,w,i,_,0,h))<w)for(s.dlShiftTo(_,b),i.subTo(b,i);i[m]<--w;)i.subTo(b,i)}null!=t&&(i.drShiftTo(h,t),l!=u&&n.ZERO.subTo(t,t)),i.t=h,i.clamp(),c>0&&i.rShiftTo(c,i),l<0&&n.ZERO.subTo(i,i)}}},n.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},n.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},n.prototype.exp=function(e,t){if(e>4294967295||e<1)return n.ONE;var i=r(),o=r(),a=t.convert(this),s=f(e)-1;for(a.copyTo(i);--s>=0;)if(t.sqrTo(i,o),(e&1<<s)>0)t.mulTo(o,a,i);else{var l=i;i=o,o=l}return t.revert(i)},n.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(i=!0,o=u(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=u(n));return i?o:"0"},n.prototype.negate=function(){var e=r();return n.ZERO.subTo(this,e),e},n.prototype.abs=function(){return this.s<0?this.negate():this},n.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},n.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},n.prototype.mod=function(e){var t=r();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(n.ZERO)>0&&e.subTo(t,t),t},n.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new d(t):new p(t),this.exp(e,n)},n.ZERO=h(0),n.ONE=h(1),w.prototype.convert=k,w.prototype.revert=k,w.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},E.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=r();return e.copyTo(t),gL(this).call(this,t),t},E.prototype.revert=function(e){return e},E.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},E.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),gL(this).call(this,n)},E.prototype.sqrTo=function(e,t){e.squareTo(t),gL(this).call(this,t)};var S,T,C,A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],x=(1<<26)/A[A.length-1];function P(){var e;e=(new Date).getTime(),T[C++]^=255&e,T[C++]^=e>>8&255,T[C++]^=e>>16&255,T[C++]^=e>>24&255,C>=F&&(C-=F)}if(n.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},n.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),i=h(n),o=r(),a=r(),s="";for(this.divRemTo(i,o,a);o.signum()>0;)s=(n+a.intValue()).toString(e).substr(1)+s,o.divRemTo(i,o,a);return a.intValue().toString(e)+s},n.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),i=Math.pow(t,r),o=!1,a=0,s=0,l=0;l<e.length;++l){var u=c(e,l);u<0?"-"==e.charAt(l)&&0==this.signum()&&(o=!0):(s=t*s+u,++a>=r&&(this.dMultiply(i),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),o&&n.ZERO.subTo(this,this)},n.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(n.ONE.shiftLeft(e-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(n.ONE.shiftLeft(e-1),this);else{var i=new Array,o=7&e;i.length=1+(e>>3),t.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},n.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},n.prototype.changeBit=function(e,t){var r=n.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},n.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},n.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},n.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},n.prototype.multiplyLowerTo=function(e,t,n){var r,i=Math.min(this.t+e.t,t);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i<r;++i)n[i+this.t]=this.am(0,e[i],n,i,0,this.t);for(r=Math.min(e.t,t);i<r;++i)this.am(0,e[i],n,i,0,t-i);n.clamp()},n.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},n.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},n.prototype.millerRabin=function(e){var t=this.subtract(n.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var o=t.shiftRight(i);(e=e+1>>1)>A.length&&(e=A.length);for(var a=r(),s=0;s<e;++s){a.fromInt(A[Math.floor(Math.random()*A.length)]);var l=a.modPow(o,this);if(0!=l.compareTo(n.ONE)&&0!=l.compareTo(t)){for(var u=1;u++<i&&0!=l.compareTo(t);)if(0==(l=l.modPowInt(2,this)).compareTo(n.ONE))return!1;if(0!=l.compareTo(t))return!1}}return!0},n.prototype.clone=function(){var e=r();return this.copyTo(e),e},n.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},n.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},n.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},n.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},n.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},n.prototype.equals=function(e){return 0==this.compareTo(e)},n.prototype.min=function(e){return this.compareTo(e)<0?this:e},n.prototype.max=function(e){return this.compareTo(e)>0?this:e},n.prototype.and=function(e){var t=r();return this.bitwiseTo(e,v,t),t},n.prototype.or=function(e){var t=r();return this.bitwiseTo(e,g,t),t},n.prototype.xor=function(e){var t=r();return this.bitwiseTo(e,y,t),t},n.prototype.andNot=function(e){var t=r();return this.bitwiseTo(e,m,t),t},n.prototype.not=function(){for(var e=r(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},n.prototype.shiftLeft=function(e){var t=r();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},n.prototype.shiftRight=function(e){var t=r();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},n.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+_(this[e]);return this.s<0?this.t*this.DB:-1},n.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=b(this[n]^t);return e},n.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},n.prototype.setBit=function(e){return this.changeBit(e,g)},n.prototype.clearBit=function(e){return this.changeBit(e,m)},n.prototype.flipBit=function(e){return this.changeBit(e,y)},n.prototype.add=function(e){var t=r();return this.addTo(e,t),t},n.prototype.subtract=function(e){var t=r();return this.subTo(e,t),t},n.prototype.multiply=function(e){var t=r();return this.multiplyTo(e,t),t},n.prototype.divide=function(e){var t=r();return this.divRemTo(e,t,null),t},n.prototype.remainder=function(e){var t=r();return this.divRemTo(e,null,t),t},n.prototype.divideAndRemainder=function(e){var t=r(),n=r();return this.divRemTo(e,t,n),new Array(t,n)},n.prototype.modPow=function(e,t){var n,i,o=e.bitLength(),a=h(1);if(o<=0)return a;n=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new d(t):t.isEven()?new E(t):new p(t);var s=new Array,l=3,u=n-1,c=(1<<n)-1;if(s[1]=i.convert(this),n>1){var v=r();for(i.sqrTo(s[1],v);l<=c;)s[l]=r(),i.mulTo(v,s[l-2],s[l]),l+=2}var g,y,m=e.t-1,_=!0,b=r();for(o=f(e[m])-1;m>=0;){for(o>=u?g=e[m]>>o-u&c:(g=(e[m]&(1<<o+1)-1)<<u-o,m>0&&(g|=e[m-1]>>this.DB+o-u)),l=n;0==(1&g);)g>>=1,--l;if((o-=l)<0&&(o+=this.DB,--m),_)s[g].copyTo(a),_=!1;else{for(;l>1;)i.sqrTo(a,b),i.sqrTo(b,a),l-=2;l>0?i.sqrTo(a,b):(y=a,a=b,b=y),i.mulTo(b,s[g],a)}for(;m>=0&&0==(e[m]&1<<o);)i.sqrTo(a,b),y=a,a=b,b=y,--o<0&&(o=this.DB-1,--m)}return i.revert(a)},n.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return n.ZERO;for(var r=e.clone(),i=this.clone(),o=h(1),a=h(0),s=h(0),l=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),t?(s.isEven()&&l.isEven()||(s.addTo(this,s),l.subTo(e,l)),s.rShiftTo(1,s)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);r.compareTo(i)>=0?(r.subTo(i,r),t&&o.subTo(s,o),a.subTo(l,a)):(i.subTo(r,i),t&&s.subTo(o,s),l.subTo(a,l))}return 0!=i.compareTo(n.ONE)?n.ZERO:l.compareTo(e)>=0?l.subtract(e):l.signum()<0?(l.addTo(e,l),l.signum()<0?l.add(e):l):l},n.prototype.pow=function(e){return this.exp(e,new w)},n.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},n.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=A[A.length-1]){for(t=0;t<A.length;++t)if(n[0]==A[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<A.length;){for(var r=A[t],i=t+1;i<A.length&&r<x;)r*=A[i++];for(r=n.modInt(r);t<i;)if(r%A[t++]==0)return!1}return n.millerRabin(e)},n.prototype.square=function(){var e=r();return this.squareTo(e),e},n.prototype.Barrett=E,null==T){var I;if(T=new Array,C=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var R=new Uint8Array(32);for(window.crypto.getRandomValues(R),I=0;I<32;++I)T[C++]=R[I]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var D=window.crypto.random(32);for(I=0;I<D.length;++I)T[C++]=255&D.charCodeAt(I)}for(;C<F;)I=Math.floor(65536*Math.random()),T[C++]=I>>>8,T[C++]=255&I;C=0,P()}function O(){if(null==S){for(P(),(S=new L).init(T),C=0;C<T.length;++C)T[C]=0;C=0}return S.next()}function M(){}function L(){this.i=0,this.j=0,this.S=new Array}M.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=O()},L.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},L.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var F=256;e.exports={default:n,BigInteger:n,SecureRandom:M}}).call(kH)}));sG.BigInteger,sG.SecureRandom;var lG=sG.BigInteger;var uG=function(){function e(){Ry(this,e),this.tlv=null,this.t="00",this.l="00",this.v=""}return Fy(e,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var e=this.v.length/2,t=e.toString(16);return t.length%2==1&&(t="0"+t),e<128?t:(128+t.length/2).toString(16)+t}},{key:"getValue",value:function(){return""}}]),e}(),cG=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),(r=t.call(this)).t="02",e&&(r.v=function(e){var t=e.toString(16);if("-"!==t[0])t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=(t=t.substr(1)).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=(t=(r=new lG(r,16)).xor(e).add(lG.ONE)).toString(16).replace(/^-/,"")}return t}(e)),r}return Fy(n,[{key:"getValue",value:function(){return this.v}}]),n}(uG),hG=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),(r=t.call(this)).t="30",r.asn1Array=e,r}return Fy(n,[{key:"getValue",value:function(){var e;return this.v=Vw(e=this.asn1Array).call(e,(function(e){return e.getEncodedHex()})).join(""),this.v}}]),n}(uG);function fG(e,t){return+e[t+2]<8?1:128&+e.substr(t+2,2)}function dG(e,t){var n=fG(e,t),r=e.substr(t+2,2*n);return r?(+r[0]<8?new lG(r,16):new lG(r.substr(2),16)).intValue():-1}function pG(e,t){return t+2*(fG(e,t)+1)}var vG=function(e,t){var n=new cG(e),r=new cG(t);return new hG([n,r]).getEncodedHex()},gG=function(e){var t=pG(e,0),n=pG(e,t),r=dG(e,t),i=e.substr(n,2*r),o=n+i.length,a=pG(e,o),s=dG(e,o),l=e.substr(a,2*s);return{r:new lG(i,16),s:new lG(l,16)}},yG=sG.BigInteger,mG=new yG("2"),_G=new yG("3"),bG=function(){function e(t,n){Ry(this,e),this.x=n,this.q=t}return Fy(e,[{key:"equals",value:function(e){return e===this||this.q.equals(e.q)&&this.x.equals(e.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new e(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(t){return new e(this.q,this.x.add(t.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(t){return new e(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(t){return new e(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}},{key:"divide",value:function(t){return new e(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new e(this.q,this.x.square().mod(this.q))}}]),e}(),wG=function(){function e(t,n,r,i){Ry(this,e),this.curve=t,this.x=n,this.y=r,this.z=null==i?yG.ONE:i,this.zinv=null}return Fy(e,[{key:"getX",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(e){return e===this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(yG.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(yG.ZERO))}},{key:"isInfinity",value:function(){return null===this.x&&null===this.y||this.z.equals(yG.ZERO)&&!this.y.toBigInteger().equals(yG.ZERO)}},{key:"negate",value:function(){return new e(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var n=this.x.toBigInteger(),r=this.y.toBigInteger(),i=this.z,o=t.x.toBigInteger(),a=t.y.toBigInteger(),s=t.z,l=this.curve.q,u=n.multiply(s).mod(l),c=o.multiply(i).mod(l),h=u.subtract(c),f=r.multiply(s).mod(l),d=a.multiply(i).mod(l),p=f.subtract(d);if(yG.ZERO.equals(h))return yG.ZERO.equals(p)?this.twice():this.curve.infinity;var v=u.add(c),g=i.multiply(s).mod(l),y=h.square().mod(l),m=h.multiply(y).mod(l),_=g.multiply(p.square()).subtract(v.multiply(y)).mod(l),b=h.multiply(_).mod(l),w=p.multiply(y.multiply(u).subtract(_)).subtract(f.multiply(m)).mod(l),k=m.multiply(g).mod(l);return new e(this.curve,this.curve.fromBigInteger(b),this.curve.fromBigInteger(w),k)}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var t=this.x.toBigInteger(),n=this.y.toBigInteger(),r=this.z,i=this.curve.q,o=this.curve.a.toBigInteger(),a=t.square().multiply(_G).add(o.multiply(r.square())).mod(i),s=n.shiftLeft(1).multiply(r).mod(i),l=n.square().mod(i),u=l.multiply(t).multiply(r).mod(i),c=s.square().mod(i),h=a.square().subtract(u.shiftLeft(3)).mod(i),f=s.multiply(h).mod(i),d=a.multiply(u.shiftLeft(2).subtract(h)).subtract(c.shiftLeft(1).multiply(l)).mod(i),p=s.multiply(c).mod(i);return new e(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(d),p)}},{key:"multiply",value:function(e){if(this.isInfinity())return this;if(!e.signum())return this.curve.infinity;for(var t=e.multiply(_G),n=this.negate(),r=this,i=t.bitLength()-2;i>0;i--){r=r.twice();var o=t.testBit(i);o!==e.testBit(i)&&(r=r.add(o?this:n))}return r}}]),e}(),kG=function(){function e(t,n,r){Ry(this,e),this.q=t,this.a=this.fromBigInteger(n),this.b=this.fromBigInteger(r),this.infinity=new wG(this,null,null)}return Fy(e,[{key:"equals",value:function(e){return e===this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)}},{key:"fromBigInteger",value:function(e){return new bG(this.q,e)}},{key:"decodePointHex",value:function(e){switch(iE(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var t=this.fromBigInteger(new yG(e.substr(2),16)),n=this.fromBigInteger(t.multiply(t.square()).add(t.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new yG("4")).add(yG.ONE),this.q));return n.toBigInteger().mod(mG).equals(new yG(e.substr(0,2),16).subtract(mG))||(n=n.negate()),new wG(this,t,n);case 4:case 6:case 7:var r=(e.length-2)/2,i=e.substr(2,r),o=e.substr(r+2,r);return new wG(this,this.fromBigInteger(new yG(i,16)),this.fromBigInteger(new yG(o,16)));default:return null}}}]),e}(),EG={ECPointFp:wG,ECCurveFp:kG},SG=sG.BigInteger,TG=sG.SecureRandom,CG=EG.ECCurveFp,AG=new TG,xG=DG(),PG=xG.curve,IG=xG.G,RG=xG.n;function DG(){var e=new SG("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),t=new SG("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),n=new SG("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),r=new CG(e,t,n),i=r.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:r,G:i,n:new SG("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function OG(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e}var MG={getGlobalCurve:function(){return PG},generateEcparam:DG,generateKeyPairHex:function(e,t,n){var r=(e?new SG(e,t,n):new SG(RG.bitLength(),AG)).mod(RG.subtract(SG.ONE)).add(SG.ONE),i=OG(r.toString(16),64),o=IG.multiply(r);return{privateKey:i,publicKey:"04"+OG(o.getX().toBigInteger().toString(16),64)+OG(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(e){if(130!==e.length)throw new Error("Invalid public key to compress");var t=(e.length-2)/2,n=e.substr(2,t),r="03";return new SG(e.substr(t+2,t),16).mod(new SG("2")).equals(SG.ZERO)&&(r="02"),r+n},utf8ToHex:function(e){for(var t=(e=unescape(encodeURIComponent(e))).length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;for(var i=[],o=0;o<t;o++){var a=n[o>>>2]>>>24-o%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).toString(16))}return i.join("")},leftPad:OG,arrayToHex:function(e){return Vw(e).call(e,(function(e){return 1===(e=e.toString(16)).length?"0"+e:e})).join("")},arrayToUtf8:function(e){for(var t=[],n=0,r=0;r<2*e.length;r+=2)t[r>>>3]|=iE(e[n],10)<<24-r%8*4,n++;try{for(var i=[],o=0;o<e.length;o++){var a=t[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(a))}return decodeURIComponent(escape(i.join("")))}catch(s){throw new Error("Malformed UTF-8 data")}},hexToArray:function(e){var t=[],n=e.length;n%2!=0&&(e=OG(e,n+1)),n=e.length;for(var r=0;r<n;r+=2)t.push(iE(e.substr(r,2),16));return t},verifyPublicKey:function(e){var t=PG.decodePointHex(e);if(!t)return!1;var n=t.getX();return t.getY().square().equals(n.multiply(n.square()).add(n.multiply(PG.a)).add(PG.b))},comparePublicKeyHex:function(e,t){var n=PG.decodePointHex(e);if(!n)return!1;var r=PG.decodePointHex(t);return!!r&&n.equals(r)}},LG=new Uint32Array(68),FG=new Uint32Array(64);function UG(e,t){var n=31&t;return e<<n|e>>>32-n}function BG(e,t){for(var n=[],r=e.length-1;r>=0;r--)n[r]=255&(e[r]^t[r]);return n}function NG(e){return e^UG(e,9)^UG(e,17)}function VG(e){var t,n=8*e.length,r=n%512;r=r>=448?512-r%448-1:448-r-1;for(var i=new Array((r-7)/8),o=new Array(8),a=0,s=i.length;a<s;a++)i[a]=0;for(var l=0,u=o.length;l<u;l++)o[l]=0;n=n.toString(2);for(var c=7;c>=0;c--)if(n.length>8){var h=n.length-8;o[c]=iE(n.substr(h),2),n=n.substr(0,h)}else n.length>0&&(o[c]=iE(n,2),n="");for(var f,d=new Uint8Array(Nm(t=[]).call(t,Iy(e),[128],i,o)),p=new DataView(d.buffer,0),v=d.length/64,g=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),y=0;y<v;y++){jM(LG).call(LG,0),jM(FG).call(FG,0);for(var m=16*y,_=0;_<16;_++)LG[_]=p.getUint32(4*(m+_),!1);for(var b=16;b<68;b++)LG[b]=(f=LG[b-16]^LG[b-9]^UG(LG[b-3],15))^UG(f,15)^UG(f,23)^UG(LG[b-13],7)^LG[b-6];for(var w=0;w<64;w++)FG[w]=LG[w]^LG[w+4];for(var k=g[0],E=g[1],S=g[2],T=g[3],C=g[4],A=g[5],x=g[6],P=g[7],I=void 0,R=void 0,D=void 0,O=void 0,M=0;M<64;M++)O=M>=0&&M<=15?2043430169:2055708042,R=(M>=0&&M<=15?k^E^S:k&E|k&S|E&S)+T+((I=UG(UG(k,12)+C+UG(O,M),7))^UG(k,12))+FG[M],D=(M>=0&&M<=15?C^A^x:C&A|~C&x)+P+I+LG[M],T=S,S=UG(E,9),E=k,k=R,P=x,x=UG(A,19),A=C,C=NG(D);g[0]^=k,g[1]^=E,g[2]^=S,g[3]^=T,g[4]^=C,g[5]^=A,g[6]^=x,g[7]^=P}for(var L=[],F=0,U=g.length;F<U;F++){var B=g[F];L.push((4278190080&B)>>>24,(16711680&B)>>>16,(65280&B)>>>8,255&B)}return L}for(var HG=new Uint8Array(64),GG=new Uint8Array(64),jG=0;jG<64;jG++)HG[jG]=54,GG[jG]=92;var zG=VG,KG=function(e,t){var n,r;for(t.length>64&&(t=VG(t));t.length<64;)t.push(0);var i=BG(t,HG),o=BG(t,GG),a=VG(Nm(n=[]).call(n,Iy(i),Iy(e)));return VG(Nm(r=[]).call(r,Iy(o),Iy(a)))},WG=sG.BigInteger,qG=vG,XG=gG,YG=zG,$G=MG.generateEcparam(),ZG=$G.G,JG=$G.curve,QG=$G.n;function ej(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1234567812345678";n=MG.utf8ToHex(n);var r,i,o=MG.leftPad(ZG.curve.a.toBigInteger().toRadix(16),64),a=MG.leftPad(ZG.curve.b.toBigInteger().toRadix(16),64),s=MG.leftPad(ZG.getX().toBigInteger().toRadix(16),64),l=MG.leftPad(ZG.getY().toBigInteger().toRadix(16),64);if(128===t.length)r=t.substr(0,64),i=t.substr(64,64);else{var u=ZG.curve.decodePointHex(t);r=MG.leftPad(u.getX().toBigInteger().toRadix(16),64),i=MG.leftPad(u.getY().toBigInteger().toRadix(16),64)}var c=MG.hexToArray(n+o+a+s+l+r+i),h=4*n.length;c.unshift(255&h),c.unshift(h>>8&255);var f=YG(c);return MG.arrayToHex(YG(Nm(f).call(f,MG.hexToArray(e))))}function tj(){var e=MG.generateKeyPairHex(),t=JG.decodePointHex(e.publicKey);return e.k=new WG(e.privateKey,16),e.x1=t.getX().toBigInteger(),e}var nj={generateKeyPairHex:MG.generateKeyPairHex,compressPublicKeyHex:MG.compressPublicKeyHex,comparePublicKeyHex:MG.comparePublicKeyHex,doEncrypt:function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;e="string"==typeof e?MG.hexToArray(MG.utf8ToHex(e)):pk(Array.prototype).call(e),t=MG.getGlobalCurve().decodePointHex(t);var o=MG.generateKeyPairHex(),a=new WG(o.privateKey,16),s=o.publicKey;s.length>128&&(s=s.substr(s.length-128));var l=t.multiply(a),u=MG.hexToArray(MG.leftPad(l.getX().toBigInteger().toRadix(16),64)),c=MG.hexToArray(MG.leftPad(l.getY().toBigInteger().toRadix(16),64)),h=MG.arrayToHex(YG(Nm(n=[]).call(n,u,e,c))),f=1,d=0,p=[],v=Nm(r=[]).call(r,u,c),g=function(){var e;p=YG(Nm(e=[]).call(e,Iy(v),[f>>24&255,f>>16&255,f>>8&255,255&f])),f++,d=0};g();for(var y=0,m=e.length;y<m;y++)d===p.length&&g(),e[y]^=255&p[d++];var _=MG.arrayToHex(e);return 0===i?s+_+h:s+h+_},doDecrypt:function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).output,a=void 0===o?"string":o;t=new WG(t,16);var s=e.substr(128,64),l=e.substr(192);0===i&&(s=e.substr(e.length-64),l=e.substr(128,e.length-128-64));var u=MG.hexToArray(l),c=MG.getGlobalCurve().decodePointHex("04"+e.substr(0,128)).multiply(t),h=MG.hexToArray(MG.leftPad(c.getX().toBigInteger().toRadix(16),64)),f=MG.hexToArray(MG.leftPad(c.getY().toBigInteger().toRadix(16),64)),d=1,p=0,v=[],g=Nm(n=[]).call(n,h,f),y=function(){var e;v=YG(Nm(e=[]).call(e,Iy(g),[d>>24&255,d>>16&255,d>>8&255,255&d])),d++,p=0};y();for(var m=0,_=u.length;m<_;m++)p===v.length&&y(),u[m]^=255&v[p++];return MG.arrayToHex(YG(Nm(r=[]).call(r,h,u,f)))===s.toLowerCase()?"array"===a?u:MG.arrayToUtf8(u):"array"===a?[]:""},doSignature:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.pointPool,i=n.der,o=n.hash,a=n.publicKey,s=n.userId,l="string"==typeof e?MG.utf8ToHex(e):MG.arrayToHex(e);o&&(a=a||function(e){var t=ZG.multiply(new WG(e,16)),n=MG.leftPad(t.getX().toBigInteger().toString(16),64),r=MG.leftPad(t.getY().toBigInteger().toString(16),64);return"04"+n+r}(t),l=ej(l,a,s));var u=new WG(t,16),c=new WG(l,16),h=null,f=null,d=null;do{do{var p=void 0;h=(p=r&&r.length?r.pop():tj()).k,f=c.add(p.x1).mod(QG)}while(f.equals(WG.ZERO)||f.add(h).equals(QG));d=u.add(WG.ONE).modInverse(QG).multiply(h.subtract(f.multiply(u))).mod(QG)}while(d.equals(WG.ZERO));return i?qG(f,d):MG.leftPad(f.toString(16),64)+MG.leftPad(d.toString(16),64)},doVerifySignature:function(e,t,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=o.der,s=o.hash,l=o.userId,u="string"==typeof e?MG.utf8ToHex(e):MG.arrayToHex(e);if(s&&(u=ej(u,n,l)),a){var c=XG(t);r=c.r,i=c.s}else r=new WG(t.substring(0,64),16),i=new WG(t.substring(64),16);var h=JG.decodePointHex(n),f=new WG(u,16),d=r.add(i).mod(QG);if(d.equals(WG.ZERO))return!1;var p=ZG.multiply(i).add(h.multiply(d)),v=f.add(p.getX().toBigInteger()).mod(QG);return r.equals(v)},getPoint:tj,verifyPublicKey:MG.verifyPublicKey},rj=zG,ij=KG;function oj(e){return Vw(e).call(e,(function(e){return 1===(e=e.toString(16)).length?"0"+e:e})).join("")}function aj(e){var t,n,r=[],i=e.length;i%2!=0&&(n=i+1,e=(t=e).length>=n?t:new Array(n-t.length+1).join("0")+t),i=e.length;for(var o=0;o<i;o+=2)r.push(iE(e.substr(o,2),16));return r}var sj=0,lj=16,uj=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],cj=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function hj(e){for(var t=[],n=0,r=e.length;n<r;n+=2)t.push(iE(e.substr(n,2),16));return t}function fj(e,t){return e<<t|e>>>32-t}function dj(e){return(255&uj[e>>>24&255])<<24|(255&uj[e>>>16&255])<<16|(255&uj[e>>>8&255])<<8|255&uj[255&e]}function pj(e){return e^fj(e,2)^fj(e,10)^fj(e,18)^fj(e,24)}function vj(e){return e^fj(e,13)^fj(e,23)}function gj(e,t,n){for(var r=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&e[4*o],i[1]=255&e[4*o+1],i[2]=255&e[4*o+2],i[3]=255&e[4*o+3],r[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(var a,s=0;s<32;s+=4)a=r[1]^r[2]^r[3]^n[s+0],r[0]^=pj(dj(a)),a=r[2]^r[3]^r[0]^n[s+1],r[1]^=pj(dj(a)),a=r[3]^r[0]^r[1]^n[s+2],r[2]^=pj(dj(a)),a=r[0]^r[1]^r[2]^n[s+3],r[3]^=pj(dj(a));for(var l=0;l<16;l+=4)t[l]=r[3-l/4]>>>24&255,t[l+1]=r[3-l/4]>>>16&255,t[l+2]=r[3-l/4]>>>8&255,t[l+3]=255&r[3-l/4]}function yj(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.padding,o=void 0===i?"pkcs#7":i,a=r.mode,s=r.iv,l=void 0===s?[]:s,u=r.output,c=void 0===u?"string":u;if("cbc"===a&&("string"==typeof l&&(l=hj(l)),16!==l.length))throw new Error("iv is invalid");if("string"==typeof t&&(t=hj(t)),16!==t.length)throw new Error("key is invalid");if(e="string"==typeof e?n!==sj?function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=QV(e).call(e,n);if(i<=127)t.push(i);else if(i<=2047)t.push(192|i>>>6),t.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)t.push(224|i>>>12),t.push(128|i>>>6&63),t.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw t.push(i),new Error("input is not supported");n++,t.push(240|i>>>18&28),t.push(128|i>>>12&63),t.push(128|i>>>6&63),t.push(128|63&i)}}return t}(e):hj(e):Iy(e),("pkcs#5"===o||"pkcs#7"===o)&&n!==sj)for(var h=lj-e.length%lj,f=0;f<h;f++)e.push(h);var d=new Array(32);!function(e,t,n){for(var r=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&e[0+4*o],i[1]=255&e[1+4*o],i[2]=255&e[2+4*o],i[3]=255&e[3+4*o],r[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];r[0]^=2746333894,r[1]^=1453994832,r[2]^=1736282519,r[3]^=2993693404;for(var a,s=0;s<32;s+=4)a=r[1]^r[2]^r[3]^cj[s+0],t[s+0]=r[0]^=vj(dj(a)),a=r[2]^r[3]^r[0]^cj[s+1],t[s+1]=r[1]^=vj(dj(a)),a=r[3]^r[0]^r[1]^cj[s+2],t[s+2]=r[2]^=vj(dj(a)),a=r[0]^r[1]^r[2]^cj[s+3],t[s+3]=r[3]^=vj(dj(a));if(n===sj)for(var l,u=0;u<16;u++)l=t[u],t[u]=t[31-u],t[31-u]=l}(t,d,n);for(var p,v=[],g=l,y=e.length,m=0;y>=lj;){var _=pk(e).call(e,m,m+16),b=new Array(16);if("cbc"===a)for(var w=0;w<lj;w++)n!==sj&&(_[w]^=g[w]);gj(_,b,d);for(var k=0;k<lj;k++)"cbc"===a&&n===sj&&(b[k]^=g[k]),v[m+k]=b[k];"cbc"===a&&(g=n!==sj?b:_),y-=lj,m+=lj}if(("pkcs#5"===o||"pkcs#7"===o)&&n===sj){for(var E=v.length,S=v[E-1],T=1;T<=S;T++)if(v[E-T]!==S)throw new Error("padding is invalid");Lk(v).call(v,E-S,S)}return"array"!==c?n!==sj?Vw(p=v).call(p,(function(e){return 1===(e=e.toString(16)).length?"0"+e:e})).join(""):function(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]>=240&&e[n]<=247?(t.push(sH(((7&e[n])<<18)+((63&e[n+1])<<12)+((63&e[n+2])<<6)+(63&e[n+3]))),n+=3):e[n]>=224&&e[n]<=239?(t.push(sH(((15&e[n])<<12)+((63&e[n+1])<<6)+(63&e[n+2]))),n+=2):e[n]>=192&&e[n]<=223?(t.push(sH(((31&e[n])<<6)+(63&e[n+1]))),n++):t.push(sH(e[n]));return t.join("")}(v):v}var mj={encrypt:function(e,t,n){return yj(e,t,1,n)},decrypt:function(e,t,n){return yj(e,t,0,n)}},_j={sm2:nj,sm3:function(e,t){if(e="string"==typeof e?function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=QV(e).call(e,n);if(i<=127)t.push(i);else if(i<=2047)t.push(192|i>>>6),t.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)t.push(224|i>>>12),t.push(128|i>>>6&63),t.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw t.push(i),new Error("input is not supported");n++,t.push(240|i>>>18&28),t.push(128|i>>>12&63),t.push(128|i>>>6&63),t.push(128|63&i)}}return t}(e):pk(Array.prototype).call(e),t){if("hmac"!==(t.mode||"hmac"))throw new Error("invalid mode");var n=t.key;if(!n)throw new Error("invalid key");return n="string"==typeof n?aj(n):pk(Array.prototype).call(n),oj(ij(e,n))}return oj(rj(e))},sm4:mj},bj=_j.sm2;var wj=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.adapters={},this.sdkReady=!1,this.name=e,this.hook=new dH,this.logger=new zH(e),this.remotePlugin=new Mw,this.Types=BH,this.adapters.fetch=XH,this.adapters.storage=OH}return e.usePlugin=function(t,n,r){if(n){for(var i=!1,o=0,a=e.plugins.length;o<a;o++){if(e.plugins[o].name===n){e.plugins[o].plugin=t,e.plugins[o].options=r||{},i=!0;break}}i||e.plugins.push({name:n,plugin:t,options:r})}else e.plugins.push({plugin:t})},e.prototype.init=function(t){var n,r=this;this.inited?console.log("init can be call only one time"):t&&pH(t)?t.app_id&&function(e){return"number"==typeof e&&!isNaN(e)}(t.app_id)?!t.app_key||function(e){return"string"==typeof e}(t.app_key)?(t.channel_domain||-1!==fk(n=["cn","sg","va"]).call(n,t.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),t.channel="cn"),this.logger=new zH(this.name,t.log),this.configManager=new jH(this,t),this.appBridge=new KH(t,this.configManager),this.bridgeReport=this.appBridge.bridgeInject(),this.initConfig=t,this.env=t.channel_domain?"self":"public",this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:t,level:"info",time:Date.now()}),t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport?(this.inited=!0,this.emit(BH.Init)):(t.enable_encryption&&"sm"===t.encryption_type&&this.initCrypto(),this.configManager.set({app_id:t.app_id}),this.eventManager=new tG,this.tokenManager=new aG,this.sessionManager=new oG,Hw.all([new Hw((function(e){r.once(BH.TokenComplete,(function(){e(!0)}))})),new Hw((function(e){r.once(BH.Start,(function(){e(!0)}))}))]).then((function(){try{var n;gL(n=e.plugins).call(n,(function(e,t){var n=t.plugin,i=t.options,o=AE(r.initConfig,i),a=new n;return a.apply(r,o),e.push(a),e}),r.pluginInstances)}catch(i){console.log("load plugin error, "+i.message),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}r.sdkReady=!0,r.emit(BH.Ready),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:r.configManager.get("user")}),r.logger.info("appid: "+t.app_id+", userInfo:"+yM(r.configManager.get("user"))),r.logger.info("appid: "+t.app_id+", sdk is ready, version is "+FH+", you can report now !!!");try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(i){r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}r.pageView(),r.on(BH.TokenChange,(function(e){"webid"!==e.type&&"anonymous_id"!==e.type||r.pageView(),r.logger.info("appid: "+t.app_id+" token change, new userInfo:"+yM(r.configManager.get("user"))),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(BH.TokenReset,(function(){r.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+yM(r.configManager.get("user"))),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(BH.RouteChange,(function(e){e.init||t.disable_route_report||r.pageView()}))})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t),this.inited=!0,this.emit(BH.Init))):console.warn("app_key param is error, must be string, please check!"):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&pH(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=lH({},e);if(this.initConfig&&this.initConfig.configPersist){var n=this.configManager.getStore();n&&(t=AE(n,e)),this.configManager.setStore(e)}t.web_id,t.user_unique_id;var r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&fk(t).call(t,r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof xE){var i=0;for(r=xE(e);i<r.length;i++)fk(t).call(t,r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["web_id","user_unique_id"]);t.hasOwnProperty("web_id")&&this.emit(BH.ConfigWebId,t.web_id),t.hasOwnProperty("user_unique_id")&&this.emit(BH.ConfigUuid,t.user_unique_id),this.configManager.set(r),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:t})}else this.logger.warn("config params is error, please check");else this.logger.warn("config must be use after function init")},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(BH.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(BH.Start),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit(BH.Ready)))},e.prototype.event=function(e,t){var n=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;var r=[];if(Array.isArray(e))e.forEach((function(e){var t=n.processEvent(e[0],e[1]||{});t&&r.push(t)}));else{var i=this.processEvent(e,t);if(!i)return;r.push(i)}this.bridgeReport?r.forEach((function(e){var t=e.event,r=e.params;n.appBridge.onEventV3(t,yM(r))})):r.length&&(this.emit(BH.Event,r),this.emit(BH.SessionResetTime))}catch(o){this.logger.warn("something error, please check"),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message})}},e.prototype.beconEvent=function(e,t){if(!this.initConfig||!this.initConfig.disable_track_event)if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var n=[],r=this.processEvent(e,t||{});r&&(n.push(r),n.length&&(this.emit(BH.BeconEvent,n),this.emit(BH.SessionResetTime)))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return this.logger.warn("eventName is null, please check"),null;var n=e;/^event\./.test(e)&&(n=pk(e).call(e,6));var r=t;"object"!==Tc(r)&&(r={}),r.profile?delete r.profile:r.event_index=vH();var i=void 0;return r.local_ms?(i=r.local_ms,delete r.local_ms):i=+new Date,{event:n,params:r,local_time_ms:i,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(o){return this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message}),{event:e,params:t}}},e.prototype.dynamicParams=function(e){this.dynamicParamsFilter=e},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){if(void 0===e&&(e={}),this.inited){var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time||!1)},n=lH({},t,e);this.event("predefine_pageview",n)}else console.warn("predefinePageView should call after init")},e.prototype.clearEventCache=function(){this.emit(BH.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=bH(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit(BH.CustomWebId)}},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=bH(e);this.config({web_id:""+t,wechat_openid:e}),this.emit(BH.CustomWebId)}},e.prototype.setAnonymousId=function(e){this.emit(BH.AnonymousId,e)},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.resetStayDuration=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(BH.ResetStay,{url_path:e,title:t,url:n},BH.Stay)},e.prototype.resetStayParams=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(BH.SetStay,{url_path:e,title:t,url:n},BH.Stay)},e.prototype.getToken=function(e,t){var n=this;if(this.inited){var r=!1,i=function(t){if(!r){r=!0;var i,o=n.configManager.get().user;if(t)o.tobid=t,o[qV(i="diss".split("")).call(i).join("")]=t;return e(lH({},o))}},o=function(){n.tokenManager.getTobId().then((function(e){i(e)}))};this.sdkReady?o():(t&&setTimeout((function(){i()}),t),this.on(BH.Ready,(function(){o()})))}else this.logger.warn("getToken must be use after function init")},e.prototype.startTrackEvent=function(e){e&&this.emit(BH.TrackDurationStart,e,BH.TrackDuration)},e.prototype.endTrackEvent=function(e,t){void 0===t&&(t={}),e&&this.emit(BH.TrackDurationEnd,{eventName:e,params:t},BH.TrackDuration)},e.prototype.pauseTrackEvent=function(e){e&&this.emit(BH.TrackDurationPause,e,BH.TrackDuration)},e.prototype.resumeTrackEvent=function(e){e&&this.emit(BH.TrackDurationResume,e,BH.TrackDuration)},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(yM(e)):this.emit(BH.ProfileSet,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(yM(e)):this.emit(BH.ProfileSetOnce,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(yM(e)):this.emit(BH.ProfileIncrement,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(BH.ProfileUnset,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(yM(e)):this.emit(BH.ProfileAppend,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){var t;this.bridgeReport?this.appBridge.setExternalAbVersion(e):this.emit(BH.AbExternalVersion,"string"==typeof e&&e?IT(t=""+e).call(t):null,BH.Ab)},e.prototype.getVar=function(e,t,n){this.bridgeReport?this.appBridge.getVar(e,t,n):this.emit(BH.AbVar,{name:e,defaultValue:t,callback:n},BH.Ab)},e.prototype.getAllVars=function(e){this.bridgeReport?this.appBridge.getAllVars(e):this.emit(BH.AbAllVars,e,BH.Ab)},e.prototype.getABconfig=function(e,t){this.emit(BH.AbConfig,{params:e,callback:t},BH.Ab)},e.prototype.getAbSdkVersion=function(e){if(!this.bridgeReport||!e)return this.configManager.getAbVersion()||"";this.appBridge.getAbSdkVersion(e)},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(BH.AbVersionChangeOn,e,BH.Ab),function(){t.emit(BH.AbVersionChangeOff,e,BH.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(BH.AbVersionChangeOff,e,BH.Ab)},e.prototype.openOverlayer=function(){this.emit(BH.AbOpenLayer,"",BH.Ab)},e.prototype.closeOverlayer=function(){this.emit(BH.AbCloseLayer,"",BH.Ab)},e.prototype.initCrypto=function(){this.publicKey=this.initConfig.crypto_publicKey||"04BA9E229380DC0E41E10839B0C52A4763D3EDFE8903F3B8E81395523381E03AA995D295BD4A4088792E4785B224F7837EB4D2C7C05973C7AE8687A35ACAE470A0"},e.prototype.cryptoData=function(e){try{if(!this.initConfig.enable_encryption)return e;var t=void 0;if("sm"===this.initConfig.encryption_type){var n=(o=yM(e),a=this.publicKey,void 0===(s=1)&&(s=1),"04"+bj.doEncrypt(o,a,s)),r=wH(n);t=new Uint8Array(r)}else t="data="+(i=yM(e),window.btoa?window.btoa(encodeURIComponent(i)):encodeURIComponent(i));return t}catch(l){return e}var i,o,a,s},e.prototype.destoryInstace=function(){this.destroyInstance||(this.destroyInstance=!0,this.off(BH.TokenComplete))},e.plugins=[],e}(),kj=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var r=e.Types,i=e.adapters.fetch;this.eventCheck=new UH(e,t),this.fetch=i,this.cache={},this.collect.on(r.ProfileSet,(function(e){n.setProfile(e)})),this.collect.on(r.ProfileSetOnce,(function(e){n.setOnceProfile(e)})),this.collect.on(r.ProfileUnset,(function(e){n.unsetProfile(e)})),this.collect.on(r.ProfileIncrement,(function(e){n.incrementProfile(e)})),this.collect.on(r.ProfileAppend,(function(e){n.appendProfile(e)})),this.collect.on(r.ProfileClear,(function(){n.cache={}})),this.ready(r.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!dk(n).length)return;var r=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var i in n)r(i)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var n=[];n.push(this.collect.processEvent(e,t));var r=this.collect.eventManager.merge(n,!0),i=this.collect.cryptoData(r),o=this.collect.configManager.getUrl("profile");this.fetch(o,i,1e5,!1,(function(){}),(function(){}),"","POST",this.config.enable_encryption,this.config.encryption_header),this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:r,code:200,status:"success"})}catch(a){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}},e.prototype.setProfile=function(e){var t=this.formatParams(e);t&&dk(t).length&&(this.pushCache(t),this.report("__profile_set",lH({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this.formatParams(e,!0);t&&dk(t).length&&(this.pushCache(t),this.report("__profile_set_once",lH({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",lH({},e,{profile:!0})):console.warn("please check the params, must be object!!!")},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",lH({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var n in e){var r;"string"==typeof e[n]||"Array"===pk(r=Object.prototype.toString.call(e[n])).call(r,8,-1)?t[n]=e[n]:console.warn("please check the value of param: "+n+", must be string or array !!!")}dk(t).length&&this.report("__profile_append",lH({},t,{profile:!0}))}else console.warn("please check the params, must be object!!!")},e.prototype.pushCache=function(e){var t=this;dk(e).forEach((function(n){t.cache[n]={val:t.clone(e[n]),timestamp:Date.now()}}))},e.prototype.formatParams=function(e,t){var n=this;void 0===t&&(t=!1);try{var r;if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var i={};for(var o in e){var a;"string"==typeof e[o]||"number"==typeof e[o]||"Array"===pk(a=Object.prototype.toString.call(e[o])).call(a,8,-1)?i[o]=e[o]:console.warn("please check the value of params:"+o+", must be string,number,Array !!!")}var s=dk(i);if(!s.length)return;var l=Date.now();return gL(r=Gw(s).call(s,(function(r){var i=n.cache[r];return t?!i:!(i&&n.compare(i.val,e[r])&&l-i.timestamp<n.duration)}))).call(r,(function(e,t){return e[t]=i[t],e}),{})}catch(u){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:u.message}),console.log("error")}},e.prototype.compare=function(e,t){try{return yM(e)===yM(t)}catch(n){return this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),!1}},e.prototype.clone=function(e){try{return JSON.parse(yM(e))}catch(t){return this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),e}},e.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},e}(),Ej=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,r=Date.now()+t;return n=window.setTimeout((function i(){var o=Date.now()-r;e(),r+=t,n=window.setTimeout(i,Math.max(0,t-o))}),t),function(){window.clearTimeout(n)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var r=this.collect.Types;this.collect.on(r.SessionReset,(function(){n.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),Sj=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,!this.config.channel_domain&&!this.config.disable_track_event&&!this.config.disable_sdk_monitor){var r=e.adapters.fetch;this.fetch=r,this.url=e.configManager.getUrl("event");var i=this.collect.Types;this.collect.on(i.Ready,(function(){n.sdkOnload()})),this.collect.on(i.SubmitError,(function(e){var t=e.type,r=e.eventData,i=e.errorCode;"f_data"===t&&n.sdkError(r,i)}))}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,r=t.user,i=n.app_id,o=n.app_name,a=n.sdk_version,s=r.web_id,l={events:[{event:"onload",params:yM({app_id:i,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOB"}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.fetch(e.url,[l],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(u){}},e.prototype.sdkError=function(e,t){var n=this;try{var r=e[0],i=r.user,o=r.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:Vw(a).call(a,(function(e){return{event:"on_error",params:yM({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:yM(o),user:yM(i)}),local_time_ms:Date.now()}})),user:{user_unique_id:i.user_unique_id},header:{}};setTimeout((function(){n.fetch(n.url,[s],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(l){}},e}(),Tj=function(){function e(){this.verifyReady=!1,this.cleanStatus=!1}return e.prototype.apply=function(e,t){var n=this;this.collector=e,this.config=t,this.eventStorage=[],this.collector.on("submit-verify-h5",(function(e){e&&e.length&&n.eventStore(e[0])})),this.checkUrl(),this.heartbeat()},e.prototype.checkUrl=function(){var e=window.location.href,t=_H(e);t._r_d_&&t._r_c_k_?(this.verifyReady=!0,this.domain=t._r_d_,this.key=t._r_c_k_,this.checkCache()):this.collector.off("submit-verify-h5")},e.prototype.checkCache=function(){this.eventStorage.length&&this.postVerify(this.eventStorage)},e.prototype.heartbeat=function(){var e=this;this.heart=setInterval((function(){var t={event:"simulator_test__",local_time_ms:Date.now()},n=e.collector.configManager.get(),r=n.header,i={events:[t],user:n.user,header:r};e.eventStore(i)}),6e4)},e.prototype.eventStore=function(e){this.cleanStatus||(this.verifyReady?this.postVerify(e):this.eventStorage.push(e))},e.prototype.cleanVerify=function(){this.cleanStatus=!0,this.eventStorage=[],clearInterval(this.heart)},e.prototype.postVerify=function(e){var t=this;try{var n=JSON.parse(yM(e));!function(e){return Array.isArray(e)}(e)?this.fetchLog(n):n.forEach((function(e){t.fetchLog(e)}))}catch(r){console.log("web verify post error ~")}},e.prototype.fetchLog=function(e){XH(this.domain+"/simulator/h5/log?connection_key="+this.key,e,2e4,!1)},e.prototype.leave=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.cleanVerify()})),yH((function(){e.cleanVerify()}))},e}();wj.usePlugin(Tj,"verifyH"),wj.usePlugin(kj,"profile"),wj.usePlugin(Ej,"heartbeat"),wj.usePlugin(Sj,"monitor");var Cj,Aj=new wj("default"),xj=new Uint8Array(16);function Pj(){if(!Cj&&!(Cj="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cj(xj)}for(var Ij=[],Rj=0;Rj<256;++Rj){var Dj;Ij.push(pk(Dj=(Rj+256).toString(16)).call(Dj,1))}var Oj={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Mj(e,t,n){if(Oj.randomUUID&&!t&&!e)return Oj.randomUUID();var r=(e=e||{}).random||(e.rng||Pj)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ij[e[t+0]]+Ij[e[t+1]]+Ij[e[t+2]]+Ij[e[t+3]]+"-"+Ij[e[t+4]]+Ij[e[t+5]]+"-"+Ij[e[t+6]]+Ij[e[t+7]]+"-"+Ij[e[t+8]]+Ij[e[t+9]]+"-"+Ij[e[t+10]]+Ij[e[t+11]]+Ij[e[t+12]]+Ij[e[t+13]]+Ij[e[t+14]]+Ij[e[t+15]]}(r)}var Lj="veplayer_live_device_id",Fj="veplayer_live_user_id",Uj=function(e){return Math.floor((9*Math.random()+1)*Math.pow(10,e-1)).toString()},Bj=function(e){var t=kF.getUrlObject(e);return t?null!=t&&t.searchParams.get("_session_id")?e:kF.appendSearchParams(e,{_session_id:Nj()}):null!=e?e:""},Nj=function(){return Mj().replace(/-/g,"")+"."+Date.now()+"."+function(e){for(var t=0,n=0,r=(e+="").length,i=0;i<r;i++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t}(Mj().replace(/-/g,""))},Vj=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_userId",void 0),Uy(Yx(r),"_deviceId",void 0),Uy(Yx(r),"_liveLogger",void 0),r}return Fy(n,[{key:"afterCreate",value:function(){var e,t,n,r;this.config.enable&&(this.config.appId?(this._userId=(null===(e=this.config)||void 0===e?void 0:e.userId)||((n=localStorage.getItem(Fj))||(n=Uj(12),localStorage.setItem(Fj,n),n)),this._deviceId=(null===(t=this.config)||void 0===t?void 0:t.deviceId)||((r=localStorage.getItem(Lj))||(r=Uj(11),localStorage.setItem(Lj,r),r)),this.open()):console.info("not found appId, please generate an appId"))}},{key:"destroy",value:function(){this.close()}},{key:"close",value:function(){var e;null===(e=this._liveLogger)||void 0===e||e.destroy(!1),this._liveLogger=void 0}},{key:"open",value:function(){this._liveLogger||(this._start(),this.config.showUserIdInErrorPanel&&this.player.plugins.error&&(this.player.plugins.error.config.extraTips=[{label:"userId",value:null==Aj?void 0:Aj.getConfig("user_unique_id")}]))}},{key:"_createTea",value:function(){Aj.init(Mm(Mm({},this.config),{},{app_id:468759,channel:"cn"})),Aj.start(),Aj.config({user_unique_id:this._userId,device_id:this._deviceId})}},{key:"_start",value:function(){this._createTea(),this._liveLogger=new FV({Tea:Aj,player:this.player,aid:this.config.appId,project_key:this.config.appId,app_name:this.config.appName||this.config.appId,user_id:this._userId,device_id:this._deviceId,ext:{veplayer_version:"2.4.2-rc.4",flv_version:"3.0.19-rc.0",hls_version:"3.0.19-rc.0",rts_version:"0.2.1-alpha.6"}})}}],[{key:"pluginName",get:function(){return"logger"}},{key:"defaultConfig",get:function(){return{appId:"",enable:!0,showUserIdInErrorPanel:!0}}}]),n}(QA);function Hj(e,t){return"number"!=typeof e?"-":t?t(e):e.toString()}var Gj,jj=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_pollTimer",void 0),Uy(Yx(r),"_visible",void 0),Uy(Yx(r),"_playPlugin",void 0),r}return Fy(n,[{key:"_streamType",get:function(){return kF.getStreamType(this.player.config.url)}},{key:"afterCreate",value:function(){var e=this;this._playPlugin=this.player.plugins[this._streamType],this.player.on(lV.ERROR,(function(){return e.close()})),this.config.visible&&this.player.once(lV.LOADED_DATA,(function(){return e.open()}))}},{key:"open",value:function(){var e;this._visible||(hk(e=["flv","hls"]).call(e,this._streamType)?this.player.plugins[this._streamType]?(this.root.style.display="block",this._tick(),this._visible=!0):console.warn("不支持或未加载".concat(this._streamType,"插件")):console.warn("仅支持flv和hls格式的信息展示"))}},{key:"close",value:function(){this._visible&&(clearTimeout(this._pollTimer),this.root.innerHTML="",this.root.style.display="none",this._visible=!1)}},{key:"destroy",value:function(){var e=this;this.close(),this.player.off(lV.LOADED_DATA,(function(){return e.open()})),this.player.off(lV.ERROR,(function(){return e.close()}))}},{key:"render",value:function(){return'\n <xg-live-panel class="veplayer-live-panel">\n </xg-live-panel>\n '}},{key:"_tick",value:function(){var e=this;clearTimeout(this._pollTimer),this._renderPanel(),this._pollTimer=window.setTimeout((function(){e._tick()}),this.config.interval)}},{key:"_getStats",value:function(){var e;return null===(e=this._playPlugin)||void 0===e?void 0:e.getStats()}},{key:"_getPanelData",value:function(){var e,t,n,r,i=this._getStats()||{},o="".concat(this._streamType,"_live"),a=this._playPlugin.softDecode,s=[(e=Mm(Mm({},i),{},{format:o}),{rows:[{key:"format",labelTextKey:"FORMAT",value:null!==(t=null==e?void 0:e.format)&&void 0!==t?t:"-"},{key:"fps",labelTextKey:"FPS",value:Hj(e.fps,(function(e){return"".concat(e," fps")}))},{key:"bitrate",labelTextKey:"BITRATE",value:Hj(e.bitrate,(function(e){return"".concat(e/1e3," kbps")}))},{key:"gop",labelTextKey:"GOP",value:Hj(e.gop,(function(e){return"".concat(e," frames")}))},{key:"resolution",labelTextKey:"RESOLUTION",value:Nm(n="".concat(Hj(e.height)," * ")).call(n,Hj(e.height))},{key:"encodeType",labelTextKey:"ENCODE_TYPE",value:null!==(r=e.encodeType)&&void 0!==r?r:"-"},{key:"bufferEnd",labelTextKey:"BUFFER_END",value:Hj(e.bufferEnd)},{key:"currentTime",labelTextKey:"CURRENT_TIME",value:Hj(e.currentTime,(function(e){return e.toFixed(6)+"s"}))}]})];return a&&s.push(function(e){return{titleTextKey:"DECODE_INFO",rows:[{key:"decodeEfficiency",labelTextKey:"DECODE_EFFICIENCY",value:Hj(e.decodeFps,(function(e){return e+"frames/s"}))},{key:"decodeCost",labelTextKey:"DECODE_COST",value:Hj(e.decodeFps,(function(e){return(e?(1e3/e).toFixed():0)+"ms"}))}]}}(i)),s}},{key:"_renderPanel",value:function(){var e=this,t=this._getPanelData(),n=this.root;n&&(n.innerHTML="",t.forEach((function(t){e._renderGroup(n,t)})))}},{key:"_renderGroup",value:function(e,t){var n=this,r=t.title,i=t.titleTextKey,o=t.rows,a=this.player.config.i18nManager;if(r||i){var s,l=this._genTitleDom(null!==(s=a.getText(i))&&void 0!==s?s:r);e.appendChild(l)}o.forEach((function(t){var r=n._genRowDom(t);e.appendChild(r)}))}},{key:"_genTitleDom",value:function(e){var t=kC.createDom("xg-live-panel","",void 0,"veplayer-live-panel-row"),n=kC.createDom("xg-live-panel",e,void 0,"veplayer-live-panel-row-title");return t.appendChild(n),t}},{key:"_genRowDom",value:function(e){var t=this.player.config.i18nManager,n=kC.createDom("veplayer-live-panel-row","",void 0,"veplayer-live-panel-row"),r=kC.createDom("xg-live-panel",t.getText(e.labelTextKey),void 0,"veplayer-live-panel-row-label");n.appendChild(r);var i=kC.createDom("xg-live-panel",e.value);return n.appendChild(i),n}}],[{key:"pluginName",get:function(){return"infoPanel"}},{key:"defaultConfig",get:function(){return{visible:!1,interval:500}}}]),n}(QA),zj=Mm(Mm({},$F),{},{INVALID_PARAMETER:"The imported parameter is empty, please pass in necessary parameters such as the stream address",FORMAT:"format",FPS:"fps",BITRATE:"bitrate",GOP:"gop",RESOLUTION:"resolution",ENCODE_TYPE:"encodeType",BUFFER_END:"bufferEnd",CURRENT_TIME:"currentTime",DECODE_EFFICIENCY:"efficiency",DECODE_COST:"cost",DECODE_INFO:"decodeInfo",REFRESH:"refresh"}),Kj=Mm(Mm({},ZF),{},{INVALID_PARAMETER:"入参为空,请传入流地址等必要参数",FORMAT:"格式",FPS:"帧率",BITRATE:"码率",GOP:"GOP",RESOLUTION:"视频分辨率",ENCODE_TYPE:"编码方式",BUFFER_END:"Buffer 水位",CURRENT_TIME:"播放进度",DECODE_EFFICIENCY:"解码效率",DECODE_COST:"解码消耗",DECODE_INFO:"软解信息",REFRESH:"刷新"}),Wj=["getDrmConfig"],qj=function(){var e=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=VN(t.drm),!t.url||r!==NN.Fairplay){e.next=18;break}return e.prev=2,a=null!==(i=null==t||null===(o=t.drm)||void 0===o?void 0:o.fairplay)&&void 0!==i?i:{},s=a.getDrmConfig,l=tm(a,Wj),e.next=6,Hw.all([uF(VL.PluginDrm).then((function(e){return e.DrmPlugin})).catch((function(){})),null==s?void 0:s({url:t.url})]);case 6:return u=e.sent,c=XM(u,2),h=c[0],f=c[1],d=AE({},l,null==t?void 0:t.drm,f),f&&(null==n||n.updateDrmConfig(f)),e.abrupt("return",{options:{drm:d},plugins:h?[h]:[]});case 15:e.prev=15,e.t0=e.catch(2),console.log(e.t0);case 18:return e.abrupt("return",{});case 19:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(t,n){return e.apply(this,arguments)}}(),Xj=function(){var e=sy(oy().mark((function e(t){var n,r,i,o,a,s;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("rtm"!==(o=t.url&&_F(t.url))){e.next=3;break}return e.abrupt("return",{});case 3:if(a="flv"===o?null==t||null===(n=t.flv)||void 0===n?void 0:n.abr:null==t||null===(r=t.hls)||void 0===r?void 0:r.abr){e.next=6;break}return e.abrupt("return",{});case 6:return e.next=8,uF(VL.PluginAbr).catch((function(){}));case 8:return s=e.sent,e.abrupt("return",{options:Uy({},"flv"===o?"abr":"hlsabr",Mm(Mm({},a),{},{open:null===(i=a.enable)||void 0===i||i})),plugins:["flv"===o?null==s?void 0:s.AbrPlugin:null==s?void 0:s.HlsAbrPlugin]});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();JF.extend([{LANG:"zh-cn",TEXT:Kj},{LANG:"en",TEXT:zj}]);var Yj={autoplay:{muted:!0}},$j=Nm(Gj=[]).call(Gj,Iy(jF),[hV,Vj,jj]),Zj=function(e){return e.H264="h264",e}(Zj||{}),Jj=function(e){oP(r,e);var t,n=lP(r);function r(e){return Ry(this,r),n.call(this,e)}return Fy(r,[{key:"playTime",get:function(){var e;if(null===(e=this._player)||void 0===e||null===(e=e.played)||void 0===e||!e.length)return 0;for(var t=this._player.played.length,n=0,r=0;r<t;r++){var i,o,a=null===(i=this._player)||void 0===i?void 0:i.played.start(r);n+=(null===(o=this._player)||void 0===o?void 0:o.played.end(r))-a}return n}},{key:"openLog",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.logger.open()}},{key:"closeLog",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.logger.close()}},{key:"openInfoPanel",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.infopanel.open()}},{key:"closeInfoPanel",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.infopanel.close()}},{key:"openAbr",value:function(){var e,t,n=this.url&&_F(this.url);"flv"!==n?"hls"===n&&(null===(e=this._player.plugins)||void 0===e||null===(e=e.hlsabr)||void 0===e||e.switchAbr(!0)):null===(t=this._player.plugins)||void 0===t||null===(t=t.abr)||void 0===t||t.switchAbr(!0)}},{key:"closeAbr",value:function(){var e,t,n=this.url&&_F(this.url);"flv"!==n?"hls"===n&&(null===(e=this._player.plugins)||void 0===e||null===(e=e.hlsabr)||void 0===e||e.switchAbr(!1)):null===(t=this._player.plugins)||void 0===t||null===(t=t.abr)||void 0===t||t.switchAbr(!1)}},{key:"updateDrmConfig",value:function(e){var t;null===(t=this._player)||void 0===t||null===(t=t.plugins)||void 0===t||null===(t=t.drm)||void 0===t||t.updateDrmConfig(e)}},{key:"switchAbr",value:function(e){var t;if(null!==(t=this._player.plugins)&&void 0!==t&&t.abr){if(void 0!==(null==e?void 0:e.bitrate)){var n=this._player.plugins.abr.config.urls[e.bitrate];if(!n)return;this.switch(n,{seamless:!0}),this._player.plugins.abr.bitrate=e.bitrate}var r;if(void 0!==(null==e?void 0:e.enable))null===(r=this._player.plugins)||void 0===r||r.abr.switchAbr(e.enable)}}},{key:"getRTMNetWorkInfo",value:function(){var e;return null===(e=this._player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.rts)||void 0===e?void 0:e.getNetWorkInfo()}},{key:"getRTMStats",value:(t=sy(oy().mark((function e(){var t;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null===(t=this._player)||void 0===t||null===(t=t.plugins)||void 0===t||null===(t=t.rts)||void 0===t?void 0:t.getStatsSnapshoot());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getFLVStats",value:function(){var e;return null===(e=this._player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.flv)||void 0===e?void 0:e.getStats()}}]),r}(rU);function Qj(e){return ez.apply(this,arguments)}function ez(){return ez=sy(oy().mark((function e(t){var n,r,i,o,a,s,l;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=void 0,t&&(t.url||t.playlist)){e.next=3;break}throw IN(xN.INVALID_PARAMETER,new JF);case 3:return o=new JF({lang:null==t?void 0:t.lang,i18n:null==t?void 0:t.i18n}),a=Mm(Mm({},t),{},{plugins:Nm(n=[]).call(n,Iy($j),Iy(null!==(r=t.plugins)&&void 0!==r?r:[]))}),e.next=7,rU.create(Mm(Mm(Mm({},Yj),a),{},{isLive:!0,i18nManager:o,preProcessUrl:function(e){return{url:Bj(e)}},preparePlugins:function(e){return sy(oy().mark((function t(){var n,r,o,s,l,u,c,h,f,d,p,v,g,y,m;return oy().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Hw.all([GN(Mm(Mm({},a),{},{url:e}),i),qj(Mm(Mm({},a),{},{url:e}),i),Xj(Mm(Mm({},a),{},{url:e}))]);case 2:return r=t.sent,o=XM(r,3),s=o[0],l=o[1],u=o[2],h=(c=null!=s?s:{}).options,f=c.plugins,p=(d=null!=l?l:{}).options,v=d.plugins,y=(g=null!=u?u:{}).options,m=g.plugins,t.abrupt("return",{options:AE({},h,p,y),plugins:Nm(n=[]).call(n,Iy(null!=f?f:[]),Iy(null!=v?v:[]),Iy(null!=m?m:[]))});case 11:case"end":return t.stop()}}),t)})))()}}),Jj);case 7:return(i=e.sent)&&(l=null===(s=i)||void 0===s||null===(s=s._player)||void 0===s||null===(s=s.config)||void 0===s?void 0:s._RTMdegrade)&&i.emit("degrade",{originRtmUrl:l._originRtmUrl,code:"NOT_SUPPORT",message:"not support rtm or h264",isRTMSupported:l._isRTMSupported,isRTMSupportCodec:l._isRTMSupportCodec}),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e)}))),ez.apply(this,arguments)}var tz,nz=Object.freeze({__proto__:null,ErrorCode:xN,Events:lV});tz="umd",aF.setModuleSystem(tz);var rz=kF.isMseSupported,iz=kF.isSoftDecodeSupported;void 0!==VePlayer.registerPlugin?VePlayer.registerPlugin(VL.BizLive,{createLivePlayer:Qj}):sF(VL.BizLive,{createLivePlayer:Qj}),e.Codec=t,e.DecodeType=r,e.Degradation=n,e.DynamicModule=VL,e.EN=$F,e.ListType=CL,e.POSITIONS=eU,e.Plugin=QA,e.RTMCodec=Zj,e.Sniffer=PC,e.ZH_CN=ZF,e.createLivePlayer=Qj,e.isMseSupported=rz,e.isRTMSupportCodec=ON,e.isRTMSupported=RN,e.isSoftDecodeSupported=iz,e.live=nz,e.load=uF,e.register=lF,e.registerPlugin=sF,e.util=kF}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VePlayer={})}(this,(function(e){"use strict";var t=function(e){return e.H265="h265",e.H264="h264",e}(t||{}),n=function(e){return e.SoftFirst="soft-first",e.H264First="h264-first",e}(n||{}),r=function(e){return e.Software="software",e.Hardware="hardware",e}(r||{}),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a=function(e){return e&&e.Math==Math&&e},s=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof i&&i)||function(){return this}()||i||Function("return this")(),l=function(e){try{return!!e()}catch(t){return!0}},u=!l((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),c=u,h=Function.prototype,f=h.apply,d=h.call,p="object"==typeof Reflect&&Reflect.apply||(c?d.bind(f):function(){return d.apply(f,arguments)}),v=u,g=Function.prototype,y=g.call,m=v&&g.bind.bind(y,y),_=v?m:function(e){return function(){return y.apply(e,arguments)}},b=_,w=b({}.toString),k=b("".slice),E=function(e){return k(w(e),8,-1)},S=E,T=_,C=function(e){if("Function"===S(e))return T(e)},A="object"==typeof document&&document.all,x={all:A,IS_HTMLDDA:void 0===A&&void 0!==A},P=x.all,I=x.IS_HTMLDDA?function(e){return"function"==typeof e||e===P}:function(e){return"function"==typeof e},R={},D=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),O=u,M=Function.prototype.call,L=O?M.bind(M):function(){return M.apply(M,arguments)},F={},U={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,N=B&&!U.call({1:2},1);F.f=N?function(e){var t=B(this,e);return!!t&&t.enumerable}:U;var V,H,G=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},j=l,z=E,K=Object,W=_("".split),q=j((function(){return!K("z").propertyIsEnumerable(0)}))?function(e){return"String"==z(e)?W(e,""):K(e)}:K,X=function(e){return null==e},Y=X,$=TypeError,Z=function(e){if(Y(e))throw $("Can't call method on "+e);return e},J=q,Q=Z,ee=function(e){return J(Q(e))},te=I,ne=x.all,re=x.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:te(e)||e===ne}:function(e){return"object"==typeof e?null!==e:te(e)},ie={},oe=ie,ae=s,se=I,le=function(e){return se(e)?e:void 0},ue=function(e,t){return arguments.length<2?le(oe[e])||le(ae[e]):oe[e]&&oe[e][t]||ae[e]&&ae[e][t]},ce=_({}.isPrototypeOf),he="undefined"!=typeof navigator&&String(navigator.userAgent)||"",fe=s,de=he,pe=fe.process,ve=fe.Deno,ge=pe&&pe.versions||ve&&ve.version,ye=ge&&ge.v8;ye&&(H=(V=ye.split("."))[0]>0&&V[0]<4?1:+(V[0]+V[1])),!H&&de&&(!(V=de.match(/Edge\/(\d+)/))||V[1]>=74)&&(V=de.match(/Chrome\/(\d+)/))&&(H=+V[1]);var me=H,_e=me,be=l,we=s.String,ke=!!Object.getOwnPropertySymbols&&!be((function(){var e=Symbol();return!we(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_e&&_e<41})),Ee=ke&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Se=ue,Te=I,Ce=ce,Ae=Object,xe=Ee?function(e){return"symbol"==typeof e}:function(e){var t=Se("Symbol");return Te(t)&&Ce(t.prototype,Ae(e))},Pe=String,Ie=function(e){try{return Pe(e)}catch(t){return"Object"}},Re=I,De=Ie,Oe=TypeError,Me=function(e){if(Re(e))return e;throw Oe(De(e)+" is not a function")},Le=Me,Fe=X,Ue=function(e,t){var n=e[t];return Fe(n)?void 0:Le(n)},Be=L,Ne=I,Ve=re,He=TypeError,Ge={exports:{}},je=s,ze=Object.defineProperty,Ke=function(e,t){try{ze(je,e,{value:t,configurable:!0,writable:!0})}catch(n){je[e]=t}return t},We="__core-js_shared__",qe=s[We]||Ke(We,{}),Xe=qe;(Ge.exports=function(e,t){return Xe[e]||(Xe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"pure",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 Ye=Ge.exports,$e=Z,Ze=Object,Je=function(e){return Ze($e(e))},Qe=Je,et=_({}.hasOwnProperty),tt=Object.hasOwn||function(e,t){return et(Qe(e),t)},nt=_,rt=0,it=Math.random(),ot=nt(1..toString),at=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ot(++rt+it,36)},st=Ye,lt=tt,ut=at,ct=ke,ht=Ee,ft=s.Symbol,dt=st("wks"),pt=ht?ft.for||ft:ft&&ft.withoutSetter||ut,vt=function(e){return lt(dt,e)||(dt[e]=ct&<(ft,e)?ft[e]:pt("Symbol."+e)),dt[e]},gt=L,yt=re,mt=xe,_t=Ue,bt=function(e,t){var n,r;if("string"===t&&Ne(n=e.toString)&&!Ve(r=Be(n,e)))return r;if(Ne(n=e.valueOf)&&!Ve(r=Be(n,e)))return r;if("string"!==t&&Ne(n=e.toString)&&!Ve(r=Be(n,e)))return r;throw He("Can't convert object to primitive value")},wt=TypeError,kt=vt("toPrimitive"),Et=function(e,t){if(!yt(e)||mt(e))return e;var n,r=_t(e,kt);if(r){if(void 0===t&&(t="default"),n=gt(r,e,t),!yt(n)||mt(n))return n;throw wt("Can't convert object to primitive value")}return void 0===t&&(t="number"),bt(e,t)},St=xe,Tt=function(e){var t=Et(e,"string");return St(t)?t:t+""},Ct=re,At=s.document,xt=Ct(At)&&Ct(At.createElement),Pt=function(e){return xt?At.createElement(e):{}},It=Pt,Rt=!D&&!l((function(){return 7!=Object.defineProperty(It("div"),"a",{get:function(){return 7}}).a})),Dt=D,Ot=L,Mt=F,Lt=G,Ft=ee,Ut=Tt,Bt=tt,Nt=Rt,Vt=Object.getOwnPropertyDescriptor;R.f=Dt?Vt:function(e,t){if(e=Ft(e),t=Ut(t),Nt)try{return Vt(e,t)}catch(n){}if(Bt(e,t))return Lt(!Ot(Mt.f,e,t),e[t])};var Ht=l,Gt=I,jt=/#|\.prototype\./,zt=function(e,t){var n=Wt[Kt(e)];return n==Xt||n!=qt&&(Gt(t)?Ht(t):!!t)},Kt=zt.normalize=function(e){return String(e).replace(jt,".").toLowerCase()},Wt=zt.data={},qt=zt.NATIVE="N",Xt=zt.POLYFILL="P",Yt=zt,$t=Me,Zt=u,Jt=C(C.bind),Qt=function(e,t){return $t(e),void 0===t?e:Zt?Jt(e,t):function(){return e.apply(t,arguments)}},en={},tn=D&&l((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),nn=re,rn=String,on=TypeError,an=function(e){if(nn(e))return e;throw on(rn(e)+" is not an object")},sn=D,ln=Rt,un=tn,cn=an,hn=Tt,fn=TypeError,dn=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,vn="enumerable",gn="configurable",yn="writable";en.f=sn?un?function(e,t,n){if(cn(e),t=hn(t),cn(n),"function"==typeof e&&"prototype"===t&&"value"in n&&yn in n&&!n[yn]){var r=pn(e,t);r&&r[yn]&&(e[t]=n.value,n={configurable:gn in n?n[gn]:r[gn],enumerable:vn in n?n[vn]:r[vn],writable:!1})}return dn(e,t,n)}:dn:function(e,t,n){if(cn(e),t=hn(t),cn(n),ln)try{return dn(e,t,n)}catch(r){}if("get"in n||"set"in n)throw fn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var mn=en,_n=G,bn=D?function(e,t,n){return mn.f(e,t,_n(1,n))}:function(e,t,n){return e[t]=n,e},wn=s,kn=p,En=C,Sn=I,Tn=R.f,Cn=Yt,An=ie,xn=Qt,Pn=bn,In=tt,Rn=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return kn(e,this,arguments)};return t.prototype=e.prototype,t},Dn=function(e,t){var n,r,i,o,a,s,l,u,c,h=e.target,f=e.global,d=e.stat,p=e.proto,v=f?wn:d?wn[h]:(wn[h]||{}).prototype,g=f?An:An[h]||Pn(An,h,{})[h],y=g.prototype;for(o in t)r=!(n=Cn(f?o:h+(d?".":"#")+o,e.forced))&&v&&In(v,o),s=g[o],r&&(l=e.dontCallGetSet?(c=Tn(v,o))&&c.value:v[o]),a=r&&l?l:t[o],r&&typeof s==typeof a||(u=e.bind&&r?xn(a,wn):e.wrap&&r?Rn(a):p&&Sn(a)?En(a):a,(e.sham||a&&a.sham||s&&s.sham)&&Pn(u,"sham",!0),Pn(g,o,u),p&&(In(An,i=h+"Prototype")||Pn(An,i,{}),Pn(An[i],o,a),e.real&&y&&(n||!y[o])&&Pn(y,o,a)))},On=E,Mn=Array.isArray||function(e){return"Array"==On(e)},Ln=Math.ceil,Fn=Math.floor,Un=Math.trunc||function(e){var t=+e;return(t>0?Fn:Ln)(t)},Bn=function(e){var t=+e;return t!=t||0===t?0:Un(t)},Nn=Bn,Vn=Math.min,Hn=function(e){return e>0?Vn(Nn(e),9007199254740991):0},Gn=Hn,jn=function(e){return Gn(e.length)},zn=TypeError,Kn=function(e){if(e>9007199254740991)throw zn("Maximum allowed index exceeded");return e},Wn=Tt,qn=en,Xn=G,Yn=function(e,t,n){var r=Wn(t);r in e?qn.f(e,r,Xn(0,n)):e[r]=n},$n={};$n[vt("toStringTag")]="z";var Zn="[object z]"===String($n),Jn=Zn,Qn=I,er=E,tr=vt("toStringTag"),nr=Object,rr="Arguments"==er(function(){return arguments}()),ir=Jn?er:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=nr(e),tr))?n:rr?er(t):"Object"==(r=er(t))&&Qn(t.callee)?"Arguments":r},or=I,ar=qe,sr=_(Function.toString);or(ar.inspectSource)||(ar.inspectSource=function(e){return sr(e)});var lr=ar.inspectSource,ur=_,cr=l,hr=I,fr=ir,dr=lr,pr=function(){},vr=[],gr=ue("Reflect","construct"),yr=/^\s*(?:class|function)\b/,mr=ur(yr.exec),_r=!yr.exec(pr),br=function(e){if(!hr(e))return!1;try{return gr(pr,vr,e),!0}catch(t){return!1}},wr=function(e){if(!hr(e))return!1;switch(fr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _r||!!mr(yr,dr(e))}catch(t){return!0}};wr.sham=!0;var kr=!gr||cr((function(){var e;return br(br.call)||!br(Object)||!br((function(){e=!0}))||e}))?wr:br,Er=Mn,Sr=kr,Tr=re,Cr=vt("species"),Ar=Array,xr=function(e){var t;return Er(e)&&(t=e.constructor,(Sr(t)&&(t===Ar||Er(t.prototype))||Tr(t)&&null===(t=t[Cr]))&&(t=void 0)),void 0===t?Ar:t},Pr=function(e,t){return new(xr(e))(0===t?0:t)},Ir=l,Rr=me,Dr=vt("species"),Or=function(e){return Rr>=51||!Ir((function(){var t=[];return(t.constructor={})[Dr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Mr=Dn,Lr=l,Fr=Mn,Ur=re,Br=Je,Nr=jn,Vr=Kn,Hr=Yn,Gr=Pr,jr=Or,zr=me,Kr=vt("isConcatSpreadable"),Wr=zr>=51||!Lr((function(){var e=[];return e[Kr]=!1,e.concat()[0]!==e})),qr=function(e){if(!Ur(e))return!1;var t=e[Kr];return void 0!==t?!!t:Fr(e)};Mr({target:"Array",proto:!0,arity:1,forced:!Wr||!jr("concat")},{concat:function(e){var t,n,r,i,o,a=Br(this),s=Gr(a,0),l=0;for(t=-1,r=arguments.length;t<r;t++)if(qr(o=-1===t?a:arguments[t]))for(i=Nr(o),Vr(l+i),n=0;n<i;n++,l++)n in o&&Hr(s,l,o[n]);else Vr(l+1),Hr(s,l++,o);return s.length=l,s}});var Xr=ir,Yr=String,$r=function(e){if("Symbol"===Xr(e))throw TypeError("Cannot convert a Symbol value to a string");return Yr(e)},Zr={},Jr=Bn,Qr=Math.max,ei=Math.min,ti=function(e,t){var n=Jr(e);return n<0?Qr(n+t,0):ei(n,t)},ni=ee,ri=ti,ii=jn,oi=function(e){return function(t,n,r){var i,o=ni(t),a=ii(o),s=ri(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},ai={includes:oi(!0),indexOf:oi(!1)},si={},li=tt,ui=ee,ci=ai.indexOf,hi=si,fi=_([].push),di=function(e,t){var n,r=ui(e),i=0,o=[];for(n in r)!li(hi,n)&&li(r,n)&&fi(o,n);for(;t.length>i;)li(r,n=t[i++])&&(~ci(o,n)||fi(o,n));return o},pi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vi=di,gi=pi,yi=Object.keys||function(e){return vi(e,gi)},mi=D,_i=tn,bi=en,wi=an,ki=ee,Ei=yi;Zr.f=mi&&!_i?Object.defineProperties:function(e,t){wi(e);for(var n,r=ki(t),i=Ei(t),o=i.length,a=0;o>a;)bi.f(e,n=i[a++],r[n]);return e};var Si,Ti=ue("document","documentElement"),Ci=at,Ai=Ye("keys"),xi=function(e){return Ai[e]||(Ai[e]=Ci(e))},Pi=an,Ii=Zr,Ri=pi,Di=si,Oi=Ti,Mi=Pt,Li="prototype",Fi="script",Ui=xi("IE_PROTO"),Bi=function(){},Ni=function(e){return"<"+Fi+">"+e+"</"+Fi+">"},Vi=function(e){e.write(Ni("")),e.close();var t=e.parentWindow.Object;return e=null,t},Hi=function(){try{Si=new ActiveXObject("htmlfile")}catch(i){}var e,t,n;Hi="undefined"!=typeof document?document.domain&&Si?Vi(Si):(t=Mi("iframe"),n="java"+Fi+":",t.style.display="none",Oi.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Ni("document.F=Object")),e.close(),e.F):Vi(Si);for(var r=Ri.length;r--;)delete Hi[Li][Ri[r]];return Hi()};Di[Ui]=!0;var Gi=Object.create||function(e,t){var n;return null!==e?(Bi[Li]=Pi(e),n=new Bi,Bi[Li]=null,n[Ui]=e):n=Hi(),void 0===t?n:Ii.f(n,t)},ji={},zi=di,Ki=pi.concat("length","prototype");ji.f=Object.getOwnPropertyNames||function(e){return zi(e,Ki)};var Wi={},qi=ti,Xi=jn,Yi=Yn,$i=Array,Zi=Math.max,Ji=function(e,t,n){for(var r=Xi(e),i=qi(t,r),o=qi(void 0===n?r:n,r),a=$i(Zi(o-i,0)),s=0;i<o;i++,s++)Yi(a,s,e[i]);return a.length=s,a},Qi=E,eo=ee,to=ji.f,no=Ji,ro="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Wi.f=function(e){return ro&&"Window"==Qi(e)?function(e){try{return to(e)}catch(t){return no(ro)}}(e):to(eo(e))};var io={};io.f=Object.getOwnPropertySymbols;var oo=bn,ao=function(e,t,n,r){return r&&r.enumerable?e[t]=n:oo(e,t,n),e},so=en,lo=function(e,t,n){return so.f(e,t,n)},uo={},co=vt;uo.f=co;var ho,fo,po,vo=ie,go=tt,yo=uo,mo=en.f,_o=function(e){var t=vo.Symbol||(vo.Symbol={});go(t,e)||mo(t,e,{value:yo.f(e)})},bo=L,wo=ue,ko=vt,Eo=ao,So=function(){var e=wo("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=ko("toPrimitive");t&&!t[r]&&Eo(t,r,(function(e){return bo(n,this)}),{arity:1})},To=ir,Co=Zn?{}.toString:function(){return"[object "+To(this)+"]"},Ao=Zn,xo=en.f,Po=bn,Io=tt,Ro=Co,Do=vt("toStringTag"),Oo=function(e,t,n,r){if(e){var i=n?e:e.prototype;Io(i,Do)||xo(i,Do,{configurable:!0,value:t}),r&&!Ao&&Po(i,"toString",Ro)}},Mo=I,Lo=s.WeakMap,Fo=Mo(Lo)&&/native code/.test(String(Lo)),Uo=s,Bo=re,No=bn,Vo=tt,Ho=qe,Go=xi,jo=si,zo="Object already initialized",Ko=Uo.TypeError,Wo=Uo.WeakMap;if(Fo||Ho.state){var qo=Ho.state||(Ho.state=new Wo);qo.get=qo.get,qo.has=qo.has,qo.set=qo.set,ho=function(e,t){if(qo.has(e))throw Ko(zo);return t.facade=e,qo.set(e,t),t},fo=function(e){return qo.get(e)||{}},po=function(e){return qo.has(e)}}else{var Xo=Go("state");jo[Xo]=!0,ho=function(e,t){if(Vo(e,Xo))throw Ko(zo);return t.facade=e,No(e,Xo,t),t},fo=function(e){return Vo(e,Xo)?e[Xo]:{}},po=function(e){return Vo(e,Xo)}}var Yo={set:ho,get:fo,has:po,enforce:function(e){return po(e)?fo(e):ho(e,{})},getterFor:function(e){return function(t){var n;if(!Bo(t)||(n=fo(t)).type!==e)throw Ko("Incompatible receiver, "+e+" required");return n}}},$o=Qt,Zo=q,Jo=Je,Qo=jn,ea=Pr,ta=_([].push),na=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,u,c,h){for(var f,d,p=Jo(l),v=Zo(p),g=$o(u,c),y=Qo(v),m=0,_=h||ea,b=t?_(l,y):n||a?_(l,0):void 0;y>m;m++)if((s||m in v)&&(d=g(f=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return m;case 2:ta(b,f)}else switch(e){case 4:return!1;case 7:ta(b,f)}return o?-1:r||i?i:b}},ra={forEach:na(0),map:na(1),filter:na(2),some:na(3),every:na(4),find:na(5),findIndex:na(6),filterReject:na(7)},ia=Dn,oa=s,aa=L,sa=_,la=D,ua=ke,ca=l,ha=tt,fa=ce,da=an,pa=ee,va=Tt,ga=$r,ya=G,ma=Gi,_a=yi,ba=ji,wa=Wi,ka=io,Ea=R,Sa=en,Ta=Zr,Ca=F,Aa=ao,xa=lo,Pa=Ye,Ia=si,Ra=at,Da=vt,Oa=uo,Ma=_o,La=So,Fa=Oo,Ua=Yo,Ba=ra.forEach,Na=xi("hidden"),Va="Symbol",Ha="prototype",Ga=Ua.set,ja=Ua.getterFor(Va),za=Object[Ha],Ka=oa.Symbol,Wa=Ka&&Ka[Ha],qa=oa.TypeError,Xa=oa.QObject,Ya=Ea.f,$a=Sa.f,Za=wa.f,Ja=Ca.f,Qa=sa([].push),es=Pa("symbols"),ts=Pa("op-symbols"),ns=Pa("wks"),rs=!Xa||!Xa[Ha]||!Xa[Ha].findChild,is=la&&ca((function(){return 7!=ma($a({},"a",{get:function(){return $a(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Ya(za,t);r&&delete za[t],$a(e,t,n),r&&e!==za&&$a(za,t,r)}:$a,os=function(e,t){var n=es[e]=ma(Wa);return Ga(n,{type:Va,tag:e,description:t}),la||(n.description=t),n},as=function(e,t,n){e===za&&as(ts,t,n),da(e);var r=va(t);return da(n),ha(es,r)?(n.enumerable?(ha(e,Na)&&e[Na][r]&&(e[Na][r]=!1),n=ma(n,{enumerable:ya(0,!1)})):(ha(e,Na)||$a(e,Na,ya(1,{})),e[Na][r]=!0),is(e,r,n)):$a(e,r,n)},ss=function(e,t){da(e);var n=pa(t),r=_a(n).concat(hs(n));return Ba(r,(function(t){la&&!aa(ls,n,t)||as(e,t,n[t])})),e},ls=function(e){var t=va(e),n=aa(Ja,this,t);return!(this===za&&ha(es,t)&&!ha(ts,t))&&(!(n||!ha(this,t)||!ha(es,t)||ha(this,Na)&&this[Na][t])||n)},us=function(e,t){var n=pa(e),r=va(t);if(n!==za||!ha(es,r)||ha(ts,r)){var i=Ya(n,r);return!i||!ha(es,r)||ha(n,Na)&&n[Na][r]||(i.enumerable=!0),i}},cs=function(e){var t=Za(pa(e)),n=[];return Ba(t,(function(e){ha(es,e)||ha(Ia,e)||Qa(n,e)})),n},hs=function(e){var t=e===za,n=Za(t?ts:pa(e)),r=[];return Ba(n,(function(e){!ha(es,e)||t&&!ha(za,e)||Qa(r,es[e])})),r};ua||(Ka=function(){if(fa(Wa,this))throw qa("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ga(arguments[0]):void 0,t=Ra(e),n=function(e){this===za&&aa(n,ts,e),ha(this,Na)&&ha(this[Na],t)&&(this[Na][t]=!1),is(this,t,ya(1,e))};return la&&rs&&is(za,t,{configurable:!0,set:n}),os(t,e)},Aa(Wa=Ka[Ha],"toString",(function(){return ja(this).tag})),Aa(Ka,"withoutSetter",(function(e){return os(Ra(e),e)})),Ca.f=ls,Sa.f=as,Ta.f=ss,Ea.f=us,ba.f=wa.f=cs,ka.f=hs,Oa.f=function(e){return os(Da(e),e)},la&&xa(Wa,"description",{configurable:!0,get:function(){return ja(this).description}})),ia({global:!0,constructor:!0,wrap:!0,forced:!ua,sham:!ua},{Symbol:Ka}),Ba(_a(ns),(function(e){Ma(e)})),ia({target:Va,stat:!0,forced:!ua},{useSetter:function(){rs=!0},useSimple:function(){rs=!1}}),ia({target:"Object",stat:!0,forced:!ua,sham:!la},{create:function(e,t){return void 0===t?ma(e):ss(ma(e),t)},defineProperty:as,defineProperties:ss,getOwnPropertyDescriptor:us}),ia({target:"Object",stat:!0,forced:!ua},{getOwnPropertyNames:cs}),La(),Fa(Ka,Va),Ia[Na]=!0;var fs=ke&&!!Symbol.for&&!!Symbol.keyFor,ds=Dn,ps=ue,vs=tt,gs=$r,ys=Ye,ms=fs,_s=ys("string-to-symbol-registry"),bs=ys("symbol-to-string-registry");ds({target:"Symbol",stat:!0,forced:!ms},{for:function(e){var t=gs(e);if(vs(_s,t))return _s[t];var n=ps("Symbol")(t);return _s[t]=n,bs[n]=t,n}});var ws=Dn,ks=tt,Es=xe,Ss=Ie,Ts=fs,Cs=Ye("symbol-to-string-registry");ws({target:"Symbol",stat:!0,forced:!Ts},{keyFor:function(e){if(!Es(e))throw TypeError(Ss(e)+" is not a symbol");if(ks(Cs,e))return Cs[e]}});var As=_([].slice),xs=Mn,Ps=I,Is=E,Rs=$r,Ds=_([].push),Os=Dn,Ms=ue,Ls=p,Fs=L,Us=_,Bs=l,Ns=I,Vs=xe,Hs=As,Gs=function(e){if(Ps(e))return e;if(xs(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];"string"==typeof i?Ds(n,i):"number"!=typeof i&&"Number"!=Is(i)&&"String"!=Is(i)||Ds(n,Rs(i))}var o=n.length,a=!0;return function(e,t){if(a)return a=!1,t;if(xs(this))return t;for(var r=0;r<o;r++)if(n[r]===e)return t}}},js=ke,zs=String,Ks=Ms("JSON","stringify"),Ws=Us(/./.exec),qs=Us("".charAt),Xs=Us("".charCodeAt),Ys=Us("".replace),$s=Us(1..toString),Zs=/[\uD800-\uDFFF]/g,Js=/^[\uD800-\uDBFF]$/,Qs=/^[\uDC00-\uDFFF]$/,el=!js||Bs((function(){var e=Ms("Symbol")();return"[null]"!=Ks([e])||"{}"!=Ks({a:e})||"{}"!=Ks(Object(e))})),tl=Bs((function(){return'"\\udf06\\ud834"'!==Ks("\udf06\ud834")||'"\\udead"'!==Ks("\udead")})),nl=function(e,t){var n=Hs(arguments),r=Gs(t);if(Ns(r)||void 0!==e&&!Vs(e))return n[1]=function(e,t){if(Ns(r)&&(t=Fs(r,this,zs(e),t)),!Vs(t))return t},Ls(Ks,null,n)},rl=function(e,t,n){var r=qs(n,t-1),i=qs(n,t+1);return Ws(Js,e)&&!Ws(Qs,i)||Ws(Qs,e)&&!Ws(Js,r)?"\\u"+$s(Xs(e,0),16):e};Ks&&Os({target:"JSON",stat:!0,arity:3,forced:el||tl},{stringify:function(e,t,n){var r=Hs(arguments),i=Ls(el?nl:Ks,null,r);return tl&&"string"==typeof i?Ys(i,Zs,rl):i}});var il=io,ol=Je;Dn({target:"Object",stat:!0,forced:!ke||l((function(){il.f(1)}))},{getOwnPropertySymbols:function(e){var t=il.f;return t?t(ol(e)):[]}}),_o("asyncIterator"),_o("hasInstance"),_o("isConcatSpreadable"),_o("iterator"),_o("match"),_o("matchAll"),_o("replace"),_o("search"),_o("species"),_o("split");var al=So;_o("toPrimitive"),al();var sl=ue,ll=Oo;_o("toStringTag"),ll(sl("Symbol"),"Symbol"),_o("unscopables"),Oo(s.JSON,"JSON",!0);var ul,cl,hl,fl=ie.Symbol,dl={},pl=D,vl=tt,gl=Function.prototype,yl=pl&&Object.getOwnPropertyDescriptor,ml=vl(gl,"name"),_l={EXISTS:ml,PROPER:ml&&"something"===function(){}.name,CONFIGURABLE:ml&&(!pl||pl&&yl(gl,"name").configurable)},bl=!l((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),wl=tt,kl=I,El=Je,Sl=bl,Tl=xi("IE_PROTO"),Cl=Object,Al=Cl.prototype,xl=Sl?Cl.getPrototypeOf:function(e){var t=El(e);if(wl(t,Tl))return t[Tl];var n=t.constructor;return kl(n)&&t instanceof n?n.prototype:t instanceof Cl?Al:null},Pl=l,Il=I,Rl=re,Dl=Gi,Ol=xl,Ml=ao,Ll=vt("iterator"),Fl=!1;[].keys&&("next"in(hl=[].keys())?(cl=Ol(Ol(hl)))!==Object.prototype&&(ul=cl):Fl=!0);var Ul=!Rl(ul)||Pl((function(){var e={};return ul[Ll].call(e)!==e}));Il((ul=Ul?{}:Dl(ul))[Ll])||Ml(ul,Ll,(function(){return this}));var Bl={IteratorPrototype:ul,BUGGY_SAFARI_ITERATORS:Fl},Nl=Bl.IteratorPrototype,Vl=Gi,Hl=G,Gl=Oo,jl=dl,zl=function(){return this},Kl=function(e,t,n,r){var i=t+" Iterator";return e.prototype=Vl(Nl,{next:Hl(+!r,n)}),Gl(e,i,!1,!0),jl[i]=zl,e},Wl=_,ql=Me,Xl=I,Yl=String,$l=TypeError,Zl=function(e,t,n){try{return Wl(ql(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(r){}},Jl=an,Ql=function(e){if("object"==typeof e||Xl(e))return e;throw $l("Can't set "+Yl(e)+" as a prototype")},eu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Zl(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(r){}return function(n,r){return Jl(n),Ql(r),t?e(n,r):n.__proto__=r,n}}():void 0),tu=Dn,nu=L,ru=_l,iu=Kl,ou=xl,au=Oo,su=ao,lu=dl,uu=Bl,cu=ru.PROPER,hu=uu.BUGGY_SAFARI_ITERATORS,fu=vt("iterator"),du="keys",pu="values",vu="entries",gu=function(){return this},yu=function(e,t,n,r,i,o,a){iu(n,t,r);var s,l,u,c=function(e){if(e===i&&v)return v;if(!hu&&e in d)return d[e];switch(e){case du:case pu:case vu:return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",f=!1,d=e.prototype,p=d[fu]||d["@@iterator"]||i&&d[i],v=!hu&&p||c(i),g="Array"==t&&d.entries||p;if(g&&(s=ou(g.call(new e)))!==Object.prototype&&s.next&&(au(s,h,!0,!0),lu[h]=gu),cu&&i==pu&&p&&p.name!==pu&&(f=!0,v=function(){return nu(p,this)}),i)if(l={values:c(pu),keys:o?v:c(du),entries:c(vu)},a)for(u in l)(hu||f||!(u in d))&&su(d,u,l[u]);else tu({target:t,proto:!0,forced:hu||f},l);return a&&d[fu]!==v&&su(d,fu,v,{name:i}),lu[t]=v,l},mu=function(e,t){return{value:e,done:t}},_u=ee,bu=dl,wu=Yo;en.f;var ku=yu,Eu=mu,Su="Array Iterator",Tu=wu.set,Cu=wu.getterFor(Su);ku(Array,"Array",(function(e,t){Tu(this,{type:Su,target:_u(e),index:0,kind:t})}),(function(){var e=Cu(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,Eu(void 0,!0)):Eu("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values"),bu.Arguments=bu.Array;var Au={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},xu=s,Pu=ir,Iu=bn,Ru=dl,Du=vt("toStringTag");for(var Ou in Au){var Mu=xu[Ou],Lu=Mu&&Mu.prototype;Lu&&Pu(Lu)!==Du&&Iu(Lu,Du,Ou),Ru[Ou]=Ru.Array}var Fu=fl;_o("dispose");var Uu=Fu;_o("asyncDispose");var Bu=Dn,Nu=_,Vu=ue("Symbol"),Hu=Vu.keyFor,Gu=Nu(Vu.prototype.valueOf);Bu({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==Hu(Gu(e))}catch(t){return!1}}});for(var ju=Dn,zu=Ye,Ku=ue,Wu=_,qu=xe,Xu=vt,Yu=Ku("Symbol"),$u=Yu.isWellKnown,Zu=Ku("Object","getOwnPropertyNames"),Ju=Wu(Yu.prototype.valueOf),Qu=zu("wks"),ec=0,tc=Zu(Yu),nc=tc.length;ec<nc;ec++)try{var rc=tc[ec];qu(Yu[rc])&&Xu(rc)}catch(oz){}ju({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if($u&&$u(e))return!0;try{for(var t=Ju(e),n=0,r=Zu(Qu),i=r.length;n<i;n++)if(Qu[r[n]]==t)return!0}catch(oz){}return!1}}),_o("matcher"),_o("metadataKey"),_o("observable"),_o("metadata"),_o("patternMatch"),_o("replaceAll");var ic=Uu,oc=o(ic),ac=_,sc=Bn,lc=$r,uc=Z,cc=ac("".charAt),hc=ac("".charCodeAt),fc=ac("".slice),dc=function(e){return function(t,n){var r,i,o=lc(uc(t)),a=sc(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=hc(o,a))<55296||r>56319||a+1===s||(i=hc(o,a+1))<56320||i>57343?e?cc(o,a):r:e?fc(o,a,a+2):i-56320+(r-55296<<10)+65536}},pc={codeAt:dc(!1),charAt:dc(!0)},vc=pc.charAt,gc=$r,yc=Yo,mc=yu,_c=mu,bc="String Iterator",wc=yc.set,kc=yc.getterFor(bc);mc(String,"String",(function(e){wc(this,{type:bc,string:gc(e),index:0})}),(function(){var e,t=kc(this),n=t.string,r=t.index;return r>=n.length?_c(void 0,!0):(e=vc(n,r),t.index+=e.length,_c(e,!1))}));var Ec=uo.f("iterator"),Sc=o(Ec);function Tc(e){return(Tc="function"==typeof oc&&"symbol"==typeof Sc?function(e){return typeof e}:function(e){return e&&"function"==typeof oc&&e.constructor===oc&&e!==oc.prototype?"symbol":typeof e})(e)}var Cc={exports:{}},Ac=Dn,xc=D,Pc=en.f;Ac({target:"Object",stat:!0,forced:Object.defineProperty!==Pc,sham:!xc},{defineProperty:Pc});var Ic=ie.Object,Rc=Cc.exports=function(e,t,n){return Ic.defineProperty(e,t,n)};Ic.defineProperty.sham&&(Rc.sham=!0);var Dc=Cc.exports,Oc=o(Dc);Dn({target:"Object",stat:!0,sham:!D},{create:Gi});var Mc=ie.Object,Lc=o((function(e,t){return Mc.create(e,t)})),Fc=Je,Uc=xl,Bc=bl;Dn({target:"Object",stat:!0,forced:l((function(){Uc(1)})),sham:!Bc},{getPrototypeOf:function(e){return Uc(Fc(e))}});var Nc=ie.Object.getPrototypeOf,Vc=o(Nc),Hc=l,Gc=function(e,t){var n=[][e];return!!n&&Hc((function(){n.call(null,t||function(){return 1},1)}))},jc=ra.forEach,zc=Gc("forEach")?[].forEach:function(e){return jc(this,e,arguments.length>1?arguments[1]:void 0)};Dn({target:"Array",proto:!0,forced:[].forEach!=zc},{forEach:zc});var Kc=ie,Wc=function(e){return Kc[e+"Prototype"]},qc=Wc("Array").forEach,Xc=ir,Yc=tt,$c=ce,Zc=qc,Jc=Array.prototype,Qc={DOMTokenList:!0,NodeList:!0},eh=o((function(e){var t=e.forEach;return e===Jc||$c(Jc,e)&&t===Jc.forEach||Yc(Qc,Xc(e))?Zc:t})),th=D,nh=Mn,rh=TypeError,ih=Object.getOwnPropertyDescriptor,oh=th&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(oz){return oz instanceof TypeError}}()?function(e,t){if(nh(e)&&!ih(e,"length").writable)throw rh("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},ah=Je,sh=jn,lh=oh,uh=Kn;Dn({target:"Array",proto:!0,arity:1,forced:l((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(oz){return oz instanceof TypeError}}()},{push:function(e){var t=ah(this),n=sh(t),r=arguments.length;uh(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return lh(t,n),n}});var ch=Wc("Array").push,hh=ce,fh=ch,dh=Array.prototype,ph=o((function(e){var t=e.push;return e===dh||hh(dh,e)&&t===dh.push?fh:t}));Dn({target:"Object",stat:!0},{setPrototypeOf:eu});var vh=ie.Object.setPrototypeOf,gh=o(vh),yh=ue,mh=ji,_h=io,bh=an,wh=_([].concat),kh=yh("Reflect","ownKeys")||function(e){var t=mh.f(bh(e)),n=_h.f;return n?wh(t,n(e)):t},Eh=tt,Sh=kh,Th=R,Ch=en,Ah=re,xh=bn,Ph=Error,Ih=_("".replace),Rh=String(Ph("zxcasd").stack),Dh=/\n\s*at [^:]*:[^\n]*/,Oh=Dh.test(Rh),Mh=G,Lh=!l((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Mh(1,7)),7!==e.stack)})),Fh=bn,Uh=function(e,t){if(Oh&&"string"==typeof e&&!Ph.prepareStackTrace)for(;t--;)e=Ih(e,Dh,"");return e},Bh=Lh,Nh=Error.captureStackTrace,Vh=dl,Hh=vt("iterator"),Gh=Array.prototype,jh=function(e){return void 0!==e&&(Vh.Array===e||Gh[Hh]===e)},zh=ir,Kh=Ue,Wh=X,qh=dl,Xh=vt("iterator"),Yh=function(e){if(!Wh(e))return Kh(e,Xh)||Kh(e,"@@iterator")||qh[zh(e)]},$h=L,Zh=Me,Jh=an,Qh=Ie,ef=Yh,tf=TypeError,nf=function(e,t){var n=arguments.length<2?ef(e):t;if(Zh(n))return Jh($h(n,e));throw tf(Qh(e)+" is not iterable")},rf=L,of=an,af=Ue,sf=function(e,t,n){var r,i;of(e);try{if(!(r=af(e,"return"))){if("throw"===t)throw n;return n}r=rf(r,e)}catch(oz){i=!0,r=oz}if("throw"===t)throw n;if(i)throw r;return of(r),n},lf=Qt,uf=L,cf=an,hf=Ie,ff=jh,df=jn,pf=ce,vf=nf,gf=Yh,yf=sf,mf=TypeError,_f=function(e,t){this.stopped=e,this.result=t},bf=_f.prototype,wf=function(e,t,n){var r,i,o,a,s,l,u,c=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=lf(t,c),g=function(e){return r&&yf(r,"normal",e),new _f(!0,e)},y=function(e){return h?(cf(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(f)r=e.iterator;else if(d)r=e;else{if(!(i=gf(e)))throw mf(hf(e)+" is not iterable");if(ff(i)){for(o=0,a=df(e);a>o;o++)if((s=y(e[o]))&&pf(bf,s))return s;return new _f(!1)}r=vf(e,i)}for(l=f?e.next:r.next;!(u=uf(l,r)).done;){try{s=y(u.value)}catch(oz){yf(r,"throw",oz)}if("object"==typeof s&&s&&pf(bf,s))return s}return new _f(!1)},kf=$r,Ef=Dn,Sf=ce,Tf=xl,Cf=eu,Af=function(e,t,n){for(var r=Sh(t),i=Ch.f,o=Th.f,a=0;a<r.length;a++){var s=r[a];Eh(e,s)||n&&Eh(n,s)||i(e,s,o(t,s))}},xf=Gi,Pf=bn,If=G,Rf=function(e,t){Ah(t)&&"cause"in t&&xh(e,"cause",t.cause)},Df=function(e,t,n,r){Bh&&(Nh?Nh(e,t):Fh(e,"stack",Uh(n,r)))},Of=wf,Mf=function(e,t){return void 0===e?arguments.length<2?"":t:kf(e)},Lf=vt("toStringTag"),Ff=Error,Uf=[].push,Bf=function(e,t){var n,r=Sf(Nf,this);Cf?n=Cf(Ff(),r?Tf(this):Nf):(n=r?this:xf(Nf),Pf(n,Lf,"Error")),void 0!==t&&Pf(n,"message",Mf(t)),Df(n,Bf,n.stack,1),arguments.length>2&&Rf(n,arguments[2]);var i=[];return Of(e,Uf,{that:i}),Pf(n,"errors",i),n};Cf?Cf(Bf,Ff):Af(Bf,Ff,{name:!0});var Nf=Bf.prototype=xf(Ff.prototype,{constructor:If(1,Bf),message:If(1,""),name:If(1,"AggregateError")});Ef({global:!0,constructor:!0,arity:2},{AggregateError:Bf});var Vf,Hf,Gf,jf,zf="undefined"!=typeof process&&"process"==E(process),Kf=ue,Wf=lo,qf=D,Xf=vt("species"),Yf=function(e){var t=Kf(e);qf&&t&&!t[Xf]&&Wf(t,Xf,{configurable:!0,get:function(){return this}})},$f=ce,Zf=TypeError,Jf=function(e,t){if($f(t,e))return e;throw Zf("Incorrect invocation")},Qf=kr,ed=Ie,td=TypeError,nd=function(e){if(Qf(e))return e;throw td(ed(e)+" is not a constructor")},rd=an,id=nd,od=X,ad=vt("species"),sd=function(e,t){var n,r=rd(e).constructor;return void 0===r||od(n=rd(r)[ad])?t:id(n)},ld=TypeError,ud=function(e,t){if(e<t)throw ld("Not enough arguments");return e},cd=/(?:ipad|iphone|ipod).*applewebkit/i.test(he),hd=s,fd=p,dd=Qt,pd=I,vd=tt,gd=l,yd=Ti,md=As,_d=Pt,bd=ud,wd=cd,kd=zf,Ed=hd.setImmediate,Sd=hd.clearImmediate,Td=hd.process,Cd=hd.Dispatch,Ad=hd.Function,xd=hd.MessageChannel,Pd=hd.String,Id=0,Rd={},Dd="onreadystatechange";gd((function(){Vf=hd.location}));var Od=function(e){if(vd(Rd,e)){var t=Rd[e];delete Rd[e],t()}},Md=function(e){return function(){Od(e)}},Ld=function(e){Od(e.data)},Fd=function(e){hd.postMessage(Pd(e),Vf.protocol+"//"+Vf.host)};Ed&&Sd||(Ed=function(e){bd(arguments.length,1);var t=pd(e)?e:Ad(e),n=md(arguments,1);return Rd[++Id]=function(){fd(t,void 0,n)},Hf(Id),Id},Sd=function(e){delete Rd[e]},kd?Hf=function(e){Td.nextTick(Md(e))}:Cd&&Cd.now?Hf=function(e){Cd.now(Md(e))}:xd&&!wd?(jf=(Gf=new xd).port2,Gf.port1.onmessage=Ld,Hf=dd(jf.postMessage,jf)):hd.addEventListener&&pd(hd.postMessage)&&!hd.importScripts&&Vf&&"file:"!==Vf.protocol&&!gd(Fd)?(Hf=Fd,hd.addEventListener("message",Ld,!1)):Hf=Dd in _d("script")?function(e){yd.appendChild(_d("script"))[Dd]=function(){yd.removeChild(this),Od(e)}}:function(e){setTimeout(Md(e),0)});var Ud={set:Ed,clear:Sd},Bd=function(){this.head=null,this.tail=null};Bd.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 Nd,Vd,Hd,Gd,jd,zd=Bd,Kd=/ipad|iphone|ipod/i.test(he)&&"undefined"!=typeof Pebble,Wd=/web0s(?!.*chrome)/i.test(he),qd=s,Xd=Qt,Yd=R.f,$d=Ud.set,Zd=zd,Jd=cd,Qd=Kd,ep=Wd,tp=zf,np=qd.MutationObserver||qd.WebKitMutationObserver,rp=qd.document,ip=qd.process,op=qd.Promise,ap=Yd(qd,"queueMicrotask"),sp=ap&&ap.value;if(!sp){var lp=new Zd,up=function(){var e,t;for(tp&&(e=ip.domain)&&e.exit();t=lp.get();)try{t()}catch(oz){throw lp.head&&Nd(),oz}e&&e.enter()};Jd||tp||ep||!np||!rp?!Qd&&op&&op.resolve?((Gd=op.resolve(void 0)).constructor=op,jd=Xd(Gd.then,Gd),Nd=function(){jd(up)}):tp?Nd=function(){ip.nextTick(up)}:($d=Xd($d,qd),Nd=function(){$d(up)}):(Vd=!0,Hd=rp.createTextNode(""),new np(up).observe(Hd,{characterData:!0}),Nd=function(){Hd.data=Vd=!Vd}),sp=function(e){lp.head||Nd(),lp.add(e)}}var cp=sp,hp=function(e){try{return{error:!1,value:e()}}catch(oz){return{error:!0,value:oz}}},fp=s.Promise,dp="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,pp=!dp&&!zf&&"object"==typeof window&&"object"==typeof document,vp=s,gp=fp,yp=I,mp=Yt,_p=lr,bp=vt,wp=pp,kp=dp,Ep=me,Sp=gp&&gp.prototype,Tp=bp("species"),Cp=!1,Ap=yp(vp.PromiseRejectionEvent),xp={CONSTRUCTOR:mp("Promise",(function(){var e=_p(gp),t=e!==String(gp);if(!t&&66===Ep)return!0;if(!Sp.catch||!Sp.finally)return!0;if(!Ep||Ep<51||!/native code/.test(e)){var n=new gp((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[Tp]=r,!(Cp=n.then((function(){}))instanceof r))return!0}return!t&&(wp||kp)&&!Ap})),REJECTION_EVENT:Ap,SUBCLASSING:Cp},Pp={},Ip=Me,Rp=TypeError,Dp=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw Rp("Bad Promise constructor");t=e,n=r})),this.resolve=Ip(t),this.reject=Ip(n)};Pp.f=function(e){return new Dp(e)};var Op,Mp,Lp=Dn,Fp=zf,Up=s,Bp=L,Np=ao,Vp=Oo,Hp=Yf,Gp=Me,jp=I,zp=re,Kp=Jf,Wp=sd,qp=Ud.set,Xp=cp,Yp=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(oz){}},$p=hp,Zp=zd,Jp=Yo,Qp=fp,ev=xp,tv=Pp,nv="Promise",rv=ev.CONSTRUCTOR,iv=ev.REJECTION_EVENT,ov=Jp.getterFor(nv),av=Jp.set,sv=Qp&&Qp.prototype,lv=Qp,uv=sv,cv=Up.TypeError,hv=Up.document,fv=Up.process,dv=tv.f,pv=dv,vv=!!(hv&&hv.createEvent&&Up.dispatchEvent),gv="unhandledrejection",yv=function(e){var t;return!(!zp(e)||!jp(t=e.then))&&t},mv=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,u=e.reject,c=e.domain;try{s?(a||(2===t.rejection&&Ev(t),t.rejection=1),!0===s?n=o:(c&&c.enter(),n=s(o),c&&(c.exit(),i=!0)),n===e.promise?u(cv("Promise-chain cycle")):(r=yv(n))?Bp(r,n,l,u):l(n)):u(o)}catch(oz){c&&!i&&c.exit(),u(oz)}},_v=function(e,t){e.notified||(e.notified=!0,Xp((function(){for(var n,r=e.reactions;n=r.get();)mv(n,e);e.notified=!1,t&&!e.rejection&&wv(e)})))},bv=function(e,t,n){var r,i;vv?((r=hv.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Up.dispatchEvent(r)):r={promise:t,reason:n},!iv&&(i=Up["on"+e])?i(r):e===gv&&Yp("Unhandled promise rejection",n)},wv=function(e){Bp(qp,Up,(function(){var t,n=e.facade,r=e.value;if(kv(e)&&(t=$p((function(){Fp?fv.emit("unhandledRejection",r,n):bv(gv,n,r)})),e.rejection=Fp||kv(e)?2:1,t.error))throw t.value}))},kv=function(e){return 1!==e.rejection&&!e.parent},Ev=function(e){Bp(qp,Up,(function(){var t=e.facade;Fp?fv.emit("rejectionHandled",t):bv("rejectionhandled",t,e.value)}))},Sv=function(e,t,n){return function(r){e(t,r,n)}},Tv=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,_v(e,!0))},Cv=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw cv("Promise can't be resolved itself");var r=yv(t);r?Xp((function(){var n={done:!1};try{Bp(r,t,Sv(Cv,n,e),Sv(Tv,n,e))}catch(oz){Tv(n,oz,e)}})):(e.value=t,e.state=1,_v(e,!1))}catch(oz){Tv({done:!1},oz,e)}}};rv&&(uv=(lv=function(e){Kp(this,uv),Gp(e),Bp(Op,this);var t=ov(this);try{e(Sv(Cv,t),Sv(Tv,t))}catch(oz){Tv(t,oz)}}).prototype,(Op=function(e){av(this,{type:nv,done:!1,notified:!1,parent:!1,reactions:new Zp,rejection:!1,state:0,value:void 0})}).prototype=Np(uv,"then",(function(e,t){var n=ov(this),r=dv(Wp(this,lv));return n.parent=!0,r.ok=!jp(e)||e,r.fail=jp(t)&&t,r.domain=Fp?fv.domain:void 0,0==n.state?n.reactions.add(r):Xp((function(){mv(r,n)})),r.promise})),Mp=function(){var e=new Op,t=ov(e);this.promise=e,this.resolve=Sv(Cv,t),this.reject=Sv(Tv,t)},tv.f=dv=function(e){return e===lv||undefined===e?new Mp(e):pv(e)}),Lp({global:!0,constructor:!0,wrap:!0,forced:rv},{Promise:lv}),Vp(lv,nv,!1,!0),Hp(nv);var Av=vt("iterator"),xv=!1;try{var Pv=0,Iv={next:function(){return{done:!!Pv++}},return:function(){xv=!0}};Iv[Av]=function(){return this},Array.from(Iv,(function(){throw 2}))}catch(oz){}var Rv=function(e,t){if(!t&&!xv)return!1;var n=!1;try{var r={};r[Av]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(oz){}return n},Dv=fp,Ov=xp.CONSTRUCTOR||!Rv((function(e){Dv.all(e).then(void 0,(function(){}))})),Mv=L,Lv=Me,Fv=Pp,Uv=hp,Bv=wf;Dn({target:"Promise",stat:!0,forced:Ov},{all:function(e){var t=this,n=Fv.f(t),r=n.resolve,i=n.reject,o=Uv((function(){var n=Lv(t.resolve),o=[],a=0,s=1;Bv(e,(function(e){var l=a++,u=!1;s++,Mv(n,t,e).then((function(e){u||(u=!0,o[l]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var Nv=Dn,Vv=xp.CONSTRUCTOR;fp&&fp.prototype,Nv({target:"Promise",proto:!0,forced:Vv,real:!0},{catch:function(e){return this.then(void 0,e)}});var Hv=L,Gv=Me,jv=Pp,zv=hp,Kv=wf;Dn({target:"Promise",stat:!0,forced:Ov},{race:function(e){var t=this,n=jv.f(t),r=n.reject,i=zv((function(){var i=Gv(t.resolve);Kv(e,(function(e){Hv(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Wv=L,qv=Pp;Dn({target:"Promise",stat:!0,forced:xp.CONSTRUCTOR},{reject:function(e){var t=qv.f(this);return Wv(t.reject,void 0,e),t.promise}});var Xv=an,Yv=re,$v=Pp,Zv=function(e,t){if(Xv(e),Yv(t)&&t.constructor===e)return t;var n=$v.f(e);return(0,n.resolve)(t),n.promise},Jv=Dn,Qv=fp,eg=xp.CONSTRUCTOR,tg=Zv,ng=ue("Promise"),rg=!eg;Jv({target:"Promise",stat:!0,forced:true},{resolve:function(e){return tg(rg&&this===ng?Qv:this,e)}});var ig=L,og=Me,ag=Pp,sg=hp,lg=wf;Dn({target:"Promise",stat:!0,forced:Ov},{allSettled:function(e){var t=this,n=ag.f(t),r=n.resolve,i=n.reject,o=sg((function(){var n=og(t.resolve),i=[],o=0,a=1;lg(e,(function(e){var s=o++,l=!1;a++,ig(n,t,e).then((function(e){l||(l=!0,i[s]={status:"fulfilled",value:e},--a||r(i))}),(function(e){l||(l=!0,i[s]={status:"rejected",reason:e},--a||r(i))}))})),--a||r(i)}));return o.error&&i(o.value),n.promise}});var ug=L,cg=Me,hg=ue,fg=Pp,dg=hp,pg=wf,vg="No one promise resolved";Dn({target:"Promise",stat:!0,forced:Ov},{any:function(e){var t=this,n=hg("AggregateError"),r=fg.f(t),i=r.resolve,o=r.reject,a=dg((function(){var r=cg(t.resolve),a=[],s=0,l=1,u=!1;pg(e,(function(e){var c=s++,h=!1;l++,ug(r,t,e).then((function(e){h||u||(u=!0,i(e))}),(function(e){h||u||(h=!0,a[c]=e,--l||o(new n(a,vg)))}))})),--l||o(new n(a,vg))}));return a.error&&o(a.value),r.promise}});var gg=Dn,yg=fp,mg=l,_g=ue,bg=I,wg=sd,kg=Zv,Eg=yg&&yg.prototype;gg({target:"Promise",proto:!0,real:!0,forced:!!yg&&mg((function(){Eg.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=wg(this,_g("Promise")),n=bg(e);return this.then(n?function(n){return kg(t,e()).then((function(){return n}))}:e,n?function(n){return kg(t,e()).then((function(){throw n}))}:e)}});var Sg=ie.Promise,Tg=Pp,Cg=hp;Dn({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Tg.f(this),n=Cg(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}});var Ag=Sg,xg=o(Ag),Pg=Dn,Ig=Mn,Rg=_([].reverse),Dg=[1,2];Pg({target:"Array",proto:!0,forced:String(Dg)===String(Dg.reverse())},{reverse:function(){return Ig(this)&&(this.length=this.length),Rg(this)}});var Og=Wc("Array").reverse,Mg=ce,Lg=Og,Fg=Array.prototype,Ug=function(e){var t=e.reverse;return e===Fg||Mg(Fg,e)&&t===Fg.reverse?Lg:t},Bg=o(Ug),Ng=Dn,Vg=Mn,Hg=kr,Gg=re,jg=ti,zg=jn,Kg=ee,Wg=Yn,qg=vt,Xg=As,Yg=Or("slice"),$g=qg("species"),Zg=Array,Jg=Math.max;Ng({target:"Array",proto:!0,forced:!Yg},{slice:function(e,t){var n,r,i,o=Kg(this),a=zg(o),s=jg(e,a),l=jg(void 0===t?a:t,a);if(Vg(o)&&(n=o.constructor,(Hg(n)&&(n===Zg||Vg(n.prototype))||Gg(n)&&null===(n=n[$g]))&&(n=void 0),n===Zg||void 0===n))return Xg(o,s,l);for(r=new(void 0===n?Zg:n)(Jg(l-s,0)),i=0;s<l;s++,i++)s in o&&Wg(r,i,o[s]);return r.length=i,r}});var Qg=Wc("Array").slice,ey=ce,ty=Qg,ny=Array.prototype,ry=function(e){var t=e.slice;return e===ny||ey(ny,e)&&t===ny.slice?ty:t},iy=o(ry);function oy(){oy=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Oc||function(e,t,n){e[t]=n.value},i="function"==typeof oc?oc:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Oc(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(A){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Lc(o.prototype),s=new S(i||[]);return r(a,"_invoke",{value:b(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=u;var h={};function f(){}function d(){}function p(){}var v={};l(v,o,(function(){return this}));var g=Vc&&Vc(Vc(T([])));g&&g!==t&&n.call(g,o)&&(v=g);var y=p.prototype=f.prototype=Lc(v);function m(e){var t;eh(t=["next","throw","return"]).call(t,(function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(r,o,a,s){var l=c(e[r],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==Tc(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function b(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function w(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function k(e){var t,n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),ph(t=this.tryEntries).call(t,n)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],eh(e).call(e,k,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return gh?gh(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Lc(y),e},e.awrap=function(e){return{__await:e}},m(_.prototype),l(_.prototype,a,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,i,o){void 0===o&&(o=xg);var a=new _(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(y),l(y,s,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)ph(n).call(n,r);return Bg(n).call(n),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=T,S.prototype={constructor:S,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,eh(t=this.tryEntries).call(t,E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+iy(r).call(r,1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function ay(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(oz){return void n(oz)}s.done?t(l):xg.resolve(l).then(r,i)}function sy(e){return function(){var t=this,n=arguments;return new xg((function(r,i){var o=e.apply(t,n);function a(e){ay(o,r,i,a,s,"next",e)}function s(e){ay(o,r,i,a,s,"throw",e)}a(void 0)}))}}Dn({target:"Array",stat:!0},{isArray:Mn});var ly=o(ie.Array.isArray);function uy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cy=Yh,hy=o(cy),fy=an,dy=sf,py=Qt,vy=L,gy=Je,yy=function(e,t,n,r){try{return r?t(fy(n)[0],n[1]):t(n)}catch(oz){dy(e,"throw",oz)}},my=jh,_y=kr,by=jn,wy=Yn,ky=nf,Ey=Yh,Sy=Array,Ty=function(e){var t=gy(e),n=_y(this),r=arguments.length,i=r>1?arguments[1]:void 0,o=void 0!==i;o&&(i=py(i,r>2?arguments[2]:void 0));var a,s,l,u,c,h,f=Ey(t),d=0;if(!f||this===Sy&&my(f))for(a=by(t),s=n?new this(a):Sy(a);a>d;d++)h=o?i(t[d],d):t[d],wy(s,d,h);else for(c=(u=ky(t,f)).next,s=n?new this:[];!(l=vy(c,u)).done;d++)h=o?yy(u,i,[l.value,d],!0):l.value,wy(s,d,h);return s.length=d,s},Cy=Ty;Dn({target:"Array",stat:!0,forced:!Rv((function(e){Array.from(e)}))},{from:Cy});var Ay=ie.Array.from,xy=o(Ay);function Py(e,t){var n;if(e){if("string"==typeof e)return uy(e,t);var r=iy(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?xy(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uy(e,t):void 0}}function Iy(e){return function(e){if(ly(e))return uy(e)}(e)||function(e){if(void 0!==oc&&null!=hy(e)||null!=e["@@iterator"])return xy(e)}(e)||Py(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ry(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Dy=uo.f("toPrimitive"),Oy=o(Dy);function My(e){var t=function(e,t){if("object"!==Tc(e)||null===e)return e;var n=e[Oy];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Tc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Tc(t)?t:String(t)}function Ly(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Oc(e,My(r.key),r)}}function Fy(e,t,n){return t&&Ly(e.prototype,t),n&&Ly(e,n),Oc(e,"prototype",{writable:!1}),e}function Uy(e,t,n){return(t=My(t))in e?Oc(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var By=ie.Object.getOwnPropertySymbols,Ny=o(By),Vy=Dn,Hy=ai.indexOf,Gy=Gc,jy=C([].indexOf),zy=!!jy&&1/jy([1],1,-0)<0;Vy({target:"Array",proto:!0,forced:zy||!Gy("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return zy?jy(this,e,t)||0:Hy(this,e,t)}});var Ky=Wc("Array").indexOf,Wy=ce,qy=Ky,Xy=Array.prototype,Yy=function(e){var t=e.indexOf;return e===Xy||Wy(Xy,e)&&t===Xy.indexOf?qy:t},$y=o(Yy),Zy=Je,Jy=yi;Dn({target:"Object",stat:!0,forced:l((function(){Jy(1)}))},{keys:function(e){return Jy(Zy(e))}});var Qy=ie.Object.keys,em=o(Qy);function tm(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=em(e);for(r=0;r<o.length;r++)n=o[r],$y(t).call(t,n)>=0||(i[n]=e[n]);return i}(e,t);if(Ny){var o=Ny(e);for(r=0;r<o.length;r++)n=o[r],$y(t).call(t,n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var nm=ra.filter;Dn({target:"Array",proto:!0,forced:!Or("filter")},{filter:function(e){return nm(this,e,arguments.length>1?arguments[1]:void 0)}});var rm=Wc("Array").filter,im=ce,om=rm,am=Array.prototype,sm=function(e){var t=e.filter;return e===am||im(am,e)&&t===am.filter?om:t},lm=o(sm),um={exports:{}},cm=Dn,hm=l,fm=ee,dm=R.f,pm=D;cm({target:"Object",stat:!0,forced:!pm||hm((function(){dm(1)})),sham:!pm},{getOwnPropertyDescriptor:function(e,t){return dm(fm(e),t)}});var vm=ie.Object,gm=um.exports=function(e,t){return vm.getOwnPropertyDescriptor(e,t)};vm.getOwnPropertyDescriptor.sham&&(gm.sham=!0);var ym=um.exports,mm=o(ym),_m=kh,bm=ee,wm=R,km=Yn;Dn({target:"Object",stat:!0,sham:!D},{getOwnPropertyDescriptors:function(e){for(var t,n,r=bm(e),i=wm.f,o=_m(r),a={},s=0;o.length>s;)void 0!==(n=i(r,t=o[s++]))&&km(a,t,n);return a}});var Em=ie.Object.getOwnPropertyDescriptors,Sm=o(Em),Tm={exports:{}},Cm=Dn,Am=D,xm=Zr.f;Cm({target:"Object",stat:!0,forced:Object.defineProperties!==xm,sham:!Am},{defineProperties:xm});var Pm=ie.Object,Im=Tm.exports=function(e,t){return Pm.defineProperties(e,t)};Pm.defineProperties.sham&&(Im.sham=!0);var Rm=Tm.exports,Dm=o(Rm);function Om(e,t){var n=em(e);if(Ny){var r=Ny(e);t&&(r=lm(r).call(r,(function(t){return mm(e,t).enumerable}))),ph(n).apply(n,r)}return n}function Mm(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?eh(n=Om(Object(i),!0)).call(n,(function(t){Uy(e,t,i[t])})):Sm?Dm(e,Sm(i)):eh(r=Om(Object(i))).call(r,(function(t){Oc(e,t,mm(i,t))}))}return e}var Lm=Wc("Array").concat,Fm=ce,Um=Lm,Bm=Array.prototype,Nm=o((function(e){var t=e.concat;return e===Bm||Fm(Bm,e)&&t===Bm.concat?Um:t})),Vm=Dn,Hm=ra.find,Gm="find",jm=!0;Gm in[]&&Array(1)[Gm]((function(){jm=!1})),Vm({target:"Array",proto:!0,forced:jm},{find:function(e){return Hm(this,e,arguments.length>1?arguments[1]:void 0)}});var zm=Wc("Array").find,Km=ce,Wm=zm,qm=Array.prototype,Xm=o((function(e){var t=e.find;return e===qm||Km(qm,e)&&t===qm.find?Wm:t})),Ym={exports:{}},$m=l((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Zm=l,Jm=re,Qm=E,e_=$m,t_=Object.isExtensible,n_=Zm((function(){t_(1)}))||e_?function(e){return!!Jm(e)&&((!e_||"ArrayBuffer"!=Qm(e))&&(!t_||t_(e)))}:t_,r_=!l((function(){return Object.isExtensible(Object.preventExtensions({}))})),i_=Dn,o_=_,a_=si,s_=re,l_=tt,u_=en.f,c_=ji,h_=Wi,f_=n_,d_=r_,p_=!1,v_=at("meta"),g_=0,y_=function(e){u_(e,v_,{value:{objectID:"O"+g_++,weakData:{}}})},m_=Ym.exports={enable:function(){m_.enable=function(){},p_=!0;var e=c_.f,t=o_([].splice),n={};n[v_]=1,e(n).length&&(c_.f=function(n){for(var r=e(n),i=0,o=r.length;i<o;i++)if(r[i]===v_){t(r,i,1);break}return r},i_({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h_.f}))},fastKey:function(e,t){if(!s_(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!l_(e,v_)){if(!f_(e))return"F";if(!t)return"E";y_(e)}return e[v_].objectID},getWeakData:function(e,t){if(!l_(e,v_)){if(!f_(e))return!0;if(!t)return!1;y_(e)}return e[v_].weakData},onFreeze:function(e){return d_&&p_&&f_(e)&&!l_(e,v_)&&y_(e),e}};a_[v_]=!0;var __=Ym.exports,b_=Dn,w_=s,k_=__,E_=l,S_=bn,T_=wf,C_=Jf,A_=I,x_=re,P_=Oo,I_=en.f,R_=ra.forEach,D_=D,O_=Yo.set,M_=Yo.getterFor,L_=ao,F_=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:L_(e,r,t[r],n);return e},U_=Gi,B_=lo,N_=F_,V_=Qt,H_=Jf,G_=X,j_=wf,z_=yu,K_=mu,W_=Yf,q_=D,X_=__.fastKey,Y_=Yo.set,$_=Yo.getterFor,Z_={getConstructor:function(e,t,n,r){var i=e((function(e,i){H_(e,o),Y_(e,{type:t,index:U_(null),first:void 0,last:void 0,size:0}),q_||(e.size=0),G_(i)||j_(i,e[r],{that:e,AS_ENTRIES:n})})),o=i.prototype,a=$_(t),s=function(e,t,n){var r,i,o=a(e),s=l(e,t);return s?s.value=n:(o.last=s={index:i=X_(t,!0),key:t,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=s),r&&(r.next=s),q_?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},l=function(e,t){var n,r=a(e),i=X_(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return N_(o,{clear:function(){for(var e=a(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,q_?e.size=0:this.size=0},delete:function(e){var t=this,n=a(t),r=l(t,e);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first==r&&(n.first=i),n.last==r&&(n.last=o),q_?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=a(this),r=V_(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!l(this,e)}}),N_(o,n?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),q_&&B_(o,"size",{configurable:!0,get:function(){return a(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=$_(t),o=$_(r);z_(e,t,(function(e,t){Y_(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?K_("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,K_(void 0,!0))}),n?"entries":"values",!n,!0),W_(t)}};(function(e,t,n){var r,i=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),a=i?"set":"add",s=w_[e],l=s&&s.prototype,u={};if(D_&&A_(s)&&(o||l.forEach&&!E_((function(){(new s).entries().next()})))){var c=(r=t((function(t,n){O_(C_(t,c),{type:e,collection:new s}),null!=n&&T_(n,t[a],{that:t,AS_ENTRIES:i})}))).prototype,h=M_(e);R_(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in l)||o&&"clear"==e||S_(c,e,(function(n,r){var i=h(this).collection;if(!t&&o&&!x_(n))return"get"==e&&void 0;var a=i[e](0===n?0:n,r);return t?this:a}))})),o||I_(c,"size",{configurable:!0,get:function(){return h(this).collection.size}})}else r=n.getConstructor(t,e,i,a),k_.enable();P_(r,e,!1,!0),u[e]=r,b_({global:!0,forced:!0},u),o||n.setStrong(r,e,i)})("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Z_);var J_=ie.Map,Q_=Qt,eb=L,tb=Me,nb=nd,rb=X,ib=wf,ob=[].push,ab=function(e){var t,n,r,i,o=arguments.length,a=o>1?arguments[1]:void 0;return nb(this),(t=void 0!==a)&&tb(a),rb(e)?new this:(n=[],t?(r=0,i=Q_(a,o>2?arguments[2]:void 0),ib(e,(function(e){eb(ob,n,i(e,r++))}))):ib(e,ob,{that:n}),new this(n))};Dn({target:"Map",stat:!0,forced:!0},{from:ab});var sb=As,lb=function(){return new this(sb(arguments))};Dn({target:"Map",stat:!0,forced:!0},{of:lb});var ub=Ie,cb=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"get"in e&&"set"in e&&"delete"in e&&"entries"in e)return e;throw TypeError(ub(e)+" is not a map")},hb=function(e,t){return 1==t?function(t,n){return t[e](n)}:function(t,n,r){return t[e](n,r)}},fb=ue("Map"),db={Map:fb,set:hb("set",2),get:hb("get",1),has:hb("has",1),remove:hb("delete",1),proto:fb.prototype},pb=cb,vb=db.remove;Dn({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=pb(this),n=!0,r=0,i=arguments.length;r<i;r++)e=vb(t,arguments[r]),n=n&&e;return!!n}});var gb=cb,yb=db.get,mb=db.has,_b=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var n,r,i=gb(this);return mb(i,e)?(n=yb(i,e),"update"in t&&(n=t.update(n,e,i),_b(i,e,n)),n):(r=t.insert(e,i),_b(i,e,r),r)}});var bb=L,wb=function(e,t,n){for(var r,i,o=n||e.next;!(r=bb(o,e)).done;)if(void 0!==(i=t(r.value)))return i},kb=function(e,t,n){return n?wb(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},Eb=Qt,Sb=cb,Tb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=Sb(this),n=Eb(e,arguments.length>1?arguments[1]:void 0);return!1!==Tb(t,(function(e,r){if(!n(e,r,t))return!1}),!0)}});var Cb=Qt,Ab=cb,xb=kb,Pb=db.Map,Ib=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=Ab(this),n=Cb(e,arguments.length>1?arguments[1]:void 0),r=new Pb;return xb(t,(function(e,i){n(e,i,t)&&Ib(r,i,e)})),r}});var Rb=Qt,Db=cb,Ob=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=Db(this),n=Rb(e,arguments.length>1?arguments[1]:void 0),r=Ob(t,(function(e,r){if(n(e,r,t))return{value:e}}),!0);return r&&r.value}});var Mb=Qt,Lb=cb,Fb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=Lb(this),n=Mb(e,arguments.length>1?arguments[1]:void 0),r=Fb(t,(function(e,r){if(n(e,r,t))return{key:r}}),!0);return r&&r.key}});var Ub=Dn,Bb=L,Nb=I,Vb=Me,Hb=wf,Gb=db.Map,jb=_([].push);Ub({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var n=new(Nb(this)?this:Gb);Vb(t);var r=Vb(n.has),i=Vb(n.get),o=Vb(n.set);return Hb(e,(function(e){var a=t(e);Bb(r,n,a)?jb(Bb(i,n,a),e):Bb(o,n,a,[e])})),n}});var zb=function(e,t){return e===t||e!=e&&t!=t},Kb=cb,Wb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===Wb(Kb(this),(function(t){if(zb(t,e))return!0}),!0)}});var qb=L,Xb=wf,Yb=I,$b=Me,Zb=db.Map;Dn({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var n=new(Yb(this)?this:Zb);$b(t);var r=$b(n.set);return Xb(e,(function(e){qb(r,n,t(e),e)})),n}});var Jb=cb,Qb=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=Qb(Jb(this),(function(t,n){if(t===e)return{key:n}}),!0);return t&&t.key}});var ew=Qt,tw=cb,nw=kb,rw=db.Map,iw=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=tw(this),n=ew(e,arguments.length>1?arguments[1]:void 0),r=new rw;return nw(t,(function(e,i){iw(r,n(e,i,t),e)})),r}});var ow=Qt,aw=cb,sw=kb,lw=db.Map,uw=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=aw(this),n=ow(e,arguments.length>1?arguments[1]:void 0),r=new lw;return sw(t,(function(e,i){uw(r,i,n(e,i,t))})),r}});var cw=cb,hw=wf,fw=db.set;Dn({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=cw(this),n=arguments.length,r=0;r<n;)hw(arguments[r++],(function(e,n){fw(t,e,n)}),{AS_ENTRIES:!0});return t}});var dw=Me,pw=cb,vw=kb,gw=TypeError;Dn({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=pw(this),n=arguments.length<2,r=n?void 0:arguments[1];if(dw(e),vw(t,(function(i,o){n?(n=!1,r=i):r=e(r,i,o,t)})),n)throw gw("Reduce of empty map with no initial value");return r}});var yw=Qt,mw=cb,_w=kb;Dn({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=mw(this),n=yw(e,arguments.length>1?arguments[1]:void 0);return!0===_w(t,(function(e,r){if(n(e,r,t))return!0}),!0)}});var bw=Me,ww=cb,kw=TypeError,Ew=db.get,Sw=db.has,Tw=db.set;Dn({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var n=ww(this),r=arguments.length;bw(t);var i=Sw(n,e);if(!i&&r<3)throw kw("Updating absent value");var o=i?Ew(n,e):bw(r>2?arguments[2]:void 0)(e,n);return Tw(n,e,t(o,e,n)),n}});var Cw=L,Aw=Me,xw=I,Pw=an,Iw=TypeError,Rw=function(e,t){var n,r=Pw(this),i=Aw(r.get),o=Aw(r.has),a=Aw(r.set),s=arguments.length>2?arguments[2]:void 0;if(!xw(t)&&!xw(s))throw Iw("At least one callback required");return Cw(o,r,e)?(n=Cw(i,r,e),xw(t)&&(n=t(n),Cw(a,r,e,n))):xw(s)&&(n=s(),Cw(a,r,e,n)),n};Dn({target:"Map",proto:!0,real:!0,forced:!0},{upsert:Rw}),Dn({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:Rw});var Dw=J_,Ow=o(Dw),Mw=o(Dw),Lw=ra.map;Dn({target:"Array",proto:!0,forced:!Or("map")},{map:function(e){return Lw(this,e,arguments.length>1?arguments[1]:void 0)}});var Fw=Wc("Array").map,Uw=ce,Bw=Fw,Nw=Array.prototype,Vw=o((function(e){var t=e.map;return e===Nw||Uw(Nw,e)&&t===Nw.map?Bw:t})),Hw=o(Ag),Gw=o(sm),jw=ai.includes;Dn({target:"Array",proto:!0,forced:l((function(){return!Array(1).includes()}))},{includes:function(e){return jw(this,e,arguments.length>1?arguments[1]:void 0)}});var zw=Wc("Array").includes,Kw=re,Ww=E,qw=vt("match"),Xw=function(e){var t;return Kw(e)&&(void 0!==(t=e[qw])?!!t:"RegExp"==Ww(e))},Yw=TypeError,$w=function(e){if(Xw(e))throw Yw("The method doesn't accept regular expressions");return e},Zw=vt("match"),Jw=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Zw]=!1,"/./"[e](t)}catch(oz){}}return!1},Qw=Dn,ek=$w,tk=Z,nk=$r,rk=Jw,ik=_("".indexOf);Qw({target:"String",proto:!0,forced:!rk("includes")},{includes:function(e){return!!~ik(nk(tk(this)),nk(ek(e)),arguments.length>1?arguments[1]:void 0)}});var ok=Wc("String").includes,ak=ce,sk=zw,lk=ok,uk=Array.prototype,ck=String.prototype,hk=o((function(e){var t=e.includes;return e===uk||ak(uk,e)&&t===uk.includes?sk:"string"==typeof e||e===ck||ak(ck,e)&&t===ck.includes?lk:t})),fk=o(Yy),dk=o(Qy),pk=o(ry),vk=Ie,gk=TypeError,yk=function(e,t){if(!delete e[t])throw gk("Cannot delete property "+vk(t)+" of "+vk(e))},mk=Dn,_k=Je,bk=ti,wk=Bn,kk=jn,Ek=oh,Sk=Kn,Tk=Pr,Ck=Yn,Ak=yk,xk=Or("splice"),Pk=Math.max,Ik=Math.min;mk({target:"Array",proto:!0,forced:!xk},{splice:function(e,t){var n,r,i,o,a,s,l=_k(this),u=kk(l),c=bk(e,u),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=u-c):(n=h-2,r=Ik(Pk(wk(t),0),u-c)),Sk(u+n-r),i=Tk(l,r),o=0;o<r;o++)(a=c+o)in l&&Ck(i,o,l[a]);if(i.length=r,n<r){for(o=c;o<u-r;o++)s=o+n,(a=o+r)in l?l[s]=l[a]:Ak(l,s);for(o=u;o>u-r+n;o--)Ak(l,o-1)}else if(n>r)for(o=u-r;o>c;o--)s=o+n-1,(a=o+r-1)in l?l[s]=l[a]:Ak(l,s);for(o=0;o<n;o++)l[o+c]=arguments[o+2];return Ek(l,u-r+n),i}});var Rk=Wc("Array").splice,Dk=ce,Ok=Rk,Mk=Array.prototype,Lk=o((function(e){var t=e.splice;return e===Mk||Dk(Mk,e)&&t===Mk.splice?Ok:t}));Dn({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Fk=o(ie.Number.isNaN),Uk="\t\n\v\f\r \u2028\u2029\ufeff",Bk=Z,Nk=$r,Vk=Uk,Hk=_("".replace),Gk=RegExp("^["+Vk+"]+"),jk=RegExp("(^|[^"+Vk+"])["+Vk+"]+$"),zk=function(e){return function(t){var n=Nk(Bk(t));return 1&e&&(n=Hk(n,Gk,"")),2&e&&(n=Hk(n,jk,"$1")),n}},Kk={start:zk(1),end:zk(2),trim:zk(3)},Wk=s,qk=l,Xk=_,Yk=$r,$k=Kk.trim,Zk=Uk,Jk=Wk.parseInt,Qk=Wk.Symbol,eE=Qk&&Qk.iterator,tE=/^[+-]?0x/i,nE=Xk(tE.exec),rE=8!==Jk(Zk+"08")||22!==Jk(Zk+"0x16")||eE&&!qk((function(){Jk(Object(eE))}))?function(e,t){var n=$k(Yk(e));return Jk(n,t>>>0||(nE(tE,n)?16:10))}:Jk;Dn({global:!0,forced:parseInt!=rE},{parseInt:rE});var iE=o(ie.parseInt),oE=Wc("Array").keys,aE=ir,sE=tt,lE=ce,uE=oE,cE=Array.prototype,hE={DOMTokenList:!0,NodeList:!0},fE=o((function(e){var t=e.keys;return e===cE||lE(cE,e)&&t===cE.keys||sE(hE,aE(e))?uE:t})),dE=D,pE=_,vE=L,gE=l,yE=yi,mE=io,_E=F,bE=Je,wE=q,kE=Object.assign,EE=Object.defineProperty,SE=pE([].concat),TE=!kE||gE((function(){if(dE&&1!==kE({b:1},kE(EE({},"a",{enumerable:!0,get:function(){EE(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=kE({},e)[n]||yE(kE({},t)).join("")!=r}))?function(e,t){for(var n=bE(e),r=arguments.length,i=1,o=mE.f,a=_E.f;r>i;)for(var s,l=wE(arguments[i++]),u=o?SE(yE(l),o(l)):yE(l),c=u.length,h=0;c>h;)s=u[h++],dE&&!vE(a,l,s)||(n[s]=l[s]);return n}:kE,CE=TE;Dn({target:"Object",stat:!0,arity:2,forced:Object.assign!==CE},{assign:CE});var AE=o(ie.Object.assign),xE=o(By),PE=o(ym),IE=o(Em),RE=o(Rm),DE=o(Dc),OE=o(ic),ME=o(Ec),LE=o(vh),FE=o(Nc),UE=_,BE=Me,NE=re,VE=tt,HE=As,GE=u,jE=Function,zE=UE([].concat),KE=UE([].join),WE={},qE=GE?jE.bind:function(e){var t=BE(this),n=t.prototype,r=HE(arguments,1),i=function(){var n=zE(r,HE(arguments));return this instanceof i?function(e,t,n){if(!VE(WE,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";WE[t]=jE("C,a","return new C("+KE(r,",")+")")}return WE[t](e,n)}(t,n.length,n):t.apply(e,n)};return NE(n)&&(i.prototype=n),i},XE=Dn,YE=p,$E=qE,ZE=nd,JE=an,QE=re,eS=Gi,tS=l,nS=ue("Reflect","construct"),rS=Object.prototype,iS=[].push,oS=tS((function(){function e(){}return!(nS((function(){}),[],e)instanceof e)})),aS=!tS((function(){nS((function(){}))})),sS=oS||aS;XE({target:"Reflect",stat:!0,forced:sS,sham:sS},{construct:function(e,t){ZE(e),JE(t);var n=arguments.length<3?e:ZE(arguments[2]);if(aS&&!oS)return nS(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 r=[null];return YE(iS,r,t),new(YE($E,e,r))}var i=n.prototype,o=eS(QE(i)?i:rS),a=YE(e,o,t);return QE(a)?a:o}});var lS=ie.Reflect.construct,uS=o(lS),cS=o(lS),hS=tt,fS=L,dS=re,pS=an,vS=function(e){return void 0!==e&&(hS(e,"value")||hS(e,"writable"))},gS=R,yS=xl;Dn({target:"Reflect",stat:!0},{get:function e(t,n){var r,i,o=arguments.length<3?t:arguments[2];return pS(t)===o?t[n]:(r=gS.f(t,n))?vS(r)?r.value:void 0===r.get?void 0:fS(r.get,o):dS(i=yS(t))?e(i,n,o):void 0}});var mS=ie.Reflect.get,_S=o(mS),bS=o(mS),wS=o(cy),kS=o(Ay),ES=o(Dy);function SS(e,t){var n=dk(e);if(xE){var r=xE(e);t&&(r=Gw(r).call(r,(function(t){return PE(e,t).enumerable}))),n.push.apply(n,r)}return n}function TS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SS(Object(n),!0).forEach((function(t){IS(e,t,n[t])})):IE?RE(e,IE(n)):SS(Object(n)).forEach((function(t){DE(e,t,PE(n,t))}))}return e}function CS(e){return(CS="function"==typeof OE&&"symbol"==typeof ME?function(e){return typeof e}:function(e){return e&&"function"==typeof OE&&e.constructor===OE&&e!==OE.prototype?"symbol":typeof e})(e)}function AS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),DE(e,VS(r.key),r)}}function PS(e,t,n){return t&&xS(e.prototype,t),n&&xS(e,n),DE(e,"prototype",{writable:!1}),e}function IS(e,t,n){return(t=VS(t))in e?DE(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RS(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}}),DE(e,"prototype",{writable:!1}),t&&OS(e,t)}function DS(e){return(DS=LE?FE.bind():function(e){return e.__proto__||FE(e)})(e)}function OS(e,t){return(OS=LE?LE.bind():function(e,t){return e.__proto__=t,e})(e,t)}function MS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LS(e,t){if(t&&("object"===Tc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return MS(e)}function FS(e){var t=function(){if("undefined"==typeof Reflect||!cS)return!1;if(cS.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(cS(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=DS(e);if(t){var i=DS(this).constructor;n=cS(r,arguments,i)}else n=r.apply(this,arguments);return LS(this,n)}}function US(){return US="undefined"!=typeof Reflect&&bS?bS.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=DS(e)););return e}(e,t);if(r){var i=PE(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},US.apply(this,arguments)}function BS(e){return function(e){if(Array.isArray(e))return NS(e)}(e)||function(e){if(void 0!==OE&&null!=wS(e)||null!=e["@@iterator"])return kS(e)}(e)||function(e,t){var n;if(!e)return;if("string"==typeof e)return NS(e,t);var r=pk(n=Object.prototype.toString.call(e)).call(n,8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return kS(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NS(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function VS(e){var t=function(e,t){if("object"!==Tc(e)||null===e)return e;var n=e[ES];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Tc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Tc(t)?t:String(t)}var HS={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?pk(r).call(r,1):r);return xE?Nm(i).call(i,xE(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,u,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,o),!0;case 6:return c.fn.call(c.context,t,r,i,o,a),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var f,d=c.length;for(u=0;u<d;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,r);break;case 4:c[u].fn.call(c[u].context,t,r,i);break;default:if(!l)for(f=1,l=new Array(h-1);f<h;f++)l[f-1]=arguments[f];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,u=[],c=s.length;l<c;l++)(s[l].fn!==t||i&&!s[l].once||r&&s[l].context!==r)&&u.push(s[l]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(HS);var GS=HS.exports,jS=o(GS),zS=Bn,KS=$r,WS=Z,qS=RangeError,XS=function(e){var t=KS(WS(this)),n="",r=zS(e);if(r<0||r==1/0)throw qS("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},YS=_,$S=Hn,ZS=$r,JS=Z,QS=YS(XS),eT=YS("".slice),tT=Math.ceil,nT=function(e){return function(t,n,r){var i,o,a=ZS(JS(t)),s=$S(n),l=a.length,u=void 0===r?" ":ZS(r);return s<=l||""==u?a:((o=QS(u,tT((i=s-l)/u.length))).length>i&&(o=eT(o,0,i)),e?a+o:o+a)}},rT={start:nT(!1),end:nT(!0)},iT=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(he),oT=rT.start;Dn({target:"String",proto:!0,forced:iT},{padStart:function(e){return oT(this,e,arguments.length>1?arguments[1]:void 0)}});var aT=Wc("String").padStart,sT=ce,lT=aT,uT=String.prototype,cT=o((function(e){var t=e.padStart;return"string"==typeof e||e===uT||sT(uT,e)&&t===uT.padStart?lT:t})),hT=s,fT=l,dT=$r,pT=Kk.trim,vT=Uk,gT=_("".charAt),yT=hT.parseFloat,mT=hT.Symbol,_T=mT&&mT.iterator,bT=1/yT(vT+"-0")!=-1/0||_T&&!fT((function(){yT(Object(_T))}))?function(e){var t=pT(dT(e)),n=yT(t);return 0===n&&"-"==gT(t,0)?-0:n}:yT;Dn({global:!0,forced:parseFloat!=bT},{parseFloat:bT});var wT=o(ie.parseFloat),kT=_l.PROPER,ET=l,ST=Uk,TT=Kk.trim;Dn({target:"String",proto:!0,forced:function(e){return ET((function(){return!!ST[e]()||"
"!=="
"[e]()||kT&&ST[e].name!==e}))}("trim")},{trim:function(){return TT(this)}});var CT=Wc("String").trim,AT=ce,xT=CT,PT=String.prototype,IT=o((function(e){var t=e.trim;return"string"==typeof e||e===PT||AT(PT,e)&&t===PT.trim?xT:t})),RT=Ji,DT=Math.floor,OT=function(e,t){var n=e.length,r=DT(n/2);return n<8?MT(e,t):LT(e,OT(RT(e,0,r),t),OT(RT(e,r),t),t)},MT=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},LT=function(e,t,n,r){for(var i=t.length,o=n.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?r(t[a],n[s])<=0?t[a++]:n[s++]:a<i?t[a++]:n[s++];return e},FT=OT,UT=he.match(/firefox\/(\d+)/i),BT=!!UT&&+UT[1],NT=/MSIE|Trident/.test(he),VT=he.match(/AppleWebKit\/(\d+)\./),HT=!!VT&&+VT[1],GT=Dn,jT=_,zT=Me,KT=Je,WT=jn,qT=yk,XT=$r,YT=l,$T=FT,ZT=Gc,JT=BT,QT=NT,eC=me,tC=HT,nC=[],rC=jT(nC.sort),iC=jT(nC.push),oC=YT((function(){nC.sort(void 0)})),aC=YT((function(){nC.sort(null)})),sC=ZT("sort"),lC=!YT((function(){if(eC)return eC<70;if(!(JT&&JT>3)){if(QT)return!0;if(tC)return tC<603;var e,t,n,r,i="";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(r=0;r<47;r++)nC.push({k:t+r,v:n})}for(nC.sort((function(e,t){return t.v-e.v})),r=0;r<nC.length;r++)t=nC[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));GT({target:"Array",proto:!0,forced:oC||!aC||!sC||!lC},{sort:function(e){void 0!==e&&zT(e);var t=KT(this);if(lC)return void 0===e?rC(t):rC(t,e);var n,r,i=[],o=WT(t);for(r=0;r<o;r++)r in t&&iC(i,t[r]);for($T(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:XT(t)>XT(n)?1:-1}}(e)),n=WT(i),r=0;r<n;)t[r]=i[r++];for(;r<o;)qT(t,r++);return t}});var uC,cC=Wc("Array").sort,hC=ce,fC=cC,dC=Array.prototype,pC=o((function(e){var t=e.sort;return e===dC||hC(dC,e)&&t===dC.sort?fC:t})),vC="undefined"!=typeof window&&window.location&&fk(uC=window.location.href).call(uC,"xgplayerdebugger=1")>-1,gC="color: #525252; background-color: #90ee90;",yC="color: #525252; background-color: red;",mC="color: #525252; background-color: yellow; ",_C="%c[xgplayer]",bC={config:{debug:vC?3:0},logInfo:function(e){for(var t,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];this.config.debug>=3&&(n=console).log.apply(n,Nm(t=[_C,gC,e]).call(t,i))},logWarn:function(e){for(var t,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];this.config.debug>=1&&(n=console).warn.apply(n,Nm(t=[_C,mC,e]).call(t,i))},logError:function(e){var t,n;if(!(this.config.debug<1)){for(var r=this.config.debug>=2?"trace":"error",i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];(n=console)[r].apply(n,Nm(t=[_C,yC,e]).call(t,o))}}};var wC=function(){function e(t){AS(this,e),this.bufferedList=t}return PS(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}(),kC={};function EC(e){var t=CS(e);return null!==e&&("object"===t||"function"===t)}function SC(e,t,n){var r,i,o,a,s,l,u=0,c=!1,h=!1,f=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,o=i;return r=i=void 0,u=t,a=e.apply(o,n)}function v(e,t){return d?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=o}function y(){var e=Date.now();if(g(e))return m(e);s=v(y,function(e){var n=e-u,r=t-(e-l);return h?Math.min(r,o-n):r}(e))}function m(e){return s=void 0,f&&r?p(e):(r=i=void 0,a)}function _(){for(var e=Date.now(),n=g(e),o=arguments.length,f=new Array(o),d=0;d<o;d++)f[d]=arguments[d];if(r=f,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=v(y,t),c?p(e):a}(l);if(h)return s=v(y,t),p(l)}return void 0===s&&(s=v(y,t)),a}return t=+t||0,EC(n)&&(c=!!n.leading,o=(h="maxWait"in n)?Math.max(+n.maxWait||0,t):o,f="trailing"in n?!!n.trailing:f),_.cancel=function(){void 0!==s&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),u=0,r=l=i=s=void 0},_.flush=function(){return void 0===s?a:m(Date.now())},_.pending=function(){return void 0!==s},_}function TC(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"===e&&(e="zh"),e}kC.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]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(e);return i.className=r,i.innerHTML=t,dk(n).forEach((function(t){var r=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&i.setAttribute(r,o):i.setAttribute(r,o)})),i},kC.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 r=document.createElement("div");r.innerHTML=e;var i=r.children;return r=null,i.length>0?(i=i[0],n&&kC.addClass(i,n),t&&dk(t).forEach((function(e){i.setAttribute(e,t[e])})),i):null}catch(o){return bC.logError("util.createDomFromHtml",o),null}},kC.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(r){var n=e.className&&"object"===CS(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},kC.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){kC.hasClass(e,t)||(e.className&&"object"===CS(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},kC.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){kC.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===CS(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},kC.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){kC.hasClass(e,t)?kC.removeClass(e,t):kC.addClass(e,t)}))},kC.classNames=function(){for(var e=arguments,t=[],n=function(n){if("String"===kC.typeOf(e[n]))t.push(e[n]);else if("Object"===kC.typeOf(e[n])){var r;Vw(r=dk(e[n])).call(r,(function(r){e[n][r]&&t.push(r)}))}},r=0;r<arguments.length;r++)n(r);return t.join(" ")},kC.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(r){bC.logError("util.findDom",r),0===fk(n).call(n,"#")&&(e=t.getElementById(pk(n).call(n,1)))}return e},kC.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},kC.padStart=function(e,t,n){for(var r=String(n),i=t>>0,o=Math.ceil(i/r.length),a=[],s=String(e);o--;)a.push(r);return a.join("").substring(0,i-s.length)+s},kC.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=cT(kC).call(kC,Math.floor(e/3600),2,0),n=cT(kC).call(kC,Math.floor((e-3600*t)/60),2,0),r=cT(kC).call(kC,Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,r]:[t,n,r]).join(":")},kC.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},kC.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},kC.deepCopy=function(e,t){if("Object"===kC.typeOf(t)&&"Object"===kC.typeOf(e))return dk(t).forEach((function(n){if("Object"!==kC.typeOf(t[n])||t[n]instanceof Node)if("Array"===kC.typeOf(t[n])){var r;e[n]="Array"===kC.typeOf(e[n])?Nm(r=e[n]).call(r,t[n]):t[n]}else e[n]=t[n];else void 0===e[n]||void 0===e[n]?e[n]=t[n]:kC.deepCopy(e[n],t[n])})),e},kC.deepMerge=function(e,t){var n;return Vw(n=dk(t)).call(n,(function(n){var r;"Array"===kC.typeOf(t[n])&&"Array"===kC.typeOf(e[n])?"Array"===kC.typeOf(e[n])&&(r=e[n]).push.apply(r,BS(t[n])):kC.typeOf(e[n])!==kC.typeOf(t[n])||null===e[n]||"Object"!==kC.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):kC.deepMerge(e[n],t[n])})),e},kC.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},kC.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""},kC.setInterval=function(e,t,n,r){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),r))},kC.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},kC.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var r=setTimeout((function(){t(),kC.clearTimeout(e,r)}),n);return e._timers.push(r),r},kC.clearTimeout=function(e,t){var n=e._timers;if("Array"===kC.typeOf(n)){for(var r=0;r<n.length;r++)if(n[r]===t){Lk(n).call(n,r,1),clearTimeout(t);break}}else clearTimeout(t)},kC.clearAllTimers=function(e){var t=e._timers;"Array"===kC.typeOf(t)&&(Vw(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},kC.createImgBtn=function(e,t,n,r){var i,o,a,s,l,u,c,h,f,d,p,v=kC.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(v.style.backgroundImage='url("'.concat(t,'")'),n&&r)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){var t,i;return!(fk(n).call(n,e)>-1&&fk(r).call(r,e)>-1)||(u=wT(IT(t=pk(n).call(n,0,fk(n).call(n,e))).call(t)),c=wT(IT(i=pk(r).call(r,0,fk(r).call(r,e))).call(i)),h=e,!1)})),v.style.width=Nm(i="".concat(u)).call(i,h),v.style.height=Nm(o="".concat(c)).call(o,h),v.style.backgroundSize=Nm(a=Nm(s=Nm(l="".concat(u)).call(l,h," ")).call(s,c)).call(a,h),v.style.margin="start"===e?Nm(f=Nm(d=Nm(p="-".concat(c/2)).call(p,h," auto auto -")).call(d,u/2)).call(f,h):"auto 5px auto 5px");return v},kC.Hex2RGBA=function(e,t){var n,r=[];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){r.push(iE(e,16))})),Nm(n="rgba(".concat(r.join(","),", ")).call(n,t,")")):"rgba(255, 255, 255, 0.1)"},kC.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},kC.checkIsFunction=function(e){return e&&"function"==typeof e},kC.checkIsObject=function(e){return null!==e&&"object"===CS(e)},kC.hide=function(e){e.style.display="none"},kC.show=function(e,t){e.style.display=t||"block"},kC.isUndefined=function(e){if(null==e)return!0},kC.isNotNull=function(e){return!(null==e)},kC.setStyleFromCsstext=function(e,t){if(t)if("String"===kC.typeOf(t)){var n=t.replace(/\s+/g,"").split(";");Vw(n).call(n,(function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}}))}else{var r;Vw(r=dk(t)).call(r,(function(n){e.style[n]=t[n]}))}},kC.filterStyleFromText=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],r=e.style.cssText;if(!r)return{};var i=r.replace(/\s+/g,"").split(";"),o={},a={};return Vw(i).call(i,(function(e){if(e){var t=e.split(":");t.length>1&&(!function(e,t){for(var n=0,r=t.length;n<r;n++)if(fk(e).call(e,t[n])>-1)return!0;return!1}(t[0],n)?a[t[0]]=t[1]:o[t[0]]=t[1])}})),e.setAttribute("style",""),Vw(t=dk(a)).call(t,(function(t){e.style[t]=a[t]})),o},kC.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),r={};return Vw(n).call(n,(function(e){if(e){var t=e.split(":");t.length>1&&(r[t[0]]=t[1])}})),r},kC.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 r=new window.Image;r.onload=function(e){r=null,t&&t(e)},r.onerror=function(e){r=null,n&&n(e)},r.src=e}},kC.stopPropagation=function(e){e&&e.stopPropagation()},kC.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},kC.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},kC.checkTouchSupport=function(){return"ontouchstart"in window},kC.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],r=0;r<e.length;r++)n.push({start:e.start(r)<.5?0:e.start(r),end:e.end(r)});pC(n).call(n,(function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var i=[];if(t)for(var o=0;o<n.length;o++){var a=i.length;if(a){var s=i[a-1].end;n[o].start-s<t?n[o].end>s&&(i[a-1].end=n[o].end):i.push(n[o])}else i.push(n[o])}else i=n;return new wC(i)},kC.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}},kC.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},kC.getHostFromUrl=function(e){if("String"!==kC.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},kC.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},kC.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},kC.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},kC.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=iE(e)}catch(n){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=iE(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)}))},kC.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},kC.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},kC.createPositionBar=function(e,t){var n=kC.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(n),n},kC.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r={scale:"".concat(t.scale||1),translate:Nm(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")};return dk(r).forEach((function(e){var t,i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),o=Nm(t="".concat(e,"(")).call(t,r[e],")");i.test(n)?(i.lastIndex=-1,n=n.replace(i,o)):n+="".concat(o," ")})),n},kC.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},kC.getIndexByTime=function(e,t){var n=t.length,r=-1;if(n<1)return r;if(e<=t[0].end||n<2)r=0;else if(e>t[n-1].end)r=n-1;else for(var i=1;i<n;i++)if(e>t[i-1].end&&e<=t[i].end){r=i;break}return r},kC.getOffsetCurrentTime=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=-1;if((r=n>=0&&n<t.length?n:kC.getIndexByTime(e,t))<0)return-1;var i=t.length,o=t[r],a=o.start,s=o.end,l=o.cTime,u=o.offset;return e<a?l:e>=a&&e<=s?e-u:e>s&&r>=i-1?s:-1},kC.getCurrentTimeByOffset=function(e,t){var n=-1;if(!t||t.length<0)return e;for(var r=0;r<t.length;r++)if(e<=t[r].duration){n=r;break}if(-1!==n){var i=t[n].start;return n-1<0?i+e:i+(e-t[n-1].duration)}return e};var CC=/(Android)\s([\d.]+)/,AC=/(Version)\/([\d.]+)/,xC=["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"],PC={get device(){return PC.os.isPc?"pc":"mobile"},get browser(){var e,t;if("undefined"==typeof navigator)return"";var n=navigator.userAgent.toLowerCase(),r={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return Nm(e=[]).call(e,Gw(t=dk(r)).call(t,(function(e){return r[e].test(n)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,r=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,a=o||r&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!a;return{isTablet:a,isPhone:s,isIpad:o,isIos:s||o,isAndroid:r,isPc:!(s||r||n||a),isSymbian:n,isWindowsPhone:t,isFireFox:i}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?AC:CC)?t.exec(e):[];if(n&&n.length>=3){var r=n[2].split(".");return r.length>0?iE(r[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&&Vw(xC).call(xC,(function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(oz){return this._logger.error(e,oz),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Hw.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},r=e.audio||{};try{var i=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(r.contentType);return Hw.resolve({supported:i&&o,smooth:!1,powerEfficient:!1})}catch(a){return Hw.resolve(t)}}},IC="3.0.19-rc.0",RC={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},DC={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},OC=PS((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};AS(this,e);var r=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var i,o=n.mediaError?n.mediaError:t.media.error||{},a=t.duration,s=t.currentTime,l=t.ended,u=t.src,c=t.currentSrc,h=t.media,f=h.readyState,d=h.networkState,p=n.errorCode||o.code;DC[p]&&(p=DC[p]);var v={playerVersion:IC,currentTime:s,duration:a,ended:l,readyState:f,networkState:d,src:u||c,errorType:n.errorType,errorCode:p,message:n.errorMessage||o.message,mediaError:o,originError:n.originError?n.originError.stack:"",host:kC.getHostFromUrl(u||c)};return n.ext&&Vw(i=dk(n.ext)).call(i,(function(e){v[e]=n.ext[e]})),v}if(arguments.length>1){for(var g={playerVersion:IC,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],m=0;m<arguments.length;m++)g[y[m]]=arguments[m];return g.ex=r?(r[arguments[0]]||{}).msg:"",g}})),MC="play",LC="ended",FC="pause",UC="error",BC="seeked",NC="timeupdate",VC="waiting",HC="canplay",GC="durationchange",jC="volumechange",zC="loadeddata",KC="emptied",WC="focus",qC="blur",XC="ready",YC="urlNull",$C="autoplay_started",ZC="autoplay_was_prevented",JC="complete",QC="replay",eA="destroy",tA="urlchange",nA="download_speed_change",rA="leaveplayer",iA="enterplayer",oA="loading",aA="fullscreen_change",sA="cssFullscreen_change",lA="mini_state_change",uA="definition_change",cA="before_definition_change",hA="after_definition_change",fA="retry",dA="video_resize",pA="pip_change",vA="playnext",gA="shortcut",yA="user_action",mA="reset",_A="source_error",bA="source_success",wA=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],kA=Object.freeze({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:hA,AUTOPLAY_PREVENTED:ZC,AUTOPLAY_STARTED:$C,BEFORE_DEFINITION_CHANGE:cA,BUFFER_CHANGE:"bufferedChange",CANPLAY:HC,CANPLAY_THROUGH:"canplaythrough",COMPLETE:JC,CSS_FULLSCREEN_CHANGE:sA,DEFINITION_CHANGE:uA,DESTROY:eA,DOWNLOAD_SPEED_CHANGE:nA,DURATION_CHANGE:GC,EMPTIED:KC,ENDED:LC,ENTER_PLAYER:iA,ERROR:UC,FPS_STUCK:"fps_stuck",FULLSCREEN_CHANGE:aA,LEAVE_PLAYER:rA,LOADED_DATA:zC,LOADED_METADATA:"loadedmetadata",LOADING:oA,LOAD_START:"loadstart",MINI_STATE_CHANGE:lA,PAUSE:FC,PIP_CHANGE:pA,PLAY:MC,PLAYER_BLUR:qC,PLAYER_FOCUS:WC,PLAYING:"playing",PLAYNEXT:vA,PROGRESS:"progress",RATE_CHANGE:"ratechange",READY:XC,REPLAY:QC,RESET:mA,RETRY:fA,ROTATE:"rotate",SCREEN_SHOT:"screenShot",SEEKED:BC,SEEKING:"seeking",SEI_PARSED:"SEI_PARSED",SHORTCUT:gA,SOURCE_ERROR:_A,SOURCE_SUCCESS:bA,STALLED:"stalled",STATS_EVENTS:{STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:NC,URL_CHANGE:tA,URL_NULL:YC,USER_ACTION:yA,VIDEO_EVENTS:wA,VIDEO_RESIZE:dA,VOLUME_CHANGE:jC,WAITING:VC,XGLOG:"xglog"});function EA(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var SA=function(e){RS(n,e);var t=FS(n);function n(e){var r;AS(this,n),(r=t.call(this,e))._hasStart=!1,r._currentTime=0,r._duration=0,r._internalOp={},r._lastMuted=!1,r.vtype="MP4",r._rate=-1,r.mediaConfig=AE({},{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 i=e["x5-video-player-type"]||e.x5VideoPlayerType;return PC.isWeixin&&PC.os.isAndroid&&i&&(r.mediaConfig["x5-video-player-type"]=i,delete r.mediaConfig.playsinline,delete r.mediaConfig["webkit-playsinline"],delete r.mediaConfig["x5-playsinline"]),e.loop&&(r.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(r.mediaConfig,"muted")&&(r.mediaConfig.muted=!0),r.media=kC.createDom(r.mediaConfig.mediaType,"",r.mediaConfig,""),e.defaultPlaybackRate&&(r.media.defaultPlaybackRate=r.media.playbackRate=e.defaultPlaybackRate),"Number"===kC.typeOf(e.volume)&&(r.volume=e.volume),e.autoplayMuted&&(r.media.muted=!0,r._lastMuted=!0),e.autoplay&&(r.media.autoplay=!0),r._interval={},r.mediaEventMiddleware={},r.attachVideoEvents(),r}return PS(n,[{key:"setEventsMiddleware",value:function(e){var t,n=this;Vw(t=dk(e)).call(t,(function(t){n.mediaEventMiddleware[t]=e[t]}))}},{key:"removeEventsMiddleware",value:function(e){var t,n=this;Vw(t=dk(e)).call(t,(function(e){delete n.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=Vw(wA).call(wA,(function(t){var n,r=Nm(n="on".concat(t.charAt(0).toUpperCase())).call(n,pk(t).call(t,1));return"function"==typeof e[r]&&e.on(t,e[r]),IS({},t,function(e,t){return function(n,r){var i={player:t,eventName:e,originalEvent:n,detail:n.detail||{},timeStamp:n.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[n.type],muted:t.muted,volume:t.volume,host:kC.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(n.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var o=t.media?t.media.playbackRate:0;if(o&&t._rate===o)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(i.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(i.error=r||t.video.error),t.mediaEventMiddleware[e]){var a=EA.bind(t,e,i);try{t.mediaEventMiddleware[e].call(t,i,a)}catch(s){throw EA.call(t,e,i),s}}else EA.call(t,e,i)}}(t,e))}))),this._evHandlers.forEach((function(e){var n=dk(e)[0];t.addEventListener(n,e[n],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var n=dk(e)[0];t.removeEventListener(n,e[n],!1)})),this._evHandlers.forEach((function(t){var n,r=dk(t)[0],i=Nm(n="on".concat(r.charAt(0).toUpperCase())).call(n,pk(r).call(r,1));"function"==typeof e[i]&&e.off(r,e[i])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){n.media.appendChild(kC.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var r=e.children;if(r){this._videoSourceCount=r.length,this._videoSourceIndex=r.length,this._vLoadeddata=function(e){n.emit(bA,{src:e.target.currentSrc,host:kC.getHostFromUrl(e.target.currentSrc)})};for(var i=null,o=0;o<this._evHandlers.length;o++)if("error"===dk(this._evHandlers[o])[0]){i=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){var t=iE(e.target.getAttribute("data-index"),10);if(n._videoSourceIndex--,0===n._videoSourceIndex||t>=n._videoSourceCount){var r={code:4,message:"sources_load_error"};i?i.error(e,r):n.errorHandler("error",r)}var o=RC[4];n.emit(_A,new OC(n,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<r.length;a++)r[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var n=this.media.error||t,r=n.code?RC[n.code]:"other";n.message;this.media.currentSrc||(n={code:6,message:"empty_src"}),this.emit(e,new OC(this,{errorType:r,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var n=this.media.currentTime;if(e)for(var r=0,i=e.length;r<i&&(t[0]=e.start(r),t[1]=e.end(r),!(t[0]<=n&&n<=t[1]));r++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?kC.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){if(!this.media.error)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(tA,e),this.emit(VC),this._currentTime=0,this._duration=0,kC.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===kC.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"emit",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"on",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"on",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"once",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"once",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"off",value:function(e,t){for(var r,i,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];(i=US(DS(n.prototype),"off",this)).call.apply(i,Nm(r=[this,e,t]).call(r,a))}},{key:"offAll",value:function(){US(DS(n.prototype),"removeAllListeners",this).call(this)}}]),n}(jS),TA=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"}};AS(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return PS(e,[{key:"openDB",value:function(e){var t=this,n=this,r=this.myDB.version||1,i=n.indexedDB.open(n.myDB.name,r);i.onerror=function(e){},i.onsuccess=function(r){t.myDB.db=r.target.result,e.call(n)},i.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,r=this.myDB.db.transaction(e,"readwrite").objectStore(e),i=0;i<t.length;i++)(n=r.add(t[i])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,r=this.myDB.db.transaction(e,"readwrite").objectStore(e),i=0;i<t.length;i++)(n=r.put(t[i])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var r=this,i=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);i.onerror=function(){n.call(r,null)},i.onsuccess=function(e){var t=e.target.result;n.call(r,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}(),CA=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],AA=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],xA=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],PA="data-xgplayerid";function IA(e,t,n){for(var r,i=arguments.length,o=new Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];var s,l=t.call.apply(t,Nm(r=[e]).call(r,o));n&&"function"==typeof n&&(l&&l.then?l.then((function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];n.call.apply(n,Nm(t=[e]).call(t,i))})):n.call.apply(n,Nm(s=[e]).call(s,o)))}function RA(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 r,i=arguments,o=this;if(n.pre)try{var a,s;(s=n.pre).call.apply(s,Nm(a=[this]).call(a,pk(Array.prototype).call(arguments)))}catch(y){var l,u;throw y.message=Nm(l=Nm(u="[pluginName: ".concat(this.pluginName,":")).call(u,e,":pre error] >> ")).call(l,y.message),y}if(this.__hooks&&this.__hooks[e])try{var c,h,f,d=(h=this.__hooks[e]).call.apply(h,Nm(c=[this,this]).call(c,pk(Array.prototype).call(arguments)));if(d)if(d.then)d.then((function(e){var r;!1!==e&&IA.apply(void 0,Nm(r=[o,t,n.next]).call(r,BS(i)))})).catch((function(e){throw e}));else IA.apply(void 0,Nm(f=[this,t,n.next]).call(f,pk(Array.prototype).call(arguments)));else if(void 0===d){var p;IA.apply(void 0,Nm(p=[this,t,n.next]).call(p,pk(Array.prototype).call(arguments)))}}catch(y){var v,g;throw y.message=Nm(v=Nm(g="[pluginName: ".concat(this.pluginName,":")).call(g,e,"] >> ")).call(v,y.message),y}else IA.apply(void 0,Nm(r=[this,t,n.next]).call(r,pk(Array.prototype).call(arguments)))}.bind(this)}function DA(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 OA(e,t){var n=this.__hooks;n&&delete n[e]}function MA(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.useHooks&&t.useHooks.apply(t,r)}}function LA(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.removeHooks&&t.removeHooks.apply(t,r)}}}function FA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&Vw(t).call(t,(function(t){e.__hooks[t]=null})),DE(e,"hooks",{get:function(){var t;return e.__hooks&&Vw(t=dk(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}function UA(e){e.__hooks=null}function BA(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];var a;if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,Nm(a=[e,e]).call(a,i));var s,l,u=(l=e.__hooks[t]).call.apply(l,Nm(s=[e,e]).call(s,i));if(u&&u.then)u.then((function(t){var r;return!1===t?null:n.call.apply(n,Nm(r=[e,e]).call(r,i))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==u){var c;return n.call.apply(n,Nm(c=[e,e]).call(c,i))}}function NA(e,t){var n;bC.logError(Nm(n="[".concat(e,"] event or callback cant be undefined or null when call ")).call(n,t))}var VA=function(){function e(t){AS(this,e),kC.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),FA(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return PS(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=kC.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):NA(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(r){n.__onceEvents[r]=t,n.player.once(e,t)})):NA(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(r){delete n.__events[e],n.player.off(r,t)})):NA(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){dk(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,n;if(this.player){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=this.player).emit.apply(n,Nm(t=[e]).call(t,i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var r=TS(TS({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,r)}}},{key:"hook",value:function(e,t){var n;return RA.call.apply(RA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return DA.call.apply(DA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return OA.call.apply(OA,Nm(n=[this]).call(n,pk(Array.prototype).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,t=this,n=this.player,r=this.pluginName;this.offAll(),kC.clearAllTimers(this),kC.checkIsFunction(this.destroy)&&this.destroy(),Vw(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),n.unRegisterPlugin(r),UA(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&DE(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var HA=Element.prototype;HA.matches=HA.matchesSelector||HA.mozMatchesSelector||HA.msMatchesSelector||HA.oMatchesSelector||HA.webkitMatchesSelector}var GA=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function jA(e,t,n,r,i){var o=zA.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}function zA(e,t,n,r){return function(n){n.delegateTarget=GA(n.target,t),n.delegateTarget&&r.call(e,n)}}var KA=function(e,t,n,r,i){return"function"==typeof e.addEventListener?jA.apply(null,arguments):"function"==typeof n?jA.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Vw(Array.prototype).call(e,(function(e){return jA(e,t,n,r,i)})))},WA=o(KA),qA={CONTROLS:"controls",ROOT:"root"},XA={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"},YA="xg-icon-disable";function $A(e){return!!e&&(fk(e)&&/^(?:http|data:|\/)/.test(e))}function ZA(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=null;if(e instanceof window.Element)return kC.addClass(e,i),Vw(r=dk(o)).call(r,(function(t){e.setAttribute(t,o[t])})),e;if($A(e)||$A(e.url))return o.src=$A(e)?e:e.url||"",s=kC.createDom(e.tag||"img","",o,"xg-img ".concat(i));if("function"==typeof e)try{var l,u;return(s=e())instanceof window.Element?(kC.addClass(s,i),Vw(l=dk(o)).call(l,(function(e){s.setAttribute(e,o[e])})),s):(bC.logWarn(Nm(u="warn>>icons.".concat(t," in config of plugin named [")).call(u,a,"] is a function mast return an Element Object")),null)}catch(c){return bC.logError("Plugin named [".concat(a,"]:createIcon"),c),null}return"string"==typeof e?kC.createDomFromHtml(e,o,i):(bC.logWarn(Nm(n="warn>>icons.".concat(t," in config of plugin named [")).call(n,a,"] is invalid")),null)}function JA(e,t){var n,r=t.config.icons||t.playerConfig.icons;Vw(n=dk(e)).call(n,(function(n){var i=e[n],o=i&&i.class?i.class:"",a=i&&i.attr?i.attr:{},s=null;r&&r[n]&&(o=function(e,t){var n;return"object"===CS(e)&&e.class&&"string"==typeof e.class?Nm(n="".concat(t," ")).call(n,e.class):t}(r[n],o),a=function(e,t){var n;return"object"===CS(e)&&e.attr&&"object"===CS(e.attr)&&Vw(n=dk(e.attr)).call(n,(function(n){t[n]=e.attr[n]})),t}(r[n],a),s=ZA(r[n],n,o,a,t.pluginName)),!s&&i&&(s=ZA(i.icon?i.icon:i,a,o,{},t.pluginName)),t.icons[n]=s}))}var QA=function(e){RS(n,e);var t=FS(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return AS(this,n),(e=t.call(this,r)).__delegates=[],e}return PS(n,[{key:"__init",value:function(e){if(US(DS(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,r=null;this.icons={},this.root=null,this.parent=null,JA(this.registerIcons()||{},this),this.langText={};var i,o,a,s=this.registerLanguageTexts()||{};o=this,Vw(a=dk(i=s)).call(a,(function(e){DE(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:i[e]&&i[e][t]||""}})}));var l="";try{l=this.render()}catch(f){var u;throw bC.logError("Plugin:".concat(this.pluginName,":render"),f),new Error(Nm(u="Plugin:".concat(this.pluginName,":render:")).call(u,f.message))}if(l)(r=n.insert(l,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(r=kC.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(r)}this.root=r,this.parent=t;var c=this.config.attr||{},h=this.config.style||{};this.setAttr(c),this.setStyle(h),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,n=this.children();if(n&&"object"===CS(n))if(dk(n).length>0)Vw(t=dk(n)).call(t,(function(t){var r,i,o=t,a=n[o],s={root:e.root};"function"==typeof a?(r=e.config[o]||{},i=a):"object"===CS(a)&&"function"==typeof a.plugin&&(r=a.options?kC.deepCopy(e.config[o]||{},a.options):e.config[o]||{},i=a.plugin),s.config=r,void 0!==r.index&&(s.index=r.index),r.root&&(s.root=r.root),e.registerPlugin(i,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,r=this.langText;t&&function e(t,n){for(var r=0;r<t.children.length;r++)t.children[r].children.length>0?e(t.children[r],n):n(t.children[r])}(t,(function(t){var i=t.getAttribute&&t.getAttribute("lang-key");if(i){var o=n[i.toUpperCase()]||r[i];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||{},r=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var i=n[t]||r[t]||"";i&&(e.innerHTML=i)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,kC.addClass(Xm(this).call(this,".xgplayer-icon"),YA)}},{key:"enable",value:function(){this.config.disable=!1,kC.removeClass(Xm(this).call(this,".xgplayer-icon"),YA)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var i=US(DS(n.prototype),"registerPlugin",this).call(this,e,t,r);return this._children.push(i),i}},{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,r){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.bindEL(e,t)})):this.bindEL(e,t);else{var o,a=n.delegate.call(this,this.root,e,t,r);this.__delegates=Nm(o=this.__delegates).call(o,a)}}},{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 r,i=Nm(r="".concat(e,"_")).call(r,t),o=0;o<this.__delegates.length;o++)if(this.__delegates[o].key===i){var a;this.__delegates[o].destroy(),Lk(a=this.__delegates).call(a,o,1);break}}},{key:"setStyle",value:function(e,t){var n,r=this;if(this.root)return"String"===kC.typeOf(e)?this.root.style[e]=t:void("Object"===kC.typeOf(e)&&Vw(n=dk(e)).call(n,(function(t){r.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n,r=this;if(this.root)return"String"===kC.typeOf(e)?this.root.setAttribute(e,t):void("Object"===kC.typeOf(e)&&Vw(n=dk(e)).call(n,(function(t){r.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?Xm(this).call(this,e).appendChild(t):e.appendChild(t)}catch(n){return bC.logError("Plugin:appendChild",n),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e,t,r,i=this,o=this.player;(Vw(e=this.__delegates).call(e,(function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array)&&(Vw(r=this._children).call(r,(function(e){o.unRegisterPlugin(e.pluginName)})),this._children=null);this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),US(DS(n.prototype),"__destroy",this).call(this),this.icons={},Vw(t=["root","parent"]).call(t,(function(e){i[e]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.children.length,i=Number(n),o=e instanceof window.Node;if(r){for(var a=0,s=null,l="";a<r;a++){s=t.children[a];var u=Number(s.getAttribute("data-index"));if(u>=i){l="beforebegin";break}u<i&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof r)if(Array.isArray(n))n.forEach((function(n){var a,s=WA(e,t,n,r,i);s.key=Nm(a="".concat(t,"_")).call(a,n),o.push(s)}));else{var a,s=WA(e,t,n,r,i);s.key=Nm(a="".concat(t,"_")).call(a,n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return qA}},{key:"POSITIONS",get:function(){return XA}}]),n}(VA),ex=function(){function e(){var t=this;if(AS(this,e),IS(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var r=0;r<e.length;r++)t.__runHandler(e[r].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return EC(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),SC(e,t,{leading:r,trailing:i,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(n){console.error(n)}}return PS(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(PA),r=this.__handlers,i=-1,o=0;o<r.length;o++)r[o]&&e===r[o].target&&(i=o);i>-1?this.__handlers[i].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t,n,r=-1;Vw(t=this.__handlers).call(t,(function(t,n){e===t.target&&(r=n)}));try{this.observer&&this.observer.unobserve(e)}catch(i){}this.observer&&this.observer.unobserve(e),r>-1&&Lk(n=this.__handlers).call(n,r,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(oz){console.error(oz)}return!0}return!1}}]),e}(),tx=null;var nx={pluginGroup:{},init:function(e){var t,n,r=e._pluginInfoId;r||(r=(new Date).getTime(),e._pluginInfoId=r),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.resize()},tx||(tx=new ex),tx.addObserver(t,n)),this.pluginGroup[r]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var n=null,r=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,r=e.options):(n=e,r={}),t&&(r.config=t||{}),{PLUFGIN:n,options:r}},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=dk(t),r=null,i=0;i<n.length;i++)if(e.toLowerCase()===n[i].toLowerCase()){r=t[n[i]];break}return"Object"===kC.typeOf(r)?{root:r.root,position:r.position}:{}},lazyRegister:function(e,t){var n=this,r=t.timeout||1500;return Hw.race([t.loader().then((function(t){var r;r=t&&t.__esModule?t.default:t,n.register(e,r,t.options)})),new Hw((function(e,t){setTimeout((function(){t(new Error("timeout"))}),r)}))])},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 r=e._pluginInfoId;if(r&&this.pluginGroup[r]){this.pluginGroup[r]._plugins||(this.pluginGroup[r]._plugins={});var i=this.pluginGroup[r]._plugins,o=this.pluginGroup[r]._originalOptions;n.player=e;var a=n.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){n.config||(n.config={});for(var s=dk(o),l=0;l<s.length;l++)if(a.toLowerCase()===s[l].toLowerCase()){var u=o[s[l]];"Object"===kC.typeOf(u)?n.config=AE({},n.config,o[s[l]]):"Boolean"===kC.typeOf(u)&&(n.config.disable=!u);break}t.defaultConfig&&dk(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{i[a.toLowerCase()]&&(this.unRegister(r,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var c=new t(n);return i[a.toLowerCase()]=c,i[a.toLowerCase()].func=t,c&&"function"==typeof c.afterCreate&&c.afterCreate(),c}catch(h){throw console.error(h),h}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var n=this.pluginGroup[e]._plugins[t];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(i){var r;console.error(Nm(r="[unRegister:".concat(t,"] cgid:[")).call(r,e,"] error"),i)}},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 r=t.toLowerCase();return this.pluginGroup[n]._plugins[r]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Hw((function(e){e()}))}return new Hw((function(r){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Hw.all(e._loadingPlugins):Hw.resolve()).then((function(){var i,o=e._pluginInfoId;if(t.pluginGroup[o]){var a=t.pluginGroup[o]._plugins,s=[];dk(a).forEach((function(e){if(a[e]&&a[e].beforePlayerInit)try{var t=a[e].beforePlayerInit();s.push(n(t))}catch(r){throw s.push(n(null)),r}})),Hw.all(Nm(i=[]).call(i,s)).then((function(){r()})).catch((function(e){console.error(e),r()}))}else r()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;dk(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 r=this.pluginGroup[n]._plugins;dk(r).forEach((function(t){if(r[t].updateLang)r[t].updateLang(e);else try{r[t].lang=e}catch(oz){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var r=[],i=this.pluginGroup[n]._plugins;dk(i).forEach((function(e){"controls"!==e&&i[e]&&(r.push({plugin:i[e].func,options:i[e].__args}),t.unRegister(n,e))})),r.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||{};dk(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,r;n=e.root,tx.unObserver(n,r);for(var i=this.pluginGroup[t]._plugins,o=0,a=dk(i);o<a.length;o++){var s=a[o];this.unRegister(t,s)}delete this.pluginGroup[t],delete e._pluginInfoId}}},rx="xgplayer",ix="xgplayer-is-enter",ox="xgplayer-pause",ax="xgplayer-playing",sx="xgplayer-ended",lx="xgplayer-isloading",ux="xgplayer-is-error",cx="xgplayer-replay",hx="xgplayer-nostart",fx="xgplayer-inactive",dx="xgplayer-is-fullscreen",px="xgplayer-is-cssfullscreen",vx="xgplayer-rotate-fullscreen",gx="xgplayer-rotate-parent",yx="xgplayer-fullscreen-parent",mx="xgplayer-fullscreen-inner",_x="no-controls",bx="flex-controls",wx="controls-autohide",kx="top-bar-autohide",Ex="not-allow-autoplay",Sx="seeking";function Tx(){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:TC(),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 Cx=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onMouseEnter",(function(e){var t=MS(r),n=t.player;t.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),IS(MS(r),"onMouseLeave",(function(e){MS(r).player.focus()})),r}return PS(n,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==PC.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e,t=this,n=this.config,r=n.disable,i=n.height,o=n.mode;if(!r){"flex"===o&&this.player.addClass(bx);var a={height:"".concat(i,"px")};Vw(e=dk(a)).call(e,(function(e){t.root.style[e]=a[e]})),this.left=Xm(this).call(this,"xg-left-grid"),this.center=Xm(this).call(this,"xg-center-grid"),this.right=Xm(this).call(this,"xg-right-grid"),this.innerRoot=Xm(this).call(this,"xg-inner-controls"),this.on(lA,(function(e){e?kC.addClass(t.root,"mini-controls"):kC.removeClass(t.root,"mini-controls")}));var s=this.playerConfig.isMobileSimulateMode;"mobile"!==PC.device&&"mobile"!==s&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&kC.addClass(this.root,wx)}},{key:"pauseAutoHide",value:function(){kC.removeClass(this.root,wx)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(this.root){var i=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:i.position){case XA.CONTROLS_LEFT:t.root=this.left;break;case XA.CONTROLS_RIGHT:t.root=this.right;break;case XA.CONTROLS_CENTER:t.root=this.center;break;case XA.CONTROLS:t.root=this.root;break;default:t.root=this.left}return US(DS(n.prototype),"registerPlugin",this).call(this,e,t,r)}}}},{key:"destroy",value:function(){"mobile"!==PC.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,r=e.initShow;if(!e.disable){var i=kC.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},IS({},wx,n),{"xgplayer-controls-initshow":r||!n});return'<xg-controls class="'.concat(i,'" 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}(QA),Ax={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"}},xx={lang:{},langKeys:[],textKeys:[]};function Px(e,t){return dk(t).forEach((function(n){var r,i=kC.typeOf(t[n]),o=kC.typeOf(e[n]);"Array"===i?("Array"!==o&&(e[n]=[]),(r=e[n]).push.apply(r,BS(t[n]))):"Object"===i?("Object"!==o&&(e[n]={}),Px(e[n],t[n])):e[n]=t[n]})),e}function Ix(){var e;Vw(e=dk(xx.lang.en)).call(e,(function(e){xx.textKeys[e]=e}))}function Rx(e,t){var n=e.LANG;if(t||(t=xx),t.lang){var r=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?Px(t.lang[n],r):(t.langKeys.push(n),t.lang[n]=r),Ix()}}Rx(Ax);var Dx={get textKeys(){return xx.textKeys},get langKeys(){return xx.langKeys},get lang(){var e,t={};return Vw(e=xx.langKeys).call(e,(function(e){t[e]=xx.lang[e]})),xx.lang["zh-cn"]&&(t.zh=xx.lang["zh-cn"]||{}),t},extend:function(e,t){var n=[];if(t||(t=xx),t.lang){var r;if("Array"!==kC.typeOf(e))n=Vw(r=dk(e)).call(r,(function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}}));else n=e;var i=t.lang;Vw(n).call(n,(function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?Px(i[e.LANG]||{},e.TEXT||{}):Rx(e,t)})),Ix()}},use:Rx,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return Px(n.lang,xx.lang),(t=n.langKeys).push.apply(t,BS(xx.langKeys)),Px(n.textKeys,xx.textKeys),n}},Ox=1,Mx=2,Lx=3,Fx=4,Ux=5,Bx=6,Nx=7,Vx=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Hx={},Gx=null,jx=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"add",value:function(e){e&&(Hx[e.playerId]=e,1===dk(Hx).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Hx[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in Hx)if(Object.prototype.hasOwnProperty.call(Hx,n)){var r=Hx[n];if(t){if(e(r))break}else e(r)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(n){var r=e(n);return r&&(t=n),r}),!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(Hx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Hx[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=dk(Hx),t=0;t<e.length;t++){var n=Hx[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(Hx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Hx[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Gx||(Gx=new n),Gx}}]),n}(GS.EventEmitter);var zx=["play","pause","replay","retry"],Kx=0,Wx=0,qx=null,Xx=function(e){RS(n,e);var t=FS(n);function n(e){var r;AS(this,n);var i,o=kC.deepMerge(Tx(),e);IS(MS(r=t.call(this,o)),"canPlayFunc",(function(){if(r.config){var e=r.config,t=e.autoplay,n=e.defaultPlaybackRate;bC.logInfo("player","canPlayFunc, startTime",r.__startTime),r.__startTime>0&&r.duration>0&&(r.currentTime=r.__startTime>r.duration?r.duration:r.__startTime,r.__startTime=-1),r.playbackRate=n,(t||r._useAutoplay)&&r.mediaPlay(),r.off(HC,r.canPlayFunc),r.removeClass(ix)}})),IS(MS(r),"onFullscreenChange",(function(e,t){var n=function(){kC.setTimeout(MS(r),(function(){r.resize()}),100)},i=kC.getFullScreenEl();r._fullActionFrom?r._fullActionFrom="":r.emit(yA,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:r.currentTime,duration:r.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var r=e.getAttribute(n);return!(!r||r!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(i,r.playerId,PA);if(t||i&&(i===r._fullscreenEl||o))n(),!r.config.closeFocusVideoFocus&&r.media.focus(),r.fullscreen=!0,r.changeFullStyle(r.root,i,dx),r.emit(aA,!0,r._fullScreenOffset),r.cssfullscreen&&r.exitCssFullscreen();else if(r.fullscreen){n();var a=MS(r),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),kC.setTimeout(MS(r),(function(){r.fullscreen=!1,r._fullScreenOffset=null}),100)):(!r.config.closeFocusVideoFocus&&r.media.focus(),r.fullscreen=!1,r._fullScreenOffset=null),r.cssfullscreen)r.removeClass(dx);else{var l=r._fullscreenEl;l||!r.root.contains(e.target)&&e.target!==r.root||(l=e.target),r.recoverFullStyle(r.root,l,dx)}r._fullscreenEl=null,r.emit(aA,!1)}})),IS(MS(r),"_onWebkitbeginfullscreen",(function(e){r._fullscreenEl=r.media,r.onFullscreenChange(e,!0)})),IS(MS(r),"_onWebkitendfullscreen",(function(e){r.onFullscreenChange(e,!1)})),FA(MS(r),zx),r.config=o,r._pluginInfoId=kC.generateSessionId(),(i=MS(r)).logInfo=bC.logInfo.bind(i),i.logWarn=bC.logWarn.bind(i),i.logError=bC.logError.bind(i);var a=r.constructor.defaultPreset;if(r.config.presets.length){var s,l=fk(s=r.config.presets).call(s,"default");l>=0&&a&&(r.config.presets[l]=a)}else a&&r.config.presets.push(a);if(r.userTimer=null,r.waitTimer=null,r.handleSource=!0,r._state=Ox,r.isError=!1,r._hasStart=!1,r.isSeeking=!1,r.isCanplay=!1,r._useAutoplay=!1,r.__startTime=-1,r.rotateDeg=0,r.isActive=!1,r.fullscreen=!1,r.cssfullscreen=!1,r.isRotateFullscreen=!1,r._fullscreenEl=null,r.timeSegments=[],r._cssfullscreenEl=null,r.curDefinition=null,r._orgCss="",r._fullScreenOffset=null,r._videoHeight=0,r._videoWidth=0,r.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},r.sizeInfo={width:0,height:0,left:0,top:0},r._accPlayed={t:0,acc:0,loopAcc:0},r._offsetInfo={currentTime:-1,duration:0},r.innerContainer=null,r.controls=null,r.topBar=null,r.root=null,r.__i18n=Dx.init(r._pluginInfoId),PC.os.isAndroid&&PC.osVersion>0&&PC.osVersion<6&&(r.config.autoplay=!1),r.database=new TA,r.isUserActive=!1,r._onceSeekCanplay=null,r._isPauseBeforeSeek=0,r.innerStates={isActiveLocked:!1},r.instManager=qx,!r._initDOM())return console.error(new Error("can't find the dom which id is ".concat(r.config.id," or this.config.el does not exist"))),LS(r);var u=r.config,c=u.definition,h=void 0===c?{}:c;if(!u.url&&h.list&&h.list.length>0){var f,d=Xm(f=h.list).call(f,(function(e){return e.definition&&e.definition===h.defaultDefinition}));d||(h.defaultDefinition=h.list[0].definition,d=h.list[0]),r.config.url=d.url,r.curDefinition=d}return r._bindEvents(),r._registerPresets(),r._registerPlugins(),nx.onPluginsReady(MS(r)),r.getInitDefinition(),r.setState(Mx),kC.setTimeout(MS(r),(function(){r.emit(XC)}),0),r.onReady&&r.onReady(),(r.config.videoInit||r.config.autoplay)&&(!r.hasStart||r.state<Fx)&&r.start(),r}return PS(n,[{key:"_initDOM",value:function(){var e,t,n,r,i=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var o=this.config.el;if(!o||1!==o.nodeType)return this.emit(UC,new OC("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=o}var a=function(e){for(var t=dk(Hx),n=0;n<t.length;n++){var r=Hx[t[n]];if(r.root===e)return r}return null}(this.root);a&&(bC.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),a.destroy()),this.root.setAttribute(PA,this.playerId),null===(r=qx)||void 0===r||r.add(this),nx.init(this),this._initBaseDoms();var s=this.constructor.XgVideoProxy;if(s&&this.mediaConfig.mediaType===s.mediaType){var l=this.innerContainer||this.root;this.detachVideoEvents(this.media);var u=new s(l,this.config,this.mediaConfig);this.attachVideoEvents(u),this.media=u}if(this.media.setAttribute(PA,this.playerId),this.config.controls){var c=this.config.controls.root||null,h=nx.register(this,Cx,{root:c});this.controls=h}var f="mobile"===this.config.isMobileSimulateMode?"mobile":PC.device;if(this.addClass(Nm(e=Nm(t=Nm(n="".concat(rx," ")).call(n,fx," xgplayer-")).call(t,f," ")).call(e,this.config.controls?"":_x)),this.config.autoplay?this.addClass(ix):this.addClass(hx),this.config.fluid){var d=this.config,p=d.width,v=d.height;"number"==typeof p&&"number"==typeof v||(p=600,v=337.5);var g={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*v/p,"%")};dk(g).forEach((function(e){i.root.style[e]=g[e]}))}else["width","height"].forEach((function(e){i.config[e]&&("number"!=typeof i.config[e]?i.root.style[e]=i.config[e]:i.root.style[e]="".concat(i.config[e],"px"))}));var y=this.root.getBoundingClientRect(),m=y.width,_=y.height,b=y.left,w=y.top;return this.sizeInfo.width=m,this.sizeInfo.height=_,this.sizeInfo.left=b,this.sizeInfo.top=w,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=kC.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+pk(t).call(t,1)])})),CA.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),PC.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(zC,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(MC,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),CA.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(MC,this.playFunc),this.off(HC,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(kC.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this;if(this.media&&(e&&""!==e&&("Array"!==kC.typeOf(e)||0!==e.length)||(e="",this.emit(YC),bC.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this.handleSource&&(this._detachSourceEvents(this.media),"Array"===kC.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e),"Number"===kC.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var r=this.media.readyState;bC.logInfo("_startInit readyState",r),this.config.autoplay&&(!kC.isMSE(this.media)&&this.load(),(PC.os.isIpad||PC.os.isPhone)&&this.mediaPlay());var i=this.config.startTime;this.__startTime=i>0?i:-1,this.config.startTime=0,r>=2&&this.duration>0?this.canPlayFunc():this.on(HC,this.canPlayFunc),(!this.hasStart||this.state<Fx)&&nx.afterInit(this),this.hasStart=!0,this.setState(Fx),kC.setTimeout(this,(function(){t.emit(JC)}),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||[],r=this.config.plugins||[],i=this.config.i18n||[];t&&Dx.extend(i,this.__i18n);var o=n.join("||").toLowerCase().split("||"),a=this.plugins;r.forEach((function(n){try{var r=n.plugin?n.plugin.pluginName:n.pluginName;if(r&&fk(o).call(o,r.toLowerCase())>-1)return null;if(!t&&a[r.toLowerCase()])return;if(n.lazy&&n.loader){var i=nx.lazyRegister(e,n);return void(n.forceBeforeInit&&(i.then((function(){var t,n;Lk(t=e._loadingPlugins).call(t,fk(n=e._loadingPlugins).call(n,i),1)})).catch((function(t){var n,r;bC.logError("_registerPlugins:loadingPlugin",t),Lk(n=e._loadingPlugins).call(n,fk(r=e._loadingPlugins).call(r,i),1)})),e._loadingPlugins.push(i)))}return e.registerPlugin(n)}catch(s){bC.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,r,i,o=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),a=o.plugins,s=void 0===a?[]:a,l=o.ignores,u=void 0===l?[]:l,c=o.icons,h=void 0===c?{}:c,f=o.i18n,d=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(r=e.config.plugins).push.apply(r,BS(s)),(i=e.config.ignores).push.apply(i,BS(u)),Vw(n=dk(h)).call(n,(function(t){e.config.icons[t]||(e.config.icons[t]=h[t])}));var p=e.config.i18n||[];d.push.apply(d,BS(p)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case XA.ROOT_RIGHT:this.rightBar||(this.rightBar=kC.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case XA.ROOT_LEFT:this.leftBar||(this.leftBar=kC.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case XA.ROOT_TOP:this.topBar||(this.topBar=kC.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&kC.addClass(this.topBar,kx)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=nx.formatPluginInfo(e,t),r=n.PLUFGIN,i=n.options,o=this.config.plugins;!nx.checkPluginIfExits(r.pluginName,o)&&o.push(r);var a=nx.getRootByConfig(r.pluginName,this.config);a.root&&(i.root=a.root),a.position&&(i.position=a.position);var s=i.position?i.position:i.config&&i.config.position||r.defaultConfig&&r.defaultConfig.position;return!i.root&&"string"==typeof s&&fk(s).call(s,"controls")>-1?this.controls&&this.controls.registerPlugin(r,i,r.pluginName):(i.root||(i.root=this._getRootByPosition(s)),nx.register(this,r,i))}},{key:"deregister",value:function(e){"string"==typeof e?nx.unRegister(this,e):e instanceof VA&&nx.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 VA&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){var r;Lk(r=this.config.plugins).call(r,n,1);break}}}},{key:"plugins",get:function(){return nx.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=nx.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(kC.hasClass(this.root,e)||kC.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&kC.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return kC.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>Lx))return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(Lx),this._registerPlugins(!1),nx.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",bC.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e,t){var n=this,r=e;"Object"===kC.typeOf(e)&&(r=e.url),r=this._preProcessUrl(r).url;var i=this.currentTime;this.__startTime=i;var o=this.paused&&!this.isError;return this.src=r,new Hw((function(e,t){var i=function(e){n.off("timeupdate",a),n.off("canplay",a),t(e)},a=function(){n.duration>0&&n.__startTime>0&&(n.currentTime=n.__startTime,n.__startTime=-1),o&&n.pause(),n.off("error",i),e(!0)};n.once("error",i),r?(PC.os.isAndroid?n.once("timeupdate",a):n.once("canplay",a),n.play()):n.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<Fx)return this.removeClass(hx),this.addClass(ix),this.start(),void(this._useAutoplay=!0);this.state<Bx&&(this.removeClass(hx),!this.isCanplay&&this.addClass(ix));var t=US(DS(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Ex),e.addClass(ax),e.state<Bx&&(bC.logInfo(">>>>playPromise.then"),e.setState(Bx),e.emit($C))})).catch((function(t){if(bC.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(ix);"NotAllowedError"===t.name&&(e._errorTimer=kC.setTimeout(e,(function(){e._errorTimer=null,e.emit(ZC),e.addClass(Ex),e.removeClass(ix),e.pause(),e.setState(Ux)}),0))})):(bC.logWarn("video.play not return promise"),this.state<Bx&&(this.setState(Bx),this.removeClass(Ex),this.removeClass(hx),this.removeClass(ix),this.addClass(ax),this.emit($C))),t}},{key:"mediaPause",value:function(){US(DS(n.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){US(DS(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(ox),BA(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;BA(this,"pause",(function(){US(DS(n.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var n=this;if(this.media&&!Fk(Number(e))&&this.hasStart){var r=this.config,i=r.isSeekedPlay,o=r.seekedStatus,a=t||(i?"play":o);e=e<0?0:e>this.duration?iE(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(BC,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(ix),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(BC,this._onceSeekCanplay),this.state<Bx?(this.removeClass(hx),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e,t=this,n=this.config,r=n.definition;!n.url&&r&&r.list&&r.list.length>0&&r.defaultDefinition&&Vw(e=r.list).call(e,(function(e){e.definition===r.defaultDefinition&&(t.config.url=e.url,t.curDefinition=e)}))}},{key:"changeDefinition",value:function(e,t){var n=this,r=this.config.definition;if(Array.isArray(null==r?void 0:r.list)&&r.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=iE(e.bitrate,10)||0),this.emit(uA,{from:t,to:e}),this.hasStart){var i=this.switchURL(e.url,TS({seamless:!1!==r.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));i&&i.then?i.then((function(){n.emit(hA,{from:t,to:e})})):this.emit(hA,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(zC,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Ex,ax,hx,ox,cx,ix,sx,ux,lx];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(hx),this.emit(mA)}},{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&&(Vw(t).call(t,(function(t){e.deregister(t)})),n)){var r,i=Tx();fE(r=dk(this.config)).call(r,(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,r=this,i=this.innerContainer,o=this.root,a=this.media;if(o&&a){if(this.hasStart=!1,this._useAutoplay=!1,o.removeAttribute(PA),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),kC.clearAllTimers(this),this.emit(eA),null===(t=qx)||void 0===t||t.remove(this),nx.destroy(this),UA(this),US(DS(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),i)for(var s=i.children,l=0;l<s.length;l++)i.removeChild(s[l]);!i&&a instanceof window.Node&&o.contains(a)&&o.removeChild(a),Vw(e=["topBar","leftBar","rightBar","innerContainer"]).call(e,(function(e){r[e]&&o.removeChild(r[e]),r[e]=null}));var u=o.className.split(" ");u.length>0?o.className=Gw(u).call(u,(function(e){return fk(e).call(e,"xgplayer")<0})).join(" "):o.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){r[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(sx),this.currentTime=0,this.isSeeking=!1,BA(this,"replay",(function(){e.once(BC,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(QC),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(ux),this.addClass(lx),BA(this,"retry",(function(){var t=e.currentTime,n=e.config.url,r=kC.isMSE(e.media)?{url:n}:e._preProcessUrl(n);e.src=r.url,!e.config.isLive&&(e.currentTime=t),e.once(HC,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,r){e&&(r||(r=yx),this._orgCss||(this._orgCss=kC.filterStyleFromText(e)),kC.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=kC.filterStyleFromText(t),kC.addClass(t,r),t.setAttribute(PA,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,r){r||(r=yx),this._orgCss&&(kC.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),kC.removeClass(e,n),t&&t!==e&&this._orgPCss&&(kC.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",kC.removeClass(t,r),t.removeAttribute(PA))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:kC.scrollTop(),left:kC.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",kC.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Hw.resolve();try{for(var r=0;r<AA.length;r++){var i=AA[r];if(e[i]){var o="webkitRequestFullscreen"===i?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[i]();return o&&o.then?o:Hw.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Hw.resolve()):Hw.reject(new Error("call getFullscreen fail"))}catch(a){return Hw.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||kC.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var n=0;n<xA.length;n++){var r=xA[n];if(document[r]){var i=document[r]();return i&&i.then?i:Hw.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Hw.resolve()):Hw.reject(new Error("call exitFullscreen fail"))}catch(o){return Hw.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var n=t?Nm(e="".concat(mx," ")).call(e,px):px;this.changeFullStyle(this.root,t,n);var r=this.config.fullscreen,i=void 0===r?{}:r;(!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen())&&(this.fullscreen=!0,this.emit(aA,!0)),this._cssfullscreenEl=t,this.cssfullscreen=!0,this.emit(sA,!0)}},{key:"exitCssFullscreen",value:function(){var e,t=this._cssfullscreenEl?Nm(e="".concat(mx," ")).call(e,px):px;if(this.fullscreen){var n=this.config.fullscreen,r=void 0===n?{}:n;!0===r.useCssFullscreen||"function"==typeof r.useCssFullscreen&&r.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,t),this.fullscreen=!1,this.emit(aA,!1)):this.removeClass(t)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,t);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(sA,!1)}},{key:"getRotateFullscreen",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(t);var n=t?Nm(e="".concat(mx," ")).call(e,vx):vx;this._fullscreenEl=t||this.root,this.changeFullStyle(this.root,t,n,gx),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style"),this.root.style.width="".concat(window.innerHeight,"px"),this.emit(aA,!0)}},{key:"exitRotateFullscreen",value:function(e){var t,n=this._fullscreenEl!==this.root?Nm(t="".concat(mx," ")).call(t,vx):vx;this.recoverFullStyle(this.root,this._fullscreenEl,n,gx),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(aA,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(WC,TS({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?(this._clearUserTimer(),this.emit(qC,TS({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(fx),this._clearUserTimer(),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this._clearUserTimer();else{var r=t&&t.delay?t.delay:this.config.inactive;this.userTimer=kC.setTimeout(this,(function(){e.userTimer=null,e.blur()}),r)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var n=this.config.closePauseVideoFocus;this.isActive=!1,(t||n||!this.paused&&!this.ended)&&this.addClass(fx)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(ix),this.removeClass(ux),this.removeClass(lx),this.isCanplay=!0,this.waitTimer&&kC.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1,this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime,this.__startTime=-1)}},{key:"onLoadstart",value:function(){this.removeClass(ux),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===Nx&&this.setState(Bx),this.removeClass(ox),this.ended&&this.removeClass(sx),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(ox),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(sx),this.setState(Nx)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Ex),this.removeClass(hx),this.removeClass(ix),this.removeClass(lx),this.addClass(ux)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Sx)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&kC.clearTimeout(this,this.waitTimer),this.removeClass(lx),this.removeClass(Sx)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&kC.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=kC.setTimeout(this,(function(){e.addClass(lx),e.emit(oA),kC.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[hx,ox,sx,ux,cx,lx].forEach((function(t){e.removeClass(t)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(lx))&&this.media.readyState>2&&(this.removeClass(lx),kC.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===Ux&&this.duration&&(this.setState(Bx),this.emit($C)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===kC.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,n){if(this.media&&t&&e){var r="String"===kC.typeOf(e)?e:e.type||"";n.props&&"Array"!==kC.typeOf(n.props)&&(n.props=[n.props]),this.emit(yA,TS({eventType:r,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=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},n=t.startDiff,r=void 0===n?0:n,i=t.endDiff,o=void 0===i?0:i,a=this.media.buffered;if(!a||0===a.length||!this.duration)return!0;for(var s=e||this.media.currentTime||.2,l=a.length,u=0;u<l;u++)if(a.start(u)+r<=s&&a.end(u)-o>s)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.vy,n=e.vx,r=e.h,i=e.w,o=this.videoPos.rotate;if(!(o<0&&r<0&&i<0)){var a=this.videoPos._pi;if(!a&&this.media.videoHeight&&(a=this.media.videoWidth/this.media.videoHeight*100),a){this.videoPos.pi=a;var s={rotate:o=o<0?0:o},l=0,u=0,c=1,h=Math.abs(o/90),f=this.root,d=this.innerContainer,p=f.offsetWidth,v=d?d.offsetHeight:f.offsetHeight,g=v,y=p;if(h%2==0)c=r>0?100/r:i>0?100/i:1,s.scale=c,l=t>0?(100-r)/2-t:0,s.y=2===h?0-l:l,u=n>0?(100-i)/2-n:0,s.x=2===h?0-u:u,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(g,"px");else if(h%2==1){g=p;var m=v-p;u=-m/2/(y=v)*100,s.x=3===h?u+t/2:u-t/2,l=m/2/g*100,s.y=3===h?l+n/2:l-n/2,s.scale=c,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(g,"px")}var _=kC.getTransformStyle(s,this.media.style.transform||this.media.style.webkitTransform);this.media.style.transform=_,this.media.style.webkitTransform=_}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t,n=this;e&&Vw(t=dk(e)).call(t,(function(t){if("plugins"!==t){n.config[t]=e[t];var r=n.plugins[t.toLowerCase()];r&&"Function"===kC.typeOf(r.setConfig)&&r.setConfig(e[t])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,BA(this,"playnext",(function(){t.start(),t.emit(vA,e)}))}},{key:"resize",value:function(){var e=this;if(this.media){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var n=this.media,r=n.videoWidth,i=n.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),i&&r){this._videoHeight=i,this._videoWidth=r;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,c=t.height-l,h=iE(r/i*1e3,10),f=iE(u/c*1e3,10),d=u,p=c,v={};"auto"===a&&f>h||"fixWidth"===a?(p=u/h*1e3,this.config.fluid?v.paddingTop="".concat(100*p/d,"%"):v.height="".concat(p+l,"px")):("auto"===a&&f<h||"fixHeight"===a)&&(d=h*c/1e3,v.width="".concat(d,"px")),this.fullscreen||this.cssfullscreen||dk(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===s&&f<h||"fillWidth"===s&&f>h)&&this.setAttribute("data-xgfill","cover");var g={videoScale:h,vWidth:d,vHeight:p,cWidth:d,cHeight:p+l};this.resizePosition(),this.emit(dA,g)}}}},{key:"updateObjectPosition",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(t,n):this.media.style.objectPosition=Nm(e="".concat(100*t,"% ")).call(e,100*n,"%")}},{key:"setState",value:function(e){var t;bC.logInfo("setState",Nm(t="state from:".concat(Vx[this.state]," to:")).call(t,Vx[e])),this._state=e}},{key:"_preProcessUrl",value:function(e,t){var n=this.config,r=n.preProcessUrl,i=n.preProcessUrlOptions,o=AE({},i,t);return kC.isBlob(e)||"function"!=typeof r?{url:e}:r(e,o)}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(Mx),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===Bx||this._state===Nx},set:function(e){e?this.setState(Bx):this._state>=Bx&&this.setState(Fx)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition,r=null,i=null;n.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(r=e),n.defaultDefinition===e.definition&&(i=e)})),!i&&e.length>0&&(i=e[0]),r?this.changeDefinition(r):i&&this.changeDefinition(i)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=iE(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var t,n;0!==Gw(t=Dx.langKeys).call(t,(function(t){return t===e})).length||"zh"===e?(this.config.lang=e,nx.setLang(e,this)):console.error(Nm(n="Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [")).call(n,Dx.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 IC}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return US(DS(n.prototype),"readyState",this)}},{key:"error",get:function(){var e=US(DS(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return US(DS(n.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,n=e.t;return n?(new Date).getTime()-n+t:t}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=kC.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Wx},set:function(e){Wx=e}},{key:"realTimeSpeed",get:function(){return Kx},set:function(e){Kx=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,t){var n;return RA.call.apply(RA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){var n;return DA.call.apply(DA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){var n;return OA.call.apply(OA,Nm(n=[this]).call(n,pk(Array.prototype).call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var r,i=arguments.length,o=new Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];return MA.call.apply(MA,Nm(r=[this]).call(r,pk(Array.prototype).call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var r,i=arguments.length,o=new Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];return LA.call.apply(LA,Nm(r=[this]).call(r,pk(Array.prototype).call(arguments)))}},{key:"setUserActive",value:function(e,t){var n;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),kC.typeOf(t)===Boolean&&(this.muted=t)),null===(n=qx)||void 0===n||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return bC.config.debug},set:function(e){bC.config.debug=e}},{key:"instManager",get:function(){return qx},set:function(e){qx=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=qx)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var n;null===(n=qx)||void 0===n||n.setActive(e,t)}},{key:"isHevcSupported",value:function(){return PC.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return PC.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}(SA);IS(Xx,"defaultPreset",null),IS(Xx,"XgVideoProxy",null),Xx.instManager=jx.getInstance();function Yx(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var $x=qE;Dn({target:"Function",proto:!0,forced:Function.bind!==$x},{bind:$x});var Zx,Jx,Qx=Wc("Function").bind,eP=ce,tP=Qx,nP=Function.prototype,rP=o((function(e){var t=e.bind;return e===nP||eP(nP,e)&&t===nP.bind?tP:t}));function iP(e,t){var n;return(iP=gh?rP(n=gh).call(n):function(e,t){return e.__proto__=t,e})(e,t)}function oP(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Lc(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Oc(e,"prototype",{writable:!1}),t&&iP(e,t)}function aP(e){var t;return(aP=gh?rP(t=Vc).call(t):function(e){return e.__proto__||Vc(e)})(e)}function sP(){if("undefined"==typeof Reflect||!uS)return!1;if(uS.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(uS(Boolean,[],(function(){}))),!0}catch(e){return!1}}function lP(e){var t=sP();return function(){var n,r=aP(e);if(t){var i=aP(this).constructor;n=uS(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Tc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Yx(e)}(this,n)}}function uP(e,t,n){var r;sP()?uP=rP(r=uS).call(r):uP=function(e,t,n){var r=[null];ph(r).apply(r,t);var i=new(rP(Function).apply(e,r));return n&&iP(i,n.prototype),i};return uP.apply(null,arguments)}function cP(e){var t="function"==typeof Ow?new Ow:void 0;return cP=function(e){if(null===e||(n=e,-1===$y(r=Function.toString.call(n)).call(r,"[native code]")))return e;var n,r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return uP(e,arguments,aP(this).constructor)}return i.prototype=Lc(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),iP(i,e)},cP(e)}var hP=function(e){return e.Fatal="Fatal",e.Error="Error",e}(hP||{}),fP=function(e){return e[e.MANIFEST_HLS_ERROR=1100]="MANIFEST_HLS_ERROR",e[e.MANIFEST_DASH_ERROR=1200]="MANIFEST_DASH_ERROR",e[e.NETWORK=2100]="NETWORK",e[e.NETWORK_TIMEOUT=2101]="NETWORK_TIMEOUT",e[e.NETWORK_FORBIDDEN=2103]="NETWORK_FORBIDDEN",e[e.NETWORK_NOTFOUND=2104]="NETWORK_NOTFOUND",e[e.NETWORK_RANGE_NOT_SATISFIABLE=2116]="NETWORK_RANGE_NOT_SATISFIABLE",e[e.DEMUX_FLV_ERROR=3100]="DEMUX_FLV_ERROR",e[e.DEMUX_HLS_ERROR=3200]="DEMUX_HLS_ERROR",e[e.DEMUX_MP4_ERROR=3300]="DEMUX_MP4_ERROR",e[e.DEMUX_FMP4_ERROR=3400]="DEMUX_FMP4_ERROR",e[e.DEMUX_SIDX_ERROR=3410]="DEMUX_SIDX_ERROR",e[e.REMUX_FMP4_ERROR=4100]="REMUX_FMP4_ERROR",e[e.REMUX_MP4_ERROR=4200]="REMUX_MP4_ERROR",e[e.MEDIA_ERR_ABORTED=5101]="MEDIA_ERR_ABORTED",e[e.MEDIA_ERR_NETWORK=5102]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=5103]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=5104]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MEDIA_ERR_CODEC_NOT_SUPPORTED=5105]="MEDIA_ERR_CODEC_NOT_SUPPORTED",e[e.MEDIA_ERR_URL_EMPTY=5106]="MEDIA_ERR_URL_EMPTY",e[e.MEDIA_MSE_ADD_SB=5200]="MEDIA_MSE_ADD_SB",e[e.MEDIA_MSE_APPEND_BUFFER=5201]="MEDIA_MSE_APPEND_BUFFER",e[e.MEDIA_MSE_OTHER=5202]="MEDIA_MSE_OTHER",e[e.MEDIA_MSE_FULL=5203]="MEDIA_MSE_FULL",e[e.MEDIA_MSE_HIJACK=5204]="MEDIA_MSE_HIJACK",e[e.MEDIA_EME_HIJACK=5301]="MEDIA_EME_HIJACK",e[e.DRM_LICENSE=7100]="DRM_LICENSE",e[e.DRM_CUSTOM_LICENSE=7200]="DRM_CUSTOM_LICENSE",e[e.OTHER=8e3]="OTHER",e[e.RUNTIME_NO_CANPLAY_ERROR=9001]="RUNTIME_NO_CANPLAY_ERROR",e[e.RUNTIME_BUFFERBREAK_ERROR=9002]="RUNTIME_BUFFERBREAK_ERROR",e[e.RUNTIME_BWAITING_TIMEOUT_ERROR=9002]="RUNTIME_BWAITING_TIMEOUT_ERROR",e[e.MODULE_LOAD_ERROR=110]="MODULE_LOAD_ERROR",e.UNKNOWN="UNKNOWN",e}(fP||{}),dP=(Uy(Zx={},2100,{messageTextKey:"NETWORK",level:"Error"}),Uy(Zx,2101,{messageTextKey:"NETWORK_TIMEOUT",level:"Error"}),Uy(Zx,2103,{messageTextKey:"NETWORK_FORBIDDEN",level:"Error"}),Uy(Zx,2104,{messageTextKey:"NETWORK_NOTFOUND",level:"Error"}),Uy(Zx,5101,{messageTextKey:"MEDIA_ERR_ABORTED",level:"Error"}),Uy(Zx,5102,{messageTextKey:"MEDIA_ERR_NETWORK",level:"Error"}),Uy(Zx,5103,{messageTextKey:"MEDIA_ERR_DECODE",level:"Error"}),Uy(Zx,5104,{messageTextKey:"MEDIA_ERR_SRC_NOT_SUPPORTED",level:"Error"}),Uy(Zx,5105,{messageTextKey:"MEDIA_ERR_CODEC_NOT_SUPPORTED",level:"Error"}),Uy(Zx,5106,{messageTextKey:"MEDIA_ERR_URL_EMPTY",level:"Error"}),Uy(Zx,110,{messageTextKey:"MODULE_LOAD_ERROR",level:"Fatal"}),Uy(Zx,7100,{messageTextKey:"DRM_LICENSE",level:"Fatal"}),Zx),pP=(Uy(Jx={},"manifest",{messageTextKey:"MANIFEST",level:"Error"}),Uy(Jx,"network",{messageTextKey:"NETWORK",level:"Error"}),Uy(Jx,"demux",{messageTextKey:"DEMUX",level:"Error"}),Uy(Jx,"remux",{messageTextKey:"REMUX",level:"Error"}),Uy(Jx,"media",{messageTextKey:"MEDIA",level:"Error"}),Uy(Jx,"drm",{messageTextKey:"DRM",level:"Error"}),Uy(Jx,"other",{messageTextKey:"OTHER",level:"Error"}),Uy(Jx,"runtime",{messageTextKey:"RUNTIME",level:"Error"}),Jx),vP=function(e){oP(n,e);var t=lP(n);function n(e,r){var i,o,a,s,l,u,c;Ry(this,n);var h="string"==typeof e?{message:e}:e,f=null!==(i=null!==(o=null!==(a=null==r?void 0:r.getText(null==h?void 0:h.messageTextKey))&&void 0!==a?a:null==h?void 0:h.message)&&void 0!==o?o:null==h||null===(s=h.error)||void 0===s?void 0:s.message)&&void 0!==i?i:null==r?void 0:r.getText("UNKNOWN");return Uy(Yx(c=t.call(this,f)),"errorCode",void 0),Uy(Yx(c),"level",void 0),Uy(Yx(c),"ext",void 0),c.errorCode=null!==(l=null==h?void 0:h.errorCode)&&void 0!==l?l:"UNKNOWN",c.level=null!==(u=null==h?void 0:h.level)&&void 0!==u?u:"Error",c.ext=null==h?void 0:h.ext,c}return Fy(n)}(cP(Error));function gP(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new vP(Mm(Mm({errorCode:e},dP[e]),t),n)}function yP(e,t){var n,r,i=dP[e.errorCode]||pP[e.errorType],o=e.errorCode;return new vP({messageTextKey:null==i?void 0:i.messageTextKey,message:null!==(n=null==e?void 0:e.message)&&void 0!==n?n:o,errorCode:o,level:null!==(r=null==i?void 0:i.level)&&void 0!==r?r:"Error",ext:e},t)}var mP=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){kC.addClass(this.root,"hide")}},{key:"show",value:function(e){kC.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(LC,(function(){e.isEndedShow&&kC.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(NC,(function(){e.onTimeUpdate()})),this.on(tA,(function(){kC.removeClass(e.root,"hide"),kC.addClass(e.root,"xg-showplay"),e.once(NC,(function(){e.onTimeUpdate()}))}))):this.on(MC,(function(){kC.addClass(e.root,"hide")}))}},{key:"setConfig",value:function(e){var t=this;dk(e).forEach((function(n){t.config[n]=e[n]}));var n=this.config.poster;this.update(n)}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?kC.removeClass(this.root,"xg-showplay"):this.once(NC,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"getBgSize",value:function(e){var t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;default:t=""}return t?"background-size: ".concat(t,";"):""}},{key:"render",value:function(){var e,t,n=this.config,r=n.poster,i=n.hideCanplay,o=n.fillMode,a=n.notHidden,s=this.getBgSize(o),l=r?Nm(e="background-image:url(".concat(r,");")).call(e,s):s;return Nm(t='<xg-poster class="xgplayer-poster '.concat(a?"xg-not-hidden":i?"xg-showplay":"",'" style="')).call(t,l,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),n}(QA);function _P(){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 bP(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var wP={};function kP(e){var t;e?window.clearTimeout(e):Vw(t=dk(wP)).call(t,(function(e){window.clearTimeout(wP[e].id),delete wP[e]}))}var EP=function(e){RS(n,e);var t=FS(n);function n(e){var r;return AS(this,n),IS(MS(r=t.call(this,e)),"onPlayerReset",(function(){r.autoPlayStart=!1;var e="auto"===r.config.mode?"auto-hide":"hide";r.setAttr("data-state","play"),kC.removeClass(r.root,e),r.show()})),IS(MS(r),"onAutoplayStart",(function(){if(!r.autoPlayStart){var e="auto"===r.config.mode?"auto-hide":"hide";kC.addClass(r.root,e),r.autoPlayStart=!0,r.onPlayPause("play")}})),r.autoPlayStart=!1,r}return PS(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(XC,(function(){n&&(n.lang&&"en"===n.lang?kC.addClass(t.root,"lang-is-en"):"jp"===n.lang&&kC.addClass(t.root,"lang-is-jp"))})),this.on($C,this.onAutoplayStart),n.autoplay||this.show(),this.on(ZC,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),kC.removeClass(e.root,t),e.show()})),this.on(MC,(function(){e.onPlayPause("play")})),this.on(FC,(function(){e.onPlayPause("pause")})),this.on(mA,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var n=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:n,to:!n})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:_P,class:"xg-icon-play"},startPause:{icon:bP,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(){kC.addClass(this.root,"hide")}},{key:"show",value:function(e){kC.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){kC.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){kC.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return wP[e]&&window.clearTimeout(wP[e].id),wP[e]={},n.start&&n.start(),wP[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(wP[e].id),delete wP[e]}),t),wP[e].id}("pauseplay",400,{start:function(){kC.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){kC.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){kC.removeClass(this.root,"interact"),kP(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<Mx)||(this.player.paused||t.state!==Bx?t.play():t.pause())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n&&!(n.state<Bx)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),kP(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(QA),SP=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=kC.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="",r=1;r<=12;r++)n+='<div class="xgplayer-enter-bar'.concat(r,'"></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}(QA);function TP(e,t,n){try{var r,i;return Nm(r=Nm(i=' <div class="xg-tips '.concat(n?"hide":" ",'" lang-key="')).call(i,e.i18nKeys[t],'">\n ')).call(r,e.i18n[t],"\n </div>")}catch(o){return'<div class="xg-tips hide"></div>'}}var CP=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(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,t="MINISCREEN";return Nm(e='\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[t],'">')).call(e,this.i18n[t],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_RIGHT,index:10}}}]),n}(QA);function AP(e){var t=wT(e);return-1===fk(e).call(e,"%")&&!Fk(t)&&t}var xP=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],PP=xP.length;function IP(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===CS(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<PP;t++)e[xP[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var r=n.isBorderBox="border-box"===t.boxSizing,i=0;i<PP;i++){var o=xP[i],a=t[o],s=wT(a);n[o]=Fk(s)?0:s}var l=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,c=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,f=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=r,v=AP(t.width);!1!==v&&(n.width=v+(p?0:l+f));var g=AP(t.height);return!1!==g&&(n.height=g+(p?0:u+d)),n.innerWidth=n.width-(l+f),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+c,n.outerHeight=n.height+h,n}}function RP(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.identifier===t)return r}}var DP="dragStart",OP="dragMove",MP="dragEnded",LP={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},FP=function(e){RS(n,e);var t=FS(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return AS(this,n),(r=t.call(this)).isEnabled=!0,r.isDragging=!1,r.isDown=!1,r.position={},r.downPoint={},r.dragPoint={x:0,y:0},r.startPos={x:0,y:0},r._root=e instanceof Element?e:document.querySelector(e),r._handlerDom=i.handle instanceof Element?i.handle:document.querySelector(i.handle),r._root&&r._handlerDom?(r._bindStartEvent(),r):LS(r)}return PS(n,[{key:"_bindStartEvent",value:function(){var e,t=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)]),Vw(e=LP[this._startKey]).call(e,(function(e){t["on".concat(e)]=t["on".concat(e)].bind(t)}))}},{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=LP[this._startKey];Vw(n).call(n,(function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e,t=this;this._boundPointerEvents&&(Vw(e=this._boundPointerEvents).call(e,(function(e){window.removeEventListener(e,t["on".concat(e)])})),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,t=Nm(e="translate3d(".concat(this.dragPoint.x,"px, ")).call(e,this.dragPoint.y,"px, 0)");this._root.style.transform=t,this._root.style.webKitTransform=t}},{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=RP(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=RP(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=RP(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=IP(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(DP,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(MP)),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,r=n.x,i=n.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,r),s=this.checkContain("y",s,i),this.position.x=r+a,this.position.y=i+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(OP,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=Fk(t)?0:t,this.position.y=Fk(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===fk(t).call(t,"matrix")){var n=t.split(","),r=0===fk(t).call(t,"matrix3d")?12:4,i=iE(n[r],10),o=iE(n[r+1],10);this.position.x+=i,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==fk(e).call(e,"%")){var n=IP(this._root.parentNode);return n?wT(e)/100*n[t]:0}return iE(e,10)}}]),n}(jS),UP=function(e){RS(n,e);var t=FS(n);function n(e){var r;AS(this,n),IS(MS(r=t.call(this,e)),"onCancelClick",(function(e){r.exitMini(),r.isClose=!0})),IS(MS(r),"onCenterClick",(function(e){var t=MS(r).player;t.paused?t.play():t.pause()})),IS(MS(r),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-r.pos.scrollY)<50)){var t=iE(kC.getCss(r.player.root,"height"));t+=r.config.scrollTop,r.pos.scrollY=window.scrollY,window.scrollY>t+5?!r.isMini&&!r.isClose&&r.getMini():window.scrollY<=t&&(r.isMini&&r.exitMini(),r.isClose=!1)}})),r.isMini=!1,r.isClose=!1;var i=MS(r).config;return r.pos={left:i.left<0?window.innerWidth-i.width-20:i.left,top:i.top<0?window.innerHeight-i.height-20:i.top,height:r.config.height,width:r.config.width,scrollY:window.scrollY||0},r.lastStyle=null,r}return PS(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(FC,(function(){e.setAttr("data-state","pause")})),this.on(MC,(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(CP,n,CP.pluginName)}var r=kC.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",r,this.onCancelClick),this.bind(".play-icon",r,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new FP(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:_P,class:"xg-icon-play"},pause:{icon:bP,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,t=this;if(!this.isMini){var n=this.player,r=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},kC.addClass(n.root,"xgplayer-mini"),Vw(e=["width","height","top","left"]).call(e,(function(e){t.lastStyle[e]=i.style[e],i.style[e]="".concat(t.pos[e],"px")})),r.fluid&&(i.style["padding-top"]=""),this.emit(lA,!0),n.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t,n=this.player,r=this.playerConfig,i=this.config.target||this.player.root;(kC.removeClass(n.root,"xgplayer-mini"),this.lastStyle)&&Vw(t=dk(this.lastStyle)).call(t,(function(t){i.style[t]=e.lastStyle[t]}));this.lastStyle=null,r.fluid&&(n.root.style.width="100%",n.root.style.height="0",n.root.style["padding-top"]="".concat(100*r.height/r.width,"%")),this.emit(lA,!1),this.isMini=n.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=kC.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(TP(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(QA),BP={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},NP=["videoClick","videoDbClick"],VP=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onMouseMove",(function(e){var t=MS(r),n=t.player,i=t.playerConfig;n.isActive||(n.focus({autoHide:!i.closeDelayBlur}),!i.closeFocusVideoFocus&&n.media.focus())})),IS(MS(r),"onMouseEnter",(function(e){var t=MS(r),n=t.playerConfig,i=t.player;!n.closeFocusVideoFocus&&i.media.focus(),n.closeDelayBlur?i.focus({autoHide:!1}):i.focus(),r.emit(iA)})),IS(MS(r),"onMouseLeave",(function(e){var t=r.playerConfig,n=t.closePlayerBlur,i=t.leavePlayerTime,o=t.closeDelayBlur;n||o||(i?r.player.focus({autoHide:!0,delay:i}):r.player.blur({ignorePaused:!0})),r.emit(rA)})),IS(MS(r),"onVideoClick",(function(e){var t=MS(r),n=t.player,i=t.playerConfig;e.target&&i.closeVideoClick||e.target!==n.root&&e.target!==n.media&&e.target!==n.innerContainer&&e.target!==n.media.__canvas||(e.preventDefault(),i.closeVideoStopPropagation||e.stopPropagation(),r._clickCount++,r.clickTimer&&(clearTimeout(r.clickTimer),r.clickTimer=null),r.clickTimer=setTimeout((function(){r._clickCount&&(r._clickCount--,BA(MS(r),NP[0],(function(e,t){r.switchPlayPause(t.e)}),{e:e,paused:n.paused}),clearTimeout(r.clickTimer),r.clickTimer=null)}),300))})),IS(MS(r),"onVideoDblClick",(function(e){var t=MS(r),n=t.player,i=t.playerConfig;i.closeVideoDblclick||!e.target||e.target!==n.media&&e.target!==n.media.__canvas||(!i.closeVideoClick&&r._clickCount<2?r._clickCount=0:(r._clickCount=0,r.clickTimer&&(clearTimeout(r.clickTimer),r.clickTimer=null),e.preventDefault(),e.stopPropagation(),BA(MS(r),NP[1],(function(e,t){r.emitUserAction(t.e,"switch_fullscreen",{props:"fullscreen",from:n.fullscreen,to:!n.fullscreen}),n.fullscreen?n.exitFullscreen():n.getFullscreen()}),{e:e,fullscreen:n.fullscreen})))})),r}return PS(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Vw(NP).call(NP,(function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===PC.device&&!PC.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e,t=this,n=this.player,r=n.media,i=n.root,o=this.playerConfig.enableContextmenu;i&&i.addEventListener("click",this.onVideoClick,!1),i&&i.addEventListener("dblclick",this.onVideoDblClick,!1),Vw(e=dk(BP)).call(e,(function(e){i.addEventListener(e,t[BP[e]],!1)})),!o&&r&&r.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e,t=this,n=this.player,r=n.video,i=n.root;this.clickTimer&&clearTimeout(this.clickTimer),i.removeEventListener("click",this.onVideoClick,!1),i.removeEventListener("dblclick",this.onVideoDblClick,!1),r.removeEventListener("contextmenu",this.onContextmenu,!1),Vw(e=dk(BP)).call(e,(function(e){i.removeEventListener(e,t[BP[e]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(VA),HP="press",GP="pressend",jP="doubleclick",zP="click",KP="touchmove",WP="touchstart",qP="touchend",XP={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},YP={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function $P(e){return e&&e.length>0?e[e.length-1]:null}var ZP=function(){function e(t){var n,r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};AS(this,e),IS(this,"onTouchStart",(function(e){var t=r._pos,n=r.root,i=$P(e.touches);t.x=i?iE(i.pageX,10):e.pageX,t.y=i?iE(i.pageX,10):e.pageX,t.start=!0,r.__setPress(e),n.addEventListener(r.events.end,r.onTouchEnd),n.addEventListener(r.events.cancel,r.onTouchCancel),n.addEventListener(r.events.move,r.onTouchMove),r.trigger(WP,e)})),IS(this,"onTouchCancel",(function(e){r.onTouchEnd(e)})),IS(this,"onTouchEnd",(function(e){var t=r._pos,n=r.root;r.__clearPress(),n.removeEventListener(r.events.cancel,r.onTouchCancel),n.removeEventListener(r.events.end,r.onTouchEnd),n.removeEventListener(r.events.move,r.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&r.trigger(GP,e),r.trigger(qP,e),!t.press&&!t.moving&&r.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),IS(this,"onTouchMove",(function(e){var t=r._pos,n=r.config,i=$P(e.touches),o=i?iE(i.pageX,10):e.pageX,a=i?iE(i.pageY,10):e.pageX,s=o-t.x,l=a-t.y;Math.abs(l)<n.miniStep&&Math.abs(s)<n.miniStep||(r.__clearPress(),t.press&&r.trigger(GP,e),t.press=!1,t.moving=!0,r.trigger(KP,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},Vw(n=dk(i)).call(n,(function(e){r.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?YP:XP,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return PS(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(HP,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(jP,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(zP,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,r=this.__handlers[e],i=-1,o=0;o<r.length;o++)if(r[o]===t){i=o;break}if(i>=0)Lk(n=this.__handlers[e]).call(n,i,1)}}},{key:"trigger",value:function(e,t){var n;this.__handlers[e]&&Vw(n=this.__handlers[e]).call(n,(function(n){try{n(t)}catch(oz){console.error("trigger>>:".concat(e),oz)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};dk(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}();function JP(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var QP="auto",eI="seeking",tI="playbackrate",nI=["videoClick","videoDbClick"],rI=function(e){RS(n,e);var t=FS(n);function n(e){var r;return AS(this,n),IS(MS(r=t.call(this,e)),"onTouchStart",(function(e){var t=MS(r),n=t.player,i=t.config,o=t.pos,a=t.playerConfig,s=r.getTouche(e);if(s&&!i.disableGesture&&r.duration>0&&!n.ended){o.isStart=!0,r.timer&&clearTimeout(r.timer),kC.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),Xm(r).call(r,".xg-dur").innerHTML=kC.format(r.duration);var l=r.root.getBoundingClientRect();90===n.rotateDeg?(o.top=l.left,o.left=l.top,o.width=l.height,o.height=l.width):(o.top=l.top,o.left=l.left,o.width=l.width,o.height=l.height);var u=iE(s.pageX-o.left,10),c=iE(s.pageY-o.top,10);o.x=90===n.rotateDeg?c:u,o.y=90===n.rotateDeg?u:c,o.scopeL=i.scopeL*o.width,o.scopeR=(1-i.scopeR)*o.width,o.scopeM1=o.width*(1-i.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),IS(MS(r),"onTouchMove",(function(e){var t=r.getTouche(e),n=MS(r),i=n.pos,o=n.config,a=n.player;if(t&&!o.disableGesture&&r.duration&&i.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,u=iE(t.pageX-i.left,10),c=iE(t.pageY-i.top,10),h=90===a.rotateDeg?c:u,f=90===a.rotateDeg?u:c;if(Math.abs(h-i.x)>s||Math.abs(f-i.y)>s){var d=h-i.x,p=f-i.y,v=i.scope;if(-1===v&&(0===(v=r.checkScope(h,f,d,p,i))&&(l?a.blur():a.focus({autoHide:!1}),!i.time&&(i.time=iE(1e3*a.currentTime,10)+1e3*r.timeOffset)),i.scope=v),-1===v||v>0&&!o.gestureY||0===v&&!o.gestureX)return;r.executeMove(d,p,v,i.width,i.height),i.x=h,i.y=f}}})),IS(MS(r),"onTouchEnd",(function(e){var t=MS(r),n=t.player,i=t.pos,o=t.playerConfig;if(setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),i.isStart){i.scope>-1&&e.cancelable&&e.preventDefault();var a=r.config,s=a.disableGesture,l=a.gestureX;!s&&l?r.endLastMove(i.scope):i.time=0,i.scope=-1,r.resetPos(),kC.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),r.changeAction(QP)}})),IS(MS(r),"onRootTouchMove",(function(e){!r.config.disableGesture&&r.config.gestureX&&r.checkIsRootTarget(e)&&(e.stopPropagation(),r.pos.isStart?r.onTouchMove(e):r.onTouchStart(e))})),IS(MS(r),"onRootTouchEnd",(function(e){r.pos.scope>-1&&r.onTouchEnd(e)})),r.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},r.timer=null,r}return PS(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:JP,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e,t=this;Vw(nI).call(nI,(function(e){t.__hooks[e]=null}));var n=this.playerConfig,r=this.config,i=this.player;!0===n.closeVideoDblclick&&(r.closedbClick=!0),this.resetPos(),kC.isUndefined(n.disableGesture)||(r.disableGesture=!!n.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=kC.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var o="mouse"===this.domEventType?"mouse":"touch";this.touch=new ZP(this.root,{eventType:o,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),i.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var a=this.player.controls;a&&a.center&&(a.center.addEventListener("touchmove",this.onRootTouchMove,!0),a.center.addEventListener("touchend",this.onRootTouchEnd,!0),a.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(GC,(function(){var e=t.player,n=t.config;1e3*e.duration<n.moveDuration&&(n.moveDuration=1e3*e.duration)})),this.on([HC,LC],(function(){var e=t.pos,n=e.time;!e.isStart&&n>0&&(t.pos.time=0)}));var s={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Vw(e=dk(s)).call(e,(function(e){t.touch.on(e,(function(n){t[s[e]](n)}))})),!r.disableActive){var l=i.plugins.progress;l&&(l.addCallBack("dragmove",(function(e){t.activeSeekNote(e.currentTime,e.forward)})),["dragend","click"].forEach((function(e){l.addCallBack(e,(function(){t.changeAction(QP)}))})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=Xm(this).call(this,".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor,r=e.timePreviewStyle,i=e.curTimeColor,o=e.durationColor;t&&(Xm(this).call(this,".xg-curbar").style.backgroundColor=t);n&&(Xm(this).call(this,".xg-bar").style.backgroundColor=n);if(r){var a=Xm(this).call(this,".time-preview");dk(r).forEach((function(e){a.style[e]=r[e]}))}var s=i||t,l=o;s&&(Xm(this).call(this,".xg-cur").style.color=s),l&&(Xm(this).call(this,".xg-dur").style.color=l),this.config.disableTimeProgress&&kC.addClass(Xm(this).call(this,".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e,t=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,Vw(e=["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"]).call(e,(function(e){t.pos[e]=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,r,i){var o=i.width,a=-1;if(e<0||e>o)return a;var s=0===r?Math.abs(n):Math.abs(n/r);return Math.abs(n)>0&&s>=1.73&&e>i.scopeM1&&e<i.scopeM2?a=0:(0===Math.abs(n)||s<=.57)&&(a=e<i.scopeL?1:e>i.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,n,r,i){switch(n){case 0:this.updateTime(e/r*this.config.scopeM);break;case 1:this.updateBrightness(t/i);break;case 2:PC.os.isIos||this.updateVolume(t/i)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,r=this.player,i=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)r.seek(Number(o).toFixed(1)),i.hideControlsEnd?r.blur():r.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(QP)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,n=this.config,r=this.playerConfig;t.state<Bx?r.closeVideoClick||(this.sendUseAction(kC.createEvent("click")),t.play()):!n.closedbClick||r.closeVideoClick?t.isActive?t.blur():t.focus():r.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.sendUseAction(kC.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.state>=Bx&&(this.sendUseAction(kC.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;BA(this,nI[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;BA(this,nI[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,r=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:r.playbackRate,to:n.pressRate}),r.playbackRate=n.pressRate,this.changeAction(tI))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,r=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:r.playbackRate,to:t.rate}),r.playbackRate=t.rate,t.rate=1,this.changeAction(QP))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,r=this.player.duration;e=Number(e.toFixed(4));var i=iE(e*n.moveDuration,10)+this.timeOffset;i=(i+=this.pos.time)<0?0:i>1e3*r?1e3*r-200:i,t.getPlugin("time")&&t.getPlugin("time").updateTime(i/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(i/1e3/this.duration,!0),this.activeSeekNote(i/1e3,e>0),n.isTouchingSeek&&t.seek(Number((i-this.timeOffset)/1e3).toFixed(1)),this.pos.time=i}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=iE(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var r=iE(10*t.volume,10)-iE(n.volume/10,10);r=r>10?10:r<1?0:r,t.volume=r/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,r=this.xgMask,i=t.light+.8*e;i=i>n.maxDarkness?n.maxDarkness:i<0?0:i,r&&(r.style.backgroundColor="rgba(0,0,0,".concat(i,")")),t.light=i}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,r=this.config,i=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!i&&!r.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(eI);var o=n.plugins.start;if(o&&o.focusHide(),Xm(this).call(this,".xg-dur").innerHTML=kC.format(this.duration),Xm(this).call(this,".xg-cur").innerHTML=kC.format(e),Xm(this).call(this,".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t)kC.removeClass(Xm(this).call(this,".xg-seek-show"),"xg-back");else kC.addClass(Xm(this).call(this,".xg-seek-show"),"xg-back");this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<Fx)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),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e,t,n,r="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return Nm(e=Nm(t=Nm(n='\n <xg-trigger class="trigger">\n <div class="'.concat(r,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ')).call(n,this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span class="xg-separator">/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>')).call(t,this.config.pressRate,"X</i>")).call(e,this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(QA);Dn({target:"String",proto:!0},{repeat:XS});var iI=Wc("String").repeat,oI=ce,aI=iI,sI=String.prototype,lI=o((function(e){var t=e.repeat;return"string"==typeof e||e===sI||oI(sI,e)&&t===sI.repeat?aI:t}));function uI(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var cI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onBodyKeyDown",(function(e){if(r.player){var t=e||window.event,n=t.keyCode,i=MS(r),o=i._keyState,a=i.player,s=r.config,l=s.disable,u=s.disableBodyTrigger,c=s.isIgnoreUserActive;l||u||!a.isUserActive&&!c||uI(t.target)||!r.checkIsVisible()||t.metaKey||t.altKey||t.ctrlKey?o.isBodyKeyDown=!1:(lI(e)||o.isKeyDown||((t.target===document.body||r.config.isGlobalTrigger&&!uI(t.target))&&r.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",r.onBodyKeyUp)),o.isBodyKeyDown&&r.handleKeyDown(t))}})),IS(MS(r),"onBodyKeyUp",(function(e){r.player&&(document.removeEventListener("keyup",r.onBodyKeyUp),r.handleKeyUp(e))})),IS(MS(r),"onKeydown",(function(e){if(r.player){var t=e||window.event,n=MS(r)._keyState;if(!lI(t)){if(r.config.disable||r.config.disableRootTrigger||t.metaKey||t.altKey||t.ctrlKey)return;!t||37!==t.keyCode&&!r.checkCode(t.keyCode)||t.target!==r.player.root&&t.target!==r.player.video&&t.target!==r.player.controls.el||(n.isKeyDown=!0),r.player.root.addEventListener("keyup",r.onKeyup)}n.isKeyDown&&r.handleKeyDown(t)}})),IS(MS(r),"onKeyup",(function(e){r.player&&(r.player.root.removeEventListener("keyup",r.onKeyup),r.handleKeyUp(e))})),r}return PS(n,[{key:"mergekeyCodeMap",value:function(){var e,t=this,n=this.config.keyCodeMap;n&&Vw(e=dk(n)).call(e,(function(e){var r;t.keyCodeMap[e]?Vw(r=["keyCode","action","disable","pressAction","disablePress","isBodyTarget"]).call(r,(function(r){n[e][r]&&(t.keyCodeMap[e][r]=n[e][r])})):t.keyCodeMap[e]=n[e]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var t=this;dk(e).forEach((function(n){t.config[n]=e[n]}))}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,r=e.bottom,i=window.innerHeight;return!(n<0&&n<0-.9*t||r>0&&r-i>.9*t)}},{key:"checkCode",value:function(e,t){var n,r=this,i=!1;return Vw(n=dk(this.keyCodeMap)).call(n,(function(n){r.keyCodeMap[n]&&e===r.keyCodeMap[n].keyCode&&!r.keyCodeMap[n].disable&&(i=!t||t&&!r.keyCodeMap[n].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var n=wT((t.volume-.1).toFixed(1)),r={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:r}),t.volume=n>=0?n:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var n=wT((t.volume+.1).toFixed(1)),r={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:r}),t.volume=n<=1?n:1}}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,r=t.offsetCurrentTime,i=t.duration,o=t.offsetDuration,a=t.timeSegments,s=r>-1?r:n,l=o||i,u=lI(e)&&this.seekStep>=4?iE(this.seekStep/2,10):this.seekStep;s+u<=l?s+=u:s=l;var c=kC.getCurrentTimeByOffset(s,a),h={currentTime:{from:n,to:c}};this.emitUserAction(e,"seek",{props:h}),this.player.currentTime=c}},{key:"seekBack",value:function(e){var t=this.player,n=t.currentTime,r=t.offsetCurrentTime,i=t.timeSegments,o=(r>-1?r:n)-(lI(e)?iE(this.seekStep/2,10):this.seekStep);o<0&&(o=0);var a={currentTime:{from:n,to:o=kC.getCurrentTimeByOffset(o,i)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,r=this.player;0===t.playbackRate&&(t.playbackRate=r.playbackRate,r.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,r=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),r&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:r,to:!r}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(lI(e)){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}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 r,i=dk(this.keyCodeMap),o=0;o<i.length;o++){var a=this.keyCodeMap[i[o]],s=a.action,l=a.keyCode,u=a.disable,c=a.pressAction,h=a.disablePress;if(l===e){if(!(u||n&&h)){var f=n&&c||s;"function"==typeof f?s(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(gA,TS({key:i[o],target:t.target,isPress:n},this.keyCodeMap[i[o]]))}(r=t).preventDefault(),r.returnValue=!1,t.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),n}(VA);function hI(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var fI=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"registerIcons",value:function(){return{loadingIcon:hI}}},{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:XA.ROOT}}}]),n}(QA),dI=Dn,pI=ra.findIndex,vI="findIndex",gI=!0;vI in[]&&Array(1)[vI]((function(){gI=!1})),dI({target:"Array",proto:!0,forced:gI},{findIndex:function(e){return pI(this,e,arguments.length>1?arguments[1]:void 0)}});var yI=Wc("Array").findIndex,mI=ce,_I=yI,bI=Array.prototype,wI=o((function(e){var t=e.findIndex;return e===bI||mI(bI,e)&&t===bI.findIndex?_I:t})),kI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_onMouseenter",(function(e){r.emit("icon_mouseenter",{pluginName:r.pluginName})})),IS(MS(r),"_onMouseLeave",(function(e){r.emit("icon_mouseleave",{pluginName:r.pluginName})})),r}return PS(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}(QA),EI=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(n,[{key:"afterCreate",value:function(){var e=this;US(DS(n.prototype),"afterCreate",this).call(this);var t=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on([FC,UC,KC],(function(){e.animate(t.paused)})),this.on(MC,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:_P,class:"xg-icon-play"},pause:{icon:bP,class:"xg-icon-pause"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player;return this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t.paused,to:!t.paused}),t.ended?t.replay():t.paused?(t.play(),this.animate(!1)):(t.pause(),this.animate(!0)),!1}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,n=Xm(this).call(this,".xg-tips");e?(this.setAttr("data-state","pause"),n&&this.changeLangTextKey(n,t.PLAY_TIPS)):(this.setAttr("data-state","play"),n&&this.changeLangTextKey(n,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){US(DS(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(TP(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(kI);function SI(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var TI=function(e){RS(n,e);var t=FS(n);function n(){return AS(this,n),t.apply(this,arguments)}return PS(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:SI,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){kC.addClass(this.root,"show")}},{key:"hide",value:function(){kC.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:XA.ROOT_TOP,index:0}}}]),n}(QA);function CI(){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 AI(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var xI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_onOrientationChange",(function(e){r.player.fullscreen&&r.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?r.player.setRotateDeg(0):r.player.setRotateDeg(90))})),r}return PS(n,[{key:"afterCreate",value:function(){var e=this;US(DS(n.prototype),"afterCreate",this).call(this);var t=this.config,r=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var i=kC.getFullScreenEl();r.fullscreenTarget===i&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var n=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:n,to:!n})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(aA,(function(t){var n=Xm(e).call(e,".xg-tips");n&&e.changeLangTextKey(n,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:TI,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===PC.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:CI,class:"xg-get-fullscreen"},exitFullscreen:{icon:AI,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){US(DS(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===PC.device?"touchend":"click",this.handleFullscreen),"mobile"===PC.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player,n=this.config;!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):n.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):n.switchCallback&&"function"==typeof n.switchCallback?n.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),n.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),n.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(n.lockOrientationType))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(TP(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(t){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(e){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(kI);function PI(){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 II(){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 RI(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var DI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"onBarMousedown",(function(e){var t=MS(r).player,n=Xm(r).call(r,".xgplayer-bar");kC.event(e);var i=n.getBoundingClientRect(),o=kC.getEventPos(e,t.zoom),a=i.height-(o.clientY-i.top);if(o.h=a,o.barH=i.height,r.pos=o,!(a<-2))return r.updateVolumePos(a,e),document.addEventListener("mouseup",r.onBarMouseUp),r._d.isStart=!0,!1})),IS(MS(r),"onBarMouseMove",(function(e){var t=MS(r)._d;if(t.isStart){var n=MS(r),i=n.pos,o=n.player;e.preventDefault(),e.stopPropagation(),kC.event(e);var a=kC.getEventPos(e,o.zoom);t.isMoving=!0;var s=i.h-a.clientY+i.clientY;s>i.barH||r.updateVolumePos(s,e)}})),IS(MS(r),"onBarMouseUp",(function(e){kC.event(e),document.removeEventListener("mouseup",r.onBarMouseUp);var t=MS(r)._d;t.isStart=!1,t.isMoving=!1})),IS(MS(r),"onMouseenter",(function(e){r._d.isActive=!0,r.focus(),r.emit("icon_mouseenter",{pluginName:r.pluginName})})),IS(MS(r),"onMouseleave",(function(e){r._d.isActive=!1,r.unFocus(100,!1,e),r.emit("icon_mouseleave",{pluginName:r.pluginName})})),IS(MS(r),"onVolumeChange",(function(e){if(r.player){var t=r.player,n=t.muted,i=t.volume;r._d.isMoving||(Xm(r).call(r,".xgplayer-drag").style.height=n||0===i?"4px":"".concat(100*i,"%"),r.config.showValueLabel&&r.updateVolumeValue()),r.animate(n,i)}})),r}return PS(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:II,class:"xg-volume-small"},volumeLarge:{icon:PI,class:"xg-volume"},volumeMuted:{icon:RI,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,n=t.commonStyle,r=t.volume;if(n.volumeColor)Xm(this).call(this,".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"!==PC.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(jC,this.onVolumeChange),this.once(zC,this.onVolumeChange),"Number"!==kC.typeOf(r)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var n=this.player,r=Xm(this).call(this,".xgplayer-drag"),i=Xm(this).call(this,".xgplayer-bar");if(i&&r){var o=iE(e/i.getBoundingClientRect().height*1e3,10);r.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:n.volume,to:a}};n.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:s}),n.volume=Math.max(Math.min(o/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,r=Xm(this).call(this,".xgplayer-value-label"),i=Math.max(Math.min(t,1),0);r.innerText=n?0:Math.round(100*i)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(kC.clearTimeout(this,this._timerId),this._timerId=null),kC.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],r=arguments.length>2?arguments[2]:void 0,i=this._d,o=this.player;i.isActive||(this._timerId&&(kC.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=kC.setTimeout(this,(function(){i.isActive||(n?o.blur():o.focus(),kC.removeClass(e.root,"slide-show"),i.isStart&&e.onBarMouseUp(r)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(kC.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"===PC.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){var e;if(!this.config.disable){var t=this.config.default||this.player.volume,n=this.config.showValueLabel;return Nm(e='\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(n?'<div class="xgplayer-value-label">'.concat(100*t,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ')).call(e,100*t,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:XA.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(QA);function OI(){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 MI(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var LI="picture-in-picture",FI="inline",UI="fullscreen",BI=function(e){RS(n,e);var t=FS(n);function n(){var e,r;AS(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return IS(MS(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"switchPIP",(function(e){if(!r.isPIPAvailable())return!1;e.stopPropagation&&e.stopPropagation(),r.isPip?(r.exitPIP(),r.emitUserAction(e,"change_pip",{props:"pip",from:!0,to:!1}),r.setAttr("data-state","normal")):4===r.player.media.readyState&&(r.requestPIP(),r.emitUserAction(e,"change_pip",{props:"pip",from:!1,to:!0}),r.setAttr("data-state","pip"))})),r}return PS(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()&&(US(DS(n.prototype),"afterCreate",this).call(this),this.pMode=FI,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(JC,(function(){e.config.showIcon&&(kC.removeClass(Xm(e).call(e,".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:OI,class:"xg-get-pip"},pipIconExit:{icon:MI,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;kC.setTimeout(e,(function(){!n&&t.mediaPlay()}),0),!n&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(pA,!1)},this.enterPIPCallback=function(n){t.emit(pA,!0),null!=n&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var r=t.media.webkitPresentationMode;e.pMode===UI&&r!==UI&&t.onFullscreenChange(null,!1),e.pMode=r,r===LI?e.enterPIPCallback(n):r===FI&&e.leavePIPCallback(n)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t,n,r=Gw(t=Vw(n=BS(document.styleSheets)).call(n,(function(t){try{var n;return Vw(n=BS(t.cssRules)).call(n,(function(e){return e.cssText})).join("")}catch(i){var r=document.createElement("link");r.rel="stylesheet",r.type=t.type,r.media=t.media,r.href=t.href,e.document.head.appendChild(r)}return""}))).call(t,Boolean).join("\n"),i=document.createElement("style");i.textContent=r,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,r=this.playerConfig,i=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=r.poster;if(o&&(t.media.poster="String"===kC.typeOf(o)?o:o.poster),i.preferDocument&&this.isDocPIPAvailable()){var a={};if(i.width&&i.height)a.width=i.width,a.height=i.height;else{var s=t.root.getBoundingClientRect();a.width=s.width,a.height=s.height}documentPictureInPicture.requestWindow(a).then((function(n){var r=i.docPiPNode,o=i.docPiPStyle;e.enterPIPCallback();var a=r||t.root,s=a.parentElement,l=a.previousSibling,u=a.nextSibling;e.copyStyleIntoPiPWindow(n);var c=document.createElement("style");if(c.append("body{padding:0; margin:0;}"),o){var h="";"string"==typeof o?h=o:"function"==typeof o&&(h=o.call(i)),h&&c.append(h)}else a===t.root&&c.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");n.document.head.append(c),n.document.body.append(a),n.addEventListener("pagehide",(function(t){s&&(u?s.insertBefore(a,u):l?s.insertBefore(a,l.nextSibling):s.appendChild(a)),e.leavePIPCallback()}),{once:!0})}))}else n.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(l){return console.error("requestPiP",l),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;if(this.isPIPAvailable()&&this.isPip)this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(r){return console.error("exitPIP",r),!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===LI}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return("Boolean"!==kC.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===kC.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===kC.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){US(DS(n.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(TP(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:XA.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}(kI),NI=l,VI=vt("iterator"),HI=!NI((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,r){t.delete("b"),n+=r+e})),!e.toJSON||!t.size&&true||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[VI]||"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})),GI=_,jI=2147483647,zI=/[^\0-\u007E]/,KI=/[.\u3002\uFF0E\uFF61]/g,WI="Overflow: input needs wider integers to process",qI=RangeError,XI=GI(KI.exec),YI=Math.floor,$I=String.fromCharCode,ZI=GI("".charCodeAt),JI=GI([].join),QI=GI([].push),eR=GI("".replace),tR=GI("".split),nR=GI("".toLowerCase),rR=function(e){return e+22+75*(e<26)},iR=function(e,t,n){var r=0;for(e=n?YI(e/700):e>>1,e+=YI(e/t);e>455;)e=YI(e/35),r+=36;return YI(r+36*e/(e+38))},oR=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=ZI(e,n++);if(i>=55296&&i<=56319&&n<r){var o=ZI(e,n++);56320==(64512&o)?QI(t,((1023&i)<<10)+(1023&o)+65536):(QI(t,i),n--)}else QI(t,i)}return t}(e);var n,r,i=e.length,o=128,a=0,s=72;for(n=0;n<e.length;n++)(r=e[n])<128&&QI(t,$I(r));var l=t.length,u=l;for(l&&QI(t,"-");u<i;){var c=jI;for(n=0;n<e.length;n++)(r=e[n])>=o&&r<c&&(c=r);var h=u+1;if(c-o>YI((jI-a)/h))throw qI(WI);for(a+=(c-o)*h,o=c,n=0;n<e.length;n++){if((r=e[n])<o&&++a>jI)throw qI(WI);if(r==o){for(var f=a,d=36;;){var p=d<=s?1:d>=s+26?26:d-s;if(f<p)break;var v=f-p,g=36-p;QI(t,$I(rR(p+v%g))),f=YI(v/g),d+=36}QI(t,$I(rR(f))),s=iR(a,h,u==l),a=0,u++}}a++,o++}return JI(t,"")},aR=Dn,sR=s,lR=L,uR=_,cR=D,hR=HI,fR=ao,dR=lo,pR=F_,vR=Oo,gR=Kl,yR=Yo,mR=Jf,_R=I,bR=tt,wR=Qt,kR=ir,ER=an,SR=re,TR=$r,CR=Gi,AR=G,xR=nf,PR=Yh,IR=ud,RR=FT,DR=vt("iterator"),OR="URLSearchParams",MR=OR+"Iterator",LR=yR.set,FR=yR.getterFor(OR),UR=yR.getterFor(MR),BR=Object.getOwnPropertyDescriptor,NR=function(e){if(!cR)return sR[e];var t=BR(sR,e);return t&&t.value},VR=NR("fetch"),HR=NR("Request"),GR=NR("Headers"),jR=HR&&HR.prototype,zR=GR&&GR.prototype,KR=sR.RegExp,WR=sR.TypeError,qR=sR.decodeURIComponent,XR=sR.encodeURIComponent,YR=uR("".charAt),$R=uR([].join),ZR=uR([].push),JR=uR("".replace),QR=uR([].shift),eD=uR([].splice),tD=uR("".split),nD=uR("".slice),rD=/\+/g,iD=Array(4),oD=function(e){return iD[e-1]||(iD[e-1]=KR("((?:%[\\da-f]{2}){"+e+"})","gi"))},aD=function(e){try{return qR(e)}catch(oz){return e}},sD=function(e){var t=JR(e,rD," "),n=4;try{return qR(t)}catch(oz){for(;n;)t=JR(t,oD(n--),aD);return t}},lD=/[!'()~]|%20/g,uD={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},cD=function(e){return uD[e]},hD=function(e){return JR(XR(e),lD,cD)},fD=gR((function(e,t){LR(this,{type:MR,iterator:xR(FR(e).entries),kind:t})}),"Iterator",(function(){var e=UR(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n}),!0),dD=function(e){this.entries=[],this.url=null,void 0!==e&&(SR(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===YR(e,0)?nD(e,1):e:TR(e)))};dD.prototype={type:OR,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,i,o,a,s,l=PR(e);if(l)for(n=(t=xR(e,l)).next;!(r=lR(n,t)).done;){if(o=(i=xR(ER(r.value))).next,(a=lR(o,i)).done||(s=lR(o,i)).done||!lR(o,i).done)throw WR("Expected sequence with length 2");ZR(this.entries,{key:TR(a.value),value:TR(s.value)})}else for(var u in e)bR(e,u)&&ZR(this.entries,{key:u,value:TR(e[u])})},parseQuery:function(e){if(e)for(var t,n,r=tD(e,"&"),i=0;i<r.length;)(t=r[i++]).length&&(n=tD(t,"="),ZR(this.entries,{key:sD(QR(n)),value:sD($R(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],ZR(n,hD(e.key)+"="+hD(e.value));return $R(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var pD=function(){mR(this,vD);var e=LR(this,new dD(arguments.length>0?arguments[0]:void 0));cR||(this.length=e.entries.length)},vD=pD.prototype;if(pR(vD,{append:function(e,t){IR(arguments.length,2);var n=FR(this);ZR(n.entries,{key:TR(e),value:TR(t)}),cR||this.length++,n.updateURL()},delete:function(e){IR(arguments.length,1);for(var t=FR(this),n=t.entries,r=TR(e),i=0;i<n.length;)n[i].key===r?eD(n,i,1):i++;cR||(this.length=n.length),t.updateURL()},get:function(e){IR(arguments.length,1);for(var t=FR(this).entries,n=TR(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){IR(arguments.length,1);for(var t=FR(this).entries,n=TR(e),r=[],i=0;i<t.length;i++)t[i].key===n&&ZR(r,t[i].value);return r},has:function(e){IR(arguments.length,1);for(var t=FR(this).entries,n=TR(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){IR(arguments.length,1);for(var n,r=FR(this),i=r.entries,o=!1,a=TR(e),s=TR(t),l=0;l<i.length;l++)(n=i[l]).key===a&&(o?eD(i,l--,1):(o=!0,n.value=s));o||ZR(i,{key:a,value:s}),cR||(this.length=i.length),r.updateURL()},sort:function(){var e=FR(this);RR(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=FR(this).entries,r=wR(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new fD(this,"keys")},values:function(){return new fD(this,"values")},entries:function(){return new fD(this,"entries")}},{enumerable:!0}),fR(vD,DR,vD.entries,{name:"entries"}),fR(vD,"toString",(function(){return FR(this).serialize()}),{enumerable:!0}),cR&&dR(vD,"size",{get:function(){return FR(this).entries.length},configurable:!0,enumerable:!0}),vR(pD,OR),aR({global:!0,constructor:!0,forced:!hR},{URLSearchParams:pD}),!hR&&_R(GR)){var gD=uR(zR.has),yD=uR(zR.set),mD=function(e){if(SR(e)){var t,n=e.body;if(kR(n)===OR)return t=e.headers?new GR(e.headers):new GR,gD(t,"content-type")||yD(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),CR(e,{body:AR(0,TR(n)),headers:AR(0,t)})}return e};if(_R(VR)&&aR({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return VR(e,arguments.length>1?mD(arguments[1]):{})}}),_R(HR)){var _D=function(e){return mR(this,jR),new HR(e,arguments.length>1?mD(arguments[1]):{})};jR.constructor=_D,_D.prototype=jR,aR({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_D})}}var bD,wD=Dn,kD=D,ED=HI,SD=s,TD=Qt,CD=_,AD=ao,xD=lo,PD=Jf,ID=tt,RD=TE,DD=Ty,OD=Ji,MD=pc.codeAt,LD=function(e){var t,n,r=[],i=tR(eR(nR(e),KI,"."),".");for(t=0;t<i.length;t++)n=i[t],QI(r,XI(zI,n)?"xn--"+oR(n):n);return JI(r,".")},FD=$r,UD=Oo,BD=ud,ND={URLSearchParams:pD,getState:FR},VD=Yo,HD=VD.set,GD=VD.getterFor("URL"),jD=ND.URLSearchParams,zD=ND.getState,KD=SD.URL,WD=SD.TypeError,qD=SD.parseInt,XD=Math.floor,YD=Math.pow,$D=CD("".charAt),ZD=CD(/./.exec),JD=CD([].join),QD=CD(1..toString),eO=CD([].pop),tO=CD([].push),nO=CD("".replace),rO=CD([].shift),iO=CD("".split),oO=CD("".slice),aO=CD("".toLowerCase),sO=CD([].unshift),lO="Invalid scheme",uO="Invalid host",cO="Invalid port",hO=/[a-z]/i,fO=/[\d+-.a-z]/i,dO=/\d/,pO=/^0x/i,vO=/^[0-7]+$/,gO=/^\d+$/,yO=/^[\da-f]+$/i,mO=/[\0\t\n\r #%/:<>?@[\\\]^|]/,_O=/[\0\t\n\r #/:<>?@[\\\]^|]/,bO=/^[\u0000-\u0020]+/,wO=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,kO=/[\t\n\r]/g,EO=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)sO(t,e%256),e=XD(e/256);return JD(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=QD(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},SO={},TO=RD({},SO,{" ":1,'"':1,"<":1,">":1,"`":1}),CO=RD({},TO,{"#":1,"?":1,"{":1,"}":1}),AO=RD({},CO,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),xO=function(e,t){var n=MD(e,0);return n>32&&n<127&&!ID(t,e)?e:encodeURIComponent(e)},PO={ftp:21,file:null,http:80,https:443,ws:80,wss:443},IO=function(e,t){var n;return 2==e.length&&ZD(hO,$D(e,0))&&(":"==(n=$D(e,1))||!t&&"|"==n)},RO=function(e){var t;return e.length>1&&IO(oO(e,0,2))&&(2==e.length||"/"===(t=$D(e,2))||"\\"===t||"?"===t||"#"===t)},DO=function(e){return"."===e||"%2e"===aO(e)},OO={},MO={},LO={},FO={},UO={},BO={},NO={},VO={},HO={},GO={},jO={},zO={},KO={},WO={},qO={},XO={},YO={},$O={},ZO={},JO={},QO={},eM=function(e,t,n){var r,i,o,a=FD(e);if(t){if(i=this.parse(a))throw WD(i);this.searchParams=null}else{if(void 0!==n&&(r=new eM(n,!0)),i=this.parse(a,null,r))throw WD(i);(o=zD(new jD)).bindURL(this),this.searchParams=o}};eM.prototype={type:"URL",parse:function(e,t,n){var r,i,o,a,s,l=this,u=t||OO,c=0,h="",f=!1,d=!1,p=!1;for(e=FD(e),t||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,e=nO(e,bO,""),e=nO(e,wO,"$1")),e=nO(e,kO,""),r=DD(e);c<=r.length;){switch(i=r[c],u){case OO:if(!i||!ZD(hO,i)){if(t)return lO;u=LO;continue}h+=aO(i),u=MO;break;case MO:if(i&&(ZD(fO,i)||"+"==i||"-"==i||"."==i))h+=aO(i);else{if(":"!=i){if(t)return lO;h="",u=LO,c=0;continue}if(t&&(l.isSpecial()!=ID(PO,h)||"file"==h&&(l.includesCredentials()||null!==l.port)||"file"==l.scheme&&!l.host))return;if(l.scheme=h,t)return void(l.isSpecial()&&PO[l.scheme]==l.port&&(l.port=null));h="","file"==l.scheme?u=WO:l.isSpecial()&&n&&n.scheme==l.scheme?u=FO:l.isSpecial()?u=VO:"/"==r[c+1]?(u=UO,c++):(l.cannotBeABaseURL=!0,tO(l.path,""),u=ZO)}break;case LO:if(!n||n.cannotBeABaseURL&&"#"!=i)return lO;if(n.cannotBeABaseURL&&"#"==i){l.scheme=n.scheme,l.path=OD(n.path),l.query=n.query,l.fragment="",l.cannotBeABaseURL=!0,u=QO;break}u="file"==n.scheme?WO:BO;continue;case FO:if("/"!=i||"/"!=r[c+1]){u=BO;continue}u=HO,c++;break;case UO:if("/"==i){u=GO;break}u=$O;continue;case BO:if(l.scheme=n.scheme,i==bD)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.query=n.query;else if("/"==i||"\\"==i&&l.isSpecial())u=NO;else if("?"==i)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.query="",u=JO;else{if("#"!=i){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.path.length--,u=$O;continue}l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=OD(n.path),l.query=n.query,l.fragment="",u=QO}break;case NO:if(!l.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,u=$O;continue}u=GO}else u=HO;break;case VO:if(u=HO,"/"!=i||"/"!=$D(h,c+1))continue;c++;break;case HO:if("/"!=i&&"\\"!=i){u=GO;continue}break;case GO:if("@"==i){f&&(h="%40"+h),f=!0,o=DD(h);for(var v=0;v<o.length;v++){var g=o[v];if(":"!=g||p){var y=xO(g,AO);p?l.password+=y:l.username+=y}else p=!0}h=""}else if(i==bD||"/"==i||"?"==i||"#"==i||"\\"==i&&l.isSpecial()){if(f&&""==h)return"Invalid authority";c-=DD(h).length+1,h="",u=jO}else h+=i;break;case jO:case zO:if(t&&"file"==l.scheme){u=XO;continue}if(":"!=i||d){if(i==bD||"/"==i||"?"==i||"#"==i||"\\"==i&&l.isSpecial()){if(l.isSpecial()&&""==h)return uO;if(t&&""==h&&(l.includesCredentials()||null!==l.port))return;if(a=l.parseHost(h))return a;if(h="",u=YO,t)return;continue}"["==i?d=!0:"]"==i&&(d=!1),h+=i}else{if(""==h)return uO;if(a=l.parseHost(h))return a;if(h="",u=KO,t==zO)return}break;case KO:if(!ZD(dO,i)){if(i==bD||"/"==i||"?"==i||"#"==i||"\\"==i&&l.isSpecial()||t){if(""!=h){var m=qD(h,10);if(m>65535)return cO;l.port=l.isSpecial()&&m===PO[l.scheme]?null:m,h=""}if(t)return;u=YO;continue}return cO}h+=i;break;case WO:if(l.scheme="file","/"==i||"\\"==i)u=qO;else{if(!n||"file"!=n.scheme){u=$O;continue}if(i==bD)l.host=n.host,l.path=OD(n.path),l.query=n.query;else if("?"==i)l.host=n.host,l.path=OD(n.path),l.query="",u=JO;else{if("#"!=i){RO(JD(OD(r,c),""))||(l.host=n.host,l.path=OD(n.path),l.shortenPath()),u=$O;continue}l.host=n.host,l.path=OD(n.path),l.query=n.query,l.fragment="",u=QO}}break;case qO:if("/"==i||"\\"==i){u=XO;break}n&&"file"==n.scheme&&!RO(JD(OD(r,c),""))&&(IO(n.path[0],!0)?tO(l.path,n.path[0]):l.host=n.host),u=$O;continue;case XO:if(i==bD||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&IO(h))u=$O;else if(""==h){if(l.host="",t)return;u=YO}else{if(a=l.parseHost(h))return a;if("localhost"==l.host&&(l.host=""),t)return;h="",u=YO}continue}h+=i;break;case YO:if(l.isSpecial()){if(u=$O,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=bD&&(u=$O,"/"!=i))continue}else l.fragment="",u=QO;else l.query="",u=JO;break;case $O:if(i==bD||"/"==i||"\\"==i&&l.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=aO(s=h))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(l.shortenPath(),"/"==i||"\\"==i&&l.isSpecial()||tO(l.path,"")):DO(h)?"/"==i||"\\"==i&&l.isSpecial()||tO(l.path,""):("file"==l.scheme&&!l.path.length&&IO(h)&&(l.host&&(l.host=""),h=$D(h,0)+":"),tO(l.path,h)),h="","file"==l.scheme&&(i==bD||"?"==i||"#"==i))for(;l.path.length>1&&""===l.path[0];)rO(l.path);"?"==i?(l.query="",u=JO):"#"==i&&(l.fragment="",u=QO)}else h+=xO(i,CO);break;case ZO:"?"==i?(l.query="",u=JO):"#"==i?(l.fragment="",u=QO):i!=bD&&(l.path[0]+=xO(i,SO));break;case JO:t||"#"!=i?i!=bD&&("'"==i&&l.isSpecial()?l.query+="%27":l.query+="#"==i?"%23":xO(i,SO)):(l.fragment="",u=QO);break;case QO:i!=bD&&(l.fragment+=xO(i,TO))}c++}},parseHost:function(e){var t,n,r;if("["==$D(e,0)){if("]"!=$D(e,e.length-1))return uO;if(t=function(e){var t,n,r,i,o,a,s,l=[0,0,0,0,0,0,0,0],u=0,c=null,h=0,f=function(){return $D(e,h)};if(":"==f()){if(":"!=$D(e,1))return;h+=2,c=++u}for(;f();){if(8==u)return;if(":"!=f()){for(t=n=0;n<4&&ZD(yO,f());)t=16*t+qD(f(),16),h++,n++;if("."==f()){if(0==n)return;if(h-=n,u>6)return;for(r=0;f();){if(i=null,r>0){if(!("."==f()&&r<4))return;h++}if(!ZD(dO,f()))return;for(;ZD(dO,f());){if(o=qD(f(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;h++}l[u]=256*l[u]+i,2!=++r&&4!=r||u++}if(4!=r)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;l[u++]=t}else{if(null!==c)return;h++,c=++u}}if(null!==c)for(a=u-c,u=7;0!=u&&a>0;)s=l[u],l[u--]=l[c+a-1],l[c+--a]=s;else if(8!=u)return;return l}(oO(e,1,-1)),!t)return uO;this.host=t}else if(this.isSpecial()){if(e=LD(e),ZD(mO,e))return uO;if(t=function(e){var t,n,r,i,o,a,s,l=iO(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=l[r]))return e;if(o=10,i.length>1&&"0"==$D(i,0)&&(o=ZD(pO,i)?16:8,i=oO(i,8==o?1:2)),""===i)a=0;else{if(!ZD(10==o?gO:8==o?vO:yO,i))return e;a=qD(i,o)}tO(n,a)}for(r=0;r<t;r++)if(a=n[r],r==t-1){if(a>=YD(256,5-t))return null}else if(a>255)return null;for(s=eO(n),r=0;r<n.length;r++)s+=n[r]*YD(256,3-r);return s}(e),null===t)return uO;this.host=t}else{if(ZD(_O,e))return uO;for(t="",n=DD(e),r=0;r<n.length;r++)t+=xO(n[r],SO);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return ID(PO,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&IO(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=n+(r?":"+r:"")+"@"),u+=EO(i),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+JD(a,"/"):"",null!==s&&(u+="?"+s),null!==l&&(u+="#"+l),u},setHref:function(e){var t=this.parse(e);if(t)throw WD(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new tM(e.path[0]).origin}catch(oz){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+EO(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(FD(e)+":",OO)},getUsername:function(){return this.username},setUsername:function(e){var t=DD(FD(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=xO(t[n],AO)}},getPassword:function(){return this.password},setPassword:function(e){var t=DD(FD(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=xO(t[n],AO)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?EO(e):EO(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,jO)},getHostname:function(){var e=this.host;return null===e?"":EO(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,zO)},getPort:function(){var e=this.port;return null===e?"":FD(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=FD(e))?this.port=null:this.parse(e,KO))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+JD(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,YO))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=FD(e))?this.query=null:("?"==$D(e,0)&&(e=oO(e,1)),this.query="",this.parse(e,JO)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=FD(e))?("#"==$D(e,0)&&(e=oO(e,1)),this.fragment="",this.parse(e,QO)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var tM=function(e){var t=PD(this,nM),n=BD(arguments.length,1)>1?arguments[1]:void 0,r=HD(t,new eM(e,!1,n));kD||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},nM=tM.prototype,rM=function(e,t){return{get:function(){return GD(this)[e]()},set:t&&function(e){return GD(this)[t](e)},configurable:!0,enumerable:!0}};if(kD&&(xD(nM,"href",rM("serialize","setHref")),xD(nM,"origin",rM("getOrigin")),xD(nM,"protocol",rM("getProtocol","setProtocol")),xD(nM,"username",rM("getUsername","setUsername")),xD(nM,"password",rM("getPassword","setPassword")),xD(nM,"host",rM("getHost","setHost")),xD(nM,"hostname",rM("getHostname","setHostname")),xD(nM,"port",rM("getPort","setPort")),xD(nM,"pathname",rM("getPathname","setPathname")),xD(nM,"search",rM("getSearch","setSearch")),xD(nM,"searchParams",rM("getSearchParams")),xD(nM,"hash",rM("getHash","setHash"))),AD(nM,"toJSON",(function(){return GD(this).serialize()}),{enumerable:!0}),AD(nM,"toString",(function(){return GD(this).serialize()}),{enumerable:!0}),KD){var iM=KD.createObjectURL,oM=KD.revokeObjectURL;iM&&AD(tM,"createObjectURL",TD(iM,KD)),oM&&AD(tM,"revokeObjectURL",TD(oM,KD))}UD(tM,"URL"),wD({global:!0,constructor:!0,forced:!ED,sham:!kD},{URL:tM});var aM=Dn,sM=l,lM=ud,uM=$r,cM=HI,hM=ue("URL");aM({target:"URL",stat:!0,forced:!(cM&&sM((function(){hM.canParse()})))},{canParse:function(e){var t=lM(arguments.length,1),n=uM(e),r=t<2||void 0===arguments[1]?void 0:uM(arguments[1]);try{return!!new hM(n,r)}catch(oz){return!1}}});var fM=o(ie.URL),dM=function(){function e(t){AS(this,e),this.config=t.config,this.parent=t.root,this.root=kC.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var n=this.config.maxHeight;n&&this.setStyle({maxHeight:n}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var r="touch"===this.config.domEventType?"touchend":"click";this._delegates=QA.delegate.call(this,this.root,"li",r,this.onItemClick)}return PS(e,[{key:"renderItemList",value:function(e){var t,n=this,r=this.config,i=this.root;(e?r.data=e:e=r.data,r.style)&&Vw(t=dk(r.style)).call(t,(function(e){i.style[e]=r[e]}));e.length>0&&(this.attrKeys=dk(e[0])),this.root.innerHTML="",Vw(e).call(e,(function(e,t){var r=e.selected?"option-item selected":"option-item";e["data-index"]=t,n.root.appendChild(kC.createDom("li","<span>".concat(e.showText,"</span>"),e,r))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&kC.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,r=this.root.querySelector(".selected");kC.addClass(t,"selected"),r&&kC.removeClass(r,"selected"),n(e,{from:r?this.getAttrObj(r,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};Vw(t).call(t,(function(t){n[t]=e.getAttribute(t)}));var r=e.getAttribute("data-index");return r&&(n.index=Number(r)),n}},{key:"show",value:function(){kC.removeClass(this.root,"hide"),kC.addClass(this.root,"active")}},{key:"hide",value:function(){kC.removeClass(this.root,"active"),kC.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;dk(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){var e;this._delegates&&(Vw(e=this._delegates).call(e,(function(e){e.destroy&&e.destroy()})),this._delegates=null);this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),pM=ie,vM=p;pM.JSON||(pM.JSON={stringify:JSON.stringify});var gM=function(e,t,n){return vM(pM.JSON.stringify,null,arguments)},yM=o(gM),mM=o(uo.f("toStringTag")),_M=Dn,bM=C;R.f;var wM=Hn,kM=$r,EM=$w,SM=Z,TM=Jw,CM=bM("".startsWith),AM=bM("".slice),xM=Math.min;_M({target:"String",proto:!0,forced:!TM("startsWith")},{startsWith:function(e){var t=kM(SM(this));EM(e);var n=wM(xM(arguments.length>1?arguments[1]:void 0,t.length)),r=kM(e);return CM?CM(t,r,n):AM(t,n,n+r.length)===r}});var PM=Wc("String").startsWith,IM=ce,RM=PM,DM=String.prototype,OM=o((function(e){var t=e.startsWith;return"string"==typeof e||e===DM||IM(DM,e)&&t===DM.startsWith?RM:t})),MM=Je,LM=ti,FM=jn,UM=function(e){for(var t=MM(this),n=FM(t),r=arguments.length,i=LM(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:LM(o,n);a>i;)t[i++]=e;return t};Dn({target:"Array",proto:!0},{fill:UM});var BM,NM=Wc("Array").fill,VM=ce,HM=NM,GM=Array.prototype,jM=o((function(e){var t=e.fill;return e===GM||VM(GM,e)&&t===GM.fill?HM:t})),zM={SEI:"sei",PLAYER_CREATE_FINISH:"playerCreateFinish",FALLBACK_ERROR:"fallbackError",FALLBACK:"fallback",AUTOPLAY_STARTED:"autoplayStarted",AUTOPLAY_PREVENTED:"autoplayWasPrevented",DOWNLOAD_SPEED_CHANGE:"downloadSpeedChange",FULLSCREEN_CHANGE:"fullscreenChange",CSS_FULLSCREEN_CHANGE:"cssFullscreenChange",MINI_STATE_CHANGE:"miniStateChange",DEFINITION_CHANGE:"definitionChange",BEFORE_DEFINITION_CHANGE:"beforeDefinitionChange",AFTER_DEFINITION_CHANGE:"afterDefinitionChange",VIDEO_RESIZE:"videoResize",PIP_CHANGE:"pipChange",USER_ACTION:"userAction",AUTOPLAY_UNMUTE:"autoplayUnmute",LONG_WAITING:"longWaiting",DEFINITION_FALLBACK:"definitionFallback",AUTOPLAY_FAIL:"autoplayFail",AUTOPLAY_SUCCESS:"autoplaySuccess",ERROR_REFRESH_CLICK:"errorRefreshClick",SOURCE_CHANGE:"sourceChange",ABR_SWITCH_START:"abrSwitchStart",ABR_SWITCH_SUCCESS:"abrSwitchSuccess",ABR_SWITCH_FAILED:"abrSwitchFailed"},KM=Mm(Mm({},kA),zM),WM=(Uy(BM={},zM.SEI,{event:"core_event",shouldCallback:function(e){return"core.sei"===(null==e?void 0:e.eventName)}}),Uy(BM,zM.AUTOPLAY_STARTED,{event:$C}),Uy(BM,zM.AUTOPLAY_PREVENTED,{event:ZC}),Uy(BM,zM.FULLSCREEN_CHANGE,{event:aA}),Uy(BM,zM.CSS_FULLSCREEN_CHANGE,{event:sA}),Uy(BM,zM.MINI_STATE_CHANGE,{event:lA}),Uy(BM,zM.DEFINITION_CHANGE,{event:uA}),Uy(BM,zM.BEFORE_DEFINITION_CHANGE,{event:cA}),Uy(BM,zM.AFTER_DEFINITION_CHANGE,{event:hA}),Uy(BM,zM.VIDEO_RESIZE,{event:dA}),Uy(BM,zM.PIP_CHANGE,{event:pA}),Uy(BM,zM.USER_ACTION,{event:yA}),Uy(BM,zM.DOWNLOAD_SPEED_CHANGE,{event:nA}),Uy(BM,zM.ABR_SWITCH_START,{event:"switch_definition_start"}),Uy(BM,zM.ABR_SWITCH_SUCCESS,{event:"switch_definition_success"}),Uy(BM,zM.ABR_SWITCH_FAILED,{event:"switch_definition_fail"}),BM);var qM=/["'&<>]/;function XM(e,t){return function(e){if(ly(e))return e}(e)||function(e,t){var n=null==e?null:void 0!==oc&&hy(e)||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(ph(s).call(s,r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||Py(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var YM=D,$M=_,ZM=yi,JM=ee,QM=$M(F.f),eL=$M([].push),tL=function(e){return function(t){for(var n,r=JM(t),i=ZM(r),o=i.length,a=0,s=[];o>a;)n=i[a++],YM&&!QM(r,n)||eL(s,e?[n,r[n]]:r[n]);return s}},nL={entries:tL(!0),values:tL(!1)},rL=nL.entries;Dn({target:"Object",stat:!0},{entries:function(e){return rL(e)}});var iL=o(ie.Object.entries);var oL=Me,aL=Je,sL=q,lL=jn,uL=TypeError,cL=function(e){return function(t,n,r,i){oL(n);var o=aL(t),a=sL(o),s=lL(o),l=e?s-1:0,u=e?-1:1;if(r<2)for(;;){if(l in a){i=a[l],l+=u;break}if(l+=u,e?l<0:s<=l)throw uL("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=u)l in a&&(i=n(i,a[l],l,o));return i}},hL={left:cL(!1),right:cL(!0)}.left;Dn({target:"Array",proto:!0,forced:!zf&&me>79&&me<83||!Gc("reduce")},{reduce:function(e){var t=arguments.length;return hL(this,e,t,t>1?arguments[1]:void 0)}});var fL=Wc("Array").reduce,dL=ce,pL=fL,vL=Array.prototype,gL=o((function(e){var t=e.reduce;return e===vL||dL(vL,e)&&t===vL.reduce?pL:t}));var yL=function(){function e(t){var n;Ry(this,e),Uy(this,"definition",void 0),Uy(this,"source",void 0),Uy(this,"text",void 0),Uy(this,"fallbackUrl",void 0),Uy(this,"urls",void 0),Uy(this,"_currentUrlRef",void 0);var r=t.url,i=t.definition,o=t.text,a=t.source,s=t.fallbackUrls;this.definition=i,this.text=o,this.source=a,this.urls=Nm(n=[r]).call(n,Iy(null!=s?s:[])),this.fallbackUrl=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={url:e[0],next:null},n=t,r=1;r<e.length;r++){var i=r===e.length-1?t:null,o={url:e[r],next:i};n.next=o,n=o}return t}(this.urls),this._currentUrlRef=this.fallbackUrl}return Fy(e,[{key:"url",get:function(){return this._currentUrlRef.url},set:function(e){this._currentUrlRef.url=e}},{key:"next",value:function(){var e=this._currentUrlRef.next;return e&&(this._currentUrlRef=e),this._currentUrlRef}}]),e}(),mL=function(){function e(t,n,r){var i=this;Ry(this,e),Uy(this,"name",void 0),Uy(this,"text",void 0),Uy(this,"definitions",void 0),this.definitions=Vw(t).call(t,(function(e){return new yL(AE({},e,{source:i}))})),this.name=n,this.text=r}return Fy(e,[{key:"defaultDefinition",get:function(){return this.definitions[0]}},{key:"add",value:function(e){this.definitions.push(e)}}],[{key:"normalize",value:function(t){if(void 0===t)throw new Error('"input" cannot be undefined');var n=void 0,r=void 0,i=void 0;if("string"==typeof t?n=t:Array.isArray(t)?i=t:(n=t.url,r=t.fallbackUrls,i=t.sources),"string"==typeof n)return e.normalizeUrl(n,r);if(Array.isArray(i)){if(0===i.length)throw new Error('"sources" cannot be an empty array');return Vw(i).call(i,(function(t){var n;return new e(Vw(n=t.definitions).call(n,(function(e){return"string"==typeof e?{url:e,definition:"unknown"}:e})),t.name,t.text)}))}return[]}},{key:"normalizeUrl",value:function(t,n){var r=new e([],"unknown");return r.add(new yL({definition:"unknown",url:t,source:r,fallbackUrls:n})),[r]}}]),e}(),_L=function(){function e(t){var n,r,i,o;Ry(this,e),Uy(this,"defaultSource",void 0),Uy(this,"defaultDefinition",void 0),Uy(this,"maxFallbackRound",void 0),Uy(this,"_currentDefinition",void 0),Uy(this,"_sources",void 0),Uy(this,"_fallbackCount",0);var a=t.url,s=t.defaultDefinition,l=t.defaultSource,u=t.sources,c=t.maxFallbackRound;this.defaultDefinition=s,this.defaultSource=l,this.maxFallbackRound=null!=c?c:1,this._sources=u;var h=a?Xm(this).call(this,a):null===(n=Xm(r=this.sources).call(r,(function(e){return void 0===l||e.name===l})))||void 0===n?void 0:Xm(i=n.definitions).call(i,(function(e){return void 0===s||e.definition===s}));this._currentDefinition=null!=h?h:null===(o=this._sources)||void 0===o||null===(o=o[0])||void 0===o||null===(o=o.definitions)||void 0===o?void 0:o[0]}return Fy(e,[{key:"sources",get:function(){return this._sources}},{key:"definition",get:function(){return this._currentDefinition}},{key:"source",get:function(){var e;return null===(e=this.definition)||void 0===e?void 0:e.source}},{key:"url",get:function(){var e;return null===(e=this.definition)||void 0===e?void 0:e.url},set:function(e){this.definition&&(this.definition.url=e)}},{key:"find",value:function(e,t){var n,r,i,o,a,s=this;if("string"==typeof e)return Xm(o=gL(a=this.sources).call(a,(function(e,t){return Nm(e).call(e,t.definitions)}),[])).call(o,(function(t){return t.url===e}));var l=Xm(n=this.sources).call(n,(function(t){var n,r;return t.name===(null!==(n=null==e?void 0:e.source)&&void 0!==n?n:null===(r=s.source)||void 0===r?void 0:r.name)})),u=null==l?void 0:Xm(r=l.definitions).call(r,(function(t){var n,r;return t.definition===(null!==(n=null==e?void 0:e.definition)&&void 0!==n?n:null===(r=s.definition)||void 0===r?void 0:r.definition)}));return u||(null!=t&&t.fallbackToFirstDefinition&&null!=l&&null!==(i=l.definitions)&&void 0!==i&&i.length?null==l?void 0:l.definitions[0]:void 0)}},{key:"fallback",value:function(){var e;if(this._fallbackCount++,!(this._fallbackCount>=this.maxFallbackRound*this.definition.urls.length)){var t=null===(e=this._currentDefinition)||void 0===e?void 0:e.next();return null==t?void 0:t.url}this.resetFallback()}},{key:"switch",value:function(e){return this._currentDefinition=e,this.resetFallback(),e}},{key:"updateSources",value:function(e,t){var n,r,i,o,a;return this._sources=mL.normalize(e),this._currentDefinition=null!==(n=Xm(this).call(this,null!=t?t:{source:null!==(r=this.defaultSource)&&void 0!==r?r:null===(i=this._currentDefinition)||void 0===i?void 0:i.source.name,definition:null!==(o=this.defaultDefinition)&&void 0!==o?o:null===(a=this._currentDefinition)||void 0===a?void 0:a.definition}))&&void 0!==n?n:this._sources[0].definitions[0],this.resetFallback(),this}},{key:"resetFallback",value:function(){this._fallbackCount=0}}]),e}();function bL(){var e;"undefined"!=typeof Reflect&&_S?bL=rP(e=_S).call(e):bL=function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=aP(e)););return e}(e,t);if(r){var i=mm(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}};return bL.apply(this,arguments)}function wL(){return(new DOMParser).parseFromString('<svg width="150" height="162" viewBox="0 0 150 162" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M127.718 112.831H6.13675C4.19663 112.831 2.25651 108.974 2.90322 104.475C3.54993 99.9761 8.07687 99.9761 13.8972 99.9761C11.9571 97.4052 9.37028 88.4069 15.8373 81.3369C22.3044 74.2668 25.5379 74.2668 34.5918 75.5526C33.9451 63.9837 47.526 34.4178 77.2744 35.0605C107.023 35.7032 116.077 54.3421 119.957 63.3404C129.011 62.6976 147.765 66.554 149.706 87.1214C151.258 103.575 135.694 111.117 127.718 112.831Z" fill="#F1F4F8"/>\n<path d="M44.9346 91.6022L43.6782 99.8032" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M47.3545 125.695L48.6109 117.494" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M31.5347 97.7378L38.7295 101.869" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M60.7544 119.559L53.5595 115.428" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M69.6755 44.5318L138.35 26.0209C139.115 25.8148 139.804 26.5367 139.563 27.2909L121.081 85.1146C120.982 85.4243 120.739 85.6665 120.429 85.7641L52.0645 107.28C51.2996 107.521 50.5766 106.809 50.8062 106.04L68.9776 45.2111C69.0768 44.879 69.3409 44.622 69.6755 44.5318Z" fill="#D0D6E0" stroke="#D0D6E0" stroke-width="4" stroke-linecap="round"/>\n<path d="M83.1285 52.7415C91.6454 54.3438 107.322 62.0019 101.894 79.8155" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<path d="M84.138 62.3385C88.3894 63.1384 96.2148 66.9611 93.5053 75.8531" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<ellipse cx="83.6417" cy="71.98" rx="3.08443" ry="3.07025" transform="rotate(12.6375 83.6417 71.98)" fill="white"/>\n<path d="M43.4699 110.358C39.5425 109.114 30.6316 108.203 26.4077 114.511C21.1278 122.397 36.5031 152.755 2.11053 160.141" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n</svg>\n',"image/svg+xml").firstChild}var kL=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_error",void 0),r}return Fy(n,[{key:"_errorTip",get:function(){var e,t,n,r=this.player.config.i18nManager,i=null===(e=this._error)||void 0===e?void 0:e.errorCode;return this.config.errorTipsText?r.normalize(this.config.errorTipsText):Nm(t="".concat(i?"[".concat(i,"] "):"")).call(t,null===(n=this._error)||void 0===n?void 0:n.message)}},{key:"afterCreate",value:function(){this._handleRefresh=this._handleRefresh.bind(this),this._focus=this._focus.bind(this),this._initEvents(),this._initIcons(),"mobile"===PC.device&&this.bind("touchend",this._focus),this.bind(".veplayer-error-refresh","click",this._handleRefresh)}},{key:"registerIcons",value:function(){return{error:{icon:wL,class:"veplayer-error-svg"}}}},{key:"updateLang",value:function(){this.config.showRefresh&&this._renderRefresh(),this._renderExtraTips()}},{key:"showError",value:function(e){this._error=e instanceof vP?e:yP(e),this.config.showErrorTip&&this._renderText(this._errorTip),this._renderExtraTips(),bL(aP(n.prototype),"show",this).call(this)}},{key:"hideError",value:function(){bL(aP(n.prototype),"hide",this).call(this)}},{key:"destroy",value:function(){"mobile"===PC.device&&this.unbind("touchend",this._focus),this.unbind(".veplayer-error-refresh","click",this._handleRefresh),this.off(KM.FALLBACK_ERROR,this.showError.bind(this)),this.off(HC,this.hideError.bind(this))}},{key:"render",value:function(){var e,t=this.player.config.i18nManager;return Nm(e='<veplayer-error class="veplayer-error">\n <div class="veplayer-error-cover">\n '.concat(this.config.showErrorImg?'<div class="veplayer-error-img"></div>':"",'\n <div class="veplayer-error-tips"></div>\n ')).call(e,this.config.showRefresh?'<div class="veplayer-error-refresh">'.concat(t.getText("ERROR_REFRESH"),"</div>"):"",'\n <div class="veplayer-error-extra"></div>\n </div>\n </veplayer-error>')}},{key:"_focus",value:function(){this.player.focus({autoHide:!0})}},{key:"_initIcons",value:function(){this.config.showErrorImg&&this.appendChild(".veplayer-error-img",this.icons.error)}},{key:"_initEvents",value:function(){this.on(KM.FALLBACK_ERROR,this.showError.bind(this)),this.on(HC,this.hideError.bind(this)),this.on(MC,this.hideError.bind(this)),this.on(fA,this.hideError.bind(this))}},{key:"_renderText",value:function(e){var t=Xm(this).call(this,".veplayer-error-tips");t&&(t.innerText=e)}},{key:"_renderExtraTips",value:function(){var e,t=this,n=Xm(this).call(this,".veplayer-error-extra");n&&(n.innerHTML="");var r=this.player.config.i18nManager;null===(e=this.config.extraTips)||void 0===e||e.forEach((function(e){if(e){var n,i=kC.createDom("div",Nm(n="".concat(r.normalize(e.label),": ")).call(n,r.normalize(e.value)),void 0,"veplayer-error-detail-info");t.appendChild(".veplayer-error-extra",i)}}))}},{key:"_handleRefresh",value:function(){var e,t;null===(e=this.player)||void 0===e||e.emit(KM.ERROR_REFRESH_CLICK),null===(t=this.player)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.veplayer)||void 0===t||t.retry(),this.hideError()}},{key:"_renderRefresh",value:function(){var e,t=this.player.config.i18nManager,n=Xm(this).call(this,".veplayer-error-refresh");n&&(n.innerHTML=null!==(e=t.getText("ERROR_REFRESH"))&&void 0!==e?e:"")}}],[{key:"pluginName",get:function(){return"error"}},{key:"defaultConfig",get:function(){return{showErrorImg:!0,showErrorTip:!0,showRefresh:!0,errorTipsText:"",extraTips:[],position:QA.POSITIONS.ROOT}}}]),n}(QA),EL=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_toastNumber",0),Uy(Yx(r),"_toastMap",{}),r}return Fy(n,[{key:"toast",value:function(e,t){var n=this,r=t||{},i=r.duration,o=void 0===i?2e3:i,a=r.closable,s=void 0!==a&&a,l=this._toastNumber+1;this._toastNumber=l;var u=this._renderToast(e,s,l);return this.root.appendChild(u),this._toastMap[l]=u,setTimeout((function(){n.remove(l)}),o),l}},{key:"remove",value:function(e){var t=this._toastMap[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this._toastMap[e])}},{key:"render",value:function(){return'<veplayer-toast class="veplayer-toast"></veplayer-toast>'}},{key:"_renderToast",value:function(e,t,n){var r=this,i=kC.createDom("div","",void 0,"veplayer-toast-container"),o=kC.checkIsObject(e)?e:kC.createDom("div",e,void 0,"veplayer-toast-txt");if(i.appendChild(o),t){var a=kC.createDom("span","×",void 0,"veplayer-toast-close");a.addEventListener("click",(function(){r.remove(n)})),i.appendChild(a)}return i}}],[{key:"pluginName",get:function(){return"toast"}},{key:"defaultConfig",get:function(){return{index:5}}}]),n}(QA);function SL(){return(new DOMParser).parseFromString('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7123 1C11.85 1 11.1173 1.55472 10.8516 2.32675L4.94973 2.32675C3.16413 2.32675 1.71662 3.77427 1.71662 5.55987C1.71662 7.34547 3.16413 8.79298 4.94973 8.79298L11.0483 8.79298L11.1134 8.79418C11.9936 8.82748 12.697 9.55166 12.697 10.44C12.697 11.3497 11.9596 12.0871 11.05 12.0871H5.01323C4.67882 11.4781 4.03143 11.0654 3.28763 11.0654C2.20111 11.0654 1.32031 11.9462 1.32031 13.0327C1.32031 14.1192 2.20111 15 3.28763 15C4.14992 15 4.88264 14.4452 5.14834 13.6732H11.05C12.8356 13.6732 14.2831 12.2256 14.2831 10.44C14.2831 8.65444 12.8356 7.20693 11.05 7.20693L4.94973 7.20693C4.04009 7.20693 3.30267 6.46951 3.30267 5.55987C3.30267 4.65022 4.04009 3.91281 4.94973 3.91281L10.9866 3.91281C11.321 4.52183 11.9685 4.93464 12.7123 4.93464C13.7988 4.93464 14.6796 4.05384 14.6796 2.96732C14.6796 1.8808 13.7988 1 12.7123 1ZM12.7123 2.18954C12.2827 2.18954 11.9345 2.53777 11.9345 2.96732C11.9345 3.39688 12.2827 3.7451 12.7123 3.7451C13.1418 3.7451 13.4901 3.39688 13.4901 2.96732C13.4901 2.53777 13.1418 2.18954 12.7123 2.18954ZM2.50986 13.0327C2.50986 12.6031 2.85808 12.2549 3.28763 12.2549C3.71719 12.2549 4.06541 12.6031 4.06541 13.0327C4.06541 13.4622 3.71719 13.8105 3.28763 13.8105C2.85808 13.8105 2.50986 13.4622 2.50986 13.0327Z" fill="#FFFFFF"/>\n</svg>',"image/svg+xml").firstChild}var TL=function(){function e(t){Ry(this,e),Uy(this,"_root",void 0),Uy(this,"_config",void 0),Uy(this,"_parent",void 0),Uy(this,"_listDom",void 0),Uy(this,"_container",void 0),Uy(this,"_titleDom",void 0),Uy(this,"_player",void 0),Uy(this,"_delegates",void 0),Uy(this,"_listType",void 0);var n=t.config,r=t.root,i=t.player;this._config=n,this._parent=r,this._player=i,this._listType=n.listType,this.renderPanel(),this._initEvents(),this._bindDomEvent()}return Fy(e,[{key:"changeMode",value:function(e){this.updatePanel(e),this._listType=e}},{key:"renderItemList",value:function(e){var t,n=this,r=this._config;return e&&(r.list=e),this._listDom||(this._listDom=kC.createDom("div","",{},"item-list-panel-content")),this._listDom.innerHTML="",null===(t=r.list)||void 0===t||Vw(t).call(t,(function(e,t){var r,i,o=e.selected?"panel-item select-in":"panel-item ".concat(null!==(r=e.className)&&void 0!==r?r:"");e["data-index"]=t;var a=kC.createDom("div","",e,o);e.showText&&("string"==typeof e.showText?a.innerHTML=e.showText:a.appendChild(e.showText)),null===(i=n._listDom)||void 0===i||i.appendChild(a)})),this._listDom}},{key:"renderTitle",value:function(){var e,t,n=this._player.config.i18nManager;if(null!==(e=this._config.panel)&&void 0!==e&&e.title&&this._listType!==CL.Inner)return this._titleDom||(this._titleDom=kC.createDom("div","",{},"xg-mobile-panel-title")),this._titleDom.innerHTML=n.normalize(null===(t=this._config.panel)||void 0===t?void 0:t.title),this._titleDom}},{key:"updatePanel",value:function(e){this._root&&kC.removeClass(this._root,"panel-".concat(this._listType)),this._root&&kC.addClass(this._root,"panel-".concat(e));var t="mobile"===PC.device?"touchend":"click";e===CL.Inner?this._container&&this._bind(this._container,t,this._handleHide.bind(this)):this._container&&this._unbind(this._container,t,this._handleHide.bind(this))}},{key:"renderPanel",value:function(){var e,t,n,r=Nm(e="xg-mobile-panel panel-".concat(this._config.listType," ")).call(e,null!==(t=null===(n=this._config)||void 0===n||null===(n=n.panel)||void 0===n?void 0:n.className)&&void 0!==t?t:"");this._root=kC.createDom("div","",{},r),this._parent&&this._parent.appendChild(this._root);var i=this.renderTitle(),o=this.renderItemList();this._container=kC.createDom("div","",{},"xg-mobile-panel-content"),this._root.appendChild(this._container),i&&this._container.appendChild(i),o&&this._container.appendChild(o)}},{key:"show",value:function(){this._root&&(kC.removeClass(this._root,"hide"),kC.addClass(this._root,"active"))}},{key:"hide",value:function(){this._root&&(kC.removeClass(this._root,"active"),kC.addClass(this._root,"hide"))}},{key:"destroy",value:function(){this._parent&&this._root&&this._parent.removeChild(this._root),this._unbindDomEvent(),this._unbindEvents()}},{key:"_bind",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&"on".concat(t)in e&&"function"==typeof n&&e.addEventListener(t,n,r)}},{key:"_unbind",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&"on".concat(t)in e&&"function"==typeof n&&e.removeEventListener(t,n,r)}},{key:"_initEvents",value:function(){var e;this._config.isAutoChange&&(window.addEventListener("orientationchange",this._handleOrientationChange.bind(this)),null===(e=this._player)||void 0===e||e.on(aA,this._handleOrientationChange.bind(this)))}},{key:"_unbindEvents",value:function(){var e;window.removeEventListener("orientationchange",this._handleOrientationChange.bind(this)),null===(e=this._player)||void 0===e||e.off(aA,this._handleOrientationChange.bind(this))}},{key:"_handleOrientationChange",value:function(){var e,t,n,r=hk(e=[90,-90,"90","-90"]).call(e,window.orientation);if(null!==(t=this._player)&&void 0!==t&&t.fullscreen&&r)this.changeMode(CL.Fullscreen);else if(this._listType!==(null===(n=this._config)||void 0===n?void 0:n.listType)){var i;this.changeMode(null===(i=this._config)||void 0===i?void 0:i.listType)}}},{key:"_bindDomEvent",value:function(){var e="mobile"===PC.device?"touchend":"click";this._listType===CL.Inner&&this._container&&this._bind(this._container,e,this._handleHide.bind(this)),this._root&&this._bind(this._root,e,this._handleHide.bind(this)),this._container&&this._bind(this._container,e,this._stopPropagation),this._listDom&&(this._delegates=QA.delegate.call(this,this._listDom,".panel-item",e,this._onItemClick.bind(this),!0))}},{key:"_unbindDomEvent",value:function(){var e,t="mobile"===PC.device?"touchend":"click";(this._root&&this._unbind(this._root,t,this._handleHide.bind(this)),this._container&&this._unbind(this._container,t,this._handleHide.bind(this)),this._container&&this._unbind(this._container,t,this._stopPropagation),this._delegates)&&(Vw(e=this._delegates).call(e,(function(e){e.destroy&&e.destroy()})),this._delegates=null)}},{key:"_stopPropagation",value:function(e){e.stopPropagation(),e.preventDefault()}},{key:"_onItemClick",value:function(e){var t,n,r,i,o=e.delegateTarget,a="function"==typeof this._config.onOptionClick?this._config.onOptionClick:null,s="function"==typeof this._config.onItemClick?this._config.onItemClick:null,l=null===(t=this._root)||void 0===t?void 0:t.querySelector(".selected");kC.addClass(o,"selected"),l&&(kC.removeClass(l,"selected"),i=Number(l.getAttribute("data-index")));var u=Number(o.getAttribute("data-index")),c={from:void 0!==Tc(i)?null===(n=this._config.list)||void 0===n?void 0:n[i]:void 0,to:null===(r=this._config.list)||void 0===r?void 0:r[u]};null==a||a(e,c),o&&i===u||null==s||s(e,c)}},{key:"_handleHide",value:function(e){var t,n;e.stopPropagation(),e.preventDefault(),null===(t=(n=this._config).hide)||void 0===t||t.call(n)}}]),e}(),CL=function(e){return e.Middle="middle",e.Bottom="bottom",e.Fullscreen="fullscreen",e.Inner="inner",e}(CL||{}),AL=function(e){return e.Icon="Icon",e.Text="Text",e}(AL||{}),xL="mobile"===PC.device,PL=["bottom","fullscreen","inner"],IL=["middle"],RL=["bottom","inner","fullscreen"],DL=["bottom","inner","fullscreen"],OL=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),Uy(Yx(r=t.call(this,e)),"optionsList",void 0),Uy(Yx(r),"_isIcon",void 0),Uy(Yx(r),"_isActive",void 0),Uy(Yx(r),"_curIndex",void 0),Uy(Yx(r),"activeEvent",void 0),Uy(Yx(r),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),r.emit("icon_mouseenter",{pluginName:r.pluginName}),r.toggle(!0)})),Uy(Yx(r),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),r.emit("icon_mouseleave",{pluginName:r.pluginName}),r._isActive&&r.toggle(!1)})),r._isIcon=!1,r._isActive=!1,r._curIndex=0,r}return Fy(n,[{key:"updateLang",value:function(){this.config.list&&this.renderItemList(this.config.list,this._curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.config.listType=this._getListType(),this.initIcons(),t.hidePortrait&&kC.addClass(this.root,"portrait"),xL&&this.on(WC,(function(){e._isActive&&(e.optionsList&&e.optionsList.hide(),e._isActive=!1)})),t.list&&this.renderItemList(t.list),this.activeEvent=xL?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=dk(t);if(n.length>0&&"Icon"===this.config.renderType)return n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n])})),void(this._isIcon=!0);var r=this.appendChild(".xgplayer-icon",kC.createDom("span","",{},"icon-text"));r&&kC.addClass(r,"btn-text")}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||this.config.hideOnSingleOption&&1===this.config.list.length||kC.addClass(this.root,"show")}},{key:"hide",value:function(){kC.removeClass(this.root,"show")}},{key:"toggle",value:function(e){if(e!==this._isActive){var t=this.player.controls,n=this.config.listType;e?(n&&hk(RL).call(RL,n)?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(n&&hk(RL).call(RL,n)?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this._isActive=e}}},{key:"onItemClick",value:function(e,t){var n;e.preventDefault(),e.stopPropagation();var r=this.config.listType;this._curIndex=null===(n=t.to)||void 0===n?void 0:n.index,this.changeCurrentText(),(this.config.isItemClickHide||r&&hk(RL).call(RL,r))&&this.toggle(!1)}},{key:"onOptionClick",value:function(e,t){e.preventDefault(),e.stopPropagation()}},{key:"changeCurrentText",value:function(){if(!this._isIcon){var e=this.config.list,t=e&&this._curIndex<e.length?this._curIndex:0,n=null==e?void 0:e[t];if(n){var r,i=Xm(this).call(this,".icon-text"),o=this.player.config.i18nManager;if(i)i.innerHTML=o.normalize(null!==(r=null==n?void 0:n.iconText)&&void 0!==r?r:null==n?void 0:n.text)}}}},{key:"renderItemList",value:function(e,t){var r,i=this,o=this.config,a=this.optionsList,s=this.player;if("number"==typeof t&&(this._curIndex=t),a)return a.renderItemList(e),this.changeCurrentText(),void(a instanceof TL&&a.renderTitle());this.config.isShowIcon&&(this.optionsList=o.listType&&hk(DL).call(DL,o.listType)?new TL({config:{list:e||[],onItemClick:function(e,t){i.onItemClick(e,t)},onOptionClick:function(e,t){i.onOptionClick(e,t)},panel:this.config.panel,listType:null!==(r=o.listType)&&void 0!==r?r:n.defaultConfig.listType,isAutoChange:o.isAutoChange,hide:function(){return i.toggle(!1)}},root:s.root,player:s}):new dM({config:{data:e||[],onItemClick:function(e,t){i.onItemClick(e,t)}},root:this.root}),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.activeEvent&&this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave),this.optionsList&&(this.optionsList.destroy(),this.optionsList=void 0)}},{key:"render",value:function(){return this.config.isShowIcon?'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>'):""}},{key:"_getListType",value:function(){var e,t=this.config.listType;return null!==(e=this.player)&&void 0!==e&&null!==(e=e.config)&&void 0!==e&&e.listType&&(t=this.player.config.listType),xL||t&&hk(PL).call(PL,t)||(t="bottom"),xL||t&&hk(IL).call(IL,t)||(t="middle"),t}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:xL?eU.ROOT_TOP_RIGHT:eU.CONTROLS_RIGHT,listType:xL?"bottom":"middle",index:100,list:[],listStyle:{},hidePortrait:!0,isShowIcon:!1,renderType:xL?"Icon":"Text",isItemClickHide:!0,hideOnSingleOption:!0,isAutoChange:!0}}}]),n}(QA),ML=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"updateLang",value:function(){this.renderItemList()}},{key:"beforeCreate",value:function(e){var t=e.player.config.sources.sourceManager;e.config.list=t.sources}},{key:"afterCreate",value:function(){bL(aP(n.prototype),"afterCreate",this).call(this),this.config.sourceManager.sources.length<2?this.hide():this.renderItemList()}},{key:"registerIcons",value:function(){return{source:{icon:SL}}}},{key:"renderItemList",value:function(){var e=this.config.sourceManager,t=e.sources,r=e.source,i=this.player.config.i18nManager,o=Vw(t).call(t,(function(e){var t;return Mm(Mm({},e),{},{showText:null!==(t=i.normalize(e.text))&&void 0!==t?t:e.name,selected:!1})})),a=wI(o).call(o,(function(e){return e.name===(null==r?void 0:r.name)}));this.config.list=t,a>-1&&(o[a].selected=!0),bL(aP(n.prototype),"renderItemList",this).call(this,o,a)}},{key:"onItemClick",value:function(e,t){var r,i=this;bL(aP(n.prototype),"onItemClick",this).call(this,e,t),null===(r=this.player.config)||void 0===r||r.veplayer.switch({source:t.to.name},{fallbackToFirstDefinition:!0}).catch((function(){i.renderItemList()}))}}],[{key:"pluginName",get:function(){return"sources"}},{key:"defaultConfig",get:function(){return Mm(Mm({},OL.defaultConfig),{},{index:4,panel:{title:{jp:"ライン選ぶ",en:"Line Choose","zh-cn":"线路选择","zh-hk":"線路選擇"}},list:[],className:"xgplayer-sources",hidePortrait:!1,isShowIcon:!0})}},{key:"textTips",get:function(){return{jp:"ライン",en:"Line","zh-cn":"线路","zh-hk":"線路"}}}]),n}(OL);function LL(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 3.8001H4C3.55817 3.8001 3.2 4.15827 3.2 4.6001V12.6001C3.2 13.0419 3.55817 13.4001 4 13.4001H16C16.4418 13.4001 16.8 13.0419 16.8 12.6001V4.6001C16.8 4.15827 16.4418 3.8001 16 3.8001ZM4 2.6001C2.89543 2.6001 2 3.49553 2 4.6001V12.6001C2 13.7047 2.89543 14.6001 4 14.6001H16C17.1046 14.6001 18 13.7047 18 12.6001V4.6001C18 3.49553 17.1046 2.6001 16 2.6001H4ZM5.0249 6.24509V11.6001H5.9024V9.23009H8.6174V11.6001H9.4949V6.24509H8.6174V8.48009H5.9024V6.24509H5.0249ZM10.5474 6.24509V11.6001H12.5049C13.3749 11.6001 14.0274 11.3601 14.4774 10.8801C14.9049 10.4226 15.1224 9.77009 15.1224 8.92259C15.1224 8.06759 14.9049 7.41509 14.4774 6.96509C14.0274 6.48509 13.3749 6.24509 12.5049 6.24509H10.5474ZM11.4249 6.99509H12.3399C13.0074 6.99509 13.4949 7.14509 13.8024 7.45259C14.1024 7.75259 14.2524 8.24759 14.2524 8.92259C14.2524 9.58259 14.1024 10.0701 13.8024 10.3851C13.4949 10.6926 13.0074 10.8501 12.3399 10.8501H11.4249V6.99509ZM4.15 16.1001C3.79101 16.1001 3.5 16.3911 3.5 16.7501C3.5 17.1091 3.79101 17.4001 4.15 17.4001H15.85C16.209 17.4001 16.5 17.1091 16.5 16.7501C16.5 16.3911 16.209 16.1001 15.85 16.1001H4.15Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}var FL={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",a="[object Boolean]",s="[object Date]",l="[object Function]",u="[object GeneratorFunction]",c="[object Map]",h="[object Number]",f="[object Object]",d="[object Promise]",p="[object RegExp]",v="[object Set]",g="[object String]",y="[object Symbol]",m="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",S="[object Int16Array]",T="[object Int32Array]",C="[object Uint8Array]",A="[object Uint8ClampedArray]",x="[object Uint16Array]",P="[object Uint32Array]",I=/\w*$/,R=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,O={};O[o]=O["[object Array]"]=O[_]=O[b]=O[a]=O[s]=O[w]=O[k]=O[E]=O[S]=O[T]=O[c]=O[h]=O[f]=O[p]=O[v]=O[g]=O[y]=O[C]=O[A]=O[x]=O[P]=!0,O["[object Error]"]=O[l]=O[m]=!1;var M="object"==Tc(i)&&i&&i.Object===Object&&i,L="object"==("undefined"==typeof self?"undefined":Tc(self))&&self&&self.Object===Object&&self,F=M||L||Function("return this")(),U=t&&!t.nodeType&&t,B=U&&e&&!e.nodeType&&e,N=B&&B.exports===U;function V(e,t){return e.set(t[0],t[1]),e}function H(e,t){return e.add(t),e}function G(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function j(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}function z(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function K(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var q,X=Array.prototype,Y=Function.prototype,$=Object.prototype,Z=F["__core-js_shared__"],J=(q=/[^.]+$/.exec(Z&&fE(Z)&&fE(Z).IE_PROTO||""))?"Symbol(src)_1."+q:"",Q=Y.toString,ee=$.hasOwnProperty,te=$.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=N?F.Buffer:void 0,ie=F.Symbol,oe=F.Uint8Array,ae=K(FE,Object),se=Object.create,le=$.propertyIsEnumerable,ue=Lk(X),ce=xE,he=re?re.isBuffer:void 0,fe=K(dk,Object),de=Be(F,"DataView"),pe=Be(F,"Map"),ve=Be(F,"Promise"),ge=Be(F,"Set"),ye=Be(F,"WeakMap"),me=Be(Object,"create"),_e=je(de),be=je(pe),we=je(ve),ke=je(ge),Ee=je(ye),Se=ie?ie.prototype:void 0,Te=Se?Se.valueOf:void 0;function Ce(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pe(e){this.__data__=new Ae(e)}function Ie(e,t){var n=Ke(e)||function(e){return function(e){return function(e){return!!e&&"object"==Tc(e)}(e)&&We(e)}(e)&&ee.call(e,"callee")&&(!le.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||He(a,r))||n.push(a);return n}function Re(e,t,n){var r=e[t];ee.call(e,t)&&ze(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function De(e,t){for(var n=e.length;n--;)if(ze(e[n][0],t))return n;return-1}function Oe(e,t,n,r,i,d,m){var R;if(r&&(R=d?r(e,i,d,m):r(e)),void 0!==R)return R;if(!Ye(e))return e;var D=Ke(e);if(D){if(R=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,R)}else{var M=Ve(e),L=M==l||M==u;if(qe(e))return function(e,t){if(t)return pk(e).call(e);var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(M==f||M==o||L&&!d){if(j(e))return d?e:{};if(R=function(e){return"function"!=typeof e.constructor||Ge(e)?{}:(t=ae(e),Ye(t)?se(t):{});var t}(L?{}:e),!t)return function(e,t){return Fe(e,Ne(e),t)}(e,function(e,t){return e&&Fe(t,$e(t),e)}(R,e))}else{if(!O[M])return d?e:{};R=function(e,t,n,r){var i=e.constructor;switch(t){case _:return Le(e);case a:case s:return new i(+e);case b:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case k:case E:case S:case T:case C:case A:case x:case P:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case c:return function(e,t,n){var r=t?n(z(e),!0):z(e);return G(r,V,new e.constructor)}(e,r,n);case h:case g:return new i(e);case p:return function(e){var t=new e.constructor(e.source,I.exec(e));return t.lastIndex=e.lastIndex,t}(e);case v:return function(e,t,n){var r=t?n(W(e),!0):W(e);return G(r,H,new e.constructor)}(e,r,n);case y:return o=e,Te?Object(Te.call(o)):{}}var o}(e,M,Oe,t)}}m||(m=new Pe);var F=m.get(e);if(F)return F;if(m.set(e,R),!D)var U=n?function(e){return function(e,t,n){var r=t(e);return Ke(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,$e,Ne)}(e):$e(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(U||e,(function(i,o){U&&(i=e[o=i]),Re(R,o,Oe(i,t,n,r,o,e,m))})),R}function Me(e){return!(!Ye(e)||(t=e,J&&J in t))&&(Xe(e)||j(e)?ne:R).test(je(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function Fe(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r?r(n[a],e[a],a,n,e):void 0;Re(n,a,void 0===s?e[a]:s)}return n}function Ue(e,t){var n,r,i=e.__data__;return("string"==(r=Tc(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:Vw(i)}function Be(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Ce.prototype.clear=function(){this.__data__=me?me(null):{}},Ce.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ce.prototype.get=function(e){var t=this.__data__;if(me){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Ce.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},Ae.prototype.clear=function(){this.__data__=[]},Ae.prototype.delete=function(e){var t=this.__data__,n=De(t,e);return!(n<0)&&(n==t.length-1?t.pop():ue.call(t,n,1),!0)},Ae.prototype.get=function(e){var t=this.__data__,n=De(t,e);return n<0?void 0:t[n][1]},Ae.prototype.has=function(e){return De(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var n=this.__data__,r=De(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},xe.prototype.clear=function(){this.__data__={hash:new Ce,map:new(pe||Ae),string:new Ce}},xe.prototype.delete=function(e){return Ue(this,e).delete(e)},xe.prototype.get=function(e){return Ue(this,e).get(e)},xe.prototype.has=function(e){return Ue(this,e).has(e)},xe.prototype.set=function(e,t){return Ue(this,e).set(e,t),this},Pe.prototype.clear=function(){this.__data__=new Ae},Pe.prototype.delete=function(e){return this.__data__.delete(e)},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ae){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new xe(r)}return n.set(e,t),this};var Ne=ce?K(ce,Object):function(){return[]},Ve=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||D.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||$)}function je(e){if(null!=e){try{return Q.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function ze(e,t){return e===t||e!=e&&t!=t}(de&&Ve(new de(new ArrayBuffer(1)))!=b||pe&&Ve(new pe)!=c||ve&&Ve(ve.resolve())!=d||ge&&Ve(new ge)!=v||ye&&Ve(new ye)!=m)&&(Ve=function(e){var t=te.call(e),n=t==f?e.constructor:void 0,r=n?je(n):void 0;if(r)switch(r){case _e:return b;case be:return c;case we:return d;case ke:return v;case Ee:return m}return t});var Ke=Array.isArray;function We(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Xe(e)}var qe=he||function(){return!1};function Xe(e){var t=Ye(e)?te.call(e):"";return t==l||t==u}function Ye(e){var t=Tc(e);return!!e&&("object"==t||"function"==t)}function $e(e){return We(e)?Ie(e):function(e){if(!Ge(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Oe(e,!0,!0)}}(FL,FL.exports);var UL=o(FL.exports),BL=function(e){oP(r,e);var t,n=lP(r);function r(){var e,t;Ry(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(t=n.call.apply(n,Nm(e=[this]).call(e,o))),"_waitingStartTime",0),Uy(Yx(t),"_timer",void 0),Uy(Yx(t),"_toastId",void 0),t}return Fy(r,[{key:"updateLang",value:function(){this.renderItemList()}},{key:"beforeCreate",value:function(e){var t,n=e.player.config.sources.sourceManager;e.config.list=null===(t=n.source)||void 0===t?void 0:t.definitions}},{key:"afterCreate",value:function(){var e,t;bL(aP(r.prototype),"afterCreate",this).call(this),(null!==(e=null===(t=this.player.config.sourceManager.source)||void 0===t?void 0:t.definitions)&&void 0!==e?e:[]).length<2?this.hide():(this.renderItemList(),this.on(KM.WAITING,this._waiting.bind(this)),this.on(KM.PLAYING,this._clearTimer.bind(this)),this.on(KM.PAUSE,this._clearTimer.bind(this)),this.on(KM.PLAY,this._clearTimer.bind(this)),this._initTimeUpdateEvent())}},{key:"registerIcons",value:function(){return{source:{icon:LL}}}},{key:"renderItemList",value:function(){var e,t,n,i=this,o=this.player.config.sourceManager,a=null!==(e=null===(t=o.source)||void 0===t?void 0:t.definitions)&&void 0!==e?e:[],s=Vw(a).call(a,(function(e){var t;return{url:e.url,definition:e.definition||"",showText:null!==(t=i.player.config.i18nManager.normalize(e.text))&&void 0!==t?t:e.definition,selected:!1}})),l=wI(a).call(a,(function(e){var t;return e.definition===(null===(t=o.definition)||void 0===t?void 0:t.definition)}));this.config.list=null===(n=o.source)||void 0===n?void 0:n.definitions,l>-1&&(s[l].selected=!0),bL(aP(r.prototype),"renderItemList",this).call(this,s,l)}},{key:"onItemClick",value:function(e,t){var n,i=this;this._showToast(t.to),bL(aP(r.prototype),"onItemClick",this).call(this,e,t),null===(n=this.player.config)||void 0===n||n.veplayer.switch({definition:t.to.definition}).catch((function(){i.renderItemList()}))}},{key:"fallback",value:(t=sy(oy().mark((function e(){var t,n,r,i,o,a,s,l=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=l.length>0&&void 0!==l[0]?l[0]:{toast:!0},i=this.player.config.sourceManager,!((o=wI(t=this.config.demotePriority).call(t,(function(e){var t;return e===(null===(t=i.definition)||void 0===t?void 0:t.definition)})))<0)){e.next=5;break}return e.abrupt("return");case 5:if(a=UL(i.definition),s=this._getNextDefinition(o)){e.next=9;break}return e.abrupt("return");case 9:if(!r.toast){e.next=15;break}return e.next=12,this._toast(s);case 12:if(e.sent){e.next=15;break}return e.abrupt("return");case 15:this.player.emit(KM.DEFINITION_FALLBACK,{from:a,to:s}),null===(n=this.player.config)||void 0===n||n.veplayer.switch({definition:s.definition}).catch((function(){}));case 17:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_waiting",value:function(){var e=this;if(!this._timer){this._waitingStartTime=Date.now();var t=this.player.currentTime;this._timer=window.setTimeout((function(){e.player&&e.player.currentTime<=t+.1&&(e.player.emit(KM.LONG_WAITING),e.config.needFallback&&e.fallback({toast:!0}),e._clearTimer())}),this.config.longWaitingTime)}}},{key:"_clearTimer",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=void 0),this._waitingStartTime&&(this._waitingStartTime=0)}},{key:"_toast",value:function(e){var t=this,n=this.player.config.i18nManager;return new Hw((function(r){var i,o,a=null===(i=t.player)||void 0===i?void 0:i.getPlugin("toast");if(a){var s=kC.createDom("div",n.getText("DEFINITION_FALLBACK_TOAST"),void 0,"veplayer-toast-txt"),l=null!==(o=t.player.config.i18nManager.normalize(e.text))&&void 0!==o?o:e.definition,u=kC.createDom("span",l,void 0,"veplayer-toast-txt-bt");s.appendChild(u);var c=a.toast(s,{duration:5e3,closable:!0});u.addEventListener("click",(function(){a.remove(c),r(!0)}))}else r(!1)}))}},{key:"_getNextDefinition",value:function(e){var t,n=this.player.config.sourceManager;if(null!==(t=n.source)&&void 0!==t&&t.definitions.length&&!(e+1>=this.config.demotePriority.length)){var r=e+1,i=Xm(n).call(n,{definition:this.config.demotePriority[r]});return i||this._getNextDefinition(r)}}},{key:"_initTimeUpdateEvent",value:function(){var e=this,t=this.player.currentTime;this.on(KM.TIME_UPDATE,(function(){var n=e.player.currentTime;n!==t?(t=n,e._clearTimer()):t=n}))}},{key:"_showToast",value:function(e){var t,n,r,i=this,o=null===(t=this.player)||void 0===t?void 0:t.getPlugin("toast"),a=this.player.config.i18nManager;o&&(this._toastId&&o.remove(this._toastId),this._toastId=o.toast(Nm(n="".concat(a.getText("DEFINITION_SWITCHING")," ")).call(n,null!==(r=e.showText)&&void 0!==r?r:e.definition," ..."),{duration:2e3,closable:!0}),this.player.once(KM.AFTER_DEFINITION_CHANGE,(function(){void 0!==i._toastId&&o.remove(i._toastId)})))}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return Mm(Mm({},OL.defaultConfig),{},{index:3,list:[],panel:{title:{jp:"クラリティセレクション",en:"Definition Choose","zh-cn":"清晰度选择","zh-hk":"清晰度選擇"}},className:"xgplayer-definition",hidePortrait:!1,isShowIcon:!0,longWaitingTime:5e3,needFallback:!1,demotePriority:["uhd","hd","sd","ld","ao"]})}},{key:"textTips",get:function(){return{jp:"明快さ",en:"Definition","zh-cn":"清晰度","zh-hk":"清晰度"}}}]),r}(OL),NL={"biz:vod":"veplayer.biz.vod.[env].[ext]","biz:live":"veplayer.biz.live.[env].[ext]","plugin:flv":"veplayer.plugin.flv.[env].[ext]","plugin:mp4":"veplayer.plugin.mp4.[env].[ext]","plugin:hls":"veplayer.plugin.hls.[env].[ext]","plugin:shaka":"veplayer.plugin.shaka.[env].[ext]","plugin:rtm":"veplayer.plugin.rtm.[env].[ext]","plugin:xgvideo":"veplayer.plugin.xgvideo.[env].[ext]","plugin:drm":"veplayer.plugin.drm.[env].[ext]","plugin:abr":"veplayer.plugin.abr.[env].[ext]"},VL=function(e){return e.BizVod="biz:vod",e.BizLive="biz:live",e.PluginFlv="plugin:flv",e.PluginMp4="plugin:mp4",e.PluginHls="plugin:hls",e.PluginShaka="plugin:shaka",e.PluginRtm="plugin:rtm",e.PluginXgvideo="plugin:xgvideo",e.PluginDrm="plugin:drm",e.PluginAbr="plugin:abr",e}(VL||{}),HL=function(){function e(t){var n=this;Ry(this,e),Uy(this,"modules",{}),Uy(this,"mountPromiseMap",{}),Uy(this,"_baseUrl",void 0),Uy(this,"_moduleSystem",void 0),Uy(this,"load",function(){var e=sy(oy().mark((function e(t,r){var i,o,a,s,l;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n._moduleSystem){e.next=2;break}throw new Error('You have to specify moduleSystem first, call "setModuleSystem(moduleSystem)" to set module system');case 2:if(NL[t]){e.next=4;break}throw new Error('Invalid module name: "'.concat(t,'"'));case 4:if("esm"!==n._moduleSystem){e.next=11;break}if(n.modules[t]){e.next=9;break}throw new Error('Dynamic module "'.concat(t,'" not found, you have to register it first under ESM'));case 9:return o=n.modules[t].exports,e.abrupt("return",null!==(i=o.default)&&void 0!==i?i:o);case 11:if(!n.modules[t]){e.next=21;break}if(1!==n.modules[t].state){e.next=16;break}return e.abrupt("return",n.modules[t].exports);case 16:if(0!==n.modules[t].state){e.next=20;break}return e.abrupt("return",n.mountPromiseMap[t].then((function(e){var t;return null!==(t=e.default)&&void 0!==t?t:e})));case 20:throw null!==(a=n.modules[t].error)&&void 0!==a?a:new Error('Dynamic module "'.concat(t,'" load failed.'));case 21:return s=[n._baseUrl,NL[t]].join("/").replace("[env]","production").replace("[ext]","js"),l={src:null!=r?r:s,name:t,state:0,exports:{__PLUGIN_NAME__:t}},n.modules[t]=l,n.mountPromiseMap[t]=n._mount(l),e.abrupt("return",n.mountPromiseMap[t]);case 26:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),Uy(this,"registerPlugin",(function(e,t){if(!n._moduleSystem)throw new Error("You have to specify moduleSystem first, call setModuleSystem(moduleSystem) to set module system");return"esm"===n._moduleSystem?(n.modules[e]={src:"esm:".concat(e),name:e,state:1,exports:t},n.modules[e].exports):(n.modules[e]?n.modules[e].exports=t:n.modules[e]={src:"umd:".concat(e),name:e,state:1,exports:t},n.modules[e].exports)})),Uy(this,"register",(function(e){return Vw(e).call(e,(function(e){return n.registerPlugin(e.__PLUGIN_NAME__,e)}))})),this._baseUrl=t.baseUrl}return Fy(e,[{key:"baseUrl",get:function(){return this._baseUrl}},{key:"moduleSystem",get:function(){return this._moduleSystem}},{key:"setModuleSystem",value:function(e){this._moduleSystem=e}},{key:"setBaseUrl",value:function(e){this._baseUrl=e}},{key:"_mount",value:function(e){var t=this.modules;return new Hw((function(n,r){var i=document.createElement("script");i.src=e.src,i.onload=function(){e.state=1,n(t[e.name].exports),i.onload=null},i.onerror=function(t){e.state=2,e.error=t,r(t),i.onerror=null},document.body.appendChild(i)}))}}]),e}(),GL=p,jL=ee,zL=Bn,KL=jn,WL=Gc,qL=Math.min,XL=[].lastIndexOf,YL=!!XL&&1/[1].lastIndexOf(1,-0)<0,$L=WL("lastIndexOf"),ZL=YL||!$L?function(e){if(YL)return GL(XL,this,arguments)||0;var t=jL(this),n=KL(t),r=n-1;for(arguments.length>1&&(r=qL(r,zL(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:XL;Dn({target:"Array",proto:!0,forced:ZL!==[].lastIndexOf},{lastIndexOf:ZL});var JL,QL,eF=Wc("Array").lastIndexOf,tF=ce,nF=eF,rF=Array.prototype,iF=o((function(e){var t=e.lastIndexOf;return e===rF||tF(rF,e)&&t===rF.lastIndexOf?nF:t})),oF=null!==(JL=null===(QL=document.currentScript)||void 0===QL?void 0:QL.src)&&void 0!==JL?JL:"https://tosv.byted.org/obj/lux/sdk/@byted/veplayer/".concat("2.4.2-rc.6","/object/umd/"),aF=new HL({baseUrl:pk(oF).call(oF,0,iF(oF).call(oF,"/"))}),sF=aF.registerPlugin,lF=aF.register;function uF(e,t){return cF.apply(this,arguments)}function cF(){return(cF=sy(oy().mark((function e(t,n){var r;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,aF.load(t,n);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),gP(fP.MODULE_LOAD_ERROR,{ext:{name:t,cdn:null===e.t0||void 0===e.t0||null===(r=e.t0.target)||void 0===r?void 0:r.src},error:e.t0});case 9:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var hF=function(e,t){var n,r=fF(e);if(!e||!r)return null!==(n=e)&&void 0!==n?n:"";var i,o=OM(e).call(e,"//");for(var a in t){var s,l,u=t[a];if(null!=r&&r.searchParams.has(a))null==r||null===(s=r.searchParams)||void 0===s||s.set(a,u);else null==r||null===(l=r.searchParams)||void 0===l||l.append(a,u)}return e=r.toString(),o?null===(i=e)||void 0===i?void 0:i.replace(location.protocol,""):e},fF=function(e){if(e){OM(e).call(e,"//")&&(e=location.protocol+e);try{return new fM(e)}catch(oz){return}}};function dF(e){return function(t){var n;return null==t?void 0:hk(n=t.split("?")[0].toLowerCase()).call(n,e)}}var pF=dF(".m3u8"),vF=dF(".mp4"),gF=dF(".flv"),yF=dF(".sdp"),mF=dF(".mpd");function _F(e){return pF(e)?"hls":gF(e)?"flv":yF(e)?"rtm":vF(e)?"mp4":mF(e)?"dash":"unknown"}function bF(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.H264)===t.H265?PC.isHevcSupported():PC.isMSESupport()}function wF(){return(wF=sy(oy().mark((function e(){var t,n;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uF(VL.PluginXgvideo);case 2:return t=e.sent,n=t.XGVideoPlugin,e.abrupt("return",null==n?void 0:n.isSupported());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var kF=Mm(Mm({},kC),{},{getStreamType:_F,isMseSupported:bF,isSoftDecodeSupported:function(){return wF.apply(this,arguments)},appendSearchParams:hF,getUrlObject:fF}),EF=PC.isWeixin,SF=PC.os,TF=PC.device,CF=SF.isAndroid,AF=SF.isIos,xF="mobile"===TF,PF=0,IF=!1,RF=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),Uy(Yx(r=t.call(this,e)),"_hasSetUserAutoplay",void 0),Uy(Yx(r),"_timer",void 0),Uy(Yx(r),"_wxTimer",void 0),Uy(Yx(r),"_state",{mode:0,showUnmuteBt:!1}),Uy(Yx(r),"userClickPlay",(function(){if(!IF){var e=r.player.play();e&&e.then?e.then((function(){console.log("user action autoplay success"),IF=!0})).catch((function(e){console.warn("user action autoplay fail:",e)})):(console.warn("no play promise"),IF=!0)}})),r}return Fy(n,[{key:"afterCreate",value:function(){this.initState(),this.initEvents(),this.setWXAutoPlay()}},{key:"updateLang",value:function(){this.renderUnmuteBt()}},{key:"initState",value:function(){this._state.mode=this.player.muted?1:0}},{key:"initEvents",value:function(){this.player.on(ZC,this.handleAutoplayPrevented.bind(this)),this.player.on($C,this.handleAutoplayStart.bind(this)),this.player.on(jC,this.handleVolumechange.bind(this)),this.setUserActionAutoPlay()}},{key:"setWXAutoPlay",value:function(){EF&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1))}},{key:"wxCanPlayFn",value:function(){var e=this;window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(function(){e._wxTimer=window.setTimeout((function(){e._wxTimer&&clearTimeout(e._wxTimer);var t=e.player.play();t&&t.then?t.then((function(){console.log("wechat autoplay success")})).catch((function(t){console.warn("wechat autoplay fail:",t),e._state.showUnmuteBt=!1,e.renderUnmuteBt()})):console.warn("wechat browser no play promise")}))}))}},{key:"wxPlay",value:function(){this.player.readyState>=2?this.wxCanPlayFn():CF?this.player.once(HC,this.wxCanPlayFn.bind(this)):AF&&this.player.once(JC,this.wxCanPlayFn.bind(this))}},{key:"setUserActionAutoPlay",value:function(){var e=this;this.config.enableUserActionAutoplay&&this.player.once(zM.AUTOPLAY_FAIL,(function(){e._hasSetUserAutoplay=!0,(e.config.userActionDom instanceof window.Node?e.config.userActionDom:window.document.body).addEventListener("click",e.userClickPlay,!1)}))}},{key:"handleAutoplayPrevented",value:function(){return 0===this._state.mode?(console.warn("unmute autoplay fail"),this.player.emit(zM.AUTOPLAY_FAIL,{mode:"unmute"}),CF&&EF?void(this._state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this._state.mode?(console.warn("mute autoplay fail"),this.player.emit(zM.AUTOPLAY_FAIL,{mode:"mute"}),void(this._state.mode=2)):2===this._state.mode?(this.player.emit(zM.AUTOPLAY_FAIL,{mode:"noSupport"}),void console.warn("not support autoplay")):void 0}},{key:"changeMuteMode",value:function(){var e=this;this.player.muted=!0,this._state.showUnmuteBt=!0,this._state.mode=1,this.renderUnmuteBt(),this._timer=window.setTimeout((function(){e._timer&&window.clearTimeout(e._timer);var t=e.player.play();t&&t.then?t.then((function(){console.log("degrade mute autoplay success")})).catch((function(t){console.warn("degrade mute autoplay fail:",t),e.player.muted=!1,e._state.showUnmuteBt=!1,e.renderUnmuteBt()})):console.warn("no play promise")}))}},{key:"handleAutoplayStart",value:function(){if(0!==this._state.mode)return 1===this._state.mode?(this.player.emit(zM.AUTOPLAY_SUCCESS,{mode:"mute"}),this._state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this._state.mode?(this.player.emit(zM.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this._state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(zM.AUTOPLAY_SUCCESS,{mode:"unmute"})}},{key:"handleVolumechange",value:function(){this._state.showUnmuteBt&&(this._state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())}},{key:"renderUnmuteBt",value:function(){var e=this.root,t=this.player.config.i18nManager;if(e&&(e.innerHTML="",this._state.showUnmuteBt)){var n=t.getText("UNMUTE"),r=kC.createDom("div",n,void 0,"veplayer-unmute-bt");e.appendChild(r),this.bind(".veplayer-unmute-bt","click",this.cancelUnmute.bind(this)),this.bind(".veplayer-unmute-bt","touchend",this.cancelUnmute.bind(this))}}},{key:"cancelUnmute",value:function(){var e=Date.now();if(e-PF>200){PF=e,this.player.muted=!1,this._state.showUnmuteBt=!1,this.renderUnmuteBt(),this.emit(zM.AUTOPLAY_UNMUTE);var t="mobile"===PC.device,n=yF(this.player.config.url);t&&n&&(this.player.volume>.5?this.player.volume=this.player.volume-.1:this.player.volume=this.player.volume+.1)}}},{key:"destroy",value:function(){if(this.player.off(ZC,this.handleAutoplayPrevented.bind(this)),this.player.off($C,this.handleAutoplayStart.bind(this)),this.player.off(jC,this.handleVolumechange.bind(this)),this._timer&&window.clearTimeout(this._timer),this._wxTimer&&window.clearTimeout(this._wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1),this._hasSetUserAutoplay){var e=xF?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}},{key:"render",value:function(){return'<div class="veplayer-unmute"></div>'}}],[{key:"pluginName",get:function(){return"autoplayPlugin"}},{key:"defaultConfig",get:function(){return{position:QA.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1}}}]),n}(QA),DF=nL.values;Dn({target:"Object",stat:!0},{values:function(e){return DF(e)}});var OF=o(ie.Object.values);function MF(){return(new DOMParser).parseFromString('<svg width="18" height="18" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 11C5.75 11.9665 4.9665 12.75 4 12.75C3.0335 12.75 2.25 11.9665 2.25 11C2.25 10.0335 3.0335 9.25 4 9.25C4.9665 9.25 5.75 10.0335 5.75 11ZM13.25 11C13.25 11.9665 12.4665 12.75 11.5 12.75C10.5335 12.75 9.75 11.9665 9.75 11C9.75 10.0335 10.5335 9.25 11.5 9.25C12.4665 9.25 13.25 10.0335 13.25 11ZM19 12.75C19.9665 12.75 20.75 11.9665 20.75 11C20.75 10.0335 19.9665 9.25 19 9.25C18.0335 9.25 17.25 10.0335 17.25 11C17.25 11.9665 18.0335 12.75 19 12.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var LF,FF,UF=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"onItemClick",value:function(){}},{key:"onOptionClick",value:function(){this.toggle(!1)}},{key:"updateLang",value:function(){var e,t=this,n=this.player.config.i18nManager;null===(e=this.config.plugins)||void 0===e||e.forEach((function(e){var r,i=null!==(r=n.normalize(e.textTips))&&void 0!==r?r:e.pluginName;if(t.player.root){var o=kC.findDom(t.player.root,".panel-plugin-".concat(e.pluginName," .panel-icon-bt-text"));o&&(o.innerHTML=i)}}))}},{key:"beforeCreate",value:function(e){var t,n=e.player.config.i18nManager;e.config.list=null===(t=e.config.plugins)||void 0===t?void 0:Vw(t).call(t,(function(t,r){var i,o=kC.createDom("div","",{},"panel-icon-bt panel-plugin-".concat(t.pluginName)),a=kC.createDom("div","",{},"panel-icon-svg"),s=null!==(i=n.normalize(t.textTips))&&void 0!==i?i:t.pluginName;return o.appendChild(a),o.appendChild(kC.createDom("span",s,{"plugin-index":r},"panel-icon-bt-text")),{showText:o,plugin:e.player.registerPlugin({plugin:t,options:{root:a}})}}))}},{key:"hideChild",value:function(e){if(e){var t;null===(t=e.hide)||void 0===t||t.call(e);var n=document.querySelector(".panel-plugin-".concat(e.pluginName));n&&kC.addClass(n,"hide")}}},{key:"showChild",value:function(e){if(e){var t;null===(t=e.show)||void 0===t||t.call(e);var n=document.querySelector(".panel-plugin-".concat(e.pluginName));n&&kC.removeClass(n,"hide")}}},{key:"registerIcons",value:function(){return{more:{icon:MF}}}}],[{key:"pluginName",get:function(){return"more"}},{key:"defaultConfig",get:function(){return Mm(Mm({},OL.defaultConfig),{},{index:1,plugins:[],list:[],hideOnSingleOption:!1,isShowIcon:!0,hidePortrait:!1,renderType:AL.Icon,panel:{className:"more-panel-content"}})}}]),n}(OL),BF=function(e){return e.ROOT_TOP_RIGHT="rootTopRight",e.ROOT_TOP_RIGHT_COLLAPSE="rootTopRightCollapse",e}(BF||{}),NF=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"registerIcons",value:function(){return{more:{icon:MF,class:"xgplayer-more-svg"}}}},{key:"children",value:function(){var e=this,t=this._getPlugins(),n=t.plugins,r=t.collapsePlugins,i={};return n.forEach((function(t){i[t.pluginName]={plugin:t,options:{root:e.root}}})),r.length&&(i[UF.pluginName]={plugin:UF,options:{root:this.root,plugins:r}}),i}},{key:"render",value:function(){return'<xg-right-grid class="xg-right-grid xgplayer-rightTop-iconList"></xg-right-grid>'}},{key:"_getPlugins",value:function(){var e,t=this,n=[],r=[],i=null===(e=this.player.config.ignores)||void 0===e?void 0:Vw(e).call(e,(function(e){return e.toLowerCase()}));return this.config.plugins.forEach((function(e){var o,a=e.pluginName.toLowerCase();null!=i&&hk(i).call(i,a)||("rootTopRight"===(null!==(o=t.player.config[a].position)&&void 0!==o?o:e.defaultConfig.position)?n.push(e):r.push(e))})),{plugins:null!=n?n:[],collapsePlugins:null!=r?r:[]}}}],[{key:"pluginName",get:function(){return"topRightBar"}},{key:"defaultConfig",get:function(){return{position:QA.POSITIONS.ROOT_TOP,plugins:[]}}},{key:"isTopRightPlugin",value:function(e,t){var n,r,i,o,a,s=null!==(r=null===(i=t[null==e||null===(n=e.pluginName)||void 0===n?void 0:n.toLowerCase()])||void 0===i?void 0:i.position)&&void 0!==r?r:null==e||null===(o=e.defaultConfig)||void 0===o?void 0:o.position;return!!hk(a=OF(BF)).call(a,s)}}]),n}(QA),VF=[EI,xI,DI,UP,BI,mP,EP,fI,SP,kL,EL,ML,BL,RF],HF=Nm(LF=[]).call(LF,VF,[cI,VP,NF]),GF=Nm(FF=[]).call(FF,VF,[rI,NF]),jF="pc"===PC.device?HF:GF;function zF(){return(new DOMParser).parseFromString('<svg width="21" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.892 2h4.445v1.778H3.892v4.444H2.114V3.778C2.114 2.796 2.91 2 3.892 2zm4.445 16v-4.444c0-.982-.796-1.778-1.778-1.778H2.114v1.778h2.944L2.264 16.35a.9.9 0 001.272 1.273l2.988-2.987a.918.918 0 00.035-.037V18h1.778zm8-6.222v4.444h-4.445V18h4.445c.981 0 1.777-.796 1.777-1.778v-4.444h-1.777zM11.892 2v4.445c0 .981.796 1.777 1.778 1.777h4.444V6.445H15.17l2.568-2.568a.9.9 0 10-1.273-1.273L13.67 5.4V2h-1.778z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function KF(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.778 2h4.444v1.778H3.778v4.444H2V3.778C2 2.796 2.796 2 3.778 2zM2 11.778v4.444C2 17.204 2.796 18 3.778 18h4.444v-1.778H4.823l2.313-2.313a.9.9 0 00-1.272-1.273l-2.086 2.086v-2.944H2zm14.222 0v4.444h-4.444V18h4.444c.982 0 1.778-.796 1.778-1.778v-4.444h-1.778zM18 8.222V3.778C18 2.796 17.204 2 16.222 2h-4.444v1.778h2.945l-2.587 2.586a.9.9 0 101.273 1.273l2.813-2.813v3.398H18z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var WF={startPlay:function(){return(new DOMParser).parseFromString('<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="60" height="60" rx="30" fill="#000" fill-opacity=".4"/><path d="M40.243 28.3a2 2 0 010 3.401L24.06 41.712c-1.332.825-3.052-.134-3.052-1.7V19.988c0-1.566 1.72-2.525 3.052-1.7l16.184 10.01z" fill="#fff"/></svg>',"image/svg+xml").firstChild},play:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.121 8.299a2 2 0 010 3.402l-7.94 4.91c-1.332.825-3.051-.133-3.051-1.7V5.09c0-1.567 1.72-2.525 3.052-1.701l7.939 4.911z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.313" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/><rect x="11.563" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:KF,exitFullscreen:zF,replay:function(){return(new DOMParser).parseFromString('<svg width="72" height="72" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF" fill-rule="evenodd"><circle fill-opacity=".3" cx="36" cy="36" r="36"/><path d="M40.167 32.667a.833.833 0 01-.834-.834v-1.666c0-.46.373-.834.834-.834h5.409a11.653 11.653 0 00-9.576-5c-6.443 0-11.667 5.224-11.667 11.667S29.557 47.667 36 47.667c5.285 0 9.749-3.514 11.183-8.333h3.445C49.112 46.014 43.138 51 36 51c-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 4.713 0 8.918 2.173 11.668 5.572l-.001-4.739c0-.46.373-.833.833-.833h1.667c.46 0 .833.373.833.833V31c0 .879-.68 1.598-1.542 1.662l-.125.005h-9.166z"/></g></svg>',"image/svg+xml").firstChild},volumeLarge:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zm6.767 2.278A7.474 7.474 0 0118.75 10a7.477 7.477 0 01-2.128 5.234.4.4 0 01-.57-.004l-.587-.586a.442.442 0 01.005-.617A5.812 5.812 0 0017.083 10c0-1.557-.61-2.97-1.603-4.017a.442.442 0 01-.003-.615l.586-.586a.4.4 0 01.57-.004zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild},volumeMuted:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.045 2.5h.55c.44 0 .8.34.831.771l.003.062v13.334c0 .44-.34.799-.771.83l-.063.003h-.55a.833.833 0 01-.443-.128l-.065-.045-4.866-3.744a.831.831 0 01-.323-.59l-.003-.07V7.077c0-.235.1-.458.272-.615l.054-.045 4.866-3.744a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.68 6.667c.23 0 .416.186.416.416v5.834c0 .23-.186.416-.416.416h-.834a.417.417 0 01-.416-.416V7.083c0-.23.186-.416.416-.416h.834zm10.467.294a.417.417 0 01.59 0l1.767 1.768L17.27 6.96a.417.417 0 01.589 0l.59.59a.417.417 0 010 .589L16.68 9.908l1.768 1.767c.15.15.162.387.035.55l-.035.04-.589.589a.417.417 0 01-.59 0l-1.767-1.768-1.768 1.768a.417.417 0 01-.59 0l-.588-.59a.417.417 0 010-.589l1.767-1.768-1.767-1.767a.417.417 0 01-.035-.55l.035-.04.589-.589z" fill="#fff"/></svg>',"image/svg+xml").firstChild},volumeSmall:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}},qF=Mm(Mm({},WF),{},{fullscreen:KF,exitFullscreen:zF}),XF=Mm(Mm({},WF),{},{fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.125 3a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375H15.5v3.375c0 .207.168.375.375.375h.75A.375.375 0 0017 7.875v-4.5A.375.375 0 0016.625 3h-4.5zm0 12.5a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-4.5a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375V15.5h-3.375zM3 3.375C3 3.168 3.168 3 3.375 3h4.5c.207 0 .375.168.375.375v.75a.375.375 0 01-.375.375H4.5v3.375a.375.375 0 01-.375.375h-.75A.375.375 0 013 7.875v-4.5zM7.875 15.5H4.5v-3.375a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375v4.5c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-.75a.375.375 0 00-.375-.375z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 8.333h-4.167c-.92 0-1.666-.746-1.666-1.666V2.5h1.666v4.167H17.5v1.666zM2.5 6.667v1.666h4.167c.92 0 1.666-.746 1.666-1.666V2.5H6.667v4.167H2.5zM2.5 13.333h4.167V17.5h1.666v-4.167c0-.92-.746-1.666-1.666-1.666H2.5v1.666zM13.333 17.5v-4.167H17.5v-1.666h-4.167c-.92 0-1.666.746-1.666 1.666V17.5h1.666z" fill="#fff"/></svg>',"image/svg+xml").firstChild}}),YF="pc"===PC.device?qF:XF,$F=Mm(Mm({},Ax.TEXT),{},{DEFINITION_FALLBACK_TOAST:"The current network is unstable, it is recommended to switch to ",DEFINITION_SWITCHING:"Switching to",ERROR_REFRESH:"Refresh",UNMUTE:"Click to unmute",MANIFEST:"Video parsing error",NETWORK:"Network error",NETWORK_TIMEOUT:"Network timeout",NETWORK_FORBIDDEN:"Authentication error",NETWORK_NOTFOUND:"Stream does not exist",DEMUX:"Video parsing error",REMUX:"Video parsing error",MEDIA:"An error occurred, Please try again",MEDIA_ERR_CODEC_NOT_SUPPORTED:"Audio/video codec is not supported",MEDIA_ERR_URL_EMPTY:"The stream address is not specified",DRM:"Permission verification failed",DRM_LICENSE:"Commercial DRM Permission verification failed",OTHER:"Unknown error",RUNTIME:"An error occurred, Please try again",MODULE_LOAD_ERROR:"CDN fetch error",UNKNOWN:"Unknown error"}),ZF=Mm(Mm({},{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:"直播"}),{},{DEFINITION_FALLBACK_TOAST:"当前网络不稳定,建议切换到",DEFINITION_SWITCHING:"正在切换至",ERROR_REFRESH:"刷新",UNMUTE:"点击取消静音",MANIFEST:"视频解析错误",NETWORK:"网络错误",NETWORK_TIMEOUT:"网络超时",NETWORK_FORBIDDEN:"鉴权异常",NETWORK_NOTFOUND:"播放地址不存在",DEMUX:"视频解析错误",REMUX:"视频解析错误",MEDIA:"播放异常,请重试",MEDIA_ERR_CODEC_NOT_SUPPORTED:"不支持的音频/视频格式",MEDIA_ERR_URL_EMPTY:"当前播放地址为空",DRM:"权限验证失败",DRM_LICENSE:"商业 DRM LICENSE 鉴权失败",OTHER:"其他报错",RUNTIME:"播放异常,请重试",MODULE_LOAD_ERROR:"插件模块加载异常",UNKNOWN:"未知报错"}),JF=function(){function e(t){var n;if(Ry(this,e),Uy(this,"_lang",void 0),this._lang=(null==t?void 0:t.lang)||TC()||"en","zh"===this._lang&&(this._lang="zh-cn"),null!=t&&null!==(n=t.i18n)&&void 0!==n&&n.texts){var r,i,o=Vw(r=iL(null==t||null===(i=t.i18n)||void 0===i?void 0:i.texts)).call(r,(function(e){var t=XM(e,2);return{LANG:t[0],TEXT:t[1]}}));e.extend(o)}}return Fy(e,[{key:"setLang",value:function(e){this._lang=e}},{key:"getLang",value:function(){return this._lang}},{key:"normalize",value:function(e){return e?"string"==typeof e?e:e[this._lang]:""}},{key:"getText",value:function(e){var t,n,r;if(e){var i=null==Dx?void 0:Dx.lang;return null!==(t=null==i||null===(n=i[this._lang])||void 0===n?void 0:n[e])&&void 0!==t?t:null==i||null===(r=i.en)||void 0===r?void 0:r[e]}}}],[{key:"langKeys",get:function(){return Dx.langKeys}},{key:"isLangValid",value:function(e){var t;return hk(t=Dx.langKeys).call(t,e)||"zh"===e}},{key:"extend",value:function(e,t){Dx.extend(e,t)}}]),e}(),QF=["autoplay"],eU=Mm(Mm({},QA.POSITIONS),BF),tU={id:"veplayer",width:"100%",height:"100%",decodeType:r.Hardware,fullscreen:{useCssFullscreen:!1}},nU=function(e){var t,n,r,i=e.autoplay,o=tm(e,QF);(o.poster&&(o.poster=function(e){var t,n=""+e,r=qM.exec(n);if(!r)return n;var i,o="",a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==i&&(o+=n.substring(a,i)),a=i+1,o+=t}return a!==i?o+n.substring(a,i):o}(o.poster)),o.icons=Mm(Mm({},YF),o.icons?(t=o.icons,n={},iL(null!=t?t:{}).forEach((function(e){var t=XM(e,2),r=t[0],i=t[1];"string"==typeof i?console.warn("icons.".concat(r," has been removed")):n[r]=i})),n):{}),o.autoplay=Boolean(i),i&&"boolean"!=typeof i)&&(o.autoplayMuted=null==i?void 0:i.muted,o.videoAttributes=Mm(Mm({},null!==(r=o.videoAttributes)&&void 0!==r?r:{}),{},{muted:null==i?void 0:i.muted}),o.autoplayPlugin=i);return delete o.i18n,o},rU=function(){function e(){var t,n,r,i,o,a,s,l,u,c,h,f,d=this,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ry(this,e),Uy(this,"_player",void 0),Uy(this,"_sourceManager",void 0),Uy(this,"_preparePlugins",void 0),Uy(this,"_previousPrepareResult",void 0),Uy(this,"_i18nManager",void 0),Uy(this,"_events",{}),Uy(this,"_errorCallback",void 0),this._sourceManager=p.sourceManager,this._preparePlugins=p.preparePlugins,this._previousPrepareResult=p.prepareResult,this._i18nManager=null!==(t=p.i18nManager)&&void 0!==t?t:new JF({i18n:p.i18n});var v=nU(Mm(Mm({},p),null===(n=this._previousPrepareResult)||void 0===n?void 0:n.options)),g=Nm(r=[]).call(r,Iy(null!==(i=null===(o=this._previousPrepareResult)||void 0===o?void 0:o.plugins)&&void 0!==i?i:[]),Iy(null!==(a=p.plugins)&&void 0!==a?a:jF)),y=[],m=[];g.forEach((function(e){NF.isTopRightPlugin(e,p)?y.push(e):m.push(e)})),this._player=new Xx(Mm(Mm(Mm({},tU),v),{},{definition:Mm({list:null!==(s=null===(l=this._sourceManager.source)||void 0===l?void 0:l.definitions)&&void 0!==s?s:[],defaultDefinition:null===(u=this._sourceManager.definition)||void 0===u?void 0:u.definition},null!==(c=p.definition)&&void 0!==c?c:{}),url:null===(h=this._sourceManager.definition)||void 0===h?void 0:h.url,sources:Mm(Mm({},null!==(f=p.sources)&&void 0!==f?f:{}),{},{sourceManager:this._sourceManager}),topRightBar:{plugins:y},plugins:m,i18nManager:this._i18nManager,veplayer:this})),this.emit(KM.PLAYER_CREATE_FINISH,this._player),this._errorCallback=function(e){return d._handleFallback(e)},this._player.on(UC,this._errorCallback)}var t,n,r,i,o,a;return Fy(e,[{key:"readyState",get:function(){return this._player.readyState}},{key:"buffered",get:function(){return this._player.buffered}},{key:"played",get:function(){return this._player.played}},{key:"cumulateTime",get:function(){return this._player.cumulateTime}},{key:"isFocused",get:function(){return this._player.isActive}},{key:"isFullscreen",get:function(){return this._player.isFullscreen}},{key:"isCssFullscreen",get:function(){return this._player.isCssfullScreen}},{key:"networkState",get:function(){return this._player.networkState}},{key:"paused",get:function(){return this._player.paused}},{key:"ended",get:function(){return this._player.ended}},{key:"state",get:function(){return this._player.state}},{key:"url",get:function(){return this._player.config.url}},{key:"source",get:function(){var e;return null===(e=this._sourceManager.source)||void 0===e?void 0:e.name}},{key:"playerVersion",get:function(){return"2.4.2-rc.6"}},{key:"definition",get:function(){var e;return null===(e=this._sourceManager.definition)||void 0===e?void 0:e.definition}},{key:"crossOrigin",get:function(){return this._player.crossOrigin},set:function(e){this._player.crossOrigin=e}},{key:"volume",get:function(){return this._player.volume},set:function(e){this._player.volume=e}},{key:"muted",get:function(){return this._player.muted},set:function(e){this._player.muted=e}},{key:"lang",get:function(){return this._i18nManager.getLang()},set:function(e){if(this._player.lang!==e)if(JF.isLangValid(e))this._i18nManager.setLang(e),this._player.lang=e;else{var t,n,r,i,o=JF.langKeys.join(","),a={en:Nm(t="Sorry, we couldn't set the language to ".concat(e," because it's not currently supported. The list of supported languages includes ")).call(t,o,"."),"zh-cn":Nm(n="不支持当前设置的语言".concat(e,", 支持的语言有")).call(n,o,", 请重新设置")};console.error((null===(r=this._i18nManager)||void 0===r||null===(i=r.normalize)||void 0===i?void 0:i.call(r,a))||a.en)}}},{key:"_src",get:function(){return this._player.currentSrc}},{key:"switch",value:(a=sy(oy().mark((function e(t,n){var r,i,o,a;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t||1!==this._sourceManager.sources.length||1!==(null===(r=this._sourceManager.sources)||void 0===r||null===(r=r[0].definitions)||void 0===r?void 0:r.length)){e.next=5;break}return this._sourceManager.updateSources(t),e.next=4,this._switchUrl(t,{seamless:null==n?void 0:n.seamless});case 4:return e.abrupt("return",this._sourceManager.definition);case 5:if(o=Xm(i=this._sourceManager).call(i,t,n)){e.next=8;break}throw new Error("string"==typeof t?"No definition found for url: ".concat(t):Nm(a="No definition found for source: ".concat(t.source,", definition: ")).call(a,t.definition));case 8:return e.next=10,this._switch(o);case 10:return e.abrupt("return",o);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"updatePlaylist",value:function(e,t){var n=this._sourceManager.updateSources(e,t);return this._switch(n.definition)}},{key:"once",value:function(e,t){var n,r=this._transformEvent(e,t),i=r.xgCallback,o=r.xgEventName;i&&(null!==(n=this._events)&&void 0!==n&&n[e]||(this._events[e]=new Mw),this._events[e].set(t,i),this._player.once(o,i))}},{key:"off",value:function(e,t){var n,r=null===(n=this._events[e])||void 0===n?void 0:n.get(t),i=this._transformEvent(e).xgEventName;r&&(this._player.off(i,r),this._events[e].delete(t))}},{key:"emit",value:function(e,t){var n=this._transformEvent(e).xgEventName;this._player.emit(n,t)}},{key:"offAll",value:function(){this._events={},this._player.offAll()}},{key:"on",value:function(e,t){var n,r=this._transformEvent(e,t),i=r.xgCallback,o=r.xgEventName;i&&(null!==(n=this._events)&&void 0!==n&&n[e]||(this._events[e]=new Mw),this._events[e].set(t,i),this._player.on(o,i))}},{key:"play",value:function(){return this._player.play()}},{key:"pause",value:function(){return this._player.pause()}},{key:"requestPIP",value:function(){var e;null===(e=this._player.plugins.pip)||void 0===e||e.requestPIP()}},{key:"exitPIP",value:function(){var e;null===(e=this._player.plugins.pip)||void 0===e||e.exitPIP()}},{key:"retry",value:function(){return this._player.retry()}},{key:"focus",value:function(e){return this._player.focus(e)}},{key:"blur",value:function(e){return this._player.blur(e)}},{key:"canPlayType",value:function(e){return this._player.canPlayType(e)}},{key:"requestFullscreen",value:function(e){return this._player.getFullscreen(e)}},{key:"exitFullscreen",value:function(e){return this._player.exitFullscreen(e)}},{key:"requestCssFullscreen",value:function(e){return this._player.getCssFullscreen(e)}},{key:"exitCssFullscreen",value:function(){return this._player.exitCssFullscreen()}},{key:"registerPlugin",value:function(e,t){return this._player.registerPlugin(e,t)}},{key:"unRegisterPlugin",value:function(e){return this._player.unRegisterPlugin(e)}},{key:"showIcon",value:function(e){var t=this,n=this._player.getPlugin("more");e.forEach((function(e){var r=t._player.getPlugin(e);r&&null!=r&&r.root&&(r.config.position===eU.ROOT_TOP_RIGHT_COLLAPSE?null==n||n.showChild(r):r.show())}))}},{key:"hideIcon",value:function(e){var t=this,n=this._player.getPlugin("more");e.forEach((function(e){var r=t._player.getPlugin(e);r&&null!=r&&r.root&&(r.config.position===eU.ROOT_TOP_RIGHT_COLLAPSE?null==n||n.hideChild(r):r.hide())}))}},{key:"destroy",value:function(){this._player.off(UC,this._errorCallback),this._player.controls=null,this._player.destroy()}},{key:"prepare",value:(o=sy(oy().mark((function e(t){var n,r,i,o,a,s,l,u,c=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(n=this._preparePlugins)||void 0===n?void 0:n.call(this,t);case 2:return a=e.sent,s=this._diffPlugins(null!==(r=null===(i=this._previousPrepareResult)||void 0===i?void 0:i.plugins)&&void 0!==r?r:[],null!==(o=null==a?void 0:a.plugins)&&void 0!==o?o:[]),l=s.removedPlugins,u=s.addedPlugins,null==l||l.forEach((function(e){c._player.unRegisterPlugin(e)})),this._previousPrepareResult=a,null!=a&&a.options&&this._player.setConfig(a.options),e.abrupt("return",{plugins:Vw(u).call(u,(function(e){return c._player.registerPlugin(e)})),options:null==a?void 0:a.options});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_handleFallback",value:(i=sy(oy().mark((function e(t){var n,r,i=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._player.addClass(ix),n=this._sourceManager.url,r=this._sourceManager.fallback()){e.next=7;break}return this._player.removeClass(ix),this.emit(KM.FALLBACK_ERROR,yP(t,this._i18nManager)),e.abrupt("return");case 7:this._player.once("canplay",(function(){i._sourceManager.resetFallback()})),this.emit(KM.FALLBACK,{from:{url:n},to:{url:r}}),this._switchUrl(r);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_transformEvent",value:function(e,t){var n=this;return e===UC?{xgCallback:t?function(e){t(yP(e,n._i18nManager))}:void 0,xgEventName:e}:function(e,t){var n=WM[e];if(n)return{xgEventName:n.event,xgCallback:t?n.shouldCallback?function(){for(var e,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];null!==(e=n.shouldCallback)&&void 0!==e&&e.call.apply(e,Nm(r=[n]).call(r,o))&&(null==t||t.apply(void 0,o))}:t:void 0};return{xgEventName:e,xgCallback:t}}(e,t)}},{key:"_switch",value:(r=sy(oy().mark((function e(t){var n,r,i,o,a,s,l,u;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=UL(this._sourceManager.definition),e.next=3,this.prepare(t.url);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(s=e.t0,l=s.plugins,null!=(u=s.options)&&u.url&&(t.url=null==u?void 0:u.url),this._sourceManager.switch(t),null===(n=this._player)||void 0===n||null===(n=n.plugins)||void 0===n||n.sources.renderItemList(),null===(r=this._player)||void 0===r||null===(r=r.plugins)||void 0===r||r.definition.renderItemList(),(null==t||null===(i=t.source)||void 0===i?void 0:i.name)!==(null==a||null===(o=a.source)||void 0===o?void 0:o.name)&&this.emit(KM.SOURCE_CHANGE),null==l||!l.length){e.next=21;break}return this.emit(KM.DEFINITION_CHANGE),e.next=18,this._callBeforePlayerInitForUrl(l,t.url);case 18:this.emit(KM.AFTER_DEFINITION_CHANGE),e.next=22;break;case 21:this._player.changeDefinition(t,a);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_switchUrl",value:(n=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.prepare(t);case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0={};case 5:if(i=e.t0,o=i.plugins,a=i.options,s=null!==(r=null==a?void 0:a.url)&&void 0!==r?r:t,this._sourceManager.url=s,null==o||!o.length){e.next=14;break}this._callBeforePlayerInitForUrl(o,s),e.next=21;break;case 14:if(l=this._player.switchURL(s,{seamless:null==n?void 0:n.seamless}),u=this._player.currentTime,!l||!l.then){e.next=20;break}return e.abrupt("return",l);case 20:return e.abrupt("return",new Hw((function(e){var t=c._player.paused&&!c._player.isError,n=function(){c._player.currentTime=u,t&&c._player.once(HC,(function(){c._player.pause()})),e()};PC.os.isAndroid?c.once(NC,(function(){n()})):c.once(HC,(function(){n()})),c._player.play()})));case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"_diffPlugins",value:function(e,t){var n=Vw(e).call(e,(function(e){return e.pluginName})),r=Vw(t).call(t,(function(e){return e.pluginName}));return{removedPlugins:Gw(n).call(n,(function(e){return!hk(r).call(r,e)})),addedPlugins:Gw(t).call(t,(function(e){return!hk(n).call(n,e.pluginName)}))}}},{key:"_callBeforePlayerInitForUrl",value:function(e,t){var n=this;return new Hw((function(r){n._player.config.url=t,null==e||e.forEach((function(e){e.beforePlayerInit()})),n._player.on(KM.CANPLAY,(function(){r(void 0)}))}))}}],[{key:"create",value:(t=sy(oy().mark((function t(){var n,r,i,o,a,s,l,u,c=arguments;return oy().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=c.length>0&&void 0!==c[0]?c[0]:{},a=c.length>1?c[1]:void 0,s=new _L({sources:mL.normalize({url:o.url,fallbackUrls:o.fallbackUrls,sources:o.playlist}),url:o.url,defaultSource:o.defaultSource,defaultDefinition:o.defaultDefinition,maxFallbackRound:o.maxFallbackRound}),t.next=5,null==o||null===(n=o.preparePlugins)||void 0===n?void 0:n.call(o,null!==(r=s.url)&&void 0!==r?r:"");case 5:return null!=(l=t.sent)&&null!==(i=l.options)&&void 0!==i&&i.url&&(s.url=null==l||null===(u=l.options)||void 0===u?void 0:u.url),o.url=s.url,t.abrupt("return",new(null!=a?a:e)(Mm(Mm({},o),{},{prepareResult:l,sourceManager:s})));case 9:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})}]),e}();function iU(e){var t=gL(e).call(e,(function(e,t){return e+t.byteLength}),0),n=new Uint8Array(t),r=0;return e.forEach((function(e){n.set(e,r),r+=e.byteLength})),n}function oU(e,t){return wT(null==e?void 0:e.toFixed(t||4))}var aU,sU,lU=DE,uU=function(e,t,n){return function(e,t,n){t in e?lU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},cU="ScriptData",hU="Sequence_Header",fU="RawData",dU=[5500,11e3,22e3,44e3],pU="aac",vU="pcma",gU="pcmu",yU="avc",mU="bytevc1",_U=function(){function e(t){var n=this;Ry(this,e),uU(this,"type",0),uU(this,"tagSize",0),uU(this,"timestamp",0),uU(this,"duration",0),uU(this,"header",null),uU(this,"body",null),uU(this,"bodyView",null),uU(this,"tailsize",null),dk(t).forEach((function(e){n[e]=t[e]}))}return Fy(e,[{key:"streamType",get:function(){switch(this.type){case 18:return"scriptData";case 9:return"video";case 8:return"audio"}}},{key:"packetType",get:function(){var e;return null==(e=this.bodyView)?void 0:e.packetType}},{key:"frameType",get:function(){var e;return null==(e=this.bodyView)?void 0:e.frameType},set:function(e){this.bodyView.frameType=e}},{key:"dts",get:function(){return this.timestamp}},{key:"pts",get:function(){var e;return((null==(e=this.bodyView)?void 0:e.cts)||0)+this.timestamp}},{key:"ptsTime",get:function(){return this.pts?oU(this.pts/1e3):0}},{key:"dtsTime",get:function(){return this.dts?oU(this.dts/1e3):0}},{key:"sampleView",get:function(){var e,t,n;if("Sequence_Header"!==(null==(e=this.bodyView)?void 0:e.packetType)&&18!==this.type)return{dts:this.timestamp,pts:((null==(t=this.bodyView)?void 0:t.cts)||0)+this.timestamp,data:this._getSampleData(),units:null==(n=this.bodyView)?void 0:n.units}}},{key:"size",get:function(){var e,t;return null==(t=null==(e=this.sampleView)?void 0:e.data)?void 0:t.length}},{key:"data",get:function(){return this._getSampleData()}},{key:"nalTypes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.type}))}},{key:"nalSizes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.unit.length}))}},{key:"keyframe",get:function(){return"I"===this.frameType}},{key:"isSample",get:function(){return"scriptData"!==this.streamType&&"Sequence_Header"!==this.packetType}},{key:"isVideo",get:function(){return this.isSample&&"video"===this.streamType}},{key:"isAudio",get:function(){return this.isSample&&"audio"===this.streamType}},{key:"isSqHeader",get:function(){return"Sequence_Header"===this.packetType}},{key:"timescale",get:function(){return 1e3}},{key:"isHevc",get:function(){var e;return"bytevc1"===(null==(e=this.bodyView)?void 0:e.codecType)}},{key:"_getSampleData",value:function(){var e,t;if("audio"===this.streamType)return this.bodyView.sample;var n=(null==(t=this.bodyView)?void 0:Gw(e=t.units).call(e,(function(e){return!e.isSei})))||[],r=gL(n).call(n,(function(e,t){return e+(t.unit.byteLength+4)}),0),i=new Uint8Array(r),o=0;return n.forEach((function(e){i.set([0,0,0,1],o),o+=4,i.set(e.unit,o),o+=e.unit.byteLength})),i}}]),e}(),bU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"decode",value:function(t){for(var n=[],r=t,i=0,o=t.length;i<o;)if(r[i]<128)n.push(String.fromCharCode(r[i])),++i;else{if(r[i]<192);else if(r[i]<224){if(e._checkContinuation(r,i,1)){var a=(31&r[i])<<6|63&r[i+1];if(a>=128){n.push(String.fromCharCode(65535&a)),i+=2;continue}}}else if(r[i]<240){if(e._checkContinuation(r,i,2)){var s=(15&r[i])<<12|(63&r[i+1])<<6|63&r[i+2];if(s>=2048&&55296!=(63488&s)){n.push(String.fromCharCode(65535&s)),i+=3;continue}}}else if(r[i]<248&&e._checkContinuation(r,i,3)){var l=(7&r[i])<<18|(63&r[i+1])<<12|(63&r[i+2])<<6|63&r[i+3];if(l>65536&&l<1114112){l-=65536,n.push(String.fromCharCode(l>>>10|55296)),n.push(String.fromCharCode(1023&l|56320)),i+=4;continue}}n.push(String.fromCharCode(65533)),++i}return n.join("")}},{key:"_checkContinuation",value:function(e,t,n){var r=e;if(t+n<r.length){for(;n--;)if(128!=(192&r[++t]))return!1;return!0}return!1}}]),e}(),wU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parse",value:function(t){if(!(t.length<3)){var n={},r=e._parseValue(new DataView(t.buffer,t.byteOffset,t.byteLength));try{var i=e._parseValue(new DataView(t.buffer,t.byteOffset+r.size,t.byteLength-r.size));n[r.data]=i.data}catch(o){}return n}}},{key:"_parseValue",value:function(t){var n,r=t.byteLength,i=1,o=!1;switch(t.getUint8(0)){case 0:n=t.getFloat64(1),i+=8;break;case 1:n=!!t.getUint8(1),i+=1;break;case 2:var a=e._parseString(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i));n=a.data,i+=a.size;break;case 3:n={};var s=0;for(9==(16777215&t.getUint32(r-4))&&(s=3);i<r-4;){var l=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-s)),u=l.size,c=l.data;if(l.isEnd)break;n[c.name]=c.value,i+=u}if(i<=r-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 8:n={},i+=4;var h=0;for(9==(16777215&t.getUint32(r-4))&&(h=3);i<r-8;){var f=e._parseObject(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i-h)),d=f.size,p=f.data;if(f.isEnd)break;n[p.name]=p.value,i+=d}if(i<=r-3)9===(16777215&t.getUint32(i-1))&&(i+=3);break;case 9:n=void 0,i=1,o=!0;break;case 10:n=[];var v=t.getUint32(1);i+=4;for(var g=0;g<v;g++){var y=e._parseValue(new DataView(t.buffer,t.byteOffset+i,t.byteLength-i)),m=y.data,_=y.size;n.push(m),i+=_}break;case 11:var b=t.getFloat64(i)+6e4*t.getInt16(i+8);n=new Date(b),i+=10;break;case 12:var w=t.getUint32(1);i+=4,n="",w>0&&(n=bU.decode(new Uint8Array(t.buffer,t.byteOffset+i,w))),i+=w;break;default:i=r}return{data:n,size:i,isEnd:o}}},{key:"_parseString",value:function(e){var t=e.getUint16(0),n="";return t>0&&(n=bU.decode(new Uint8Array(e.buffer,e.byteOffset+2,t))),{data:n,size:2+t}}},{key:"_parseObject",value:function(t){if(!(t.byteLength<3)){var n=e._parseString(t),r=e._parseValue(new DataView(t.buffer,t.byteOffset+n.size,t.byteLength-n.size));return{data:{name:n.data,value:r.data},size:n.size+r.size,isEnd:r.isEnd}}}}]),e}(),kU="undefined"!=typeof window,EU=kU&&navigator.userAgent.toLocaleLowerCase(),SU=kU&&hk(EU).call(EU,"firefox"),TU=kU&&hk(EU).call(EU,"android"),CU=DE,AU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseADTS",value:function(t,n){for(var r=t.length,i=0;i+2<r&&(255!==t[i]||240!=(246&t[i+1]));)i++;if(!(i>=r)){var o=i,a=[],s=(60&t[i+2])>>>2,l=e.FREQ[s];if(!l)throw new Error("Invalid sampling index: ".concat(s));for(var u,c,h=1+((192&t[i+2])>>>6),f=(1&t[i+2])<<2|(192&t[i+3])>>>6,d=e._getConfig(s,f,h),p=d.config,v=d.codec,g=0,y=e.getFrameDuration(l);i+7<r;)if(255===t[i]&&240==(246&t[i+1])){if(r-i<(c=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5))break;u=2*(1&~t[i+1]);var m=oU(n+g*y);a.push({pts:m,dts:m,ptsTime:oU(m/9e4),dtsTime:oU(m/9e4),data:t.subarray(i+7+u,i+c)}),g++,i+=c}else i++;return{skip:o,remaining:i>=r?void 0:t.subarray(i),frames:a,nbFrame:a.length,samplingFrequencyIndex:s,sampleRate:l,objectType:h,channelCount:f,codec:v,config:p,originCodec:"mp4a.40.".concat(h)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var n=t[0]>>>3,r=(7&t[0])<<1|t[1]>>>7,i=(120&t[1])>>>3,o=e.FREQ[r];if(!o)throw new Error("Invalid sampling index: ".concat(r));var a=e._getConfig(r,i,n);return{samplingFrequencyIndex:r,sampleRate:o,objectType:n,channelCount:i,config:a.config,codec:a.codec,originCodec:"mp4a.40.".concat(n)}}}},{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"_getConfig",value:function(e,t,n){var r,i,o=[];return SU?e>=6?(r=5,i=e-3):(r=2,i=e):TU?(r=2,i=e):(r=n,i=e,e>=6?i=e-3:1===t&&(r=2,i=e)),o[0]=r<<3,o[0]|=(14&e)>>1,o[1]=(1&e)<<7,o[1]|=t<<3,5===r&&(o[1]|=(14&i)>>1,o[2]=(1&i)<<7,o[2]|=8,o[3]=0),{config:o,codec:"mp4a.40.".concat(r)}}},{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),e}(),xU=AU;sU=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],function(e,t,n){t in e?CU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(xU,"symbol"!==Tc(aU="FREQ")?aU+"":aU,sU);var PU=DE,IU=function(e,t,n){return function(e,t,n){t in e?PU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},RU=function(){function e(t){if(Ry(this,e),IU(this,"_bytesAvailable"),IU(this,"_bitsAvailable",0),IU(this,"_word",0),!t)throw new Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return Fy(e,[{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw new Error("No bytes available");var n=new Uint8Array(4);n.set(this._data.subarray(e,e+t)),this._word=new DataView(n.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{e-=this._bitsAvailable;var t=Math.floor(e/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw new Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),n=this._word>>>32-t;return this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable?n<<t|this.readBits(t):n}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if(0!=(this._word&2147483648>>>e))return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,n=8,r=0;r<e;r++)0!==n&&(n=(t+this.readEG()+256)%256),t=0===n?t:n}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}},{key:"firstMbInSlice",value:function(){return this.readUByte(),this.readUEG()}}]),e}();function DU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}var OU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseAnnexB",value:function(e){for(var t=e.length,n=2,r=0;null!==e[n]&&1!==e[n];)n++;if((r=++n+2)>=t)return[];for(var i=[];r<t;)switch(e[r]){case 0:if(0!==e[r-1]){r+=2;break}if(0!==e[r-2]){r++;break}n!==r-2&&i.push(e.subarray(n,r-2));do{r++}while(1!==e[r]&&r<t);r=(n=r+1)+2;break;case 1:if(0!==e[r-1]||0!==e[r-2]){r+=3;break}n!==r-2&&i.push(e.subarray(n,r-2)),r=(n=r+1)+2;break;default:r+=3}return n<t&&i.push(e.subarray(n)),i}},{key:"parseNalu",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var n,r=e.length,i=[],o=0;o+t<r;)if(n=DU(e,o),3===t&&(n>>>=8),o+=t,n){if(o+n>r)break;i.push(e.subarray(o,o+n)),o+=n}return i}}},{key:"parseNaluType",value:function(e,t){return null==e?void 0:Vw(e).call(e,(function(e){var n=t?e[0]>>>1&63:31&e[0],r=t&&(39===n||40===n),i={type:n,unit:e,isSei:r=r||!t&&6===n};switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!t&&5!==n||t&&5===n)break;i.frameType="I"}return t||1!==n||(i.frameType=function(e){var t=new RU(e).readSliceType();return 2===t||4===t||7===t||9===t?"I":0===t||3===t||5===t||8===t?"P":1===t||6===t?"B":void 0}(e)),!t||0!==n&&1!==n||(i.frameType="P"),!t&&n<=5&&(i.firstMbInSlice=new RU(e).firstMbInSlice()),t&&n<=21&&(i.firstMbInSlice=128==(128&e[2])),i}))}},{key:"parseSEI",value:function(e){for(var t=e.length,n=1,r=0,i=0,o="";255===e[n];)r+=255,n++;for(r+=e[n++];255===e[n];)i+=255,n++;if(i+=e[n++],5===r&&t>n+16)for(var a=0;a<16;a++)o+=e[n].toString(16),n++;return{payload:e.subarray(n),type:r,size:i,uuid:o}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,n=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(!n.length)return e;var i=t-n.length,o=new Uint8Array(i),a=0;for(r=0;r<i;a++,r++)a===n[0]&&(a++,n.shift()),o[r]=e[a];return o}}]),e}(),MU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(t){if(!(t.length<7)){for(var n,r,i=1+(3&t[4]),o=[],a=[],s=6,l=31&t[5],u=0;u<l;u++)if(r=t[s]<<8|t[s+1],s+=2,r){var c=t.subarray(s,s+r);s+=r,o.push(c),n||(n=e.parseSPS(OU.removeEPB(c)))}var h,f=t[s];s++;for(var d=0;d<f;d++)h=t[s]<<8|t[s+1],s+=2,h&&(a.push(t.subarray(s,s+h)),s+=h);return{sps:n,spsArr:o,ppsArr:a,nalUnitSize:i}}}},{key:"parseSPS",value:function(e){var t=new RU(e);t.readUByte();var n=t.readUByte(),r=t.readUByte(),i=t.readUByte();t.skipUEG();var o=420;if(100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||144===n){var a=t.readUEG();if(a<=3&&(o=[0,420,422,444][a]),3===a&&t.skipBits(1),t.skipUEG(),t.skipUEG(),t.skipBits(1),t.readBool())for(var s=3!==a?8:12,l=0;l<s;l++)t.readBool()&&(l<6?t.skipScalingList(16):t.skipScalingList(64))}t.skipUEG();var u=t.readUEG();if(0===u)t.readUEG();else if(1===u){t.skipBits(1),t.skipUEG(),t.skipUEG();for(var c=t.readUEG(),h=0;h<c;h++)t.skipUEG()}t.skipUEG(),t.skipBits(1);var f=t.readUEG(),d=t.readUEG(),p=t.readBits(1);0===p&&t.skipBits(1),t.skipBits(1);var v,g,y,m,_,b=0,w=0,k=0,E=0;if(t.readBool()&&(b=t.readUEG(),w=t.readUEG(),k=t.readUEG(),E=t.readUEG()),t.readBool()){if(t.readBool())switch(t.readUByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUByte()<<8|t.readUByte(),t.readUByte()<<8|t.readUByte()]}if(t.readBool()&&t.readBool(),t.readBool()&&(t.readBits(4),t.readBool()&&t.readBits(24)),t.readBool()&&(t.readUEG(),t.readUEG()),t.readBool()){var S=t.readBits(32),T=t.readBits(32);g=t.readBool(),_=(y=T)/(m=2*S)}}for(var C=e.subarray(1,4),A="avc1.",x=0;x<3;x++){var P=C[x].toString(16);P.length<2&&(P="0".concat(P)),A+=P}return{codec:A,profileIdc:n,profileCompatibility:r,levelIdc:i,chromaFormat:o,width:Math.ceil(16*(f+1)-2*(b+w)),height:(2-p)*(d+1)*16-(p?2:4)*(k+E),sarRatio:v,fpsNum:y,fpsDen:m,fps:_,fixedFrame:g}}}]),e}(),LU=function(){function e(){Ry(this,e)}return Fy(e,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(t){if(!(t.length<23)){for(var n,r,i,o,a=1+(3&t[21]),s=[],l=[],u=[],c=23,h=t[22],f=0;f<h;f++){r=63&t[c],i=t[c+1]<<8|t[c+2],c+=3;for(var d=0;d<i;d++)if(o=t[c]<<8|t[c+1],c+=2,o){switch(r){case 32:u.push(t.subarray(c,c+o));break;case 33:var p=t.subarray(c,c+o);n||(n=e.parseSPS(OU.removeEPB(p))),s.push(p);break;case 34:l.push(t.subarray(c,c+o))}c+=o}}return{sps:n,spsArr:s,ppsArr:l,vpsArr:u,nalUnitSize:a}}}},{key:"parseSPS",value:function(e){var t=new RU(e);t.readUByte(),t.readUByte(),t.readBits(4);var n=t.readBits(3);t.readBits(1);var r=this._parseProfileTierLevel(t,n);t.readUEG();var i=t.readUEG(),o=420;i<=3&&(o=[0,420,422,444][i]);var a=0;3===i&&(a=t.readBits(1));var s,l,u,c,h=t.readUEG(),f=t.readUEG(),d=t.readBits(1);(1===d&&(s=t.readUEG(),l=t.readUEG(),u=t.readUEG(),c=t.readUEG()),1===d)&&(h-=(1!==i&&2!==i||0!==a?1:2)*(l+s),f-=(1===i&&0===a?2:1)*(c+u));return{codec:"hev1.1.6.L93.B0",width:h,height:f,chromaFormat:o,bitDepthLumaMinus8:t.readUEG(),bitDepthChromaMinus8:t.readUEG(),generalProfileSpace:r.generalProfileSpace,generalTierFlag:r.generalTierFlag,generalProfileIdc:r.generalProfileIdc,generalLevelIdc:r.generalLevelIdc}}},{key:"_parseProfileTierLevel",value:function(e,t){var n,r,i;(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)&&(n=e.readBits(2),r=e.readBits(1),i=e.readBits(5)),e.readBits(32),e.readBits(1),e.readBits(1),e.readBits(1),e.readBits(1),e.readBits(16),e.readBits(16),e.readBits(12);for(var o=e.readUByte(),a=[],s=[],l=0;l<t;l++)a[l]=e.readBits(1),s[l]=e.readBits(1);t>0&&e.readBits(2*(8-t));for(var u=0;u<t;u++)0!==a[u]&&(e.readBits(2),e.readBits(1),e.readBits(5),e.readBits(16),e.readBits(16),e.readBits(4),e.readBits(16),e.readBits(16),e.readBits(12)),0!==s[u]&&e.readBits(8);return{generalProfileSpace:n,generalTierFlag:r,generalProfileIdc:i,generalLevelIdc:o}}}]),e}();function FU(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Gw(t=e.items).call(t,(function(e){return e.isSample&&e.isVideo}))[0],o=Gw(n=e.items).call(n,(function(e){return e.isSample&&e.isAudio}))[0],a=Math.min((null==o?void 0:o.dtsTime)||0,(null==i?void 0:i.dtsTime)||0);return a-=r,e.items.forEach((function(e){e.time=oU(e.dtsTime-a)})),e}function UU(e){var t,n=Gw(t=e.items).call(t,(function(e){return e.isVideo})),r=[],i=-1,o={},a={};return n.forEach((function(e,t){(e.keyframe||t===n.length-1)&&(i=-1===i?e.time:i,r.push({time:e.time,value:oU(e.time-i)}),i=e.time);var s=Math.ceil(e.time+1e-5);o[s]?o[s]++:o[s]=1,a[s]?a[s]+=8*e.size:a[s]=8*e.size})),{bitRates:BU(a),gops:Gw(r).call(r,(function(e){return e.value})),frameRates:BU(o)}}function BU(e){var t=dk(e);return Vw(t).call(t,(function(t){return{time:Number(t),value:e[t]}}))}function NU(e){var t,n,r,i,o=gL(t=pk(n=pC(r=Gw(i=pk(e).call(e)).call(i,(function(e){return e.isSample}))).call(r,(function(e,t){return e.time>t.time?1:-1}))).call(n,0,3)).call(t,(function(e,t){return e+t.size}),0);return o>1e3?oU(o/1e3)+"KB":o+"B"}function VU(e){return gL(e).call(e,(function(e,t){return e+t.size}),0)/gL(e).call(e,(function(e,t){return e+t.duration}),0)*8e3}function HU(e){if(null==e?void 0:e.profileIdc)switch(e.profileIdc){case 66:return"66(Baseline)";case 77:return"77(Main)";case 100:return"100(High)"}}var GU=DE,jU=function(e,t,n){return function(e,t,n){t in e?GU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},zU=function(){function e(){Ry(this,e),jU(this,"_nalUnitSize",0),jU(this,"_lastAudio",null),jU(this,"_lastVideo",null),jU(this,"_videoStartDts",-1),jU(this,"_audioStartDts",-1)}return Fy(e,[{key:"parse",value:function(e){for(var t=e.byteLength,n=e.subarray(0,13),r=13,i=Mm(Mm({header:n},this._parseHeader(n)),{},{items:[]});r+11<t;){var o=e.subarray(r,r+11),a=o[1]<<16|o[2]<<8|o[3],s=r+11+a;if(s>t)break;var l=e.subarray(r+11,s),u=new _U(Mm({tagSize:11+a+4,header:o,body:l,tailsize:e.subarray(s,s+4)},this._parseTag(o,l)));u.isAudio&&(this._lastAudio&&(this._lastAudio.duration=u.dts-this._lastAudio.dts),this._lastAudio=u),u.isVideo&&(this._lastVideo&&(this._lastVideo.duration=u.dts-this._lastVideo.dts),this._lastVideo=u),i.items.push(u),r=s+4}var c=FU(i);return c.rates=UU(c),this._addMetadataToFirstKeyFrame(c),c}},{key:"getSnapshoot",value:function(t,n){var r,i,o,a,s=Gw(r=t.items).call(r,(function(e){return 8===e.type}))[0],l=Gw(i=t.items).call(i,(function(e){return 9===e.type}))[0],u=s&&s.bodyView||s,c=l&&l.bodyView||l,h=Gw(o=t.items).call(o,(function(e){return e.isVideo})).length,f=this._getNbFrame(t,"I"),d=this._getNbFrame(t,"P"),p=this._getNbFrame(t,"B"),v=0;if(null==n?void 0:n.gopCacheBuffer){var g,y=(new e).parse(n.gopCacheBuffer),m=Gw(g=y.items).call(g,(function(e){return e.isVideo})),_=null==(a=m[m.length-1])?void 0:a.time;_&&(v=_-n.take/1e3)}return{rates:t.rates,audio:u?AE({},u,this._getExt(t,"audio")):null,video:c?AE({},c,this._getExt(t,"video"),{topThreeFrameSize:NU(t.items),gopCache:oU(v),profile:HU(c.sps),iFrames:f,pFrames:d,bFrames:p,iPercent:oU(f/h*100),pPercent:oU(d/h*100),bPercent:oU(p/h*100)}):null}}},{key:"_addMetadataToFirstKeyFrame",value:function(e){var t,n,r,i=Gw(t=e.items).call(t,(function(e){return 9===e.type}))[0];if(i&&(null==(r=i.bodyView)?void 0:r.sps)){var o=Gw(n=e.items).call(n,(function(e){return e.isVideo&&e.keyframe}))[0];o&&(o.bodyView.sps=i.bodyView.sps,o.bodyView.vpsArr=i.bodyView.vpsArr,o.bodyView.spsArr=i.bodyView.spsArr,o.bodyView.ppsArr=i.bodyView.ppsArr)}}},{key:"_getExt",value:function(e,t){var n,r,i,o=Gw(n=e.items).call(n,(function(e){return e.streamType===t&&e.isSample})),a=Gw(r=e.items).call(r,(function(e){var n;return e.streamType===t&&(null==(n=e.bodyView)?void 0:n.packetType)===hU}))[0];if(!o.length)return 0;var s=o[0],l=o[o.length-1],u=0;return"audio"===t&&(u=a&&1024/(null==(i=a.bodyView)?void 0:i.sampleRate)*1e3),"video"===t&&(u=s.duration),{avgBits:VU(o),startDts:o[0].dts,duration:(l.timestamp-s.timestamp)/1e3,refDuration:u,frameLength:o.length}}},{key:"_getNbFrame",value:function(e,t){var n;return Gw(n=e.items).call(n,(function(e){return e.isVideo&&e.frameType===t})).length}},{key:"_parseHeader",value:function(e){return{hasAudio:!!(e[4]>>2&1),hasVideo:!!(1&e[4])}}},{key:"_parseTag",value:function(e,t){var n,r=31&e[0],i=(e[7]<<24>>>0)+(e[4]<<16)+(e[5]<<8)+e[6];switch(r){case 18:n=AE({packetType:cU},wU.parse(t));break;case 9:n=this._parseVideo(t,i);break;case 8:n=this._parseAudio(t,i)}return{type:r,timestamp:i,bodyView:n}}},{key:"_parseAudio",value:function(e){if(e.length){var t=(240&e[0])>>>4;if(10===t||7===t||8===t){if(10!==t){var n=(12&e[0])>>2,r=(2&e[0])>>1,i=1&e[0];return Mm({format:t,sampleRate:dU[n],sampleSize:r?2:1,channelCount:i+1},this._parseG711(e))}return this._parseAac(e,t)}console.warn("Unsupported sound format: ".concat(t))}}},{key:"_parseG711",value:function(e,t){return{codecType:7===t?vU:gU,sampleRate:8e3,sample:e.subarray(1),packetType:fU}}},{key:"_parseAac",value:function(e,t){if(0===e[1]){var n=e.subarray(2);return Mm(Mm({},xU.parseAudioSpecificConfig(n)),{},{format:t,timescale:1e3,codecType:pU,packetType:hU,sequenceData:[n],frameType:"A"})}if(1===e[1])return{sample:e.subarray(2),format:t,codecType:pU,packetType:fU,frameType:"A"}}},{key:"_parseVideo",value:function(e,t){if(!(e.length<6)){var n=(240&e[0])>>>4,r=15&e[0];if(7===r||12===r){var i=12===r,o=e[1],a=(e[2]<<16|e[3]<<8|e[4])<<8>>8;if(0===o){var s=e.subarray(5),l=i?LU.parseHEVCDecoderConfigurationRecord(s):MU.parseAVCDecoderConfigurationRecord(s);return this._nalUnitSize=l.nalUnitSize,Mm({codecId:r,codecType:i?mU:yU,packetType:hU,timescale:1e3,sequenceData:[s]},l)}if(1===o){var u=OU.parseNalu(e.subarray(5),this._nalUnitSize);if(!u||!u.length)return;var c={dts:t,cts:a,units:u=OU.parseNaluType(u,i)};return 1===n&&(c.keyframe=!0),u.forEach((function(e){var t=e.type,n=e.unit,r=e.frameType;switch(t){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!i&&5!==t||i&&5===t)break;c.keyframe=!0,c.frameType="I";break;case 6:case 39:case 40:if(!i&&6!==t||i&&6===t)break;c.seis?c.seis.push(OU.parseSEI(OU.removeEPB(n))):c.seis=[OU.parseSEI(OU.removeEPB(n))];break;case 32:if(!i)break;c.vpsArr?c.vpsArr.push(n):c.vpsArr=[n];break;case 7:case 33:if(!i&&7!==t||i&&7===t)break;c.spsArr?c.spsArr.push(n):c.spsArr=[n];var o=OU.removeEPB(n);c.sps=i?LU.parseSPS(o):MU.parseSPS(o);break;case 8:case 34:if(!i&&8!==t||i&&8===t)break;c.ppsArr?c.ppsArr.push(n):c.ppsArr=[n];break;case 1:case 0:c.frameType=r}})),Mm({codecId:r,codecType:i?mU:yU,packetType:fU},c)}}else console.warn("Unsupported codecId: ".concat(r))}}}]),e}(),KU="FLV",WU="MPEG-TS",qU="MP4";function XU(e,t){var n;return Vw(n=[e[t],e[t+1],e[t+2],e[t+3]]).call(n,(function(e){return String.fromCharCode(e)})).join("")}var YU=DE,$U=function(e,t,n){return function(e,t,n){t in e?YU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},ZU=Fy((function e(t){var n=t.startIndictor,r=t.packetType,i=t.pid,o=t.afc;Ry(this,e),$U(this,"startIndictor",0),$U(this,"pid",0),$U(this,"afc",0),$U(this,"eleInfo",null),$U(this,"packetType",""),this.startIndictor=n,this.packetType=r,this.pid=i,this.afc=o})),JU=function(){function e(t){var n=t.header,r=t.headerObject,i=t.body,o=t.eleInfo,a=t.bodyView,s=t.headerView;Ry(this,e),$U(this,"header",null),$U(this,"headerView",null),$U(this,"body",null),$U(this,"bodyView",null),$U(this,"eleInfo",null),$U(this,"duration",0),this.header=n,this.headerView=s||new ZU(r),this.eleInfo=o,this.body=i,this.bodyView=a}return Fy(e,[{key:"type",get:function(){var e;return null==(e=this.headerView)?void 0:e.packetType}},{key:"streamType",get:function(){return this.eleInfo?this.eleInfo[this.headerView.pid]:""}},{key:"packetType",get:function(){var e;return null==(e=this.headerView)?void 0:e.packetType}},{key:"frameType",get:function(){var e;return null==(e=this.bodyView)?void 0:e.frameType}},{key:"pts",get:function(){var e;return null==(e=this.bodyView)?void 0:e.pts}},{key:"ptsTime",get:function(){return this.pts?oU(this.pts/9e4):0}},{key:"dtsTime",get:function(){return this.dts?oU(this.dts/9e4):0}},{key:"dts",get:function(){var e;return null==(e=this.bodyView)?void 0:e.dts}},{key:"keyframe",get:function(){return"I"===this.frameType}},{key:"nalTypes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.type}))}},{key:"nalSizes",get:function(){var e,t;return null==(t=null==(e=this.bodyView)?void 0:e.units)?void 0:Vw(t).call(t,(function(e){return e.unit.length}))}},{key:"isSample",get:function(){return"PES"===this.packetType}},{key:"timescale",get:function(){return 9e4}},{key:"isHevc",get:function(){var e,t;return"bytevc1"===(null==(t=null==(e=this.eleInfo)?void 0:e.video)?void 0:t.codecType)}},{key:"sampleView",get:function(){var e;if("PES"===this.type)return{dts:this.dts,pts:this.pts,units:null==(e=this.bodyView)?void 0:e.units,data:this._getSampleData()}}},{key:"data",get:function(){return this._getSampleData()}},{key:"size",get:function(){var e,t;return null==(t=null==(e=this.sampleView)?void 0:e.data)?void 0:t.length}},{key:"isVideo",get:function(){return this.isSample&&"video"===this.streamType}},{key:"isAudio",get:function(){return this.isSample&&"audio"===this.streamType}},{key:"_getSampleData",value:function(){var e,t;if("audio"===this.streamType)return this.bodyView.data;var n=(null==(t=this.bodyView)?void 0:Gw(e=t.units).call(e,(function(e){return!e.isSei&&!e.isDivision})))||[],r=gL(n).call(n,(function(e,t){return e+(t.unit.byteLength+4)}),0),i=new Uint8Array(r),o=0;return n.forEach((function(e){i.set([0,0,0,1],o),o+=4,i.set(e.unit,o),o+=e.unit.byteLength})),i}}]),e}(),QU=function(){function e(){Ry(this,e)}return Fy(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=function(e){for(var t=Math.min(1e3,e.byteLength-564),n=0;n<t;n++)if(71===e[n]&&71===e[n+188]&&71===e[n+376])return n;return-1}(e);if(-1===n)throw new Error("invalid ts file");var r=e.byteLength;r-=(r-n)%188;for(var i,o=[],a=[],s=[],l=0,u=n;u<r;){var c=e.subarray(u,u+188),h=c.subarray(0,4),f=this._parseTsHeader(c.subarray(0,4));u+=188;var d=void 0,p=void 0,v=4,g="";switch((null==f?void 0:f.afc)>1&&(v+=1+Math.min(c[v],183)),f.pid){case 0:v+=1+c[v],d=c.subarray(v),g="PAT",p={pmtId:l=this._parsePAT(d)};break;default:if(f.pid===l){v+=1+c[v],d=c.subarray(v),p=i=this._parsePMT(d),g="PMT";break}if(!i||!i[f.pid])continue;d=c.subarray(v),g="PES"}if(f.packetType=g,"PES"===g){var y="video"===i[f.pid]?a:s;f.startIndictor&&y.length&&(o.push(new JU(Mm(Mm({},this._concatPesChunk(y)),{},{eleInfo:i}))),y="video"===i[f.pid]?a=[]:s=[]),y.push({header:h,headerObject:f,body:d})}else o.push(new JU({header:h,headerObject:f,body:d,eleInfo:i,bodyView:p}))}a.length&&(o.push(new JU(Mm(Mm({},this._concatPesChunk(a)),{},{eleInfo:i}))),a=[]),s.length&&(o.push(new JU(Mm(Mm({},this._concatPesChunk(s)),{},{eleInfo:i}))),s=[]);var m=FU({items:this._parsePES(o)},t);return m.rates=UU(m),m}},{key:"getSnapshoot",value:function(e){var t,n,r,i=e.items,o=e.rates,a=Gw(i).call(i,(function(e){return"video"===e.streamType})),s=Gw(i).call(i,(function(e){return"audio"===e.streamType})),l=Xm(i).call(i,(function(e){return"PMT"===e.type})),u=a[0],c=s[0],h=a.length,f=this._getNbFrame(a,"I"),d=this._getNbFrame(a,"P"),p=this._getNbFrame(a,"B"),v={rates:o,video:u?AE({},null==u?void 0:u.bodyView,{codecType:u.eleInfo.video.codecType,frameLength:h,topThreeFrameSize:NU(i),avgBits:VU(a),profile:HU(null==(t=null==u?void 0:u.bodyView)?void 0:t.sps),iFrames:f,pFrames:d,bFrames:p,iPercent:oU(f/h*100),pPercent:oU(d/h*100),bPercent:oU(p/h*100),timescale:9e4},this._getDuration(a,"video")):null,audio:c?AE({},null==c?void 0:c.bodyView,{codecType:c.eleInfo.audio.codecType,frameLength:s.length,timescale:9e4,avgBits:VU(s)},this._getDuration(s,"audio")):null};return l&&(null==(n=l.bodyView)?void 0:n.noSupported)&&(v.noSupported=null==(r=l.bodyView)?void 0:r.noSupported),v}},{key:"getRates",value:function(e){return UU(e)}},{key:"_getDuration",value:function(e,t){var n,r=e[0],i=e[e.length-1],o=0;return"audio"===t&&(o=1024/(null==(n=r.bodyView)?void 0:n.sampleRate)*1e3),"video"===t&&(o=r.duration),{duration:(i.pts-r.pts)/9e4,refDuration:o}}},{key:"_getNbKeyFrame",value:function(e){return Gw(e).call(e,(function(e){var t;return null==(t=e.bodyView)?void 0:t.keyframe})).length}},{key:"_getNbFrame",value:function(e,t){return Gw(e).call(e,(function(e){return e.frameType===t})).length}},{key:"_parseTsHeader",value:function(e){if(71===e[0]){var t={};return t.startIndictor=(64&e[1])>>6,t.pid=((31&e[1])<<8)+e[2],t.afc=(48&e[3])>>4,t}return null}},{key:"_parsePAT",value:function(e){return(31&e[10])<<8|e[11]}},{key:"_parsePMT",value:function(e){var t=0,n=3+((15&e[1])<<8|e[2])-4;e[3],e[4],t=t+11+((15&e[10])<<8|e[11])+1;for(var r,i={video:null,audio:null,noSupported:0};t<n;){r=e[t];var o=(31&e[t+1])<<8|e[t+2];switch(r){case 27:case 36:i.video={elePid:o,streamType:r,codecType:27===r?"avc":"bytevc1"},i[o]="video";break;case 15:i.audio={elePid:o,streamType:r,codecType:"aac"},i[o]="audio";break;default:i.noSupported=r,console.warn("unsupported streamType,",r)}t+=5+((15&e[t+3])<<8|e[t+4])}return i}},{key:"_concatPesChunk",value:function(e){var t=gL(e).call(e,(function(e,t){return e+t.body.byteLength}),0),n=new Uint8Array(t),r=0;return e.forEach((function(e){var t=e.body;n.set(t,r),r+=t.byteLength})),Mm(Mm({},e[0]),{},{body:n,packetType:"PES"})}},{key:"_parsePES",value:function(e){var t=this,n=[];return e.forEach((function(e,r){if(e.isSample){var i=e,o=t._parsePESInternal(i.body)||{},a=o.data,s=o.pts,l=o.dts;if(a){if(e.isVideo&&(i.bodyView=t._parseVideoFrame(a,s,l,"bytevc1"===i.eleInfo.video.codecType),t._lastVideo&&(t._lastVideo.duration=1e3*(e.dtsTime-t._lastVideo.dtsTime)),t._lastVideo=i),e.isAudio){var u=xU.parseADTS(a,s),c=u.frames;return delete u.frames,void(null==c||c.forEach((function(e){var r=new JU(AE({},i,{bodyView:Mm(Mm(Mm({},u),e),{},{frameType:"A"})}));n.push(r),t._lastAudio&&(t._lastAudio.duration=1e3*(r.dtsTime-t._lastAudio.dtsTime)),t._lastAudio=r})))}n.push(e)}}else n.push(e)})),n}},{key:"_parsePESInternal",value:function(e){var t=e[8];if(!(0===t||e.length<t+9)&&1===(e[0]<<16|e[1]<<8|e[2])){var n=(e[4]<<8)+e[5];if(!(n&&n>e.length-6)){var r,i,o=e[7];return 192&o&&(r=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&o?r-(i=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(r=i):i=r),i=i||r,{data:e.subarray(9+t),pts:r,dts:i}}}}},{key:"_parseVideoFrame",value:function(e,t,n,r){var i=OU.parseAnnexB(e);if(i.length){var o={units:i=OU.parseNaluType(i,r),pts:t,dts:n};return i.forEach((function(e){var t=e.unit,n=e.type,i=e.frameType;switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!r&&5!==n||r&&5===n)break;o.keyframe=!0,o.frameType="I";break;case 6:case 39:case 40:if(!r&&6!==n||r&&6===n)break;o.seis?o.seis.push(OU.parseSEI(OU.removeEPB(t))):o.seis=[OU.parseSEI(OU.removeEPB(t))];break;case 32:if(!r)break;o.vpsArr?o.vpsArr.push(t):o.vpsArr=[t];break;case 7:case 33:if(!r&&7!==n||r&&7===n)break;o.spsArr?o.spsArr.push(t):o.spsArr=[t];var a=OU.removeEPB(t);o.sps=r?LU.parseSPS(a):MU.parseSPS(a);break;case 8:case 34:if(!r&&8!==n||r&&8===n)break;o.ppsArr?o.ppsArr.push(t):o.ppsArr=[t];break;case 9:case 35:break;case 0:case 1:o.frameType=i}})),o}}}]),e}(),eB=Wc("Array").entries,tB=ir,nB=tt,rB=ce,iB=eB,oB=Array.prototype,aB={DOMTokenList:!0,NodeList:!0},sB=o((function(e){var t=e.entries;return e===oB||rB(oB,e)&&t===oB.entries||nB(aB,tB(e))?iB:t})),lB=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ry(this,e),this._offset=n,this._buffer=t,this._length=t.byteLength}return Fy(e,[{key:"offset",get:function(){return this._offset},set:function(e){this._offset=e}},{key:"forward",value:function(e){this._offset+=e}},{key:"subarray",value:function(e){return e?this._buffer.subarray(this._offset,this._offset+e):this._buffer.subarray(this._offset,e)}},{key:"slice",value:function(e){for(var t=this._offset,n=this._buffer,r=[],i=0;i<e;i++)r.push(n[t+i]);return new Uint8Array(r)}},{key:"readU8",value:function(){return this._buffer[this._offset]}},{key:"readU16",value:function(){var e=this._offset,t=this._buffer;return t[e]<<8|t[e+1]}},{key:"readU24",value:function(){var e=this._offset,t=this._buffer;return t[e]<<16|t[e+1]<<8|t[e+12]}},{key:"readU32",value:function(){var e=this._offset,t=this._buffer;return t[e]*(1<<24)+65536*t[e+1]+256*t[e+2]+t[e+3]}},{key:"read32",value:function(){var e=this._offset,t=this._buffer;return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}}]),e}(),uB=DE,cB=function(e,t,n){return function(e,t,n){t in e?uB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},hB=function(){function e(t,n,r,i,o,a,s,l,u,c){Ry(this,e),cB(this,"dts",0),cB(this,"pts",0),cB(this,"units",null),cB(this,"timescale",0),cB(this,"offset",0),cB(this,"duration",0),cB(this,"data",null),cB(this,"size",0),cB(this,"streamType",""),cB(this,"_frameType",""),cB(this,"isHevc",!1),this.dts=t,this.pts=n,this.units=r,this.timescale=i,this.offset=o,this.data=a,this.size=s,this.duration=l,this.streamType=u,this.isHevc=c}return Fy(e,[{key:"isSample",get:function(){return!0}},{key:"dtsTime",get:function(){return this.dts/this.timescale}},{key:"ptsTime",get:function(){return this.pts/this.timescale}},{key:"frameType",get:function(){var e,t;return"audio"===this.streamType?"A":this._frameType||(null==(t=this.units)?void 0:Gw(e=Vw(t).call(t,(function(e){return e.frameType}))).call(e,Boolean)[0])},set:function(e){this._frameType=e}},{key:"nalTypes",get:function(){var e;return null==(e=this.units)?void 0:Vw(e).call(e,(function(e){return e.type}))}},{key:"nalSizes",get:function(){var e;return null==(e=this.units)?void 0:Vw(e).call(e,(function(e){return e.unit.length}))}},{key:"keyframe",get:function(){return"I"===this.frameType}},{key:"isVideo",get:function(){return"video"===this.streamType}},{key:"isAudio",get:function(){return"audio"===this.streamType}}]),e}(),fB={ftyp:"file type and compatibility",free:"free box",moov:"container for all metadata",mvhd:"movie header,overall declarations",trak:"container for an individual track or stream",tkhd:"track header,overall information about the track",tref:"track reference container",mdia:"container for the media information in a track",mdhd:"media header,oervall information about the media",hdlr:"declares the media type",minf:"media information container",vmhd:"video media header",smhd:"sound media header",dinf:"data information box",stbl:"sample table box",stsd:"sample descriptions(codec types, etc)",stts:"decoding time to sample",ctts:"compostion time to sample",cslg:"compostion to decode timeline mapping",stsc:"sample to chunk",stsz:"sample size",stco:"chunk offset",stss:"sync sample table",sdtp:"independent abd disposable samples",sbgp:"sample to group",mvex:"movid extends box",moof:"movie fragment",mfhd:"movie fragment header",traf:"track fragment",tfhd:"track fragment header",trun:"track fragment run",tfdt:"track fragment decode time",mdat:"media data",meta:"metadata",avc1:"h264 codec info box",hev1:"hevc codec info box"};function dB(e,t){return{isLeading:(12&e[t])>>2,dependsOn:3&e[t],isDenpendedOn:(192&e[t+1])>>6,hasRedundancy:(48&e[t+1])>>4,padding:(14&e[t+1])>>1,nonSync:1&e[t+1],degradationPriority:e[t+2]<<8|e[t+3]}}function pB(e,t){var n;return Vw(n=[e[t],e[t+1],e[t+2],e[t+3]]).call(n,(function(e){return String.fromCharCode(e)})).join("")}function vB(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0;r<e.byteLength;){var i,o=e[r]*(1<<24)+65536*e[r+1]+256*e[r+2]+e[r+3];if(1===o){var a=pB(e,r+4);if("mdat"===a){var s,l=new DataView(e.buffer),u=l.getUint32(r+8)*Math.pow(2,32)+l.getUint32(r+12);console.log(Nm(s="".concat(a,": largesize=")).call(s,u)),o=u}}if(o){var c=e.subarray(r,r+o),h=pB(c,4);n.push({size:o,length:c.byteLength,start:r+t,type:h,sizetypeRepresent:pk(i=c.subarray(0,8)).call(i),body:c.subarray(8),typeDes:fB[h]||""}),r+=o}else r+=4}return n}function gB(e,t,n){if(e)for(var r=0;r<e.length;r++){var i=e[r];if(i.type===t){if(!n)return i;if(n(i))return i}if(i.bodyView instanceof Array){var o=gB(i.bodyView,t,n);if(o){if(!n)return o;if(n(o))return o}}}}function yB(e,t){return gB(e,"trak",(function(e){var n=gB(e.bodyView,"hdlr");return n&&n.bodyView.handlerType===t}))}function mB(e,t,n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w,k=yB(e,t);if(!k)return null;var E=gB(k.bodyView,"stbl"),S=gB(k.bodyView,"mdhd")||{},T=(null==(c=null==(u=Gw(r=E.bodyView).call(r,(function(e){return"stts"===e.type}))[0])?void 0:u.bodyView)?void 0:sB(c))||[];null==(f=null==(h=Gw(i=E.bodyView).call(i,(function(e){return"stss"===e.type}))[0])?void 0:h.bodyView)||sB(f);var C=(null==(p=null==(d=Gw(o=E.bodyView).call(o,(function(e){return"ctts"===e.type}))[0])?void 0:d.bodyView)?void 0:sB(p))||[],A=(null==(g=null==(v=Gw(a=E.bodyView).call(a,(function(e){return"stsc"===e.type}))[0])?void 0:v.bodyView)?void 0:sB(g))||[],x=(null==(m=null==(y=Gw(s=E.bodyView).call(s,(function(e){return"stsz"===e.type}))[0])?void 0:y.bodyView)?void 0:sB(m))||[],P=(null==(b=null==(_=Gw(l=E.bodyView).call(l,(function(e){return"stco"===e.type}))[0])?void 0:_.bodyView)?void 0:sB(b))||[],I=!!gB(E.bodyView,"hvcC"),R="vide"===t;if(!A.length||!P.length||!x.length)return[];for(var D,O=S.bodyView,M=O.timescale,L=void 0===M?1:M,F=O.duration,U=x.length,B=P.length,N=1,V=0,H=[],G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0,i=0,o=0,a=0,s=0,l=[];t=Vw(t).call(t,(function(e){return Mm({},e)})),n=Vw(n).call(n,(function(e){return Mm({},e)}));for(;o<e;){var u=t[r],c=n[i];u.sampleCount&&(a+=u.sampleDelta),u.sampleCount--,u.sampleCount||r++,c&&(s=c.sampleOffset,c.sampleCount--,c.sampleCount||i++),l.push({dts:a,pts:a+s}),o++}return l}(U,T,C);N<=B;){var j=A[V];(null==j?void 0:j.firstChunk)!==N?(H.push(AE({},D,{firstChunk:N,offset:P[N-1]})),N++):(H.push(Mm(Mm({},j),{},{offset:P[N-1]})),D=j,N++,V++)}var z=Vw(x).call(x,(function(e,t){var r=H[0],i=r.offset;r.offset+=e,r.samplesPreChunk--,r.samplesPreChunk||H.shift();var o=G[t],a=n.subarray(i,i+e);if(R){var s=OU.parseNalu(a);return new hB(o.dts,o.pts,OU.parseNaluType(s,I),L,i,a,e,0,"video",I)}return new hB(o.dts,o.pts,null,L,i,a,e,0,"audio")}));gL(z).call(z,(function(e,t){return e?(e.duration=(t.dts-e.dts)/L*1e3,t):t}),null);var K=null==(w=gB(null==k?void 0:k.bodyView,"vide"===t?I?"hvcC":"avcC":"mp4a"))?void 0:w.bodyView;return Mm(Mm(Mm({samples:z,iFrames:Gw(z).call(z,(function(e){return"I"===e.frameType})).length,pFrames:Gw(z).call(z,(function(e){return"P"===e.frameType})).length,bFrames:Gw(z).call(z,(function(e){return"B"===e.frameType})).length},S.bodyView),{},{frameLength:U,duration:F/L,timescale:L},K),null==K?void 0:K.ests)}function _B(e,t){var n=function(e){var t,n,r,i,o=yB(e,"vide"),a=yB(e,"soun"),s=gB(null==o?void 0:o.bodyView,"tkhd"),l=gB(null==a?void 0:a.bodyView,"tkhd"),u=gB(null==o?void 0:o.bodyView,"mdhd"),c=gB(null==a?void 0:a.bodyView,"mdhd"),h=gB(null==o?void 0:o.bodyView,"avcC")||gB(null==o?void 0:o.bodyView,"hvcC"),f=gB(null==a?void 0:a.bodyView,"mp4a"),d=a?Mm(Mm(Mm({type:"audio",trackId:null==(n=l.bodyView)?void 0:n.trackId},c.bodyView),null==f?void 0:f.bodyView),null==(r=null==f?void 0:f.bodyView)?void 0:r.ests):null,p=o?Mm(Mm({type:"video",trackId:null==(i=s.bodyView)?void 0:i.trackId},null==u?void 0:u.bodyView),null==h?void 0:h.bodyView):null;return Uy(t={},(null==d?void 0:d.trackId)||0,d),Uy(t,(null==p?void 0:p.trackId)||0,p),t}(e),r=wI(e).call(e,(function(e){return"moof"===e.type}));if(-1===r)return!1;n.lastVdts=-1,n.lastAdts=-1;for(var i=r;i<e.length&&"moof"===e[i].type;i+=2){var o=e[i];e[i+1].bodyView=bB(o,t,n)}return!0}function bB(e,t,n){var r,i,o=Gw(r=e.bodyView).call(r,(function(e){return"traf"===e.type})),a=Gw(i=Vw(o).call(o,(function(e){var t=gB(e.bodyView,"tfhd"),r=gB(e.bodyView,"tfdt"),i=gB(e.bodyView,"trun");if(t&&i){var o=t.bodyView.trackId;return Mm({trackId:o,baseDataOffset:t.bodyView.baseDataOffset,defaultSampleDuration:t.bodyView.defaultSampleDuration,defaultSampleSize:t.bodyView.defaultSampleSize,baseMediaDecodeTime:r.bodyView.baseMediaDecodeTime,dataOffset:i.bodyView.dataOffset,samples:i.bodyView.samples,sampleCount:i.bodyView.sampleCount},n[o])}}))).call(i,Boolean);return Vw(a).call(a,(function(e){var n,r,i,o=e.baseDataOffset,a=e.defaultSampleDuration,s=void 0===a?0:a,l=e.defaultSampleSize,u=void 0===l?0:l,c=e.dataOffset,h=e.baseMediaDecodeTime,f=void 0===h?0:h,d=e.samples,p=e.sps,v=e.timescale,g=e.type,y=o+c,m=0;return e.samples=Vw(d).call(d,(function(e){var n=t.subarray(y,y+e.size);m+=e.duration||s;var r=f+m;if("video"===g){var i="hev1.1.6.L93.B0"===(null==p?void 0:p.codec),o=OU.parseNalu(n);return y+=e.size,new hB(r,r+(e.ctOffset||0),OU.parseNaluType(o,i),v,y,n,e.size||u,(e.duration||s)/v*1e3,"video",i)}return y+=e.size,new hB(r,r+(e.ctOffset||0),null,v,y,n,e.size||u,(e.duration||s)/v*1e3,"audio")})),e.frameLength=e.samples.length,e.duration=m/v,e.iFrames=Gw(n=e.samples).call(n,(function(e){return"I"===e.frameType})).length,e.pFrames=Gw(r=e.samples).call(r,(function(e){return"P"===e.frameType})).length,e.bFrames=Gw(i=e.samples).call(i,(function(e){return"B"===e.frameType})).length,e}))}var wB=Math.pow(2,32);var kB=an,EB=L,SB=tt,TB=ce,CB=function(){var e=kB(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},AB=RegExp.prototype,xB=ce,PB=function(e){var t=e.flags;return void 0!==t||"flags"in AB||SB(e,"flags")||!TB(AB,e)?t:EB(CB,e)},IB=RegExp.prototype,RB=o((function(e){return e===IB||xB(IB,e)?PB(e):e.flags})),DB=function(){var e=[];e[3]="ES_Descriptor",e[4]="DecoderConfigDescriptor",e[5]="DecoderSpecificInfo",e[6]="SLConfigDescriptor",this.getDescriptorName=function(t){return e[t]};var t=this,n={};return this.parseOneDescriptor=function(t){var r,i,o=0,a=t.readU8();for(t.forward(1),i=t.readU8(),t.forward(1);128&i;)o=(127&i)<<7,i=t.readU8(),t.forward(1);return o+=127&i,(r=e[a]?new n[e[a]](o):new n.Descriptor(o)).parse(t),r},n.Descriptor=function(e,t){this.tag=e,this.size=t,this.descs=[]},n.Descriptor.prototype.parse=function(e){this.data=pk(e).call(e,this.size),e.forward(this.size)},n.Descriptor.prototype.findDescriptor=function(e){for(var t=0;t<this.descs.length;t++)if(this.descs[t].tag===e)return this.descs[t];return null},n.Descriptor.prototype.parseRemainingDescriptors=function(e){for(var n=e.offset;e.offset<n+this.size;){var r=t.parseOneDescriptor(e);this.descs.push(r)}},n.ES_Descriptor=function(e){n.Descriptor.call(this,3,e)},n.ES_Descriptor.prototype=new n.Descriptor,n.ES_Descriptor.prototype.parse=function(e){if(this.ES_ID=e.readU16(),e.forward(2),this.flags=e.readU8(),e.forward(1),this.size-=3,128&RB(this)?(this.dependsOn_ES_ID=e.readU16(),e.forward(2),this.size-=2):this.dependsOn_ES_ID=0,64&RB(this)){var t,n=e.readU8();e.forward(1),this.URL=Vw(t=kS(pk(e).call(e,n))).call(t,(function(e){return String.fromCharCode(e)})),e.forward(n),this.size-=n+1}else this.URL="";32&RB(this)?(this.OCR_ES_ID=e.readU16(),e.forward(2),this.size-=2):this.OCR_ES_ID=0,this.parseRemainingDescriptors(e)},n.ES_Descriptor.prototype.getOTI=function(e){var t=this.findDescriptor(4);return t?t.oti:0},n.ES_Descriptor.prototype.getAudioConfig=function(e){var t=this.findDescriptor(4);if(!t)return null;var n=t.findDescriptor(5);if(n&&n.data){var r=(248&n.data[0])>>3;return 31===r&&n.data.length>=2&&(r=32+((7&n.data[0])<<3)+((224&n.data[1])>>5)),r}return null},n.DecoderConfigDescriptor=function(e){n.Descriptor.call(this,4,e)},n.DecoderConfigDescriptor.prototype=new n.Descriptor,n.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readU8(),e.forward(1),this.streamType=e.readU8(),e.forward(1),this.bufferSize=e.readU24(),e.forward(3),this.maxBitrate=e.readU32(),e.forward(4),this.avgBitrate=e.readU32(),e.forward(4),this.size-=13,this.parseRemainingDescriptors(e)},n.DecoderSpecificInfo=function(e){n.Descriptor.call(this,5,e)},n.DecoderSpecificInfo.prototype=new n.Descriptor,n.SLConfigDescriptor=function(e){n.Descriptor.call(this,6,e)},n.SLConfigDescriptor.prototype=new n.Descriptor,this};function OB(e){var t,n,r,i=Xm(t=e.descs).call(t,(function(e){return 4===e.tag}));i&&(n=Xm(r=i.descs).call(r,(function(e){return 5===e.tag})));var o=AE({},i);return delete o.descs,o.config=(null==n?void 0:n.data.length)?kS(null==n?void 0:n.data):[],o}function MB(e){return Vw(e).call(e,(function(e){return e.toString(16)})).join("")}function LB(e){var t=e.body,n={},r=t[0],i=new lB(t);if(i.forward(4),n.systemId=MB(pk(i).call(i,16)),i.forward(16),r>0){var o=i.readU32();n.kids=[];var a=0;for(i.forward(4);a<o;)n.kids.push(MB(pk(i).call(i,16))),i.forward(16),a++}var s,l=i.readU32();return i.forward(4),n.dataSize=l,n.data=pk(i).call(i,l),n.dataToBase64=btoa((s=n.data,Vw(s).call(s,(function(e){return String.fromCharCode(e)})).join(""))),n}var FB=Math.pow(2,32);var UB=Math.pow(2,32);function BB(e){var t=e.body,n={samples:[]},r=new lB(t);n.version=r.readU8(),r.forward(1),n.flags=pk(r).call(r,3);var i,o,a,s,l=(i=RB(n),o=XM(i,3),a=o[1],{dataOffsetPresent:!!(1&(s=o[2])),firstSampleFlagsPresent:!!(4&s),sampleDurationPresent:!!(1&a),sampleSizePresent:!!((2&a)>>1),sampleFlagsPresent:!!((4&a)>>2),sampleCompositionTimeOffsetPresent:!!((8&a)>>3)}),u=l.dataOffsetPresent,c=l.firstSampleFlagsPresent,h=l.sampleDurationPresent,f=l.sampleSizePresent,d=l.sampleFlagsPresent,p=l.sampleCompositionTimeOffsetPresent;n.trFlags=l,r.forward(3),n.sampleCount=r.readU32(),r.forward(4),u&&(n.dataOffset=r.readU32(),r.forward(4)),c&&(n.firstSampleFlags=dB(t,r.offset),r.forward(4));for(var v=0;v<n.sampleCount;){var g={};h&&(g.duration=r.readU32(),r.forward(4)),f&&(g.size=r.readU32(),r.forward(4)),d&&(g.flags=dB(t,r.offset),r.forward(4)),p&&(g.ctOffset=r.readU32(),r.forward(4)),n.samples.push(g),v++}return n}function NB(e){var t=vB(e instanceof ArrayBuffer?new Uint8Array(e):e,0);if(VB(t),!_B(t,e)){var n,r=gB(t,"mdat");if(r)r.bodyView=Gw(n=[Mm({type:"video"},mB(t,"vide",e)),Mm({type:"audio"},mB(t,"soun",e))]).call(n,(function(e){return!!e.samples}))}return t}function VB(e){var t=0;e.forEach((function(e){switch(e.type){case"ftyp":case"styp":e.bodyView=function(e){var t=e.body,n=e.length,r=new lB(t),i={compatible:[]};i.major=XU(t,0),r.forward(4),i.version=r.readU32(),r.forward(4);for(var o=r.offset;o<n-8;)i.compatible.push(XU(t,o)),o+=4;return i}(e);break;case"moov":case"trak":case"mvex":case"mdia":case"minf":case"dinf":case"moof":case"traf":case"stbl":e.bodyView=vB(e.body,e.start+8),VB(e.bodyView);break;case"stsd":var n=function(e){var t=e.body,n=e.start,r=new lB(t);r.forward(4);var i=r.readU32();return r.forward(4),{entryCount:i,childData:vB(r.subarray(),n+8+8)}}(e),r=n.entryCount,i=n.childData;e.entryCount=r,e.bodyView=i,VB(e.bodyView);break;case"mvhd":e.bodyView=(h=e.body,f=new lB(h),d={},f.forward(4),d.createTime=f.readU32(),f.forward(4),d.modifyTime=f.readU32(),f.forward(4),d.timescale=f.readU32(),f.forward(4),d.duration=f.readU32(),f.forward(4),d.rate=f.readU32(),f.forward(4),f.forward(2),f.forward(70),d.nextTrackId=f.readU32(),d);break;case"tkhd":e.bodyView=function(e){var t=e.body,n=new lB(t,4),r={},i=n.readU8();r.version=i,1===i?n.forward(16):n.forward(8),r.trackId=n.readU32(),n.forward(4),1===i?(r.duration=n.readU32()*UB,n.forward(4),r.duration+=n.readU32()):r.duration=n.readU32();var o=t.byteLength;return o-=8,n.offset=o,r.width=n.readU32()>>16,n.forward(4),r.height=n.readU32()>>16,r}(e);break;case"mehd":e.bodyView=function(e){var t,n=e.body,r=new lB(n);if(r.forward(4),1===n[0]){var i=r.readU32();r.forward(4),t=i*(1<<30)*2+r.readU32()}else t=r.readU32();return{fragDuration:t}}(e);break;case"mdhd":e.bodyView=function(e){var t=e.body,n={},r=new lB(t),i=t[0];return r.forward(4),1===i?(r.forward(16),n.timescale=r.readU32(),r.forward(4),n.duration=r.readU32()*wB,r.forward(4),n.duration+=r.readU32()):(r.forward(8),n.timescale=r.readU32(),r.forward(4),n.duration=r.readU32()),n}(e);break;case"hdlr":e.bodyView=function(e){return{handlerType:XU(e.body,8)}}(e);break;case"trex":e.bodyView=function(e){var t=e.body,n={},r=new lB(t);return r.forward(4),n.trackId=r.readU32(),r.forward(4),n.defaultSdescriptionIndex=r.readU32(),r.forward(4),n.defaultSampleDuration=r.readU32(),r.forward(4),n.defaultSampleSize=r.readU32(),r.forward(4),n.defaultSampleFlags=dB(t,r.offset),n}(e);break;case"trun":e.bodyView=BB(e),t=e.bodyView.samples.length;break;case"tfdt":e.bodyView=function(e){var t=e.body,n=new lB(t),r=0;return n.forward(4),1===t[0]?(r=n.readU32()*FB,n.forward(4),r+=n.readU32()):r=n.readU32(),{baseMediaDecodeTime:r}}(e);break;case"avc1":case"hvc1":case"hev1":e.bodyView=function(e){var t=e.body,n=e.start,r=new lB(t);return r.forward(78),vB(r.subarray(),n+78+8)}(e),VB(e.bodyView);break;case"mp4a":e.bodyView=function(e){var t=e.body,n=pk(t).call(t,28),r=(new DB).parseOneDescriptor(new lB(pk(n).call(n,12),0)),i=(null==r?void 0:r.getAudioConfig)&&r.getAudioConfig();return{channelCount:t[17],samplesize:t[19],sampleRate:t[24]<<8|t[25],objectType:i,codec:"mp4a.40."+i,ests:OB(r)}}(e),e.bodyView&&(e.bodyView.codecType="aac");break;case"avcC":e.bodyView=function(e){var t=e.body,n={spsArr:[],ppsArr:[]},r=new lB(t);n.configVersion=t[0],n.avcProfile=t[1],n.profileComptibility=t[2],n.avcLevel=t[3],r.forward(4),r.forward(1);var i=31&pk(r).call(r,1);r.forward(1);for(var o=0;o<i;o++){var a=r.readU16();r.forward(2),n.spsArr.push(r.subarray(a)),r.forward(a)}var s=pk(r).call(r,1);r.forward(1);for(var l=0;l<s;l++){var u=r.readU16();r.forward(2),n.ppsArr.push(r.subarray(u)),r.forward(u)}return n}(e);var o=e.bodyView;if(o.codecType="avc",!(null==o?void 0:o.sps)){var a=o.spsArr[0],s=OU.removeEPB(a);o.sps=MU.parseSPS(s)}break;case"hvcC":e.bodyView=function(e){var t=e.body;if(!(t.length<23)){t[21];for(var n,r,i,o=[],a=[],s=[],l=23,u=t[22],c=0;c<u;c++){n=63&t[l],r=t[l+1]<<8|t[l+2],l+=3;for(var h=0;h<r;h++)if(i=t[l]<<8|t[l+1],l+=2,i){switch(n){case 32:s.push(t.subarray(l,l+i));break;case 33:o.push(t.subarray(l,l+i));break;case 34:a.push(t.subarray(l,l+i))}l+=i}}return{spsArr:o,ppsArr:a,vpsArr:s}}}(e);var l=e.bodyView;if(l.codecType="bytevc1",!(null==l?void 0:l.sps)){var u=l.spsArr[0],c=OU.removeEPB(u);l.sps=LU.parseSPS(c)}break;case"btrt":e.bodyView=function(e){var t=e.body,n=new lB(t),r=n.readU32();n.forward(4);var i=n.readU32();return n.forward(4),{bufferSizeDB:r,maxBitrate:i,avgBitrate:n.readU32()}}(e);break;case"stts":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=n.readU32(),i=[];n.forward(4);for(var o=0;o<r;o++){var a=n.readU32();n.forward(4);var s=n.readU32();n.forward(4),i.push({sampleCount:a,sampleDelta:s})}return{entries:i,count:i.length}}(e),sB(e.bodyView).length&&(t=sB(e.bodyView)[0].sampleCount);break;case"ctts":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=n.readU32(),i=[];n.forward(4);for(var o=0;o<r;o++){var a=n.readU32();n.forward(4);var s=n.readU32();n.forward(4),i.push({sampleCount:a,sampleOffset:s})}return{entries:i,count:i.length}}(e);break;case"cslg":e.bodyView=function(e){var t,n,r,i,o=e.body,a=new lB(o);return a.forward(4),t=a.read32(),a.forward(4),n=a.read32(),a.forward(4),r=a.read32(),a.forward(4),i=a.read32(),a.forward(4),{compositionToDTSShift:t,leastDecodeToDisplayDelta:n,greatestDecodeToDisplayDelta:r,compositionStartTime:i,compositionEndTime:a.read32()}}(e);break;case"stss":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=[],i=n.readU32();n.forward(4);for(var o=0;o<i;o++){var a=n.readU32();r.push(a),n.forward(4)}return{entries:r,count:r.length}}(e);break;case"stsz":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=[],i=n.readU32();n.forward(4);var o=n.readU32();if(n.forward(4),0===i)for(var a=0;a<o;a++){var s=n.readU32();r.push(s),n.forward(4)}else console.warn("parse stsz, sample size not equal 0");return{entries:r,count:r.length}}(e);break;case"stsc":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=[],i=n.readU32();n.forward(4);for(var o=0;o<i;o++){var a=n.readU32();n.forward(4);var s=n.readU32();n.forward(4);var l=n.readU32();n.forward(4),r.push({firstChunk:a,samplesPreChunk:s,sampleDesIndex:l})}return{entries:r,count:r.length}}(e);break;case"stco":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(4);var r=n.readU32(),i=[];n.forward(4);for(var o=0;o<r;o++){var a=n.readU32();i.push(a),n.forward(4)}return{entries:i,count:i.length}}(e);break;case"sdtp":e.bodyView=function(e,t){var n=e.body,r=new lB(n);r.forward(4);for(var i,o,a,s,l=[],u=0;u<t;u++){var c=r.readU8();i=(192&c)>>6,o=(48&c)>>4,a=(12&c)>>2,s=3&c,l.push({isLeading:i,dependsOn:o,isDenpendedOn:a,hasRedundancy:s}),r.forward(1)}return{entries:l}}(e,t);break;case"mfhd":e.bodyView=function(e){var t=e.body,n=new lB(t);return n.forward(4),{seqNumber:n.readU32()}}(e);break;case"tfhd":e.bodyView=function(e){var t=e.body,n=new lB(t);n.forward(1);var r=pk(n).call(n,3),i=r[0]<<16|r[1]<<8|r[2],o={flags:r},a={baseDataOffsetPresent:!!(1&i),sampleDescriptionIndexPresent:!!(2&i),defaultSampleDurationPresent:!!(8&i),defaultSampleSizePresent:!!(16&i),defaultSampleFlagsPresent:!!(32&i),durationIsEmpty:!!(65536&i),defaultBaseIsMoof:!!(131072&i)};if(o.tfFlags=a,n.forward(3),o.trackId=n.readU32(),a.baseDataOffsetPresent){n.forward(4);var s=n.readU32();n.forward(4);var l=n.readU32();o.baseDataOffset=s<<32|l}else o.baseDataOffset=0,console.warn("base data offset not detected in tfhd");return a.sampleDescriptionIndexPresent&&(n.forward(4),o.sampleDescriptionIndex=n.readU32()),a.defaultSampleDurationPresent&&(n.forward(4),o.defaultSampleDuration=n.readU32()),a.defaultSampleSizePresent&&(n.forward(4),o.defaultSampleSize=n.readU32()),a.defaultSampleFlagsPresent&&(n.forward(4),o.defaultSampleFlags=n.readU32()),o}(e);break;case"pssh":e.bodyView=LB(e)}var h,f,d}))}var HB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"parse",value:function(e){return NB(e)}},{key:"parseV2",value:function(e,t){var n,r,i,o,a,s,l=Gw(e).call(e,(function(e){return"mdat"===e.type})),u=[],c=null==(r=null==(n=l[0])?void 0:n.bodyView)?void 0:Gw(r).call(r,(function(e){return"video"===e.type}))[0],h=null==(o=null==(i=l[0])?void 0:i.bodyView)?void 0:Gw(o).call(o,(function(e){return"audio"===e.type}))[0],f=Math.min((null==(a=null==h?void 0:h.samples[0])?void 0:a.dtsTime)||0,(null==(s=null==c?void 0:c.samples[0])?void 0:s.dtsTime)||0);l.forEach((function(e){e.bodyView.forEach((function(e){e.samples.forEach((function(e){e.time=oU(e.dtsTime-f),u.push(e)}))}))}));var d={items:pC(u).call(u,(function(e,t){return e.time>t.time?1:-1}))};return this._addMetadataToFirstKeyFrame(c),d.rates=UU(d),d}},{key:"getSnapshoot",value:function(e){return function(e){var t,n,r,i,o,a,s=Gw(e).call(e,(function(e){return"mdat"===e.type}));if(!s.length){var l=yB(e,"vide"),u=yB(e,"soun"),c=null==(n=gB(null==l?void 0:l.bodyView,"mdhd"))?void 0:n.bodyView,h=(null==(r=gB(null==l?void 0:l.bodyView,"avcC"))?void 0:r.bodyView)||(null==(i=gB(null==l?void 0:l.bodyView,"hvcC"))?void 0:i.bodyView),f=null==(o=gB(null==u?void 0:u.bodyView,"mdhd"))?void 0:o.bodyView,d=null==(a=gB(null==u?void 0:u.bodyView,"mp4a"))?void 0:a.bodyView;try{return{video:Mm(Mm({},c),{},{duration:(null==c?void 0:c.duration)/c.timescale},h),audio:Mm(Mm(Mm({},f),{},{duration:(null==f?void 0:f.duration)/f.timescale},d),d.ests)}}catch(w){}return{}}var p=gL(t=Vw(s).call(s,(function(e){return e.bodyView}))).call(t,(function(e,t){return Nm(e).call(e,t)}),[]),v=gL(p).call(p,(function(e,t){var n,r=t.type,i=t.frameLength,o=t.iFrames,a=t.pFrames,s=t.bFrames,l=t.duration;return e[r]?(e[r].frameLength+=i,e[r].iFrames+=o,e[r].pFrames+=a,e[r].bFrames+=s,e[r].duration+=l,e):(e[r]=AE({},t),e[r].refDuration||(e[r].refDuration=null==(n=t.samples[0])?void 0:n.duration),e)}),{}),g=v.video;if(g){var y=g.frameLength,m=g.iFrames,_=g.pFrames,b=g.bFrames;g.iPercent=oU(m/y*100),g.pPercent=oU(_/y*100),g.bPercent=oU(b/y*100)}return v}(e)}},{key:"_addMetadataToFirstKeyFrame",value:function(e){var t;if(e){var n=Gw(t=e.samples).call(t,(function(e){return e.keyframe}))[0];n&&(n.sps=e.sps,n.vpsArr=e.vpsArr,n.spsArr=e.spsArr,n.ppsArr=e.ppsArr)}}}]),e}(),GB=.2,jB=40,zB=.3,KB=.5,WB=.1,qB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType}));if(t&&n){var r,i,o,a=t.pts-n.pts,s=oU(a/t.timescale);if(a/t.timescale>=GB)return[{description:Nm(r=Nm(i=Nm(o="【音视频首帧gap差距过大】视频首帧pts: ".concat(t.pts,", 音频首帧pts: ")).call(o,n.pts,", delta: ")).call(i,a,"(")).call(r,s,"s)"),tips:"".concat(s>10?"可能造成无法起播问题":"")}]}}}]),e}(),XB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType})),r=!!e[0]&&e[0]instanceof _U;return[this._checkBreak(t,"video"),this._checkBreak(n,"audio"),r&&this._checkConsecutiveFrameBreak(null==e?void 0:Gw(e).call(e,(function(e){return e.isSample})))]}},{key:"_checkBreak",value:function(e,t){var n=e.length;if(n)for(var r=0;r<n-1;r++){var i,o,a,s;if(Math.abs(e[r].dtsTime-e[r+1].dtsTime)>KB)return{description:Nm(i=Nm(o=Nm(a=Nm(s="【".concat(t,"时间戳发生跳变】,当前帧dts: ")).call(s,e[r].dts,", time:")).call(a,e[r].time,", 后一帧dts: ")).call(o,e[r+1].dts,", time:")).call(i,e[r+1].time)}}}},{key:"_checkConsecutiveFrameBreak",value:function(e){var t=e.length;if(t)for(var n=0;n<t-1;n++)if(Math.abs(e[n].dtsTime-e[n+1].dtsTime)>WB){var r,i,o,a,s,l=e[n],u=e[n+1];return{description:Nm(r=Nm(i=Nm(o=Nm(a=Nm(s="【前后帧dts差距过大】,当前帧(".concat(l.streamType,")dts: ")).call(s,l.dts,", time:")).call(a,l.time,", 后一帧(")).call(o,u.streamType,")dts: ")).call(i,u.dts,", time:")).call(r,u.time),tips:"可能造成播放画面卡顿或者声音卡顿"}}}}]),e}(),YB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){return[this._checkKeyFrame(e),this._checkAudioFrameDataFull(e)]}},{key:"_checkKeyFrame",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType}))[0];if(t&&"I"!==t.frameType)return{description:"【视频首帧非关键帧】",tips:"可能播放花屏或者报解码错误"}}},{key:"_checkAudioFrameDataFull",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType})),n=t.length;if(n)for(var r=0;r<n;r++){var i,o=t[r].data;if((null==o?void 0:o.length)<jB)return{description:Nm(i="【音频帧数据较少】 pts=".concat(t[r].pts,", time=")).call(i,t[r].time),tips:"可能由于音频数据原因导致解码报错"}}}}]),e}(),$B=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e,t){return[this._hasVideoMetadata(e),this._hasAudioMetadata(e),this._checkRepeatedSps(e),this._metadataOnlyInSequeceHeader(e,t)]}},{key:"_hasVideoMetadata",value:function(e){var t,n=null==(t=null==e?void 0:Gw(e).call(e,(function(e){return"video"===e.streamType}))[0])?void 0:t.bodyView;if(n&&!n.sps)return{description:"【未检测到视频metadata信息】",tips:"可能视频无法播放或者报解码错误"}}},{key:"_hasAudioMetadata",value:function(e){var t,n=null==(t=null==e?void 0:Gw(e).call(e,(function(e){return"audio"===e.streamType}))[0])?void 0:t.bodyView;if(n&&(!n.config||!n.sampleRate||!n.channelCount))return{description:"【未检测到音频metadata信息】",tips:"可能视频无法播放或者报解码错误"}}},{key:"_checkRepeatedSps",value:function(e){var t,n=null==e?void 0:Gw(e).call(e,(function(e){return"video"===e.streamType}))[0],r=(null==(t=null==n?void 0:n.bodyView)?void 0:t.spsArr)||[];if(n&&r.length>1&&r[0].join(",")!==r[1].join(","))return{description:"【关键帧前包含多个sps信息】"}}},{key:"_metadataOnlyInSequeceHeader",value:function(e,t){var n;if("FLV"===t){var r=null==e?void 0:Xm(e).call(e,(function(e){return e.keyframe}));if(r){var i=r.isHevc;return-1===fk(n=r.nalTypes).call(n,i?33:7)?{description:"【sps、pps信息只存在于Sequence Header中】"}:void 0}}}}]),e}(),ZB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"video"===e.streamType}));if(t)return t.isHevc?[{id:1,description:"【H265编码格式】",tips:"对于不支持H265解码的设备无法播放"}]:void 0}}]),e}(),JB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){if(null==e?void 0:Xm(e).call(e,(function(e){return e.isSample&&"B"===e.frameType})))return[{description:"【存在B帧】"}]}}]),e}(),QB=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType}));if(t.length&&n.length){var r,i,o=t[t.length-1].ptsTime-t[0].ptsTime,a=n[n.length-1].ptsTime-n[0].ptsTime;if(Math.abs(o-a)>=zB)return[{description:Nm(r=Nm(i="【音视频时长存在差距】, video=".concat(o,"s, audio=")).call(i,a,"s, delta=")).call(r,oU(o-a),"s"),tips:"可能造成播放画面卡顿或者声音卡顿"}]}}}]),e}(),eN=function(){function e(){Ry(this,e)}return Fy(e,[{key:"detect",value:function(e){var t=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"video"===e.streamType})),n=null==e?void 0:Gw(e).call(e,(function(e){return e.isSample&&"audio"===e.streamType}));if(t.length||n.length)return t.length&&n.length?void 0:[{description:"【流开始只包含".concat(t.length?"音频":"视频","】"),tips:"可能播放没有声音或者没有画面"}]}}]),e}();function tN(e,t){var n,r,i;return Gw(n=gL(r=Vw(i=[new ZB,new qB,new XB,new YB,new $B,new QB,new JB,new eN]).call(i,(function(n){return n.detect(e,t)}))).call(r,(function(e,t){return Nm(e).call(e,t)}),[])).call(n,Boolean)}var nN=DE,rN=function(e,t,n){return function(e,t,n){t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==Tc(t)?t+"":t,n),n},iN=function(){function e(t){var n=this;Ry(this,e),rN(this,"_opts",null),rN(this,"_controller",null),rN(this,"_reader",null),rN(this,"_loading",!1),rN(this,"_chunks",[]),rN(this,"_readStream",(function(e,t){var r=0;n._reader=e.getReader();var i=n._chunks;return function e(){var o;return null==(o=n._reader)?void 0:o.read().then((function(n){var o=n.value,a=n.done;return i.push(o),t(r,o),a?Hw.resolve(iU(Gw(i).call(i,Boolean))):(r+=o.byteLength,e())}))}()})),this._opts=t}return Fy(e,[{key:"request",value:function(){var e=this,t=this._opts,n=t.url,r=t.onProgress,i=t.contentType,o=void 0===i?"ArrayBuffer":i,a=t.loadTimeout,s=void 0===a?5e3:a,l=t.headers;return this._controller=new AbortController,Hw.race([fetch(n,{signal:this._controller.signal,headers:l}),new Hw((function(t,n){setTimeout((function(){var t;e._loading||(n({code:0,message:"timeout"}),null==(t=e._controller)||t.abort())}),s)}))]).then((function(t){return t.ok&&t.status>=200&&t.status<300?(e._loading=!0,t):Hw.reject({code:t.status,message:t.statusText})})).then((function(t){switch(o){case"TEXT":return t.text();case"JSON":return t.json();case"ArrayBuffer":return r?e._readStream(t.clone().body,r):t.arrayBuffer()}})).catch((function(t){if(e._loading=!1,"AbortError"!==t.name)return Hw.reject({code:t.code||0,message:t.message})}))}},{key:"cancel",value:function(){var e,t;try{null==(e=this._reader)||e.cancel(),null==(t=this._controller)||t.abort(),this._reader=null,this._controller=null}catch(n){}}}]),e}(),oN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parse",value:(t=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d,p=this;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=[],this._loader=new iN(Mm(Mm({url:t},n),{},{onProgress:function(e,t){u.push(t),e>n.probeSize&&p._loader.cancel()}})),e.next=4,this._loader.request();case 4:return c=new zU,h=c.parse(iU(u)),f=c.getSnapshoot(h),d=null==(r=f.video)?void 0:r.sps,e.abrupt("return",{codec:null==(i=f.video)?void 0:i.codecType,codecStr:null==d?void 0:d.codec,width:null==d?void 0:d.width,height:null==d?void 0:d.height,vDration:null==(o=null==f?void 0:f.video)?void 0:o.duration,aDuration:null==(a=null==f?void 0:f.audio)?void 0:a.duration,sampleRate:null==(s=null==f?void 0:f.audio)?void 0:s.sampleRate,channelCount:null==(l=null==f?void 0:f.audio)?void 0:l.channelCount,views:h,snap:f});case 9:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}(),aN={exports:{}};aN.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||DE(e,t,{enumerable:!0,get:r})},n.r=function(e){void 0!==OE&&mM&&DE(e,mM,{value:"Module"}),DE(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==Tc(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),DE(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function r(e,t){var n=dk(e);if(xE){var r=xE(e);t&&(r=Gw(r).call(r,(function(t){return PE(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){return(i="function"==typeof OE&&"symbol"==Tc(ME)?function(e){return Tc(e)}:function(e){return e&&"function"==typeof OE&&e.constructor===OE&&e!==OE.prototype?"symbol":Tc(e)})(e)}function o(e,t,n){return t in e?DE(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t),n.d(t,"m3u8Parser",(function(){return h})),n.d(t,"mpdParser",(function(){return g}));var a=/EXT(?:-X-)?([^:]+):?(.*)$/,s=/([^,="]+)((="[^"]+")|(=[^,]+))*/g;function l(e){var t;return gL(t=e.split("-")).call(t,(function(e,t){return e+(e?t.charAt(0)+pk(t).call(t,1).toLowerCase():t.toLowerCase())}),"")}function u(e){if(!/^#EXT/.test(e)&&/^\s*#/.test(e))return null;var t,n,u=a.exec(e);return u?(t=l(u[1]),n=function(e,t){if(!e)return null;var n=Vw(t=e.match(s)).call(t,(function(e){return function(e){var t=IT(e).call(e).replace("=","|").split("|");if(2==t.length)return o({},l(t[0]),t[1].replace(/("|')/g,""));var n=wT(t[0]);return Fk(n)?t[0]:n}(e)}));return 1===n.length?n[0]:0===Gw(n).call(n,(function(e){return"object"===i(e)})).length?n:gL(n).call(n,(function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):IE?RE(e,IE(n)):r(Object(n)).forEach((function(t){DE(e,t,PE(n,t))}))}return e}({},e,{},t)}),{})}(u[2])):(t="url",n=e),o({},t,n)}function c(e,t){if(/^https?/.test(e)||/^data:/.test(e)||/^sdk:/.test(e))return e;for(t=pk(n=t.split("/")).call(n,0,-1),e=e.split("/");e.length;){var n,r=e.shift();-1==fk(t).call(t,r)&&t.push(r)}return t.join("/")}var h=function(e,t,n){var r,i,o;if(!e||!t)return{error:1,msg:"invalid input"};var a,s=Gw(r=Vw(i=Gw(o=e.split("\n")).call(o,Boolean)).call(i,(function(e){return u(IT(e).call(e))}))).call(r,Boolean);if(!s.length)return{error:1,msg:"invalid m3u8"};a=0!==Gw(s).call(s,(function(e){return!!e.streamInf})).length?{master:!0,m3u8Url:t,levels:[],medias:[]}:{master:!1,m3u8Url:t,duration:0,startSN:0,endSN:0,segments:[],live:!0};try{a=function(e,t,n){for(var r=t.master,i=e.length,o=0,a=0,s=0,l=0,u=0,h=-1,f=0;f<i;f++){var d=e[f];for(var p in d){var v=d[p];switch(v&&v.uri&&(v.url=c(v.uri,t.m3u8Url)),p){case"inf":var g={start:a,end:a+(Array.isArray(v)?v[0]:v),cc:o,sn:s+l};h>=0&&(g.keyIndex=h),l++,a=g.end,t.segments.push(g);break;case"start":a=v;break;case"discontinuity":o++;break;case"mediaSequence":s=v;break;case"streamInf":u++,v.levelId=u,t.levels.push(v);break;case"media":t.medias.push(v);break;case"endlist":t.live=!1;break;case"key":h++,t.key?t.key.push(v):t.key=[v];break;case"url":var y=r?t.levels:t.segments;if(!y.length)throw new Error("invalid m3u8");r?y[u-1].url=c(v,t.m3u8Url):y[l-1].url=c(v,t.m3u8Url);break;default:v&&(t[p]=v)}}n&&(t=n(d,t))}return r||(t.startSN=s,t.endSN=s+l-1,t.duration=a),t}(s,a,n)}catch(l){return{error:1,msg:l.message}}return a},f=/\s*(<\/?[^>]+>)/,d=/\s*(?:<\/?([^\s>]+))?\s*([^>]+)*(?:\/?>)?/,p=/\s*([^=]+)="([^"]+)"/g;function v(e,t){for(var n,r,i,o=[],a=e.length,s=0;s<a;s++)if((n=e[s]).closed)if(r=o.pop(),"pureValue"!==n.tagName){if(r&&r.tagName===n.tagName?i=o.pop():(i=r,r=n),!i){o.push(r);break}var l=r,u=l.tagName,c=l.attrs,h=i.attrs[u];t&&(c=t(u,c)),i.attrs[u]=h?Array.isArray(h)?Nm(h).call(h,c):[h,c]:c,o.push(i)}else r.attrs?r.attrs.value=n.attrs.value:r.attrs=n.attrs,o.push(r);else o.push(n);var f,d,p,v=o[0];return v?"undefined"!=v.tagName?(f={},d=v.tagName,p=v.attrs,d in f?DE(f,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):f[d]=p,f):v.tagName:null}var g=function(e,t){if(!e)return{error:1,msg:"invalid input"};try{var n,r,i;return v(Gw(n=Vw(r=Gw(i=e.split(f)).call(i,Boolean)).call(r,(function(e){return function(e){var t,n,r=e.match(d),i={},o=(t=r&&r[1])?gL(n=t.split("_")).call(n,(function(e,t){return e?e+=t.charAt(0).toUpperCase()+pk(t).call(t,1):e=t.charAt(0).toLowerCase()+pk(t).call(t,1)}),""):"";if(r&&r[1]&&r[2]){for(var a,s={};null!=(a=p.exec(r[2]));)s[a[1]]=a[2];return"?xml"===o?null:(i.tagName=o,i.attrs=s,i.closed=/\/$/.test(r[2]),i)}return r?/^<\//.test(r[0])?(i.tagName=o,i.closed=!0,i):/^</.test(r[0])?(i.tagName=o,i.attrs={},i):(i.tagName="pureValue",i.attrs={value:r[2]},i.closed=!0,i):null}(e)}))).call(n,Boolean),t)}catch(o){return{error:1,msg:o.message}}}}]);var sN=aN.exports;function lN(e){return uN.apply(this,arguments)}function uN(){return uN=sy(oy().mark((function e(t){var n,r,i,o=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new iN(Mm(Mm({url:t},o.length>1&&void 0!==o[1]?o[1]:{}),{},{contentType:"TEXT"})),e.next=4,n.request();case 4:return r=e.sent,i=sN.m3u8Parser(r,t,(function(e,t){var n;if(!e.url||!/^\//.test(e.url))return t;var r=e.url,i=t.segments[t.segments.length-1];return i.url=pk(n=i.url.split("/")).call(n,0,3).join("/")+r,t})),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)}))),uN.apply(this,arguments)}var cN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parse",value:(t=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lN(t,n);case 2:if(!(u=e.sent).master){e.next=7;break}return e.next=6,lN(u.levels[0].url);case 6:u=e.sent;case 7:if(null==u?void 0:u.segments.length){e.next=9;break}throw new Error("invalid m3u8");case 9:c=[],h=n.nbSegment,f=0,d=oy().mark((function e(){var t;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new iN(Mm(Mm({url:u.segments[f].url},n),{},{onProgress:function(e,r){c.push(r),e>n.probeSize&&t.cancel()}})),e.next=3,t.request();case 3:h--,f++;case 5:case"end":return e.stop()}}),e)}));case 13:if(!h){e.next=17;break}return e.delegateYield(d(),"t0",15);case 15:e.next=13;break;case 17:return p=new Uint8Array(iU(Gw(c).call(c,Boolean))),v=new QU,g=v.parse(p),y=v.getSnapshoot(g),m=null==(r=y.video)?void 0:r.sps,e.abrupt("return",{codec:null==(i=y.video)?void 0:i.codecType,codecStr:null==m?void 0:m.codec,width:null==m?void 0:m.width,height:null==m?void 0:m.height,vDration:null==(o=null==y?void 0:y.video)?void 0:o.duration,aDuration:null==(a=null==y?void 0:y.audio)?void 0:a.duration,sampleRate:null==(s=null==y?void 0:y.audio)?void 0:s.sampleRate,channelCount:null==(l=null==y?void 0:y.audio)?void 0:l.channelCount,views:g,snap:y});case 23:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})}]),e}(),hN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parse",value:(t=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=new iN(Mm(Mm({url:t},n),{},{contentType:"ArrayBuffer",headers:{Range:"bytes=0-1499"}})),h=[],e.next=4,c.request();case 4:return f=e.sent,d=new Uint8Array(f),p=(new HB).parse(d),v=Xm(p).call(p,(function(e){return"mdat"===e.type})),(g=Xm(p).call(p,(function(e){return"moov"===e.type})))?(h.push(g.start),h.push(g.start+g.size)):v&&h.push(v.start+v.size),c=new iN(Mm(Mm({url:t},n),{},{contentType:"ArrayBuffer",headers:{Range:Nm(r="bytes=".concat(h[0],"-")).call(r,h[1]||"")}})),e.next=13,c.request();case 13:return y=e.sent,m=new HB,_=m.parse(y),b=m.getSnapshoot(_),w=null==(i=b.video)?void 0:i.sps,e.abrupt("return",{codec:null==(o=b.video)?void 0:o.codecType,codecStr:null==w?void 0:w.codec,width:null==w?void 0:w.width,height:null==w?void 0:w.height,vDration:null==(a=null==b?void 0:b.video)?void 0:a.duration,aDuration:null==(s=null==b?void 0:b.audio)?void 0:s.duration,sampleRate:null==(l=null==b?void 0:b.audio)?void 0:l.sampleRate,channelCount:null==(u=null==b?void 0:b.audio)?void 0:u.channelCount,views:m.parseV2(_,!0),snap:b});case 19:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})}]),e}(),fN=function(){function e(){Ry(this,e)}var t;return Fy(e,[{key:"parseUrl",value:(t=sy(oy().mark((function e(t){var n,r,i,o,a=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=AE({timeout:5e3,probeSize:8e4,nbSegment:1},r=a.length>1&&void 0!==a[1]?a[1]:{}),!/flv/.test(t)){e.next=9;break}return e.next=5,(new oN).parse(t,r);case 5:i=e.sent,o=KU,e.next=20;break;case 9:if(!/m3u8?/.test(t)){e.next=16;break}return e.next=12,(new cN).parse(t,r);case 12:i=e.sent,o=WU,e.next=20;break;case 16:return e.next=18,(new hN).parse(t,r);case 18:i=e.sent,o=qU;case 20:return i.exceps=Gw(n=tN(i.views.items,o)).call(n,(function(e){return 1!==e.id})),e.abrupt("return",i);case 22:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),dN=function(){var e=sy(oy().mark((function e(n){var r,i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w,k,E;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=(null==n||null===(r=n.flv)||void 0===r?void 0:r.enableLowLatency)&&"pc"===PC.device,v=null===(i=null==n||null===(o=n.flv)||void 0===o||null===(o=o.lowLatency)||void 0===o?void 0:o.enableFrameChasing)||void 0===i||i,g=null!==(a=null==n||null===(s=n.flv)||void 0===s||null===(s=s.lowLatency)||void 0===s?void 0:s.abrPts)&&void 0!==a?a:"-800",e.next=5,_N(n);case 5:return y=e.sent,e.next=8,EN(n,y);case 8:if(e.sent&&(d=y===t.H265?mN():yN(),f=vN(n)),bF("unknown"===y?t.H264:y)&&(f=vN(n)),f||d){e.next=13;break}return e.abrupt("return",{});case 13:return e.next=15,Hw.all([(null===(l=f)||void 0===l?void 0:l.module)&&uF(f.module).catch((function(){})),(null===(u=d)||void 0===u?void 0:u.module)&&uF(d.module).catch((function(){}))]);case 15:return m=e.sent,_=XM(m,2),b=_[0],(null==(w=_[1])?void 0:w.XGVideoPlugin)&&(null===(c=d)||void 0===c||null===(h=c.afterLoad)||void 0===h||h.call(c,null==w?void 0:w.XGVideoPlugin)),k=TN([f,d]),E=[],p&&(k.url=hF(n.url,{abr_pts:g})),b&&(E.push(b.FlvPlugin),p&&v&&E.push(b.Adaptive)),e.abrupt("return",{options:k,plugins:E});case 25:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pN=function(){var e=sy(oy().mark((function e(n){var r,i,o,a,s,l,u,c,h,f,d,p,v;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_N(n);case 2:return c=e.sent,e.next=5,EN(n,c);case 5:if(e.sent&&(u=c===t.H265?mN():yN(),l=gN(n)),("mobile"!==PC.device||null!=n&&null!==(r=n.hls)&&void 0!==r&&r.enableMSE)&&bF("unknown"===c?t.H264:c)&&(l=gN(n)),l||u){e.next=10;break}return e.abrupt("return",{});case 10:return e.next=12,Hw.all([(null===(i=l)||void 0===i?void 0:i.module)&&uF(l.module).catch((function(){})),(null===(o=u)||void 0===o?void 0:o.module)&&uF(u.module).catch((function(){}))]);case 12:return h=e.sent,f=XM(h,2),d=f[0],(null==(p=f[1])?void 0:p.XGVideoPlugin)&&(null===(a=u)||void 0===a||null===(s=a.afterLoad)||void 0===s||s.call(a,null==p?void 0:p.XGVideoPlugin)),v=TN([l,u]),e.abrupt("return",{options:v,plugins:null!=d&&d.HlsPlugin?[d.HlsPlugin]:[]});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),vN=function(e){var t,n,r;return{options:{flv:Mm({retryCount:0,disconnectRetryCount:null!==(t=null==e||null===(n=e.flv)||void 0===n?void 0:n.retryCount)&&void 0!==t?t:void 0},null!==(r=null==e?void 0:e.flv)&&void 0!==r?r:{})},module:VL.PluginFlv}},gN=function(e){var t;return{options:{hls:Mm({retryCount:0,pollRetryCount:0},null!==(t=null==e?void 0:e.hls)&&void 0!==t?t:{})},module:VL.PluginHls}},yN=function(){return{options:{mediaType:"xg-video",innerDegrade:1,codecType:t.H264},module:VL.PluginXgvideo,afterLoad:function(e){e.isSupported()&&e.setDecodeCapacity({preloadDecoder:t.H264,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1})}}},mN=function(){return{options:{mediaType:"xg-video",innerDegrade:1,codecType:t.H265},module:VL.PluginXgvideo,afterLoad:function(e){e.isSupported()&&e.setDecodeCapacity({preloadDecoder:t.H265,wasmFallbackToAsm:!1,reuseWasmDecoder:!1})}}};function _N(e){return bN.apply(this,arguments)}function bN(){return(bN=sy(oy().mark((function e(t){return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.codec){e.next=2;break}return e.abrupt("return",t.codec);case 2:if(t.degradation!==n.SoftFirst||!t.url){e.next=6;break}return e.next=5,wN(t.url);case 5:return e.abrupt("return",e.sent);case 6:return e.abrupt("return","unknown");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wN(e){return kN.apply(this,arguments)}function kN(){return(kN=sy(oy().mark((function e(n){var r,i;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(new fN).parseUrl(n);case 3:if(r=e.sent,"bytevc1"!==(i=r.codec)){e.next=9;break}return e.abrupt("return",t.H265);case 9:if("avc"!==i){e.next=11;break}return e.abrupt("return",t.H264);case 11:return e.abrupt("return","unknown");case 14:return e.prev=14,e.t0=e.catch(0),console.error("detect codec error: ",e.t0),e.abrupt("return","unknown");case 18:case"end":return e.stop()}}),e,null,[[0,14]])})))).apply(this,arguments)}function EN(e,t){return SN.apply(this,arguments)}function SN(){return(SN=sy(oy().mark((function e(i,o){return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.decodeType!==r.Software){e.next=2;break}return e.abrupt("return",!0);case 2:if("unknown"!==o){e.next=4;break}return e.abrupt("return",!1);case 4:return e.next=6,_N(i);case 6:if(e.sent!==t.H265){e.next=12;break}if(!PC.isHevcSupported()){e.next=10;break}return e.abrupt("return",!1);case 10:if(i.degradation!==n.SoftFirst){e.next=12;break}return e.abrupt("return",!0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function TN(e){return gL(e).call(e,(function(e,t){return AE(e,null==t?void 0:t.options)}),{})}var CN=vP,AN=function(e){return e[e.INVALID_PARAMETER=210]="INVALID_PARAMETER",e}(AN||{}),xN=Mm(Mm({},AN),fP),PN=Mm(Mm({},dP),{},Uy({},210,{messageTextKey:"INVALID_PARAMETER",level:hP.Fatal}));function IN(e,t){return new CN(PN[e],t)}function RN(){return DN.apply(this,arguments)}function DN(){return(DN=sy(oy().mark((function e(){var t,n;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uF(VL.PluginRtm);case 2:return t=e.sent,n=t.RtmPlugin,e.abrupt("return",n.isSupported());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ON(){return MN.apply(this,arguments)}function MN(){return MN=sy(oy().mark((function e(){var t,n,r,i=arguments;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:Zj.H264,e.next=3,uF(VL.PluginRtm);case 3:if(n=e.sent,r=n.RtmPlugin,t!==Zj.H264){e.next=7;break}return e.abrupt("return",r.isSupportedH264());case 7:return e.abrupt("return",!1);case 8:case"end":return e.stop()}}),e)}))),MN.apply(this,arguments)}var LN=["fallbackUrl","enableFallback","enableRTMAutoTranscode"],FN={options:{},module:VL.PluginRtm},UN=function(e){return"pc"===PC.device?e.replace(".sdp",".flv"):e.replace(".sdp",".m3u8")},BN=function(){var e=sy(oy().mark((function e(n,r){var i,o,a,s,l,u,c,h,f,d,p,v,g,y,m,_,b,w,k,E,S;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.url,l=n.rtm||{},u=l.fallbackUrl,c=l.enableFallback,h=void 0===c||c,f=l.enableRTMAutoTranscode,d=tm(l,LN),p=h?!u&&s?UN(s):u:"","flv"===(v=p&&kF.getStreamType(p))&&kF.isMseSupported(t.H264)?a=vN(n):"hls"===v&&("mobile"!==PC.device||null!=n&&null!==(i=n.hls)&&void 0!==i&&i.enableMSE)&&kF.isMseSupported(t.H264)&&(a=gN(n)),e.next=7,Hw.all([uF(FN.module).then((function(e){return e.RtmPlugin})).catch((function(){})),a&&uF(a.module).then((function(e){var t,n;return(null===(t=a)||void 0===t?void 0:t.module)===VL.PluginFlv?e.FlvPlugin:(null===(n=a)||void 0===n?void 0:n.module)===VL.PluginHls?e.HlsPlugin:void 0})).catch((function(){}))]);case 7:return g=e.sent,y=XM(g,2),m=y[0],_=y[1],e.next=13,Hw.all([RN(),ON()]);case 13:if(b=e.sent,w=XM(b,2),k=w[0],E=w[1],k&&E){e.next=20;break}return r&&r.emit("degrade",{url:p,originRtmUrl:s,code:"NOT_SUPPORT",message:"not support rtm or h264",isRTMSupported:k,isRTMSupportCodec:E}),e.abrupt("return",{options:Mm(Mm({},(null===(S=a)||void 0===S?void 0:S.options)||{}),{},{url:p,_RTMdegrade:{_originRtmUrl:s,_isRTMSupported:k,_isRTMSupportCodec:E}}),plugins:_?[_]:[]});case 20:return e.abrupt("return",{options:Mm(Mm({},(null===(o=a)||void 0===o?void 0:o.options)||{}),{},{url:f?kF.appendSearchParams(s,{enableRTMAutoTranscode:"true"}):void 0,_RTMdegrade:void 0,rts:Mm(Mm({retryCount:0},d),{},{backupURL:p,backupConstruct:_})}),plugins:m?[m]:[]});case 21:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),NN=function(e){return e.Fairplay="fairplay",e}(NN||{});function VN(e){if(null!=e&&e.fairplay&&("safari"===PC.browser||PC.os.isIos))return"fairplay"}function HN(e){var t=e.drm,n=e.streamType,r=VN(t);return!r||("fairplay"!==r||"hls"!==n)}var GN=function(){var e=sy(oy().mark((function e(t,n){var r;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t.url?kF.getStreamType(t.url):"")&&"unknown"!==r){e.next=3;break}return e.abrupt("return",{options:{},plugins:[]});case 3:if("rtm"!==r){e.next=7;break}return e.next=6,BN(t,n);case 6:case 10:case 16:return e.abrupt("return",e.sent);case 7:if("flv"!==r){e.next=11;break}return e.next=10,dN(t);case 11:if("hls"!==r){e.next=17;break}if(HN({drm:t.drm,streamType:r})){e.next=14;break}return e.abrupt("return",{options:{},plugins:[]});case 14:return e.next=16,pN(t);case 17:return e.abrupt("return",{options:{},plugins:[]});case 18:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),jN=NaN,zN="[object Symbol]",KN=/^\s+|\s+$/g,WN=/^[-+]0x[0-9a-f]+$/i,qN=/^0b[01]+$/i,XN=/^0o[0-7]+$/i,YN=iE,$N="object"==Tc(i)&&i&&i.Object===Object&&i,ZN="object"==("undefined"==typeof self?"undefined":Tc(self))&&self&&self.Object===Object&&self,JN=$N||ZN||Function("return this")(),QN=Object.prototype.toString,eV=Math.max,tV=Math.min,nV=function(){return JN.Date.now()};function rV(e){var t=Tc(e);return!!e&&("object"==t||"function"==t)}function iV(e){return"symbol"==Tc(e)||function(e){return!!e&&"object"==Tc(e)}(e)&&QN.call(e)==zN}function oV(e){if("number"==typeof e)return e;if(iV(e))return jN;if(rV(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rV(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(KN,"");var n=qN.test(e);return n||XN.test(e)?YN(pk(e).call(e,2),n?2:8):WN.test(e)?jN:+e}var aV=function(e,t,n){var r,i,o,a,s,l,u=0,c=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var n=r,o=i;return r=i=void 0,u=t,a=e.apply(o,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=o}function v(){var e=nV();if(p(e))return g(e);s=setTimeout(v,function(e){var n=t-(e-l);return h?tV(n,o-(e-u)):n}(e))}function g(e){return s=void 0,f&&r?d(e):(r=i=void 0,a)}function y(){var e=nV(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(v,t),c?d(e):a}(l);if(h)return s=setTimeout(v,t),d(l)}return void 0===s&&(s=setTimeout(v,t)),a}return t=oV(t)||0,rV(n)&&(c=!!n.leading,o=(h="maxWait"in n)?eV(oV(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:g(nV())},y},sV=o(aV),lV=Mm(Mm({},KM),{},{TIME_SHIFT_CHANGE:"timeShiftChange",REFRESH_CLICK:"refreshClick"});function uV(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2.488a7.48 7.48 0 00-4.154 1.253.908.908 0 101.005 1.512 5.695 5.695 0 018.844 4.746h-.908a.33.33 0 00-.264.528l1.816 2.422a.33.33 0 00.529 0l1.815-2.422A.33.33 0 0018.42 10h-.908A7.511 7.511 0 0010 2.49zM2.489 10a7.511 7.511 0 0011.665 6.26.908.908 0 00-1.005-1.513A5.695 5.695 0 014.305 10h.908a.33.33 0 00.264-.528L3.66 7.05a.33.33 0 00-.528 0L1.317 9.47a.33.33 0 00.264.53h.908z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var cV=QA.POSITIONS,hV=function(e){oP(n,e);var t=lP(n);function n(){return Ry(this,n),t.apply(this,arguments)}return Fy(n,[{key:"afterCreate",value:function(){this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.refresh),this._initEvents())}},{key:"registerIcons",value:function(){return{refresh:{icon:uV,class:"xgplayer-refresh-svg"}}}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this._handleRefresh)}},{key:"render",value:function(){var e=this.player.config.i18nManager;return'\n <xg-icon class="veplayer-refresh">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="refresh">'.concat(e.getText("REFRESH"),"</div>\n </xg-icon>\n ")}},{key:"_handleRefresh",value:function(e){var t=this.player;if(t){var n,r;if(e.preventDefault(),e.stopPropagation(),t.addClass("xgplayer-is-enter"),t.pause(),t)t.emit(lV.REFRESH_CLICK),null===(n=this.player)||void 0===n||null===(n=n.config)||void 0===n||null===(n=n.veplayer)||void 0===n||n.retry(),null===(r=this.player)||void 0===r||null===(r=r.plugins)||void 0===r||null===(r=r.error)||void 0===r||r.hideError();t.once(HC,(function(){t.removeClass("xgplayer-is-enter")}))}}},{key:"_initEvents",value:function(){this._handleRefresh=sV(this._handleRefresh.bind(this),200);var e="mobile"===PC.device?"touchend":"click";this.bind(e,this._handleRefresh),this.show()}}],[{key:"pluginName",get:function(){return"refresh"}},{key:"defaultConfig",get:function(){return{position:cV.CONTROLS_LEFT,index:1,disable:!1}}}]),n}(QA),fV=o(ie.URLSearchParams),dV=rE;Dn({target:"Number",stat:!0,forced:Number.parseInt!=dV},{parseInt:dV});var pV=o(ie.Number.parseInt),vV=bT;Dn({target:"Number",stat:!0,forced:Number.parseFloat!=vV},{parseFloat:vV});var gV=o(ie.Number.parseFloat);function yV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),DE(e,r.key,r)}}function mV(e,t,n){return t&&yV(e.prototype,t),n&&yV(e,n),e}function _V(e,t,n){return t in e?DE(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bV(e,t){var n=dk(e);if(xE){var r=xE(e);t&&(r=Gw(r).call(r,(function(t){return PE(e,t).enumerable}))),n.push.apply(n,r)}return n}function wV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bV(Object(n),!0).forEach((function(t){_V(e,t,n[t])})):IE?RE(e,IE(n)):bV(Object(n)).forEach((function(t){DE(e,t,PE(n,t))}))}return e}var kV="xgplayer_device_id",EV="xgplayer_user_id",SV=function(e){if(!document.cookie)return null;for(var t=document.cookie.split(";"),n=0,r=t.length;n<r;n++){var i,o=t[n];if(fk(i=t[n]).call(i,e)>=0)return o.split("=")[1]||null}},TV=function(e){return String(Math.floor(Math.random()*Math.pow(10,e)))},CV=function(){var e=SV(kV);if(e)return e;var t=TV(11);return document.cookie=kV+"="+t+";max-age=31536000;path=/",t},AV=function(){var e=SV(EV);if(e)return e;var t=TV(12);return document.cookie=EV+"="+t+";max-age=31536000;path=/",t};var xV={get device(){return xV.os.isPc?"pc":"mobile"},get browser(){var e=function(){var e=navigator.userAgent.toLowerCase(),t={},n={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:fk(e).call(e,"chrome")>-1&&fk(e).call(e,"safari")>-1,Firefox:fk(e).call(e,"firefox")>-1,Opera:fk(e).call(e,"opera")>-1,Safari:fk(e).call(e,"safari")>-1&&-1==fk(e).call(e,"chrome"),Edge:fk(e).call(e,"edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var r in n)if(n[r]){var i="";if("IE"===r)i=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===r){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(r="360");var a=e.match(/chrome\/([\d.]+)/);i=a?a[1]:"-1"}else if("Firefox"===r){var s=e.match(/firefox\/([\d.]+)/);i=s?s[1]:"-1"}else if("Opera"===r){var l=e.match(/opera\/([\d.]+)/);i=l?l[1]:"-1"}else if("Safari"===r){var u=e.match(/version\/([\d.]+)/);i=u?u[1]:"-1"}else if("Edge"===r){var c=e.match(/edge\/([\d.]+)/);i=c?c[1]:"-1"}else if("QQBrowser"===r){var h=e.match(/qqbrowser\/([\d.]+)/);i=h?h[1]:"-1"}t.type=r,t.versions=iE(i)}return t}();return e.type+"_"+e.versions},get os(){var e=navigator.userAgent;navigator.platform.toLowerCase();var t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,r=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||r&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o;return{isTablet:o,isPhone:a,isAndroid:r,isPc:!(a||r||n||o),isSymbian:n,isWindowsPhone:t,isFireFox:i}},get operation_os(){for(var e=navigator.userAgent,t=[{s:"windows",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1|Windows 8.1|Windows NT 6.3|Windows 8|Windows NT 6.2|Windows 7|Windows NT 6.1)/},{s:"android",r:/Android/},{s:"linux",r:/(Linux|X11)/},{s:"ios",r:/(iPhone|iPad|iPod)/},{s:"mac",r:/Mac OS X/},{s:"mac",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<t.length;n++){var r=t[n];if(r.r.test(e))return r.s}return"unknown"}};function PV(){return Date.now()}function IV(e){var t="unknown";return"string"!=typeof e?t:fk(e).call(e,".flv")>-1?"flv":fk(e).call(e,".m3u8")>-1?"m3u8":fk(e).call(e,".mp4")>-1?"mp4":fk(e).call(e,".sdp")>-1?"rts":t}function RV(e){if(e.plugins){if(e.plugins.flv)return e.plugins.flv;if(e.plugins.hls)return e.plugins.hls;if(e.plugins.rts)return e.plugins.rts;if(e.plugins.rtm)return e.plugins.rtm}return null}var DV={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},OV=function(){function e(e){var t=e.Tea;if(!t)throw new Error("lack Tea option");t.event?this.Tea=t.event.bind(t):this.Tea=t,this.logOptions=e,this._player=e.player}mV(e,[{key:"videoSize",get:function(){return this._player&&this._player.video?{width:this._player.video.videoWidth,height:this._player.video.videoHeight}:{width:0,height:0}}}]);var t=e.prototype;return t.push=function(e){var t=this._player.config.url;this._player.video&&(e.play_current_time=this._player.currentTime),this.core&&this.core.loader&&this.core.loader.finnalUrl?e.cdn_play_url=this.core.loader.finnalUrl:e.cdn_play_url=t&&OM(t).call(t,"//")?window.location.protocol+t:t,e.live_stream_session_id=function(e,t,n){var r=new fV(e.split("?")[1]);return r.get(t)||r.get(n)}(e.cdn_play_url,"_session_id","session_id"),e.play_format=IV(e.cdn_play_url),e.timestamp=PV();var n=function(){var e={cpu_core_number:-1,memory_usage:-1,network_downlink:-1};try{e.cpu_core_number=navigator.hardwareConcurrency||-1,e.memory_usage=navigator.deviceMemory||-1,e.network_downlink=navigator.connection&&navigator.connection.downlink,null==e.network_downlink&&(e.network_downlink=-1)}catch(oz){}return e}(),r=n.cpu_core_number,i=n.memory_usage,o=n.network_downlink;e.cpu_core_number=r,e.memory_usage=i,e.network_downlink=o,AE(e,wV({},this.videoSize)),this.send(e)},t.send=function(e){e.event_key&&(this.logOptions.onReport&&this.logOptions.onReport(e.event_key,e),this.Tea(e.event_key,wV({},e)))},e}(),MV=function(){return void 0!==navigator.onLine?navigator.onLine?(e=navigator.connection)&&(e.effectiveType||e.type)||xV.device:"none":"unknown";var e},LV=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","ratechange","volumechange","loadeddata"],FV=function(){function e(e){var t;this.options=e,this.logger=new UV(e),this.restart=this.restart.bind(this),this.bindUrlChange(),hk(t=xV.browser).call(t,"Chrome")}var t=e.prototype;return t.restart=function(e){this.destroy("string"!=typeof e&&Boolean(e)),this.logger=new UV(this.options),this.bindUrlChange(),this.logger.reportStartPlay(),this.logger.handlePlayerComlete()},t.bindUrlChange=function(){this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.on("urlchange",this.restart)},t.setNTP=function(e){this.logger.setNTP(e)},t.updateExt=function(e){this.options.ext=AE(this.options.ext||{},e),this.logger&&this.logger.updateExt(e)},t.destroy=function(e){this.logger.destroy(e),this.logger=null,this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.off("urlchange",this.restart)},e}(),UV=function(){function e(e){if(!e.player)throw new Error("option player is necessary");this.options=AE({},e,function(e){return{device_id:e.device_id||CV(),user_id:e.user_id||AV(),error_report_stop:!!e.error_report_stop,project_key:e.project_key||"live",product_line:e.product_line||"live",onReport:e.onReport||function(){}}}(e)),this._player=this.options.player,this._url=this._player.config.url,this.project_key=e.project_key||"live",this.product_line=e.product_line||"live",this.ntpDelta=this.options.ntp?Date.now()-this.options.ntp:0,this.inWaitingStart=0,this.errorNumber=0,this.tempDroppedFrameCount=0,this.tempTotalFrameCount=0,this._logmanager=new OV(this.options),this.init(),this.started=!1,this.destroyed=!1,this.completed=!1,this.firstFrameViewed=!1,this.cacheRtcStats={}}mV(e,[{key:"videoSize",get:function(){return this.player?{width:this.player.video.videoWidth,height:this.player.video.videoHeight}:{width:0,height:0}}},{key:"player",get:function(){return this._player}},{key:"logmanager",get:function(){return this._logmanager}},{key:"ntpTime",get:function(){return Date.now()-this.ntpDelta}}]);var t=e.prototype;return t.setNTP=function(e){this.options&&(this.options.ntp=e,this.ntpDelta=Date.now()-this.options.ntp)},t.init=function(){this.bindCtx(),this.initLog(),this.initEvt()},t.bindCtx=function(){this.handlePlayerComlete=this.handlePlayerComlete.bind(this),this.handlePlayerPlaying=this.handlePlayerPlaying.bind(this),this.destroyFunc=this.destroyFunc.bind(this),this.handleUserLeave=this.handleUserLeave.bind(this),this.handlePlayerError=this.handlePlayerError.bind(this),this.handlePlayerReady=this.handlePlayerReady.bind(this),this.handlePlayerWaiting=this.handlePlayerWaiting.bind(this),this.handleAVUnsync=this.handleAVUnsync.bind(this),this.handlePlayerPause=this.handlePlayerPause.bind(this),this.handleTTFB=this.handleTTFB.bind(this),this.handleUrlChange=this.handleUrlChange.bind(this),this.handleKeyframe=this.handleKeyframe.bind(this),this.handleSourceOpen=this.handleSourceOpen.bind(this),this.handleBufferAppend=this.handleBufferAppend.bind(this),this.handleCoreEvent=this.handleCoreEvent.bind(this),this.handleDegrade=this.handleDegrade.bind(this)},t.initLog=function(){var e=this,t=this.options,n=t.player,r=void 0!==n.hlsOps;this.commonParams=wV({os:xV.operation_os},function(e){var t,n=e.player,r=n.config.mediaType;return wV({project_key:e.project_key,live_sdk_version:RV(n)||n.hlsOps?"2":"-1",player_sdk_version:n.version,logger_version:"1.1.0-alpha.10",report_version:"5",product_line:e.product_line,user_id:e.user_id,device_id:e.device_id,logger_id:TV(12),app_name:e.app_name,cdn_ip:e.cdn_ip,is_wasm:+(!!r&&"video"!==r),review_is_live:n.config.isLive?2:1,aid:e.aid,live_id:e.live_id||e.aid+"-"+e.user_id+"-"+Date.now(),is_preview:e.is_preview?1:0,codec_type:e.codec_type||"h264",width:Math.floor(n.config.width),height:Math.floor(n.config.height),browser:xV.browser,ua:navigator.userAgent,href:window.location.href,timestamp:0,fps:-1,logger_init_time:Date.now(),play_current_time:0,cdn_play_url:n.config.url&&OM(t=n.config.url).call(t,"//")?window.location.protocol+n.config.url:n.config.url,play_format:IV(n.config.url),codec_support:-1},e.ext)}(t)),this.log=AE({},{start_play:{start_play_time:0,event_key:"start_play"},first_frame:{start:0,first_frame_view:0,event_key:"first_frame",first_sei_delay:0,ntp_sync:0,ntp_delta:0,ttfb:-1,ttdb:-1,ttfb_end:0},first_frame_failed:{code:void 0,msg:"",event_key:"first_frame_failed"},stall_start:{ready_state:-1,stall_start_time:0,event_key:"stall_start"},stalling:{event_key:"stalling"},stall:{reason:0,stall_start:0,stall_end:0,ready_state:0,event_key:"stall"},play_stop:{code:0,stop_time:0,drop_percent:0,is_stream_received:0,stall_count:0,stall_time:0,retry_count:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0,event_key:"play_stop",dns_parse_time:-1,redirect:-1,ttfb:-1,buffered:[],is_firstframe_received:0,meta:null},playing:{index:0,stall_count:0,stall_time:0,play_time:1e4,retry_count:0,is_last:0,video_buffer_time:0,audio_buffer_time:0,speed_switch_count:0,speed_switch_info:"none",download_speed:0,decode_fps:0,render_fps:0,drop_count:0,drop_percent:0,sei_source:"",sei_delay:0,ntp_sync:0,ntp_delta:0,event_key:"playing",stop_time:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0},play_error:{code:void 0,info:"",event_key:"play_error"},play_low_decode:{fps:-1,decode_fps:-1,bitrate:-1,url:-1,msg:"",event_key:"play_low_decode"},play_av_unsync:{aDts:-1,vDts:-1,frameLength:-1,currentTime:-1,duration:0,event_key:"play_av_unsync"},play_loadstream:{loadstream_url:"",event_key:"play_loadstream"},play_stream_loaded:{event_key:"play_stream_loaded"},play_metadata_loaded:{metadata_type:"",event_key:"play_metadata_loaded"},stream_exception:{event_key:"stream_exception"},pause:{event_key:"pause"},play_url_change:{event_key:"play_url_change"},source_opened:{event_key:"source_opened"},source_updateend:{event_key:"source_updateend"},play_result:{event_key:"play_result",result:0,threshold:15e3,is_threshold:0},degrade:{event_key:"degrade",payload:{}},rtcstatechange:{event_key:"rtcstatechange"}});var i=this;for(var o in this.log){var a=function(t){DE(e.log[o],t,{get:function(){return null==this["_"+t]?i.commonParams[t]:this["_"+t]},set:function(e){this["_"+t]=e},enumerable:!0})};for(var s in this.commonParams)a(s);r&&DE(this.log[o],"m3u8",{get:function(){if(n.__core__){var e=n.__core__.m3u8Text;return e?pk(e).call(e,0,25e4):""}return""},enumerable:!0}),DE(this.log[o],"volume",{get:function(){if(n&&n.video)return n.volume||0},enumerable:!0}),DE(this.log[o],"access",{get:function(){return MV()},enumerable:!0})}},t.updateExt=function(e){for(var t in this.log)for(var n in e)this.log[t][n]=e[n]},t.reportStartPlay=function(){this.started||(this.core=RV(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),this.started=!0,this.log.start_play.start_play_time=this.log.start_play.timestamp=PV(),this.logmanager.push(this.log.start_play,!0))},t.initWindowListener=function(){"pc"===xV.device?window.addEventListener("beforeunload",this.handleUserLeave):"mobile"===xV.device&&(window.addEventListener("beforeunload",this.handleUserLeave),window.addEventListener("pagehide",this.handleUserLeave))},t.removeWindowListener=function(){"pc"===xV.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===xV.device&&(window.removeEventListener("beforeunload",this.handleUserLeave),window.removeEventListener("pagehide",this.handleUserLeave))},t.initEvt=function(){var e=this,t=this.player;LV.forEach((function(t){e["handleVideo"+t+"Evt"]=function(){e["handleVideo"+t]&&e["handleVideo"+t]()},e.initWindowListener(),e.bindVideoEvt(t,e["handleVideo"+t+"Evt"])})),t.once("error",this.handlePlayerError),t.once("complete",this.handlePlayerComlete),t.once("playing",this.handlePlayerPlaying),t.once("timeupdate",this.handlePlayerPlaying),t.once("destroy",this.destroyFunc),t.on("ready",this.handlePlayerReady),t.on("waiting",this.handlePlayerWaiting),t.on("pause",this.handlePlayerPause),t.on("urlchange",this.handleUrlChange),t.once("sourceopen",this.handleSourceOpen),t.once("bufferappend",this.handleBufferAppend),t.on("core_event",this.handleCoreEvent),t.on("degrade",this.handleDegrade),this.hiJackPlayerStart()},t.handleCoreEvent=function(e){var t=e.eventName,n=e.headers,r=e.pts,i=e.type,o=e.meta,a=e.sei,s=e.decodeFps,l=e.url,u=e.state;switch(t){case"core.ttfb":this.handleTTFB(e);break;case"core.loadresponseheaders":var c=n.get("X-Server-Ip");void 0!==this.player.hlsOps&&(this.log.play_stop.review_ts_count+=1),c&&(this.commonParams.cdn_ip=c);break;case"core.loadretry":this.log.play_stop.retry_count++;break;case"core.keyframe":this.handleKeyframe(r);break;case"core.metadataparsed":this.handleMetaDataLoaded(i,o);break;case"core.sei":this.handleSEIParsed(a);break;case"core.lowdecode":this.commonParams.is_wasm&&(AE(this.log.play_low_decode,e||{}),this.log.play_low_decode.decode_fps=s,this.log.play_low_decode.timestamp=PV(),this.logmanager.push(this.log.play_low_decode,!0),this.commonParams.is_wasm=0);break;case"core.largeavgap":this.handleAVUnsync(e);break;case"core.loadstart":this.handlePlayerLoadStream(e),this.reportStartPlay();break;case"core.loadcomplete":this.handlePlayerLoadedStream(e);break;case"core.streamexception":this.handleStreamException(e);break;case"core.rtcstatechange":this.logmanager.push(AE({url:l,state:u},this.log.rtcstatechange))}},t.handleDegrade=function(e){this.log.degrade.payload=e,this.logmanager.push(this.log.degrade,!0)},t.hiJackPlayerStart=function(){var e=arguments,t=this;this.player._start=this.player.start;var n=this.player;n.start=function(){try{if(n._start)return n._start.apply(n,pk(Array.prototype).call(e,0))}catch(r){}t.destroyed||t.handlePlayerComlete()}},t.handleTTFB=function(e){var t=e||{},n=t.end,r=t.elapsed;this.log.first_frame.ttfb=r||-1,this.log.first_frame.ttfb_end=n||0},t.handleUrlChange=function(e){this.logmanager.push(AE(this.log.play_url_change,{url:e,timestamp:PV()}))},t.handleKeyframe=function(e){this.log.play_stop.is_firstframe_received=1,this.log.play_stop.firstframe_pts=e},t.handleSourceOpen=function(){this.log.source_opened.timestamp=PV(),this.logmanager.push(this.log.source_opened)},t.handleBufferAppend=function(){this.log.source_updateend.timestamp=PV(),this.logmanager.push(this.log.source_updateend)},t.handlePlayerPause=function(){this.log.pause.timestamp=PV(),this.logmanager.push(this.log.pause,!0),this.stallEnd()},t.handlePlayerError=function(e){this.errorNumber=1;var t=e.errorType,n=e.errorCode;AE(this.log.play_error,wV({timestamp:PV(),code:e.httpCode||n||("parse"===t?31:21),info:e.message,detail:yM(e)},this.videoSize)),this.logmanager.push(this.log.play_error,!0),this.destroyed||(0===this.log.first_frame.first_frame_view&&(AE(this.log.first_frame_failed,{code:n||("parse"===t?31:21),msg:e.message}),void 0!==this.log.first_frame_failed.timestamp&&(this.log.first_frame_failed.timestamp=PV()),this.logmanager.push(this.log.first_frame_failed,!0),this.log.play_result.is_threshold||(this.clearPlayResultTimer(),this.log.play_result.reason=e.message||"first frame failed",this.log.play_result.code=this.log.play_error.code,this.logmanager.push(this.log.play_result,!0))),this.options.error_report_stop?this.handleUserLeave():this.updatePlayStopParams())},t.handlePlayerLoadStream=function(e){var t=e.url,n=e.offersdp,r=e.sessionId;if("string"==typeof t){var i=this.log.play_loadstream;i.timestamp=PV(),i.loadstream_url=t,i.offersdp=n,i.sessionId=r,this.logmanager.push(i)}},t.handlePlayerLoadedStream=function(e){var t=this.log.play_stream_loaded;t.timestamp=PV(),AE(t,e),this.logmanager.push(t)},t.handleSEIParsed=function(e){var t=this.log,n=t.playing,r=t.first_frame;if(100===e.code){var i=function(e){var t,n,r,i,o,a;for(t="",r=e.length,n=0;n<r;)switch((i=e[n++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(i);break;case 12:case 13:o=e[n++],t+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=e[n++],a=e[n++],t+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&a)<<0)}return t}(e.content);i=pk(i).call(i,fk(i).call(i,"{"),iF(i).call(i,"}")+1);try{var o=JSON.parse(i),a=this.getPlayerBuffer()+this.ntpTime-o.ts;n.sei_delay=a,n.sei_source=o.source,n.ntp_sync=this.options.ntp?1:0,n.ntp_delta=this.ntp_delta,r.first_sei_delay=a,r.ntp_sync=this.options.ntp?1:0,r.ntp_delta=this.ntp_delta}catch(s){}}},t.handleMetaDataLoaded=function(e,t){var n;this.log.play_stop.meta=this.log.play_stop.meta||{},e&&(this.log.play_stop.meta[e]=t),this.log.play_metadata_loaded.timestamp=PV(),this.log.play_metadata_loaded.metadata_type=e,t&&(this.log.play_metadata_loaded.meta=t,this.log.play_metadata_loaded.codec=t.codec,"video"===e&&(this.commonParams.codec_type=t.codec,this.commonParams.codec_support=(n=t.codec,"undefined"!=typeof MediaSource?+MediaSource.isTypeSupported("video/mp4; codecs="+n):0))),t||(this.log.play_metadata_loaded.meta=void 0,this.log.play_metadata_loaded.codec=void 0,"video"===e&&(this.commonParams.codec_type="unknown")),this.logmanager.push(this.log.play_metadata_loaded)},t.handleAVUnsync=function(e){AE(this.log.play_av_unsync,e||{}),this.log.play_av_unsync.timestamp=PV(),this.logmanager.push(this.log.play_av_unsync,!1)},t.handleStreamException=function(e){this.logmanager.push(AE({},this.log.stream_exception,e))},t.handlePlayerComlete=function(){this.completed||(this.completed=!0,this.core=RV(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),(this.player.config.autoplay||this.player.config.videoInit)&&this.reportStartPlay())},t.getPlayerBuffer=function(){var e=this.player.video.buffered;if(e){var t=Math.max(0,e.length-1);try{var n=pV(1e3*(e.end(t)-this.player.video.currentTime));return this.log.playing.audio_buffer_time=this.log.playing.video_buffer_time=n,n}catch(r){return 0}}},t.getPlayerDownloadSpeed=function(){if(this.core&&this.core.core&&"function"==typeof this.core.core.speedInfo)return this.core.core.speedInfo().speed},t.getPlayerQuality=function(){var e=this.player.video;if(e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();this.log.playing.drop_count=t.droppedVideoFrames-this.tempDroppedFrameCount,this.log.playing.drop_percent=gV(this.tempTotalFrameCount/t.totalVideoFrames).toFixed(1),this.log.play_stop.drop_percent=gV(t.droppedVideoFrames/t.totalVideoFrames).toFixed(1),this.tempDroppedFrameCount=t.droppedVideoFrames,this.tempTotalFrameCount=t.totalVideoFrames}},t.getRtcStats=function(e,t){try{var n=this,r=n.player.plugins.rts||n.player.plugins.rtm,i=r&&r.pc,o={};return i?Hw.resolve(i.getStats()).then((function(t){return t.forEach((function(t){var r=t.type,i=t.mediaType,a=t.bytesReceived,s=t.packetsReceived,l=t.audioLevel,u=t.concealmentEvents,c=t.remoteTimestamp,h=t.timestamp,f=t.framesDropped,d=t.keyFramesDecoded,p=t.totalDecodeTime,v=t.framesDecoded,g=t.frameHeight,y=t.frameWidth,m=t.framesReceived,_=t.jitterBufferDelay,b=t.jitterBufferEmittedCount,w=t.jitter,k=t.nackCount,E=t.packetsLost,S=t.pliCount,T=t.totalSamplesReceived,C=t.concealedSamples,A=t.currentRoundTripTime,x=t.decoderImplementation,P=t.mimeType,I=t.freezeCount,R=t.totalFreezesDuration,D=t.totalPausesDuration;switch(r){case"inbound-rtp":"audio"===i?(o.audio_bytes_received=a-(n.cacheRtcStats.audioBytesReceived||0),n.cacheRtcStats.audioBytesReceived=a,o.audio_packets_lost=E-(n.cacheRtcStats.audioPacketsLost||0),o.audio_packets_received=s-(n.cacheRtcStats.audioPacketsReceived||0),n.cacheRtcStats.audioPacketsLost=E,n.cacheRtcStats.audioPacketsReceived=s,o.audio_level=l,o.concealment_event=u,o.audio_fraction_lost=o.audio_packets_lost/o.audio_packets_received,void 0!==n.cacheRtcStats.totalSamplesReceived&&(o.audio_rec_sample_rate=(T-n.cacheRtcStats.totalSamplesReceived)/e),n.cacheRtcStats.totalSamplesReceived=T,o.concealed_samples=C,o.total_samples_received=T):(o.frames_dropped=f,o.iframes_decoded=d,o.video_bytes_received=a-(n.cacheRtcStats.videoBytesReceived||0),n.cacheRtcStats.videoBytesReceived=a,o.video_dec_time=p,o.video_decoded_delay_ms=o.video_dec_elapse/v,o.video_frame_height=g,o.video_frame_width=y,void 0!==n.cacheRtcStats.framesDecoded&&(o.video_decode_framerate=(v-n.cacheRtcStats.framesDecoded)/e),n.cacheRtcStats.framesDecoded=v,void 0!==n.cacheRtcStats.framesReceived&&(o.video_recv_framerate=(m-n.cacheRtcStats.framesReceived)/e),void 0!==n.cacheRtcStats.freezeCount&&(o.freeze_count=I-n.cacheRtcStats.freezeCount,o.freeze_duration=R-n.cacheRtcStats.totalFreezesDuration),n.cacheRtcStats.freezeCount=I,n.cacheRtcStats.totalFreezesDuration=R,n.cacheRtcStats.framesReceived=m,o.total_pauses_duration=D,o.video_jb_delay=_/b*1e3,o.video_jitter=1e3*w,o.video_nack_count=k,o.video_packets_lost=E-(n.cacheRtcStats.videoPacketsLost||0),o.video_packets_received=s-(n.cacheRtcStats.videoPacketsReceived||0),o.video_fraction_lost=o.video_packets_lost/o.video_packets_received,n.cacheRtcStats.videoPacketsLost=E,n.cacheRtcStats.videoPacketsReceived=s,o.video_pli_count=S,o.decoder_name=x);break;case"remote-outbound-rtp":o.e2e_delay_ms=h-c;break;case"track":void 0!==y&&(o.video_frame_width=y,o.video_frame_height=g);break;case"candidate-pair":o.rtt=1e3*A;break;case"codec":hk(P).call(P,"video")?o.video_codec=P:o.audio_codec=i}o.total_delay=o.e2e_delay_ms+(o.video_decoded_delay_ms||0)+(o.video_jb_delay||0)})),AE(n.log.playing,{video_download_size:o.video_bytes_received,decode_fps:o.video_decode_framerate,sei_delay:o.total_delay,sei_network_delay:o.e2e_delay_ms,width:o.video_frame_width,height:o.video_frame_height,current_speed:(o.audio_bytes_received+o.video_bytes_received)/e}),o})):Hw.resolve(o)}catch(a){return Hw.reject(a)}},t.reportPlaying=function(e){try{var t=this;t.commonParams.is_wasm&&(t.commonParams.fps=t.player.video.fps,t.log.playing.render_fps=t.player.video.fps,t.log.playing.decode_fps=t.player.video.decodeFps),t.log.playing.index++;var n,r=t.log.playing.timestamp;t.inWaitingStart&&t.inWaitingStart<PV()&&(n=Math.min(t.options.playingInterval||t.log.playing.play_time,PV()-Math.max(t.inWaitingStart,r))),t.getPlayerQuality(),t.getPlayerBuffer(),t.options.downloadSpeedInterval||(t.log.playing.current_speed=t.getPlayerDownloadSpeed());var i=PV(),o=i-r,a=(n>200?n:0)+t.log.playing.stall_time,s=(n>200?1:0)+t.log.playing.stall_count;return t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=(n>t.options.aggregationDowngradeStallTime?n:0)+(t.log.playing.aggregation_downgrade_stall||0)),AE(t.log.playing,wV({timestamp:i,stop_time:i,duration:e?0:o/1e3,stall_time_per_100sec:a/o*100,stall_count_per_100sec:1e3*s/o*100,stall_count:s,stall_time:a,play_current_time:t.player.currentTime},t.videoSize)),Hw.resolve(t.getRtcStats(o,e)).then((function(n){var r={};if(t.core){if(t.core.getStats){var i=t.core.getStats()||{},a=i.bitrate,s=i.avgSpeed;AE(r,{bitrate:a,avg_speed:s,rate:s/a})}if(t.core.getNetWorkInfo){var l,u=(t.core.getNetWorkInfo()||{}).lostRate,c=((null===(l=t.core.core)||void 0===l?void 0:l._opts)||{}).networkEvaluateInterval;AE(r,{lostRate:u,networkEvaluateInterval:c})}}t.logmanager.push(AE({},t.log.playing,wV(wV({play_time:e?0:o},n),r)),!0),t.log.playing.download_speed_array=[],t.log.playing.stall_time=0,t.log.playing.stall_count=0,t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=0)}))}catch(l){return Hw.reject(l)}},t.handlePlayerPlaying=function(){try{var e=this;if(e.player&&e.player.video.readyState<3)return Hw.resolve();if(e.player.off("playing",e.handlePlayerPlaying),e.player.off("timeupdate",e.handlePlayerPlaying),e.core){var t=(e.core.getStats()||{}).fps;e.commonParams.fps=t}return Hw.resolve(e.reportPlaying(!0)).then((function(){e.clearPlayingInterval();var t=e.options.playingInterval||e.log.playing.play_time;e.intervalId=setInterval((function(){try{var n=function(){if(Math.abs(Date.now()-e.log.playing.timestamp-t)<100||Date.now()-e.log.playing.timestamp>=t){var n=function(){if(e.player&&e.player.video){var t=function(){if(!e.player.paused)return Hw.resolve(e.reportPlaying()).then((function(){}));e.handleVideopause()}();if(t&&t.then)return t.then((function(){}))}else e.destroyFunc()}();if(n&&n.then)return n.then((function(){}))}}();return Hw.resolve(n&&n.then?n.then((function(){})):void 0)}catch(r){return Hw.reject(r)}}),1e3),e.clearStallTimer(),e.handleVideoplaying(),e.started||e.reportStartPlay(),e.saveBuffered()}))}catch(n){return Hw.reject(n)}},t.handlePlayerReady=function(){var e=this;this.log.start_play.start_play_time=PV(),this.player.config.autoplay&&this.reportStartPlay(),this.options.playResultThreshold&&(this.log.play_result.threshold=this.options.playResultThreshold),this.clearPlayResultTimer(),this.log.play_result.start=PV(),this.playResultTimer=setTimeout((function(){e.log.play_result.timestamp>=e.log.play_result.start||(e.log.play_result.is_threshold=1,e.logmanager.push(e.log.play_result,!0))}),this.log.play_result.threshold)},t.handlePlayerWaiting=function(){var e=this;!this.inWaitingStart&&this.log.first_frame.timestamp&&(this.log.stall.timestamp=this.inWaitingStart=this.log.stall.stall_start=PV(),this.log.stall_start.ready_state=this.log.stall.ready_state=this.player.video.readyState,this.log.stall_start.timestamp=PV(),this.log.stall_start.stall_start_time=PV(),this.log.stall_start.video_buffer_time=this.player.video.readyState,this.log.stall_start.play_current_time=this.player.currentTime,this.log.stall.play_current_time=this.player.currentTime,this.log.stall_start.buffered=this.getBuffered(),this.log.stall.buffered=this.log.stall_start.buffered,this.log.stall.current_speed=this.getPlayerDownloadSpeed(),AE(this.log.stall_start,this.videoSize),this.clearStallTimer(),this.stallStartTimer=setTimeout((function(){e.logmanager.push(e.log.stall_start,!0)}),205))},t.handleVideoseeking=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.clearStallTimer())},t.handleVideoseeked=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.log.play_stop.stall_count>0&&this.log.play_stop.stall_count--)},t.handleVideoplay=function(){this.reportStartPlay(),this.removeVideoEvt("play",this.handleVideoplay)},t.handleVideotimeupdate=function(){Math.abs(this.player.currentTime-this.log.stall_start.play_current_time)>.2&&this.stallEnd(),this.saveBuffered()},t.handleVideocanplay=function(){this.stallEnd(),this.reportFirstframe()},t.handleVideoplaying=function(){this.stallEnd(),this.log.play_stop.is_stream_received=1;var e=PV();this.reportStartPlay(),this.log.first_frame.start=e},t.stallEnd=function(){this.clearStallTimer();var e=PV();if(this.inWaitingStart){var t=e-this.inWaitingStart;t>200&&(this.log.play_stop.stall_count++,this.log.play_stop.stall_time+=e-this.inWaitingStart,this.log.playing.stall_time+=e-Math.max(this.inWaitingStart,this.log.playing.timestamp),this.log.stall.stall_end=e,this.log.stall.timestamp=PV(),this.log.playing.stall_count++,AE(this.log.stall,wV({},this.videoSize)),this.logmanager.push(this.log.stall,!0)),this.options.aggregationDowngradeStallTime&&t>this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=(this.log.playing.aggregation_downgrade_stall||0)+(e-Math.max(this.inWaitingStart,this.log.playing.timestamp)))}this.inWaitingStart=0},t.handleVideoloadeddata=function(){this.reportFirstframe()},t.handleVideoratechange=function(){this.log.playing.speed_switch_count++,this.log.playing.speed_switch_info=this.player.video.playbackRate},t.handleVideoended=function(){this.clearPlayingInterval(),this.clearStallTimer(),AE(this.log.playing,wV({timestamp:PV(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing)},t.handleVideoerror=function(){var e=this;this.errorNumber=1;var t=this.player.video.error;AE(this.log.play_error,wV(wV({timestamp:PV()},this.videoSize),t&&{code:t.code,info:t.message})),this.logmanager.push(this.log.play_error,!0),0!==e.log.first_frame.first_frame_view||e.log.first_frame_failed.code||t&&(e.log.first_frame_failed.code=t.code,e.log.first_frame_failed.msg=DV[t.code],void 0!==e.log.first_frame_failed.timestamp&&(e.log.first_frame_failed.timestamp=PV()),e.logmanager.push(e.log.first_frame_failed,!0),e.log.play_result.is_threshold||(e.log.play_result.reason=DV[t.code]||"first frame failed",e.log.play_result.code=t.code,e.clearPlayResultTimer(),e.logmanager.push(e.log.play_result,!0))),e.options.error_report_stop?e.handleUserLeave():e.updatePlayStopParams()},t.handleVideopause=function(){this.stallEnd(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.player.once("playing",this.handlePlayerPlaying),this.player.once("timeupdate",this.handlePlayerPlaying)},t.destroyFunc=function(e){var t=this;this.destroyed||(e||this.handleUserLeave(),this.destroyed=!0,"pc"===xV.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===xV.device&&window.removeEventListener("pagehide",this.handleUserLeave),LV.forEach((function(e){t.removeVideoEvt(e,t["handleVideo"+e+"Evt"])})),this.player&&(this.player._start&&(this.player.start=this.player._start,delete this.player._start),this.player.off("destroy",this.destroyFunc),this.player.off("complete",this.handlePlayerComlete),this.player.off("playing",this.handlePlayerPlaying),this.player.off("timeupdate",this.handlePlayerPlaying),this.player.off("ready",this.handlePlayerReady),this.player.off("waiting",this.handlePlayerWaiting),this.player.off("largeavgap",this.handleAVUnsync),this.player.off("error",this.handlePlayerError),this.player.off("SEI_PARSED",this.handleSEIParsed),this.player.off("pause",this.handlePlayerPause),this.player.off("ttfb",this.handleTTFB),this.player.off("urlchange",this.handleUrlChange),this.player.off("isKeyframe",this.handleKeyframe),this.player.off("sourceopen",this.handleSourceOpen),this.player.off("bufferappend",this.handleBufferAppend),this.player.off("core_event",this.handleCoreEvent),this.player.off("degrade",this.handleDegrade),this._player=null),this.clearPlayingInterval(),this.clearStallTimer(),this.clearPlayResultTimer(),clearTimeout(this.collectDownloadSpeedTimer))},t.handleUserLeave=function(){try{var e=this;return e.destroyed||!e.started?Hw.resolve():(e.destroyed=!0,Hw.resolve(e.updatePlayStopParams()).then((function(){e.reportPlayStop(),e.clearPlayingInterval(),e.clearStallTimer(),clearTimeout(e.collectDownloadSpeedTimer),e.removeWindowListener()})))}catch(t){return Hw.reject(t)}},t.saveBuffered=function(){try{var e=this.getBuffered();e&&e.length&&(this.log.play_stop.buffered=e)}catch(oz){}},t.getBuffered=function(){try{for(var e=[],t=this.player.video,n=0;n<t.buffered.length;n++)e.push([t.buffered.start(n),t.buffered.end(n)]);return e}catch(oz){}},t.reportPlayStop=function(){this.player&&(this.log.play_stop.play_current_time=this.player.currentTime||this.log.playing.play_current_time,this.saveBuffered()),this.logmanager.push(this.log.play_stop,!0)},t.reportFirstframe=function(){if(!this.firstFrameViewed){if(this.core){var e=(this.core.getStats()||{}).fps;this.commonParams.fps=e}this.firstFrameViewed=!0;var t=PV();AE(this.log.first_frame,wV({first_frame_view:t-this.log.start_play.start_play_time||t,timestamp:t},this.videoSize)),this.log.first_frame.ttfb_end&&(this.log.first_frame.ttdb=t-this.log.first_frame.ttfb_end),this.logmanager.push(this.log.first_frame,!0),this.clearPlayResultTimer(),this.log.play_result.result=1,this.logmanager.push(this.log.play_result,!0),this.log.play_stop.is_stream_received=1}},t.updatePlayStopParams=function(){try{var e,t=function(){AE(o,wV({timestamp:i,stop_time:i,duration:n.playedTime/1e3,play_time:n.playedTime/1e3},n.videoSize)),0===n.errorNumber&&(o.play_time_on_no_frame=o.stop_time-n.log.start_play.start_play_time)},n=this,r=function(e){var t,n=Gw(t=performance.getEntriesByType("resource")).call(t,(function(t){return t.name===e}));if(n.length){var r=n[0],i=n[n.length-1];return{dns_parse_time:pV(r.domainLookupEnd-r.domainLookupStart),redirect:pV(r.redirectEnd-r.redirectStart),ttfb:pV(i.responseStart-i.requestStart)}}return{dns_parse_time:-1,redirect:-1,ttfb:-1}}(n._url),i=PV();n.playedTime=i-n.log.start_play.start_play_time;var o=n.log.play_stop;if(AE(o,wV({},0===o.stall_count&&{stall_time:0})),n.inWaitingStart&&i-n.inWaitingStart>200&&(o.stall_time+=i-n.inWaitingStart),n.inWaitingStart=0,AE(o,wV({stall_time_per_100sec:o.stall_time/n.playedTime*100,stall_count_per_100sec:1e3*o.stall_count/n.playedTime*100},r)),0===n.log.play_stop.stall_count_per_100sec&&(n.log.play_stop.stall_time_per_100sec=0),n.log.play_stop.stall_time_per_100sec>100||n.log.play_stop.stall_time_per_100sec<0)return Hw.resolve();if(n.log.playing.index?(AE(n.log.playing,wV({timestamp:PV(),is_last:1},n.videoSize)),n.logmanager.push(n.log.playing,!0)):(n.log.play_stop.error_code=n.log.play_error.code,n.log.play_stop.error_info=n.log.play_error.info),i=PV(),null===(e=n.core)||void 0===e?void 0:e.getStats){var a=n.core.getStats()||{},s=a.totalReceivedByte,l=a.totalReceivedCost;AE(n.log.play_stop,{totalReceivedByte:s,totalReceivedCost:l,totalAverageSpeed:8*s/(l/1e3)})}var u=function(){var e;if(null===(e=n.core)||void 0===e?void 0:e.getStatsSnapshoot)return Hw.resolve(n.core.getStatsSnapshoot()).then((function(e){var t=e.video||{},n=t.packetsLost,r=t.packetsReceived;AE(o,{packetsLost:n,packetsReceived:r,totalLostRate:n/(n+r)})}))}();return Hw.resolve(u&&u.then?u.then(t):t())}catch(c){return Hw.reject(c)}},t.clearPlayingInterval=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},t.clearStallTimer=function(){clearTimeout(this.stallStartTimer)},t.clearPlayResultTimer=function(){clearTimeout(this.playResultTimer)},t.destroy=function(e){this.destroyFunc(!e)},t.bindVideoEvt=function(e,t){this.player&&this.player.video.addEventListener(e,t,!1)},t.removeVideoEvt=function(e,t){this.player&&this.player.video&&this.player.video.removeEventListener(e,t,!1)},t.send=function(e,t){this.logmanager.send(e,t)},e}(),BV=s;Dn({global:!0,forced:BV.globalThis!==BV},{globalThis:BV});var NV=o(s),VV=Dn,HV=r_,GV=l,jV=re,zV=__.onFreeze,KV=Object.freeze;VV({target:"Object",stat:!0,forced:GV((function(){KV(1)})),sham:!HV},{freeze:function(e){return KV&&jV(e)?KV(zV(e)):e}});var WV=o(ie.Object.freeze),qV=o(Ug),XV=pc.codeAt;Dn({target:"String",proto:!0},{codePointAt:function(e){return XV(this,e)}});var YV=Wc("String").codePointAt,$V=ce,ZV=YV,JV=String.prototype,QV=o((function(e){var t=e.codePointAt;return"string"==typeof e||e===JV||$V(JV,e)&&t===JV.codePointAt?ZV:t})),eH=Dn,tH=_,nH=ti,rH=RangeError,iH=String.fromCharCode,oH=String.fromCodePoint,aH=tH([].join);eH({target:"String",stat:!0,arity:1,forced:!!oH&&1!=oH.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,i=0;r>i;){if(t=+arguments[i++],nH(t,1114111)!==t)throw rH(t+" is not a valid code point");n[i]=t<65536?iH(t):iH(55296+((t-=65536)>>10),t%1024+56320)}return aH(n,"")}});var sH=o(ie.String.fromCodePoint),lH=function(){return lH=AE||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},lH.apply(this,arguments)};function uH(e,t){var n="function"==typeof OE&&wS(e);if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(oz){i={error:oz}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function cH(){for(var e=[],t=0;t<arguments.length;t++)e=Nm(e).call(e,uH(arguments[t]));return e}var hH,fH,dH=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;if(e&&t&&"function"==typeof t){this.on(e,(function r(i){t(i),n.off(e,r)}))}},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n,r,i=fk(n=this._hooks[e]).call(n,t);if(-1!==i)Lk(r=this._hooks[e]).call(r,i,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){var r;if(!e)return;-1!==fk(r=this._cache).call(r,n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&cH(this._hooks[e]).forEach((function(e){try{e(t)}catch(n){}}))},e.prototype.set=function(e){var t;e&&-1===fk(t=this._cache).call(t,e)&&this._cache.push(e)},e}(),pH=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},vH=(fH=+Date.now()+Number(pk(hH=""+Math.random()).call(hH,2,8)),function(){return fH+=1}),gH=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof t&&"number"==typeof n){var r,i=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);r=e.split(o);for(var a=0;a<r.length;a++){var s=iE(r[a],n);s=1*s^t;var l=String.fromCharCode(s);i.push(l)}return i.join("")}}(e,64,25)},yH=function(e){!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},mH=function(e){var t=document.createElement("a");return t.href=e,t},_H=function(e){var t={};try{var n=mH(e).search;(n=pk(n).call(n,1)).split("&").forEach((function(e){var n,r,i=e.split("=");i.length&&(n=i[0],r=i[1]);try{t[n]=decodeURIComponent(void 0===r?"":r)}catch(o){t[n]=r}}))}catch(r){}return t},bH=function(e){for(var t=0,n=0,r=(e+="").length,i=0;i<r;i++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t};var wH=function(e){var t,n,r=[],i=e.length;i%2!=0&&(n=i+1,e=(t=e).length>=n?t:new Array(n-t.length+1).join("0")+t),i=e.length;for(var o=0;o<i;o+=2)r.push(iE(e.substr(o,2),16));return r},kH=void 0!==NV?NV:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function EH(e,t){return e(t={exports:{}},t.exports),t.exports}var SH=EH((function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var t={read:function(e){return'"'===e[0]&&(e=pk(e).call(e,1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function n(t,r){function i(n,i,o){if("undefined"!=typeof document){"number"==typeof(o=e({},r,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in o)o[s]&&(a+="; "+s,!0!==o[s]&&(a+="="+o[s].split(";")[0]));return document.cookie=n+"="+t.write(i,n)+a}}function o(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),a=pk(o).call(o,1).join("=");try{var s=decodeURIComponent(o[0]);if(r[s]=t.read(a,s),e===s)break}catch(l){}}return e?r[e]:r}}return Object.create({set:i,get:o,remove:function(t,n){i(t,"",e({},n,{expires:-1}))},withAttributes:function(t){return n(this.converter,e({},this.attributes,t))},withConverter:function(t){return n(e({},this.converter,t),this.attributes)}},{attributes:{value:WV(r)},converter:{value:WV(t)}})}return n(t,{path:"/"})}()})),TH=SH,CH=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e){this.getItem(e)},e.prototype.setCookie=function(e,t){this.setItem(e,t)},e}();var AH,xH,PH,IH,RH={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(r){}return n||{}}catch(r){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:yM(t);localStorage.setItem(e,n)}catch(r){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){try{return TH.get(e,{domain:t||document.domain})}catch(n){return""}},setCookie:function(e,t,n,r){try{var i=r||document.domain,o=+new Date+n;TH.set(e,t,{expires:new Date(o),path:"/",domain:i})}catch(a){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},DH={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(r){}return n||{}}catch(r){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:yM(t);sessionStorage.setItem(e,n)}catch(r){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t){}},getCookie:function(e){this.getItem(e)},setCookie:function(e,t){this.setItem(e,t)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},OH=function(){function e(e,t){this._storage=t&&"session"===t?DH:!e&&RH.isSupportLS?RH:new CH}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,r){this._storage.setCookie(e,t,n,r)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),MH=function(){function e(e,t,n){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=n}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,r=n?mH(n).hostname:"",i=_H(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,n,r){var i=new OH(!1),o=new OH(!1,"session"),a=e?"_tea_utm_cache_"+e:"_tea_utm_cache",s=e?"_$utm_from_url_"+e:"_$utm_from_url",l={},u=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],c={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;for(var f in c)c[f]&&(-1!==fk(u).call(u,f)?(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data[f]=c[f]):l[f]=c[f],h=!0);if(h)o.setItem(s,"1"),i.setCookie(a,yM(l),r,n);else{var d=i.getCookie(a,n);d&&(l=JSON.parse(d))}o.getItem(s)&&(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data.$utm_from_url=1)}catch(p){return c}return l}(this.appid,i,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:n,referrer_host:r,utm:this.utm,latest_data:this.last(n,r)}},e.prototype.last=function(e,t){var n="",r="",i="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,r=t,a=!0;var s=_H(e);s.keyword&&(i=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:r,$latest_search_keyword:i,isLast:a}},e.prototype.browser=function(){var e,t,n="",r=""+wT(this.appVersion),i=this.userAgent;return-1!==fk(i).call(i,"Edge")||-1!==fk(i).call(i,"Edg")?(n="Microsoft Edge",-1!==fk(i).call(i,"Edge")?(e=fk(i).call(i,"Edge"),r=i.substring(e+5)):(e=fk(i).call(i,"Edg"),r=i.substring(e+4))):-1!==(e=fk(i).call(i,"MSIE"))?(n="Microsoft Internet Explorer",r=i.substring(e+5)):-1!==(e=fk(i).call(i,"Lark"))?(n="Lark",r=i.substring(e+5,e+11)):-1!==(e=fk(i).call(i,"MetaSr"))?(n="sougoubrowser",r=i.substring(e+7,e+10)):-1!==fk(i).call(i,"MQQBrowser")||-1!==fk(i).call(i,"QQBrowser")?(n="qqbrowser",-1!==fk(i).call(i,"MQQBrowser")?(e=fk(i).call(i,"MQQBrowser"),r=i.substring(e+11,e+15)):-1!==fk(i).call(i,"QQBrowser")&&(e=fk(i).call(i,"QQBrowser"),r=i.substring(e+10,e+17))):-1!==fk(i).call(i,"Chrome")?-1!==(e=fk(i).call(i,"MicroMessenger"))?(n="weixin",r=i.substring(e+15,e+20)):-1!==(e=fk(i).call(i,"360"))?(n="360browser",r=i.substring(fk(i).call(i,"Chrome")+7)):-1!==fk(i).call(i,"baidubrowser")||-1!==fk(i).call(i,"BIDUBrowser")?(-1!==fk(i).call(i,"baidubrowser")?(e=fk(i).call(i,"baidubrowser"),r=i.substring(e+13,e+16)):-1!==fk(i).call(i,"BIDUBrowser")&&(e=fk(i).call(i,"BIDUBrowser"),r=i.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=fk(i).call(i,"xiaomi"))?-1!==fk(i).call(i,"openlanguagexiaomi")?(n="openlanguage xiaomi",r=i.substring(e+7,e+13)):(n="xiaomi",r=i.substring(e-7,e-1)):-1!==(e=fk(i).call(i,"TTWebView"))?(n="TTWebView",r=i.substring(e+10,e+23)):(-1!==(e=fk(i).call(i,"Chrome"))||-1!==(e=fk(i).call(i,"Chrome")))&&(n="Chrome",r=i.substring(e+7)):-1!==fk(i).call(i,"Safari")?-1!==(e=fk(i).call(i,"QQ"))?(n="qqbrowser",r=i.substring(e+10,e+16)):-1!==(e=fk(i).call(i,"Safari"))&&(n="Safari",r=i.substring(e+7),-1!==(e=fk(i).call(i,"Version"))&&(r=i.substring(e+8))):-1!==(e=fk(i).call(i,"Firefox"))?(n="Firefox",r=i.substring(e+8)):-1!==(e=fk(i).call(i,"MicroMessenger"))?(n="weixin",r=i.substring(e+15,e+20)):-1!==(e=fk(i).call(i,"QQ"))?(n="qqbrowser",r=i.substring(e+3,e+8)):-1!==(e=fk(i).call(i,"Opera"))&&(n="Opera",r=i.substring(e+6),-1!==(e=fk(i).call(i,"Version"))&&(r=i.substring(e+8))),-1!==(t=fk(r).call(r,";"))&&(r=r.substring(0,t)),-1!==(t=fk(r).call(r," "))&&(r=r.substring(0,t)),-1!==(t=fk(r).call(r,")"))&&(r=r.substring(0,t)),{browser:n,browser_version:r}},e.prototype.os=function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],r=0;r<n.length;r++){var i=n[r];if(i.r.test(this.userAgent)){"Mac OS X"===(e=i.s)&&this.isNewIpad()&&(e="iOS");break}}var o=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},a=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?pk(n).call(n,1)[0]:""};/Windows/.test(e)&&(t=o(/Windows (.*)/,e),e="windows");var s,l;switch(e){case"Mac OS X":t=a("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":s=this.userAgent,(l=o(/Android ([\.\_\d]+)/,s))||(l=o(/Android\/([\.\_\d]+)/,s)),t=l,e="android";break;case"iOS":t=this.isNewIpad()?a("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){fk(e).call(e,"Build/")>-1&&(t=pk(e).call(e,0,fk(e).call(e,"Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),r=fk(n).call(n,";");t=pk(n).call(n,0,r)}}catch(i){return IT(t).call(t)}return IT(t).call(t)},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),LH={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},FH="0.1.0",UH=function(){function e(e,t){this.collector=e,this.config=t,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","_be_active","$bav2b_slide"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","$user_unique_id_type","_staging_flag","$exposure_type","$direction","$offsetY","$offsetX"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return e.prototype.checkVerify=function(e){var t=this;if(!e||!e.length)return!1;var n=e[0];if(!n)return!1;var r=n.events,i=n.header;if(!r||!r.length)return!1;var o=!0;return r.forEach((function(e){t.checkEventName(e.event)||(o=!1,e.checkEvent="事件名不能以 $ or __开头"),t.checkEventParams(e.params)||(o=!1,e.checkParams="属性名不能以 $ or __开头")})),this.checkEventParams(i)||(o=!1),o},e.prototype.checkEventName=function(e){return!!e&&this.calculate(e,"event")},e.prototype.checkEventParams=function(e){var t=e;"string"==typeof e&&(t=JSON.parse(t));var n=!0;if(!dk(t).length)return n;for(var r in t){if(!this.calculate(r,"params")){n=!1;break}if("string"==typeof t[r]&&t[r].length>1024){console.warn("params: "+r+" can not over 1024 byte, please check;"),n=!1;break}}return n},e.prototype.calculate=function(e,t){var n="event"===t?this.eventNameWhiteList:"params"===t?this.paramsNameWhiteList:[];return-1!==fk(n).call(n,e)||(!new RegExp("^\\$").test(e)&&!new RegExp("^__").test(e)||(console.warn(t+" name: "+e+" can not start with $ or __, pleace check;"),!1))},e}();(xH=AH||(AH={})).Init="init",xH.Config="config",xH.Start="start",xH.Ready="ready",xH.TokenComplete="token-complete",xH.TokenStorage="token-storage",xH.TokenFetch="token-fetch",xH.TokenError="token-error",xH.ConfigUuid="config-uuid",xH.ConfigWebId="config-webid",xH.ConfigDomain="config-domain",xH.CustomWebId="custom-webid",xH.AnonymousId="anonymous-id",xH.TokenChange="token-change",xH.TokenReset="token-reset",xH.ConfigTransform="config-transform",xH.EnvTransform="env-transform",xH.SessionReset="session-reset",xH.SessionResetTime="session-reset-time",xH.Event="event",xH.Events="events",xH.EventNow="event-now",xH.CleanEvents="clean-events",xH.BeconEvent="becon-event",xH.SubmitBefore="submit-before",xH.SubmitScuess="submit-scuess",xH.SubmitAfter="submit-after",xH.SubmitError="submit-error",xH.SubmitVerifyH="submit-verify-h5",xH.Stay="stay",xH.ResetStay="reset-stay",xH.StayReady="stay-ready",xH.SetStay="set-stay",xH.RouteChange="route-change",xH.RouteReady="route-ready",xH.Ab="ab",xH.AbVar="ab-var",xH.AbAllVars="ab-all-vars",xH.AbConfig="ab-config",xH.AbExternalVersion="ab-external-version",xH.AbVersionChangeOn="ab-version-change-on",xH.AbVersionChangeOff="ab-version-change-off",xH.AbOpenLayer="ab-open-layer",xH.AbCloseLayer="ab-close-layer",xH.AbReady="ab-ready",xH.AbComplete="ab-complete",xH.AbTimeout="ab-timeout",xH.Profile="profile",xH.ProfileSet="profile-set",xH.ProfileSetOnce="profile-set-once",xH.ProfileUnset="profile-unset",xH.ProfileIncrement="profile-increment",xH.ProfileAppend="profile-append",xH.ProfileClear="profile-clear",xH.TrackDuration="track-duration",xH.TrackDurationStart="track-duration-start",xH.TrackDurationEnd="track-duration-end",xH.TrackDurationPause="track-duration-pause",xH.TrackDurationResume="tracl-duration-resume",xH.Autotrack="autotrack",xH.AutotrackReady="autotrack-ready",xH.CepReady="cep-ready",xH.TracerReady="tracer-ready",(IH=PH||(PH={})).DEBUGGER_MESSAGE="debugger-message",IH.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",IH.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",IH.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",IH.DEBUGGER_MESSAGE_EVENT="debugger-message-event",IH.DEVTOOL_WEB_READY="devtool-web-ready";var BH=AH,NH=void 0,VH=(new Date).getTimezoneOffset(),HH=iE(""+-VH/60,10),GH=60*VH,jH=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var n=new MH(t.app_id,t.cookie_domain||"",t.cookie_expire||7776e6).init();this.eventCheck=new UH(e,t);var r="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new OH(!1,"session"),this.localStorage=new OH(!1,"local"),t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var i=this.localStorage.getItem(r);i&&1==i?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(r,"1")),this.envInfo={user:{user_unique_id:NH,user_type:NH,user_id:NH,user_is_auth:NH,user_is_login:NH,device_id:NH,web_id:NH,ip_addr_id:NH,user_unique_id_type:NH,anonymous_id:NH},header:{app_id:NH,app_name:NH,app_install_id:NH,install_id:NH,app_package:NH,app_channel:NH,app_version:NH,ab_version:NH,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:NH,traffic_type:NH,client_ip:NH,device_brand:NH,os_api:NH,access:NH,language:n.language,region:NH,app_language:NH,app_region:NH,creative_id:n.utm.creative_id,ad_id:n.utm.ad_id,campaign_id:n.utm.campaign_id,log_type:NH,rnd:NH,platform:n.platform,sdk_version:FH,sdk_lib:"js",province:NH,city:NH,timezone:HH,tz_offset:GH,tz_name:NH,sim_region:NH,carrier:NH,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:n.utm.utm_term,utm_content:n.utm.utm_content,utm_source:n.utm.utm_source,utm_medium:n.utm.utm_medium,utm_campaign:n.utm.utm_campaign,tracer_data:yM(n.utm.tracer_data),custom:{},wechat_unionid:NH,wechat_openid:NH}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(n),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=gH(LH[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.initABData=function(){var e="__tea_sdk_ab_version_"+this.initConfig.app_id,t=null;if(this.initConfig.ab_cross){var n=this.localStorage.getCookie(e,this.initConfig.ab_cookie_domain);t=n?JSON.parse(n):null}else t=this.localStorage.getItem(e);this.setAbCache(t)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.clearAbCache=function(){this.ab_cache={},this.ab_version=""},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t="/list";break;case"webid":t="/webid";break;case"tobid":t="/tobid";break;case"profile":t="/profile/list"}var n="";return this.initConfig.caller&&(n="?sdk_version=0.1.0&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),this.initConfig.enable_encryption&&"event"===e&&"sm"!==this.initConfig.encryption_type&&(n=this.initConfig.caller?n+"&encryption=1":n+"?encryption=1"),this.initConfig.report_url?""+this.initConfig.report_url+n:""+this.getDomain()+t+n},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.set=function(e){var t=this;dk(e).forEach((function(n){void 0!==e[n]&&null!==e[n]||t.delete(n);try{t.eventCheck.calculate(n,"config")}catch(u){}if("traffic_type"===n&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[n]),"evtParams"===n)t.evtParams=lH({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===n)t.evtParams=lH({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===n&&"function"==typeof e[n])t.reportErrorCallback=e[n];else{var r="",i="";if(fk(n).call(n,".")>-1){var o=n.split(".");r=o[0],i=o[1]}if(r)"user"===r||"header"===r?t.envInfo[r][i]=e[n]:t.envInfo.header.custom[i]=e[n];else if(Object.hasOwnProperty.call(t.envInfo.user,n)){var a,s,l;fk(a=["user_type","ip_addr_id"]).call(a,n)>-1?t.envInfo.user[n]=e[n]?Number(e[n]):e[n]:fk(s=["user_id","web_id","user_unique_id","user_unique_id_type","anonymous_id"]).call(s,n)>-1?t.envInfo.user[n]=e[n]?String(e[n]):e[n]:fk(l=["user_is_auth","user_is_login"]).call(l,n)>-1?t.envInfo.user[n]=Boolean(e[n]):"device_id"===n&&(t.envInfo.user[n]=e[n])}else Object.hasOwnProperty.call(t.envInfo.header,n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(yM(this.envInfo[e])):JSON.parse(yM(this.envInfo))}catch(t){console.log("get config stringify error "),this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&dk(e).length){var n=AE(e,t);this.storage.setItem(this.configKey,n)}}catch(r){console.log("setStore error"),this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&dk(e).length?e:null}catch(t){return this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(n){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),console.log("delete error")}},e}(),zH=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("[instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),KH=function(){function e(e,t){var n;this.native=e.enable_native||e[qV(n="evitaN".split("")).call(n).join("")],this.os=t.get("os_name")}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Hw((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):n(!1)})):n(!1)}catch(r){console.log("AppLogBridge, error:"+yM(r.stack)),n(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(yM(e)),console.log("change bridge appid, event report with appid: "+e)}catch(t){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{dk(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(n){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(t){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(n){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(yM(e))}catch(t){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(t){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t)}catch(n){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(oz){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(oz){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(oz){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(oz){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(oz){console.error("profileAppend error")}},t.setExternalAbVersion=function(e){try{AppLogBridge.setExternalAbVersion(e)}catch(oz){console.error("setExternalAbVersion error")}},t.getVar=function(e,t,n){try{"android"===this.os?n(AppLogBridge.getABTestConfigValueForKey(e,t)):AppLogBridge.getABTestConfigValueForKey(e,t,(function(e){n(e)}))}catch(oz){console.error("getVar error"),n(t)}},t.getAllVars=function(e){try{"android"===this.os?e(AppLogBridge.getAllAbTestConfigs()):AppLogBridge.getAllAbTestConfigs((function(t){e(t)}))}catch(oz){console.error("getAllVars error"),e(null)}},t.getAbSdkVersion=function(e){try{"android"===this.os?e(AppLogBridge.getAbSdkVersion()):AppLogBridge.getAbSdkVersion((function(t){e(t)}))}catch(oz){console.error("getAbSdkVersion error"),e("")}},e}(),WH=500,qH=5005;function XH(e,t,n,r,i,o,a,s,l,u){try{var c=new XMLHttpRequest,h=s||"POST";c.open(h,""+e,!0),l&&u?c.setRequestHeader("Content-Type","application/octet-stream;tt-data="+u):c.setRequestHeader("Content-Type","application/json; charset=utf-8"),a&&c.setRequestHeader("X-MCS-AppKey",""+a),r&&(c.withCredentials=!0),n&&(c.timeout=n,c.ontimeout=function(){o&&o(t,qH)}),c.onload=function(){if(i){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(n){e={}}i(e,t)}}},c.onerror=function(){c.abort(),o&&o(t,WH)},l?c.send(t):c.send(yM(t))}catch(f){}}var YH=4001,$H=4e3,ZH=4002,JH=4003,QH=function(e,t,n,r){try{var i=e.match(/\/v\d\//),o="";o=i?i[0]:-1!==fk(e).call(e,"/v1/")?"/v1/":"/v2/";var a=e.split(o)[0];if(!a)return void r(e,t,YH);t.forEach((function(i){var o=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t+="&"+n+"="+encodeURIComponent(yM(e[n])));return"&"===t[0]?pk(t).call(t,1):t}(i),s=new Image(1,1);s.onload=function(){s=null,n&&n()},s.onerror=function(){s=null,r&&r(e,t,$H)},s.src=a+"/gif?"+o}))}catch(s){r&&r(e,t,ZH,s.message)}},eG=function(e,t,n,r,i,o,a,s,l){var u=window.navigator.userAgent,c=window.navigator.appName;if(-1===fk(c).call(c,"Microsoft Internet Explorer")||-1===fk(u).call(u,"MSIE 8.0")&&-1===fk(u).call(u,"MSIE 9.0")){if(a)return window.navigator&&window.navigator.sendBeacon?void(window.navigator.sendBeacon(e,yM(t))?i():o(e,t,JH)):void QH(e,t,i,o)}else QH(e,t,i,o);XH(e,t,n,r,i,o,"","",s,l)},tG=function(){function e(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new OH(!0),this.localStorage=new OH(!1),this.eventCheck=new UH(e,t),this.maxReport=t.max_report||20,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.collect.on(BH.Ready,(function(){n.reportAll(!1)})),this.collect.on(BH.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on(BH.Event,(function(e){n.event(e)})),this.collect.on(BH.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on(BH.CleanEvents,(function(){n.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),yH((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var n=cH(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var r=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),r)}}catch(i){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}},e.prototype.beconEvent=function(e){var t=cH(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var r;r=pk(e).call(e,n,n+this.eventLimit);var i=this.split(this.merge(r));this.send(i,t)}else{i=this.split(this.merge(e));this.send(i,t)}},e.prototype.handleRefer=function(){var e="";try{if(this.config.spa||this.config.autotrack){var t=this.localStorage.getItem(this.refer_key)||{};e=t.routeChange?t.refer_key:this.configManager.get("referrer")}else e=this.configManager.get("referrer")}catch(n){e=document.referrer}return e},e.prototype.merge=function(e,t){var n=this,r=this.configManager.get(),i=r.header,o=r.user;i.referrer=this.handleRefer(),i.custom=yM(i.custom);var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),l=Vw(e).call(e,(function(e){try{if(dk(a).length&&!t&&(e.params=lH({},e.params,a)),n.collect.dynamicParamsFilter){var r=n.collect.dynamicParamsFilter();dk(r).length&&(e.params=lH({},e.params,r))}s&&(e.params.$user_unique_id_type=s);var i=n.configManager.getAbCache(),l=n.configManager.getAbVersion();return l&&i&&(n.config.disable_ab_reset||i.uuid===o.user_unique_id)&&(e.ab_sdk_version=l),e.session_id=n.collect.sessionManager.getSessionId(),e.params=yM(e.params),e}catch(u){return n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:u.message}),e}})),u=[];if(!dk(o).length)return console.warn("user info error,cant report"),u;this.config.enable_anonymousid&&delete o.web_id;var c=JSON.parse(yM({events:l,user:o,header:i}));return c.local_time=Math.floor(Date.now()/1e3),c.verbose=1,c.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,u.push(c),u},e.prototype.split=function(e){return e=Vw(e).call(e,(function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var n=this;e.length&&e.forEach((function(e){try{var r,i=JSON.parse(yM(e));if(Gw(n.config))(i=Gw(r=n.config).call(r,i))||console.warn("filter must return data !!");n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var o=i||e,a=JSON.parse(yM(o));if(n.eventCheck.checkVerify(a),!o.length)return;n.collect.emit(BH.SubmitBefore,o);var s=n.collect.cryptoData(o);eG(n.reportUrl,s,n.timeout,!1,(function(e,t){e&&0!==e.e?(n.collect.emit(BH.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:a,code:e.e,failType:"数据异常",status:"fail"})):(n.collect.emit(BH.SubmitScuess,{eventData:t,res:e}),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:a,code:200,status:"success"}))}),(function(e,t){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit(BH.SubmitError,{type:"f_net",eventData:e,errorCode:t}),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:a,code:t,failType:"网络异常",status:"fail"})}),t,n.config.enable_encryption,n.config.encryption_header),n.eventCheck.checkVerify(o),n.collect.emit(BH.SubmitVerifyH,o),n.collect.emit(BH.SubmitAfter,o)}catch(l){console.warn("something error, "+yM(l.stack)),n.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:l.message})}}))},e}(),nG=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},rG=function(){var e;return pk(e=nG().replace(/-/g,"")).call(e,0,19)},iG=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},oG=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new OH(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(BH.SessionReset,(function(){n.resetSessionId()})),this.collect.on(BH.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:iG(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:iG(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:iG(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&(Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:iG(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e)))},e}(),aG=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enableTTwebid=!1,this.enableCustomWebid=!1,this.enableAnonymousid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new OH(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enableAnonymousid=t.enable_anonymousid,this.enableTTwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(BH.AnonymousId,(function(e){n.setAnonymousId(e)})),this.collect.on(BH.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on(BH.ConfigWebId,(function(e){n.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid||this.enableAnonymousid?this.enableAnonymousid?this.completeAnonymous(this.cacheToken):this.enableCustomWebid?this.collect.on(BH.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(BH.TokenComplete)})):this.checkEnv()||(this.enableTTwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:rG(),user_unique_id:this.configManager.get("user_unique_id")||rG()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==fk(e).call(e,"miniProgram")||-1!==fk(e).call(e,"MiniProgram")){var t=_H(window.location.href);return!(!t||!t.Web_ID)&&(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),!0)}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:n});var r=rG();XH(t,this.collect.cryptoData(n),3e5,!1,(function(t){var n;t&&0===t.e?(n=t.web_id,e.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t})):(n=r,e.collect.configManager.set({localWebId:r}),e.collect.emit(BH.TokenError),e.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"WEBID请求返回值异常",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})}),(function(){e.complete({web_id:e.configManager.get("web_id")||r,user_unique_id:e.configManager.get("user_unique_id")||r}),e.collect.configManager.set({localWebId:r}),e.collect.emit(BH.TokenError),e.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")}),"","",this.config.enable_encryption,this.config.encryption_header)},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;if(!t&&!n)return this.collect.emit(BH.TokenError),void console.warn("token error");e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(BH.TokenComplete)},e.prototype.completeAnonymous=function(e){var t=e.anonymous_id||iG(),n=e.user_unique_id||this.configManager.get("user_unique_id");this.collect.configManager.set({anonymous_id:t,user_unique_id:n||t}),e.anonymous_id=t,e.user_unique_id=n||t,this.setStorage(e),this.tokenReady=!0,this.collect.emit(BH.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(BH.TokenComplete)},e.prototype.setUuid=function(e){var t;if(e&&-1===fk(t=["null","undefined","Null","None"]).call(t,e)){var n=String(e),r=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(n===r&&n===i)return;this.configManager.set({user_unique_id:n}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=n,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(BH.TokenChange,{type:"uuid",id:e}),this.collect.emit(BH.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){if(!this.config.enable_ttwebid){var e=this.enableAnonymousid?this.configManager.get("anonymous_id"):this.configManager.get("web_id");this.configManager.get("user_unique_id")!==e&&(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(BH.TokenReset))}},e.prototype.setAnonymousId=function(e){if(e&&this.enableAnonymousid){var t=this.configManager.get("anonymous_id"),n=this.configManager.get("user_unique_id");t!==e&&(t!==n&&n||(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.collect.emit(BH.TokenChange,{type:"uuid",id:e})),this.configManager.set({anonymous_id:e}),this.cacheToken.anonymous_id=e,this.collect.emit(BH.TokenChange,{type:"anonymous_id",id:e}),this.setStorage(this.cacheToken))}},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid&&!this.enableAnonymousid){var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.collect.emit(BH.TokenChange,{type:"uuid",id:e})),t!==e&&(this.configManager.set({web_id:e}),this.cacheToken.web_id=e,this.collect.emit(BH.TokenChange,{type:"webid",id:e})),this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){var t;e._type_=this.enableCustomWebid?"custom":"default",delete e[qV(t="diss".split("")).call(t).join("")],this.enableCookie||this.enableTTwebid?this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this,t=this.configManager.getUrl("tobid"),n={app_id:this.config.app_id,user_unique_id:this.configManager.get("user_unique_id"),user_unique_id_type:this.configManager.get("user_unique_id_type")};this.enableAnonymousid?n.anonymous_id=this.configManager.get("anonymous_id"):n.web_id=this.configManager.get("web_id");var r=this.collect.cryptoData(n);return new Hw((function(n){XH(t,r,3e4,e.enableTTwebid,(function(e){e&&0===e.e?n(e.tobid):n("")}),(function(){n("")}),"","",e.config.enable_encryption,e.config.encryption_header)}))},e}(),sG=EH((function(e,t){(function(){var t;function n(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function r(){return new n(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var l=32767&this[e],u=this[e++]>>15,c=s*l+u*a;i=((l=a*l+((32767&c)<<15)+n[r]+(1073741823&i))>>>30)+(c>>>15)+s*u+(i>>>30),n[r++]=1073741823&l}return i},t=30):i&&"Netscape"!=navigator.appName?(n.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},t=26):(n.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var l=16383&this[e],u=this[e++]>>14,c=s*l+u*a;i=((l=a*l+((16383&c)<<14)+n[r]+i)>>28)+(c>>14)+s*u,n[r++]=268435455&l}return i},t=28),n.prototype.DB=t,n.prototype.DM=(1<<t)-1,n.prototype.DV=1<<t;n.prototype.FV=Math.pow(2,52),n.prototype.F1=52-t,n.prototype.F2=2*t-52;var o,a,s="0123456789abcdefghijklmnopqrstuvwxyz",l=new Array;for(o="0".charCodeAt(0),a=0;a<=9;++a)l[o++]=a;for(o="a".charCodeAt(0),a=10;a<36;++a)l[o++]=a;for(o="A".charCodeAt(0),a=10;a<36;++a)l[o++]=a;function u(e){return s.charAt(e)}function c(e,t){var n=l[e.charCodeAt(t)];return null==n?-1:n}function h(e){var t=r();return t.fromInt(e),t}function f(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function d(e){this.m=e}function p(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function v(e,t){return e&t}function g(e,t){return e|t}function y(e,t){return e^t}function m(e,t){return e&~t}function _(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function b(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function k(e){return e}function E(e){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}d.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},d.prototype.revert=function(e){return e},d.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},d.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),gL(this).call(this,n)},d.prototype.sqrTo=function(e,t){e.squareTo(t),gL(this).call(this,t)},p.prototype.convert=function(e){var t=r();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(n.ZERO)>0&&this.m.subTo(t,t),t},p.prototype.revert=function(e){var t=r();return e.copyTo(t),gL(this).call(this,t),t},p.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},p.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),gL(this).call(this,n)},p.prototype.sqrTo=function(e,t){e.squareTo(t),gL(this).call(this,t)},n.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},n.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},n.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var i=e.length,o=!1,a=0;--i>=0;){var s=8==r?255&e[i]:c(e,i);s<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&n.ZERO.subTo(this,this)},n.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},n.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},n.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},n.prototype.lShiftTo=function(e,t){var n,r=e%this.DB,i=this.DB-r,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<<r;for(n=a-1;n>=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},n.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},n.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},n.prototype.multiplyTo=function(e,t){var r=this.abs(),i=e.abs(),o=r.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o<i.t;++o)t[o+r.t]=r.am(0,i[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&n.ZERO.subTo(t,t)},n.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},n.prototype.divRemTo=function(e,t,i){var o=e.abs();if(!(o.t<=0)){var a=this.abs();if(a.t<o.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=r());var s=r(),l=this.s,u=e.s,c=this.DB-f(o[o.t-1]);c>0?(o.lShiftTo(c,s),a.lShiftTo(c,i)):(o.copyTo(s),a.copyTo(i));var h=s.t,d=s[h-1];if(0!=d){var p=d*(1<<this.F1)+(h>1?s[h-2]>>this.F2:0),v=this.FV/p,g=(1<<this.F1)/p,y=1<<this.F2,m=i.t,_=m-h,b=null==t?r():t;for(s.dlShiftTo(_,b),i.compareTo(b)>=0&&(i[i.t++]=1,i.subTo(b,i)),n.ONE.dlShiftTo(h,b),b.subTo(s,s);s.t<h;)s[s.t++]=0;for(;--_>=0;){var w=i[--m]==d?this.DM:Math.floor(i[m]*v+(i[m-1]+y)*g);if((i[m]+=s.am(0,w,i,_,0,h))<w)for(s.dlShiftTo(_,b),i.subTo(b,i);i[m]<--w;)i.subTo(b,i)}null!=t&&(i.drShiftTo(h,t),l!=u&&n.ZERO.subTo(t,t)),i.t=h,i.clamp(),c>0&&i.rShiftTo(c,i),l<0&&n.ZERO.subTo(i,i)}}},n.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},n.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},n.prototype.exp=function(e,t){if(e>4294967295||e<1)return n.ONE;var i=r(),o=r(),a=t.convert(this),s=f(e)-1;for(a.copyTo(i);--s>=0;)if(t.sqrTo(i,o),(e&1<<s)>0)t.mulTo(o,a,i);else{var l=i;i=o,o=l}return t.revert(i)},n.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(i=!0,o=u(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=u(n));return i?o:"0"},n.prototype.negate=function(){var e=r();return n.ZERO.subTo(this,e),e},n.prototype.abs=function(){return this.s<0?this.negate():this},n.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},n.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},n.prototype.mod=function(e){var t=r();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(n.ZERO)>0&&e.subTo(t,t),t},n.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new d(t):new p(t),this.exp(e,n)},n.ZERO=h(0),n.ONE=h(1),w.prototype.convert=k,w.prototype.revert=k,w.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},E.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=r();return e.copyTo(t),gL(this).call(this,t),t},E.prototype.revert=function(e){return e},E.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},E.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),gL(this).call(this,n)},E.prototype.sqrTo=function(e,t){e.squareTo(t),gL(this).call(this,t)};var S,T,C,A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],x=(1<<26)/A[A.length-1];function P(){var e;e=(new Date).getTime(),T[C++]^=255&e,T[C++]^=e>>8&255,T[C++]^=e>>16&255,T[C++]^=e>>24&255,C>=F&&(C-=F)}if(n.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},n.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),i=h(n),o=r(),a=r(),s="";for(this.divRemTo(i,o,a);o.signum()>0;)s=(n+a.intValue()).toString(e).substr(1)+s,o.divRemTo(i,o,a);return a.intValue().toString(e)+s},n.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),i=Math.pow(t,r),o=!1,a=0,s=0,l=0;l<e.length;++l){var u=c(e,l);u<0?"-"==e.charAt(l)&&0==this.signum()&&(o=!0):(s=t*s+u,++a>=r&&(this.dMultiply(i),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),o&&n.ZERO.subTo(this,this)},n.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(n.ONE.shiftLeft(e-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(n.ONE.shiftLeft(e-1),this);else{var i=new Array,o=7&e;i.length=1+(e>>3),t.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},n.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},n.prototype.changeBit=function(e,t){var r=n.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},n.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},n.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},n.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},n.prototype.multiplyLowerTo=function(e,t,n){var r,i=Math.min(this.t+e.t,t);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i<r;++i)n[i+this.t]=this.am(0,e[i],n,i,0,this.t);for(r=Math.min(e.t,t);i<r;++i)this.am(0,e[i],n,i,0,t-i);n.clamp()},n.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},n.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},n.prototype.millerRabin=function(e){var t=this.subtract(n.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var o=t.shiftRight(i);(e=e+1>>1)>A.length&&(e=A.length);for(var a=r(),s=0;s<e;++s){a.fromInt(A[Math.floor(Math.random()*A.length)]);var l=a.modPow(o,this);if(0!=l.compareTo(n.ONE)&&0!=l.compareTo(t)){for(var u=1;u++<i&&0!=l.compareTo(t);)if(0==(l=l.modPowInt(2,this)).compareTo(n.ONE))return!1;if(0!=l.compareTo(t))return!1}}return!0},n.prototype.clone=function(){var e=r();return this.copyTo(e),e},n.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},n.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},n.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},n.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},n.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},n.prototype.equals=function(e){return 0==this.compareTo(e)},n.prototype.min=function(e){return this.compareTo(e)<0?this:e},n.prototype.max=function(e){return this.compareTo(e)>0?this:e},n.prototype.and=function(e){var t=r();return this.bitwiseTo(e,v,t),t},n.prototype.or=function(e){var t=r();return this.bitwiseTo(e,g,t),t},n.prototype.xor=function(e){var t=r();return this.bitwiseTo(e,y,t),t},n.prototype.andNot=function(e){var t=r();return this.bitwiseTo(e,m,t),t},n.prototype.not=function(){for(var e=r(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},n.prototype.shiftLeft=function(e){var t=r();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},n.prototype.shiftRight=function(e){var t=r();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},n.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+_(this[e]);return this.s<0?this.t*this.DB:-1},n.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=b(this[n]^t);return e},n.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},n.prototype.setBit=function(e){return this.changeBit(e,g)},n.prototype.clearBit=function(e){return this.changeBit(e,m)},n.prototype.flipBit=function(e){return this.changeBit(e,y)},n.prototype.add=function(e){var t=r();return this.addTo(e,t),t},n.prototype.subtract=function(e){var t=r();return this.subTo(e,t),t},n.prototype.multiply=function(e){var t=r();return this.multiplyTo(e,t),t},n.prototype.divide=function(e){var t=r();return this.divRemTo(e,t,null),t},n.prototype.remainder=function(e){var t=r();return this.divRemTo(e,null,t),t},n.prototype.divideAndRemainder=function(e){var t=r(),n=r();return this.divRemTo(e,t,n),new Array(t,n)},n.prototype.modPow=function(e,t){var n,i,o=e.bitLength(),a=h(1);if(o<=0)return a;n=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new d(t):t.isEven()?new E(t):new p(t);var s=new Array,l=3,u=n-1,c=(1<<n)-1;if(s[1]=i.convert(this),n>1){var v=r();for(i.sqrTo(s[1],v);l<=c;)s[l]=r(),i.mulTo(v,s[l-2],s[l]),l+=2}var g,y,m=e.t-1,_=!0,b=r();for(o=f(e[m])-1;m>=0;){for(o>=u?g=e[m]>>o-u&c:(g=(e[m]&(1<<o+1)-1)<<u-o,m>0&&(g|=e[m-1]>>this.DB+o-u)),l=n;0==(1&g);)g>>=1,--l;if((o-=l)<0&&(o+=this.DB,--m),_)s[g].copyTo(a),_=!1;else{for(;l>1;)i.sqrTo(a,b),i.sqrTo(b,a),l-=2;l>0?i.sqrTo(a,b):(y=a,a=b,b=y),i.mulTo(b,s[g],a)}for(;m>=0&&0==(e[m]&1<<o);)i.sqrTo(a,b),y=a,a=b,b=y,--o<0&&(o=this.DB-1,--m)}return i.revert(a)},n.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return n.ZERO;for(var r=e.clone(),i=this.clone(),o=h(1),a=h(0),s=h(0),l=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),t?(s.isEven()&&l.isEven()||(s.addTo(this,s),l.subTo(e,l)),s.rShiftTo(1,s)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);r.compareTo(i)>=0?(r.subTo(i,r),t&&o.subTo(s,o),a.subTo(l,a)):(i.subTo(r,i),t&&s.subTo(o,s),l.subTo(a,l))}return 0!=i.compareTo(n.ONE)?n.ZERO:l.compareTo(e)>=0?l.subtract(e):l.signum()<0?(l.addTo(e,l),l.signum()<0?l.add(e):l):l},n.prototype.pow=function(e){return this.exp(e,new w)},n.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},n.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=A[A.length-1]){for(t=0;t<A.length;++t)if(n[0]==A[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<A.length;){for(var r=A[t],i=t+1;i<A.length&&r<x;)r*=A[i++];for(r=n.modInt(r);t<i;)if(r%A[t++]==0)return!1}return n.millerRabin(e)},n.prototype.square=function(){var e=r();return this.squareTo(e),e},n.prototype.Barrett=E,null==T){var I;if(T=new Array,C=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var R=new Uint8Array(32);for(window.crypto.getRandomValues(R),I=0;I<32;++I)T[C++]=R[I]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var D=window.crypto.random(32);for(I=0;I<D.length;++I)T[C++]=255&D.charCodeAt(I)}for(;C<F;)I=Math.floor(65536*Math.random()),T[C++]=I>>>8,T[C++]=255&I;C=0,P()}function O(){if(null==S){for(P(),(S=new L).init(T),C=0;C<T.length;++C)T[C]=0;C=0}return S.next()}function M(){}function L(){this.i=0,this.j=0,this.S=new Array}M.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=O()},L.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},L.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var F=256;e.exports={default:n,BigInteger:n,SecureRandom:M}}).call(kH)}));sG.BigInteger,sG.SecureRandom;var lG=sG.BigInteger;var uG=function(){function e(){Ry(this,e),this.tlv=null,this.t="00",this.l="00",this.v=""}return Fy(e,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var e=this.v.length/2,t=e.toString(16);return t.length%2==1&&(t="0"+t),e<128?t:(128+t.length/2).toString(16)+t}},{key:"getValue",value:function(){return""}}]),e}(),cG=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),(r=t.call(this)).t="02",e&&(r.v=function(e){var t=e.toString(16);if("-"!==t[0])t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=(t=t.substr(1)).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=(t=(r=new lG(r,16)).xor(e).add(lG.ONE)).toString(16).replace(/^-/,"")}return t}(e)),r}return Fy(n,[{key:"getValue",value:function(){return this.v}}]),n}(uG),hG=function(e){oP(n,e);var t=lP(n);function n(e){var r;return Ry(this,n),(r=t.call(this)).t="30",r.asn1Array=e,r}return Fy(n,[{key:"getValue",value:function(){var e;return this.v=Vw(e=this.asn1Array).call(e,(function(e){return e.getEncodedHex()})).join(""),this.v}}]),n}(uG);function fG(e,t){return+e[t+2]<8?1:128&+e.substr(t+2,2)}function dG(e,t){var n=fG(e,t),r=e.substr(t+2,2*n);return r?(+r[0]<8?new lG(r,16):new lG(r.substr(2),16)).intValue():-1}function pG(e,t){return t+2*(fG(e,t)+1)}var vG=function(e,t){var n=new cG(e),r=new cG(t);return new hG([n,r]).getEncodedHex()},gG=function(e){var t=pG(e,0),n=pG(e,t),r=dG(e,t),i=e.substr(n,2*r),o=n+i.length,a=pG(e,o),s=dG(e,o),l=e.substr(a,2*s);return{r:new lG(i,16),s:new lG(l,16)}},yG=sG.BigInteger,mG=new yG("2"),_G=new yG("3"),bG=function(){function e(t,n){Ry(this,e),this.x=n,this.q=t}return Fy(e,[{key:"equals",value:function(e){return e===this||this.q.equals(e.q)&&this.x.equals(e.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new e(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(t){return new e(this.q,this.x.add(t.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(t){return new e(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(t){return new e(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}},{key:"divide",value:function(t){return new e(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new e(this.q,this.x.square().mod(this.q))}}]),e}(),wG=function(){function e(t,n,r,i){Ry(this,e),this.curve=t,this.x=n,this.y=r,this.z=null==i?yG.ONE:i,this.zinv=null}return Fy(e,[{key:"getX",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(e){return e===this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(yG.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(yG.ZERO))}},{key:"isInfinity",value:function(){return null===this.x&&null===this.y||this.z.equals(yG.ZERO)&&!this.y.toBigInteger().equals(yG.ZERO)}},{key:"negate",value:function(){return new e(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var n=this.x.toBigInteger(),r=this.y.toBigInteger(),i=this.z,o=t.x.toBigInteger(),a=t.y.toBigInteger(),s=t.z,l=this.curve.q,u=n.multiply(s).mod(l),c=o.multiply(i).mod(l),h=u.subtract(c),f=r.multiply(s).mod(l),d=a.multiply(i).mod(l),p=f.subtract(d);if(yG.ZERO.equals(h))return yG.ZERO.equals(p)?this.twice():this.curve.infinity;var v=u.add(c),g=i.multiply(s).mod(l),y=h.square().mod(l),m=h.multiply(y).mod(l),_=g.multiply(p.square()).subtract(v.multiply(y)).mod(l),b=h.multiply(_).mod(l),w=p.multiply(y.multiply(u).subtract(_)).subtract(f.multiply(m)).mod(l),k=m.multiply(g).mod(l);return new e(this.curve,this.curve.fromBigInteger(b),this.curve.fromBigInteger(w),k)}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var t=this.x.toBigInteger(),n=this.y.toBigInteger(),r=this.z,i=this.curve.q,o=this.curve.a.toBigInteger(),a=t.square().multiply(_G).add(o.multiply(r.square())).mod(i),s=n.shiftLeft(1).multiply(r).mod(i),l=n.square().mod(i),u=l.multiply(t).multiply(r).mod(i),c=s.square().mod(i),h=a.square().subtract(u.shiftLeft(3)).mod(i),f=s.multiply(h).mod(i),d=a.multiply(u.shiftLeft(2).subtract(h)).subtract(c.shiftLeft(1).multiply(l)).mod(i),p=s.multiply(c).mod(i);return new e(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(d),p)}},{key:"multiply",value:function(e){if(this.isInfinity())return this;if(!e.signum())return this.curve.infinity;for(var t=e.multiply(_G),n=this.negate(),r=this,i=t.bitLength()-2;i>0;i--){r=r.twice();var o=t.testBit(i);o!==e.testBit(i)&&(r=r.add(o?this:n))}return r}}]),e}(),kG=function(){function e(t,n,r){Ry(this,e),this.q=t,this.a=this.fromBigInteger(n),this.b=this.fromBigInteger(r),this.infinity=new wG(this,null,null)}return Fy(e,[{key:"equals",value:function(e){return e===this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)}},{key:"fromBigInteger",value:function(e){return new bG(this.q,e)}},{key:"decodePointHex",value:function(e){switch(iE(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var t=this.fromBigInteger(new yG(e.substr(2),16)),n=this.fromBigInteger(t.multiply(t.square()).add(t.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new yG("4")).add(yG.ONE),this.q));return n.toBigInteger().mod(mG).equals(new yG(e.substr(0,2),16).subtract(mG))||(n=n.negate()),new wG(this,t,n);case 4:case 6:case 7:var r=(e.length-2)/2,i=e.substr(2,r),o=e.substr(r+2,r);return new wG(this,this.fromBigInteger(new yG(i,16)),this.fromBigInteger(new yG(o,16)));default:return null}}}]),e}(),EG={ECPointFp:wG,ECCurveFp:kG},SG=sG.BigInteger,TG=sG.SecureRandom,CG=EG.ECCurveFp,AG=new TG,xG=DG(),PG=xG.curve,IG=xG.G,RG=xG.n;function DG(){var e=new SG("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),t=new SG("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),n=new SG("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),r=new CG(e,t,n),i=r.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:r,G:i,n:new SG("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function OG(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e}var MG={getGlobalCurve:function(){return PG},generateEcparam:DG,generateKeyPairHex:function(e,t,n){var r=(e?new SG(e,t,n):new SG(RG.bitLength(),AG)).mod(RG.subtract(SG.ONE)).add(SG.ONE),i=OG(r.toString(16),64),o=IG.multiply(r);return{privateKey:i,publicKey:"04"+OG(o.getX().toBigInteger().toString(16),64)+OG(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(e){if(130!==e.length)throw new Error("Invalid public key to compress");var t=(e.length-2)/2,n=e.substr(2,t),r="03";return new SG(e.substr(t+2,t),16).mod(new SG("2")).equals(SG.ZERO)&&(r="02"),r+n},utf8ToHex:function(e){for(var t=(e=unescape(encodeURIComponent(e))).length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;for(var i=[],o=0;o<t;o++){var a=n[o>>>2]>>>24-o%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).toString(16))}return i.join("")},leftPad:OG,arrayToHex:function(e){return Vw(e).call(e,(function(e){return 1===(e=e.toString(16)).length?"0"+e:e})).join("")},arrayToUtf8:function(e){for(var t=[],n=0,r=0;r<2*e.length;r+=2)t[r>>>3]|=iE(e[n],10)<<24-r%8*4,n++;try{for(var i=[],o=0;o<e.length;o++){var a=t[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(a))}return decodeURIComponent(escape(i.join("")))}catch(s){throw new Error("Malformed UTF-8 data")}},hexToArray:function(e){var t=[],n=e.length;n%2!=0&&(e=OG(e,n+1)),n=e.length;for(var r=0;r<n;r+=2)t.push(iE(e.substr(r,2),16));return t},verifyPublicKey:function(e){var t=PG.decodePointHex(e);if(!t)return!1;var n=t.getX();return t.getY().square().equals(n.multiply(n.square()).add(n.multiply(PG.a)).add(PG.b))},comparePublicKeyHex:function(e,t){var n=PG.decodePointHex(e);if(!n)return!1;var r=PG.decodePointHex(t);return!!r&&n.equals(r)}},LG=new Uint32Array(68),FG=new Uint32Array(64);function UG(e,t){var n=31&t;return e<<n|e>>>32-n}function BG(e,t){for(var n=[],r=e.length-1;r>=0;r--)n[r]=255&(e[r]^t[r]);return n}function NG(e){return e^UG(e,9)^UG(e,17)}function VG(e){var t,n=8*e.length,r=n%512;r=r>=448?512-r%448-1:448-r-1;for(var i=new Array((r-7)/8),o=new Array(8),a=0,s=i.length;a<s;a++)i[a]=0;for(var l=0,u=o.length;l<u;l++)o[l]=0;n=n.toString(2);for(var c=7;c>=0;c--)if(n.length>8){var h=n.length-8;o[c]=iE(n.substr(h),2),n=n.substr(0,h)}else n.length>0&&(o[c]=iE(n,2),n="");for(var f,d=new Uint8Array(Nm(t=[]).call(t,Iy(e),[128],i,o)),p=new DataView(d.buffer,0),v=d.length/64,g=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),y=0;y<v;y++){jM(LG).call(LG,0),jM(FG).call(FG,0);for(var m=16*y,_=0;_<16;_++)LG[_]=p.getUint32(4*(m+_),!1);for(var b=16;b<68;b++)LG[b]=(f=LG[b-16]^LG[b-9]^UG(LG[b-3],15))^UG(f,15)^UG(f,23)^UG(LG[b-13],7)^LG[b-6];for(var w=0;w<64;w++)FG[w]=LG[w]^LG[w+4];for(var k=g[0],E=g[1],S=g[2],T=g[3],C=g[4],A=g[5],x=g[6],P=g[7],I=void 0,R=void 0,D=void 0,O=void 0,M=0;M<64;M++)O=M>=0&&M<=15?2043430169:2055708042,R=(M>=0&&M<=15?k^E^S:k&E|k&S|E&S)+T+((I=UG(UG(k,12)+C+UG(O,M),7))^UG(k,12))+FG[M],D=(M>=0&&M<=15?C^A^x:C&A|~C&x)+P+I+LG[M],T=S,S=UG(E,9),E=k,k=R,P=x,x=UG(A,19),A=C,C=NG(D);g[0]^=k,g[1]^=E,g[2]^=S,g[3]^=T,g[4]^=C,g[5]^=A,g[6]^=x,g[7]^=P}for(var L=[],F=0,U=g.length;F<U;F++){var B=g[F];L.push((4278190080&B)>>>24,(16711680&B)>>>16,(65280&B)>>>8,255&B)}return L}for(var HG=new Uint8Array(64),GG=new Uint8Array(64),jG=0;jG<64;jG++)HG[jG]=54,GG[jG]=92;var zG=VG,KG=function(e,t){var n,r;for(t.length>64&&(t=VG(t));t.length<64;)t.push(0);var i=BG(t,HG),o=BG(t,GG),a=VG(Nm(n=[]).call(n,Iy(i),Iy(e)));return VG(Nm(r=[]).call(r,Iy(o),Iy(a)))},WG=sG.BigInteger,qG=vG,XG=gG,YG=zG,$G=MG.generateEcparam(),ZG=$G.G,JG=$G.curve,QG=$G.n;function ej(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1234567812345678";n=MG.utf8ToHex(n);var r,i,o=MG.leftPad(ZG.curve.a.toBigInteger().toRadix(16),64),a=MG.leftPad(ZG.curve.b.toBigInteger().toRadix(16),64),s=MG.leftPad(ZG.getX().toBigInteger().toRadix(16),64),l=MG.leftPad(ZG.getY().toBigInteger().toRadix(16),64);if(128===t.length)r=t.substr(0,64),i=t.substr(64,64);else{var u=ZG.curve.decodePointHex(t);r=MG.leftPad(u.getX().toBigInteger().toRadix(16),64),i=MG.leftPad(u.getY().toBigInteger().toRadix(16),64)}var c=MG.hexToArray(n+o+a+s+l+r+i),h=4*n.length;c.unshift(255&h),c.unshift(h>>8&255);var f=YG(c);return MG.arrayToHex(YG(Nm(f).call(f,MG.hexToArray(e))))}function tj(){var e=MG.generateKeyPairHex(),t=JG.decodePointHex(e.publicKey);return e.k=new WG(e.privateKey,16),e.x1=t.getX().toBigInteger(),e}var nj={generateKeyPairHex:MG.generateKeyPairHex,compressPublicKeyHex:MG.compressPublicKeyHex,comparePublicKeyHex:MG.comparePublicKeyHex,doEncrypt:function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;e="string"==typeof e?MG.hexToArray(MG.utf8ToHex(e)):pk(Array.prototype).call(e),t=MG.getGlobalCurve().decodePointHex(t);var o=MG.generateKeyPairHex(),a=new WG(o.privateKey,16),s=o.publicKey;s.length>128&&(s=s.substr(s.length-128));var l=t.multiply(a),u=MG.hexToArray(MG.leftPad(l.getX().toBigInteger().toRadix(16),64)),c=MG.hexToArray(MG.leftPad(l.getY().toBigInteger().toRadix(16),64)),h=MG.arrayToHex(YG(Nm(n=[]).call(n,u,e,c))),f=1,d=0,p=[],v=Nm(r=[]).call(r,u,c),g=function(){var e;p=YG(Nm(e=[]).call(e,Iy(v),[f>>24&255,f>>16&255,f>>8&255,255&f])),f++,d=0};g();for(var y=0,m=e.length;y<m;y++)d===p.length&&g(),e[y]^=255&p[d++];var _=MG.arrayToHex(e);return 0===i?s+_+h:s+h+_},doDecrypt:function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).output,a=void 0===o?"string":o;t=new WG(t,16);var s=e.substr(128,64),l=e.substr(192);0===i&&(s=e.substr(e.length-64),l=e.substr(128,e.length-128-64));var u=MG.hexToArray(l),c=MG.getGlobalCurve().decodePointHex("04"+e.substr(0,128)).multiply(t),h=MG.hexToArray(MG.leftPad(c.getX().toBigInteger().toRadix(16),64)),f=MG.hexToArray(MG.leftPad(c.getY().toBigInteger().toRadix(16),64)),d=1,p=0,v=[],g=Nm(n=[]).call(n,h,f),y=function(){var e;v=YG(Nm(e=[]).call(e,Iy(g),[d>>24&255,d>>16&255,d>>8&255,255&d])),d++,p=0};y();for(var m=0,_=u.length;m<_;m++)p===v.length&&y(),u[m]^=255&v[p++];return MG.arrayToHex(YG(Nm(r=[]).call(r,h,u,f)))===s.toLowerCase()?"array"===a?u:MG.arrayToUtf8(u):"array"===a?[]:""},doSignature:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.pointPool,i=n.der,o=n.hash,a=n.publicKey,s=n.userId,l="string"==typeof e?MG.utf8ToHex(e):MG.arrayToHex(e);o&&(a=a||function(e){var t=ZG.multiply(new WG(e,16)),n=MG.leftPad(t.getX().toBigInteger().toString(16),64),r=MG.leftPad(t.getY().toBigInteger().toString(16),64);return"04"+n+r}(t),l=ej(l,a,s));var u=new WG(t,16),c=new WG(l,16),h=null,f=null,d=null;do{do{var p=void 0;h=(p=r&&r.length?r.pop():tj()).k,f=c.add(p.x1).mod(QG)}while(f.equals(WG.ZERO)||f.add(h).equals(QG));d=u.add(WG.ONE).modInverse(QG).multiply(h.subtract(f.multiply(u))).mod(QG)}while(d.equals(WG.ZERO));return i?qG(f,d):MG.leftPad(f.toString(16),64)+MG.leftPad(d.toString(16),64)},doVerifySignature:function(e,t,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=o.der,s=o.hash,l=o.userId,u="string"==typeof e?MG.utf8ToHex(e):MG.arrayToHex(e);if(s&&(u=ej(u,n,l)),a){var c=XG(t);r=c.r,i=c.s}else r=new WG(t.substring(0,64),16),i=new WG(t.substring(64),16);var h=JG.decodePointHex(n),f=new WG(u,16),d=r.add(i).mod(QG);if(d.equals(WG.ZERO))return!1;var p=ZG.multiply(i).add(h.multiply(d)),v=f.add(p.getX().toBigInteger()).mod(QG);return r.equals(v)},getPoint:tj,verifyPublicKey:MG.verifyPublicKey},rj=zG,ij=KG;function oj(e){return Vw(e).call(e,(function(e){return 1===(e=e.toString(16)).length?"0"+e:e})).join("")}function aj(e){var t,n,r=[],i=e.length;i%2!=0&&(n=i+1,e=(t=e).length>=n?t:new Array(n-t.length+1).join("0")+t),i=e.length;for(var o=0;o<i;o+=2)r.push(iE(e.substr(o,2),16));return r}var sj=0,lj=16,uj=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],cj=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function hj(e){for(var t=[],n=0,r=e.length;n<r;n+=2)t.push(iE(e.substr(n,2),16));return t}function fj(e,t){return e<<t|e>>>32-t}function dj(e){return(255&uj[e>>>24&255])<<24|(255&uj[e>>>16&255])<<16|(255&uj[e>>>8&255])<<8|255&uj[255&e]}function pj(e){return e^fj(e,2)^fj(e,10)^fj(e,18)^fj(e,24)}function vj(e){return e^fj(e,13)^fj(e,23)}function gj(e,t,n){for(var r=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&e[4*o],i[1]=255&e[4*o+1],i[2]=255&e[4*o+2],i[3]=255&e[4*o+3],r[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(var a,s=0;s<32;s+=4)a=r[1]^r[2]^r[3]^n[s+0],r[0]^=pj(dj(a)),a=r[2]^r[3]^r[0]^n[s+1],r[1]^=pj(dj(a)),a=r[3]^r[0]^r[1]^n[s+2],r[2]^=pj(dj(a)),a=r[0]^r[1]^r[2]^n[s+3],r[3]^=pj(dj(a));for(var l=0;l<16;l+=4)t[l]=r[3-l/4]>>>24&255,t[l+1]=r[3-l/4]>>>16&255,t[l+2]=r[3-l/4]>>>8&255,t[l+3]=255&r[3-l/4]}function yj(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.padding,o=void 0===i?"pkcs#7":i,a=r.mode,s=r.iv,l=void 0===s?[]:s,u=r.output,c=void 0===u?"string":u;if("cbc"===a&&("string"==typeof l&&(l=hj(l)),16!==l.length))throw new Error("iv is invalid");if("string"==typeof t&&(t=hj(t)),16!==t.length)throw new Error("key is invalid");if(e="string"==typeof e?n!==sj?function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=QV(e).call(e,n);if(i<=127)t.push(i);else if(i<=2047)t.push(192|i>>>6),t.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)t.push(224|i>>>12),t.push(128|i>>>6&63),t.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw t.push(i),new Error("input is not supported");n++,t.push(240|i>>>18&28),t.push(128|i>>>12&63),t.push(128|i>>>6&63),t.push(128|63&i)}}return t}(e):hj(e):Iy(e),("pkcs#5"===o||"pkcs#7"===o)&&n!==sj)for(var h=lj-e.length%lj,f=0;f<h;f++)e.push(h);var d=new Array(32);!function(e,t,n){for(var r=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&e[0+4*o],i[1]=255&e[1+4*o],i[2]=255&e[2+4*o],i[3]=255&e[3+4*o],r[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];r[0]^=2746333894,r[1]^=1453994832,r[2]^=1736282519,r[3]^=2993693404;for(var a,s=0;s<32;s+=4)a=r[1]^r[2]^r[3]^cj[s+0],t[s+0]=r[0]^=vj(dj(a)),a=r[2]^r[3]^r[0]^cj[s+1],t[s+1]=r[1]^=vj(dj(a)),a=r[3]^r[0]^r[1]^cj[s+2],t[s+2]=r[2]^=vj(dj(a)),a=r[0]^r[1]^r[2]^cj[s+3],t[s+3]=r[3]^=vj(dj(a));if(n===sj)for(var l,u=0;u<16;u++)l=t[u],t[u]=t[31-u],t[31-u]=l}(t,d,n);for(var p,v=[],g=l,y=e.length,m=0;y>=lj;){var _=pk(e).call(e,m,m+16),b=new Array(16);if("cbc"===a)for(var w=0;w<lj;w++)n!==sj&&(_[w]^=g[w]);gj(_,b,d);for(var k=0;k<lj;k++)"cbc"===a&&n===sj&&(b[k]^=g[k]),v[m+k]=b[k];"cbc"===a&&(g=n!==sj?b:_),y-=lj,m+=lj}if(("pkcs#5"===o||"pkcs#7"===o)&&n===sj){for(var E=v.length,S=v[E-1],T=1;T<=S;T++)if(v[E-T]!==S)throw new Error("padding is invalid");Lk(v).call(v,E-S,S)}return"array"!==c?n!==sj?Vw(p=v).call(p,(function(e){return 1===(e=e.toString(16)).length?"0"+e:e})).join(""):function(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]>=240&&e[n]<=247?(t.push(sH(((7&e[n])<<18)+((63&e[n+1])<<12)+((63&e[n+2])<<6)+(63&e[n+3]))),n+=3):e[n]>=224&&e[n]<=239?(t.push(sH(((15&e[n])<<12)+((63&e[n+1])<<6)+(63&e[n+2]))),n+=2):e[n]>=192&&e[n]<=223?(t.push(sH(((31&e[n])<<6)+(63&e[n+1]))),n++):t.push(sH(e[n]));return t.join("")}(v):v}var mj={encrypt:function(e,t,n){return yj(e,t,1,n)},decrypt:function(e,t,n){return yj(e,t,0,n)}},_j={sm2:nj,sm3:function(e,t){if(e="string"==typeof e?function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=QV(e).call(e,n);if(i<=127)t.push(i);else if(i<=2047)t.push(192|i>>>6),t.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)t.push(224|i>>>12),t.push(128|i>>>6&63),t.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw t.push(i),new Error("input is not supported");n++,t.push(240|i>>>18&28),t.push(128|i>>>12&63),t.push(128|i>>>6&63),t.push(128|63&i)}}return t}(e):pk(Array.prototype).call(e),t){if("hmac"!==(t.mode||"hmac"))throw new Error("invalid mode");var n=t.key;if(!n)throw new Error("invalid key");return n="string"==typeof n?aj(n):pk(Array.prototype).call(n),oj(ij(e,n))}return oj(rj(e))},sm4:mj},bj=_j.sm2;var wj=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.adapters={},this.sdkReady=!1,this.name=e,this.hook=new dH,this.logger=new zH(e),this.remotePlugin=new Mw,this.Types=BH,this.adapters.fetch=XH,this.adapters.storage=OH}return e.usePlugin=function(t,n,r){if(n){for(var i=!1,o=0,a=e.plugins.length;o<a;o++){if(e.plugins[o].name===n){e.plugins[o].plugin=t,e.plugins[o].options=r||{},i=!0;break}}i||e.plugins.push({name:n,plugin:t,options:r})}else e.plugins.push({plugin:t})},e.prototype.init=function(t){var n,r=this;this.inited?console.log("init can be call only one time"):t&&pH(t)?t.app_id&&function(e){return"number"==typeof e&&!isNaN(e)}(t.app_id)?!t.app_key||function(e){return"string"==typeof e}(t.app_key)?(t.channel_domain||-1!==fk(n=["cn","sg","va"]).call(n,t.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),t.channel="cn"),this.logger=new zH(this.name,t.log),this.configManager=new jH(this,t),this.appBridge=new KH(t,this.configManager),this.bridgeReport=this.appBridge.bridgeInject(),this.initConfig=t,this.env=t.channel_domain?"self":"public",this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:t,level:"info",time:Date.now()}),t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport?(this.inited=!0,this.emit(BH.Init)):(t.enable_encryption&&"sm"===t.encryption_type&&this.initCrypto(),this.configManager.set({app_id:t.app_id}),this.eventManager=new tG,this.tokenManager=new aG,this.sessionManager=new oG,Hw.all([new Hw((function(e){r.once(BH.TokenComplete,(function(){e(!0)}))})),new Hw((function(e){r.once(BH.Start,(function(){e(!0)}))}))]).then((function(){try{var n;gL(n=e.plugins).call(n,(function(e,t){var n=t.plugin,i=t.options,o=AE(r.initConfig,i),a=new n;return a.apply(r,o),e.push(a),e}),r.pluginInstances)}catch(i){console.log("load plugin error, "+i.message),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}r.sdkReady=!0,r.emit(BH.Ready),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:r.configManager.get("user")}),r.logger.info("appid: "+t.app_id+", userInfo:"+yM(r.configManager.get("user"))),r.logger.info("appid: "+t.app_id+", sdk is ready, version is "+FH+", you can report now !!!");try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(i){r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}r.pageView(),r.on(BH.TokenChange,(function(e){"webid"!==e.type&&"anonymous_id"!==e.type||r.pageView(),r.logger.info("appid: "+t.app_id+" token change, new userInfo:"+yM(r.configManager.get("user"))),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(BH.TokenReset,(function(){r.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+yM(r.configManager.get("user"))),r.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(BH.RouteChange,(function(e){e.init||t.disable_route_report||r.pageView()}))})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t),this.inited=!0,this.emit(BH.Init))):console.warn("app_key param is error, must be string, please check!"):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&pH(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=lH({},e);if(this.initConfig&&this.initConfig.configPersist){var n=this.configManager.getStore();n&&(t=AE(n,e)),this.configManager.setStore(e)}t.web_id,t.user_unique_id;var r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&fk(t).call(t,r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof xE){var i=0;for(r=xE(e);i<r.length;i++)fk(t).call(t,r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["web_id","user_unique_id"]);t.hasOwnProperty("web_id")&&this.emit(BH.ConfigWebId,t.web_id),t.hasOwnProperty("user_unique_id")&&this.emit(BH.ConfigUuid,t.user_unique_id),this.configManager.set(r),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:t})}else this.logger.warn("config params is error, please check");else this.logger.warn("config must be use after function init")},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(BH.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(BH.Start),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit(BH.Ready)))},e.prototype.event=function(e,t){var n=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;var r=[];if(Array.isArray(e))e.forEach((function(e){var t=n.processEvent(e[0],e[1]||{});t&&r.push(t)}));else{var i=this.processEvent(e,t);if(!i)return;r.push(i)}this.bridgeReport?r.forEach((function(e){var t=e.event,r=e.params;n.appBridge.onEventV3(t,yM(r))})):r.length&&(this.emit(BH.Event,r),this.emit(BH.SessionResetTime))}catch(o){this.logger.warn("something error, please check"),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message})}},e.prototype.beconEvent=function(e,t){if(!this.initConfig||!this.initConfig.disable_track_event)if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var n=[],r=this.processEvent(e,t||{});r&&(n.push(r),n.length&&(this.emit(BH.BeconEvent,n),this.emit(BH.SessionResetTime)))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return this.logger.warn("eventName is null, please check"),null;var n=e;/^event\./.test(e)&&(n=pk(e).call(e,6));var r=t;"object"!==Tc(r)&&(r={}),r.profile?delete r.profile:r.event_index=vH();var i=void 0;return r.local_ms?(i=r.local_ms,delete r.local_ms):i=+new Date,{event:n,params:r,local_time_ms:i,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(o){return this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message}),{event:e,params:t}}},e.prototype.dynamicParams=function(e){this.dynamicParamsFilter=e},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){if(void 0===e&&(e={}),this.inited){var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time||!1)},n=lH({},t,e);this.event("predefine_pageview",n)}else console.warn("predefinePageView should call after init")},e.prototype.clearEventCache=function(){this.emit(BH.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=bH(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit(BH.CustomWebId)}},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=bH(e);this.config({web_id:""+t,wechat_openid:e}),this.emit(BH.CustomWebId)}},e.prototype.setAnonymousId=function(e){this.emit(BH.AnonymousId,e)},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.resetStayDuration=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(BH.ResetStay,{url_path:e,title:t,url:n},BH.Stay)},e.prototype.resetStayParams=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(BH.SetStay,{url_path:e,title:t,url:n},BH.Stay)},e.prototype.getToken=function(e,t){var n=this;if(this.inited){var r=!1,i=function(t){if(!r){r=!0;var i,o=n.configManager.get().user;if(t)o.tobid=t,o[qV(i="diss".split("")).call(i).join("")]=t;return e(lH({},o))}},o=function(){n.tokenManager.getTobId().then((function(e){i(e)}))};this.sdkReady?o():(t&&setTimeout((function(){i()}),t),this.on(BH.Ready,(function(){o()})))}else this.logger.warn("getToken must be use after function init")},e.prototype.startTrackEvent=function(e){e&&this.emit(BH.TrackDurationStart,e,BH.TrackDuration)},e.prototype.endTrackEvent=function(e,t){void 0===t&&(t={}),e&&this.emit(BH.TrackDurationEnd,{eventName:e,params:t},BH.TrackDuration)},e.prototype.pauseTrackEvent=function(e){e&&this.emit(BH.TrackDurationPause,e,BH.TrackDuration)},e.prototype.resumeTrackEvent=function(e){e&&this.emit(BH.TrackDurationResume,e,BH.TrackDuration)},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(yM(e)):this.emit(BH.ProfileSet,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(yM(e)):this.emit(BH.ProfileSetOnce,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(yM(e)):this.emit(BH.ProfileIncrement,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(BH.ProfileUnset,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(yM(e)):this.emit(BH.ProfileAppend,e,BH.Profile),this.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){var t;this.bridgeReport?this.appBridge.setExternalAbVersion(e):this.emit(BH.AbExternalVersion,"string"==typeof e&&e?IT(t=""+e).call(t):null,BH.Ab)},e.prototype.getVar=function(e,t,n){this.bridgeReport?this.appBridge.getVar(e,t,n):this.emit(BH.AbVar,{name:e,defaultValue:t,callback:n},BH.Ab)},e.prototype.getAllVars=function(e){this.bridgeReport?this.appBridge.getAllVars(e):this.emit(BH.AbAllVars,e,BH.Ab)},e.prototype.getABconfig=function(e,t){this.emit(BH.AbConfig,{params:e,callback:t},BH.Ab)},e.prototype.getAbSdkVersion=function(e){if(!this.bridgeReport||!e)return this.configManager.getAbVersion()||"";this.appBridge.getAbSdkVersion(e)},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(BH.AbVersionChangeOn,e,BH.Ab),function(){t.emit(BH.AbVersionChangeOff,e,BH.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(BH.AbVersionChangeOff,e,BH.Ab)},e.prototype.openOverlayer=function(){this.emit(BH.AbOpenLayer,"",BH.Ab)},e.prototype.closeOverlayer=function(){this.emit(BH.AbCloseLayer,"",BH.Ab)},e.prototype.initCrypto=function(){this.publicKey=this.initConfig.crypto_publicKey||"04BA9E229380DC0E41E10839B0C52A4763D3EDFE8903F3B8E81395523381E03AA995D295BD4A4088792E4785B224F7837EB4D2C7C05973C7AE8687A35ACAE470A0"},e.prototype.cryptoData=function(e){try{if(!this.initConfig.enable_encryption)return e;var t=void 0;if("sm"===this.initConfig.encryption_type){var n=(o=yM(e),a=this.publicKey,void 0===(s=1)&&(s=1),"04"+bj.doEncrypt(o,a,s)),r=wH(n);t=new Uint8Array(r)}else t="data="+(i=yM(e),window.btoa?window.btoa(encodeURIComponent(i)):encodeURIComponent(i));return t}catch(l){return e}var i,o,a,s},e.prototype.destoryInstace=function(){this.destroyInstance||(this.destroyInstance=!0,this.off(BH.TokenComplete))},e.plugins=[],e}(),kj=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var r=e.Types,i=e.adapters.fetch;this.eventCheck=new UH(e,t),this.fetch=i,this.cache={},this.collect.on(r.ProfileSet,(function(e){n.setProfile(e)})),this.collect.on(r.ProfileSetOnce,(function(e){n.setOnceProfile(e)})),this.collect.on(r.ProfileUnset,(function(e){n.unsetProfile(e)})),this.collect.on(r.ProfileIncrement,(function(e){n.incrementProfile(e)})),this.collect.on(r.ProfileAppend,(function(e){n.appendProfile(e)})),this.collect.on(r.ProfileClear,(function(){n.cache={}})),this.ready(r.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!dk(n).length)return;var r=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var i in n)r(i)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var n=[];n.push(this.collect.processEvent(e,t));var r=this.collect.eventManager.merge(n,!0),i=this.collect.cryptoData(r),o=this.collect.configManager.getUrl("profile");this.fetch(o,i,1e5,!1,(function(){}),(function(){}),"","POST",this.config.enable_encryption,this.config.encryption_header),this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:r,code:200,status:"success"})}catch(a){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}},e.prototype.setProfile=function(e){var t=this.formatParams(e);t&&dk(t).length&&(this.pushCache(t),this.report("__profile_set",lH({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this.formatParams(e,!0);t&&dk(t).length&&(this.pushCache(t),this.report("__profile_set_once",lH({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",lH({},e,{profile:!0})):console.warn("please check the params, must be object!!!")},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",lH({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var n in e){var r;"string"==typeof e[n]||"Array"===pk(r=Object.prototype.toString.call(e[n])).call(r,8,-1)?t[n]=e[n]:console.warn("please check the value of param: "+n+", must be string or array !!!")}dk(t).length&&this.report("__profile_append",lH({},t,{profile:!0}))}else console.warn("please check the params, must be object!!!")},e.prototype.pushCache=function(e){var t=this;dk(e).forEach((function(n){t.cache[n]={val:t.clone(e[n]),timestamp:Date.now()}}))},e.prototype.formatParams=function(e,t){var n=this;void 0===t&&(t=!1);try{var r;if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var i={};for(var o in e){var a;"string"==typeof e[o]||"number"==typeof e[o]||"Array"===pk(a=Object.prototype.toString.call(e[o])).call(a,8,-1)?i[o]=e[o]:console.warn("please check the value of params:"+o+", must be string,number,Array !!!")}var s=dk(i);if(!s.length)return;var l=Date.now();return gL(r=Gw(s).call(s,(function(r){var i=n.cache[r];return t?!i:!(i&&n.compare(i.val,e[r])&&l-i.timestamp<n.duration)}))).call(r,(function(e,t){return e[t]=i[t],e}),{})}catch(u){this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:u.message}),console.log("error")}},e.prototype.compare=function(e,t){try{return yM(e)===yM(t)}catch(n){return this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),!1}},e.prototype.clone=function(e){try{return JSON.parse(yM(e))}catch(t){return this.collect.emit(PH.DEBUGGER_MESSAGE,{type:PH.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),e}},e.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},e}(),Ej=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,r=Date.now()+t;return n=window.setTimeout((function i(){var o=Date.now()-r;e(),r+=t,n=window.setTimeout(i,Math.max(0,t-o))}),t),function(){window.clearTimeout(n)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var r=this.collect.Types;this.collect.on(r.SessionReset,(function(){n.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),Sj=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,!this.config.channel_domain&&!this.config.disable_track_event&&!this.config.disable_sdk_monitor){var r=e.adapters.fetch;this.fetch=r,this.url=e.configManager.getUrl("event");var i=this.collect.Types;this.collect.on(i.Ready,(function(){n.sdkOnload()})),this.collect.on(i.SubmitError,(function(e){var t=e.type,r=e.eventData,i=e.errorCode;"f_data"===t&&n.sdkError(r,i)}))}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,r=t.user,i=n.app_id,o=n.app_name,a=n.sdk_version,s=r.web_id,l={events:[{event:"onload",params:yM({app_id:i,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOB"}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.fetch(e.url,[l],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(u){}},e.prototype.sdkError=function(e,t){var n=this;try{var r=e[0],i=r.user,o=r.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:Vw(a).call(a,(function(e){return{event:"on_error",params:yM({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:yM(o),user:yM(i)}),local_time_ms:Date.now()}})),user:{user_unique_id:i.user_unique_id},header:{}};setTimeout((function(){n.fetch(n.url,[s],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(l){}},e}(),Tj=function(){function e(){this.verifyReady=!1,this.cleanStatus=!1}return e.prototype.apply=function(e,t){var n=this;this.collector=e,this.config=t,this.eventStorage=[],this.collector.on("submit-verify-h5",(function(e){e&&e.length&&n.eventStore(e[0])})),this.checkUrl(),this.heartbeat()},e.prototype.checkUrl=function(){var e=window.location.href,t=_H(e);t._r_d_&&t._r_c_k_?(this.verifyReady=!0,this.domain=t._r_d_,this.key=t._r_c_k_,this.checkCache()):this.collector.off("submit-verify-h5")},e.prototype.checkCache=function(){this.eventStorage.length&&this.postVerify(this.eventStorage)},e.prototype.heartbeat=function(){var e=this;this.heart=setInterval((function(){var t={event:"simulator_test__",local_time_ms:Date.now()},n=e.collector.configManager.get(),r=n.header,i={events:[t],user:n.user,header:r};e.eventStore(i)}),6e4)},e.prototype.eventStore=function(e){this.cleanStatus||(this.verifyReady?this.postVerify(e):this.eventStorage.push(e))},e.prototype.cleanVerify=function(){this.cleanStatus=!0,this.eventStorage=[],clearInterval(this.heart)},e.prototype.postVerify=function(e){var t=this;try{var n=JSON.parse(yM(e));!function(e){return Array.isArray(e)}(e)?this.fetchLog(n):n.forEach((function(e){t.fetchLog(e)}))}catch(r){console.log("web verify post error ~")}},e.prototype.fetchLog=function(e){XH(this.domain+"/simulator/h5/log?connection_key="+this.key,e,2e4,!1)},e.prototype.leave=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.cleanVerify()})),yH((function(){e.cleanVerify()}))},e}();wj.usePlugin(Tj,"verifyH"),wj.usePlugin(kj,"profile"),wj.usePlugin(Ej,"heartbeat"),wj.usePlugin(Sj,"monitor");var Cj,Aj=new wj("default"),xj=new Uint8Array(16);function Pj(){if(!Cj&&!(Cj="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cj(xj)}for(var Ij=[],Rj=0;Rj<256;++Rj){var Dj;Ij.push(pk(Dj=(Rj+256).toString(16)).call(Dj,1))}var Oj={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Mj(e,t,n){if(Oj.randomUUID&&!t&&!e)return Oj.randomUUID();var r=(e=e||{}).random||(e.rng||Pj)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ij[e[t+0]]+Ij[e[t+1]]+Ij[e[t+2]]+Ij[e[t+3]]+"-"+Ij[e[t+4]]+Ij[e[t+5]]+"-"+Ij[e[t+6]]+Ij[e[t+7]]+"-"+Ij[e[t+8]]+Ij[e[t+9]]+"-"+Ij[e[t+10]]+Ij[e[t+11]]+Ij[e[t+12]]+Ij[e[t+13]]+Ij[e[t+14]]+Ij[e[t+15]]}(r)}var Lj="veplayer_live_device_id",Fj="veplayer_live_user_id",Uj=function(e){return Math.floor((9*Math.random()+1)*Math.pow(10,e-1)).toString()},Bj=function(e){var t=kF.getUrlObject(e);return t?null!=t&&t.searchParams.get("_session_id")?e:kF.appendSearchParams(e,{_session_id:Nj()}):null!=e?e:""},Nj=function(){return Mj().replace(/-/g,"")+"."+Date.now()+"."+function(e){for(var t=0,n=0,r=(e+="").length,i=0;i<r;i++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t}(Mj().replace(/-/g,""))},Vj=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_userId",void 0),Uy(Yx(r),"_deviceId",void 0),Uy(Yx(r),"_liveLogger",void 0),r}return Fy(n,[{key:"afterCreate",value:function(){var e,t,n,r;this.config.enable&&(this.config.appId?(this._userId=(null===(e=this.config)||void 0===e?void 0:e.userId)||((n=localStorage.getItem(Fj))||(n=Uj(12),localStorage.setItem(Fj,n),n)),this._deviceId=(null===(t=this.config)||void 0===t?void 0:t.deviceId)||((r=localStorage.getItem(Lj))||(r=Uj(11),localStorage.setItem(Lj,r),r)),this.open()):console.info("not found appId, please generate an appId"))}},{key:"destroy",value:function(){this.close()}},{key:"close",value:function(){var e;null===(e=this._liveLogger)||void 0===e||e.destroy(!1),this._liveLogger=void 0}},{key:"open",value:function(){this._liveLogger||(this._start(),this.config.showUserIdInErrorPanel&&this.player.plugins.error&&(this.player.plugins.error.config.extraTips=[{label:"userId",value:null==Aj?void 0:Aj.getConfig("user_unique_id")}]))}},{key:"_createTea",value:function(){Aj.init(Mm(Mm({},this.config),{},{app_id:468759,channel:"cn"})),Aj.start(),Aj.config({user_unique_id:this._userId,device_id:this._deviceId})}},{key:"_start",value:function(){this._createTea(),this._liveLogger=new FV({Tea:Aj,player:this.player,aid:this.config.appId,project_key:this.config.appId,app_name:this.config.appName||this.config.appId,user_id:this._userId,device_id:this._deviceId,ext:{veplayer_version:"2.4.2-rc.6",flv_version:"3.0.19-rc.0",hls_version:"3.0.19-rc.0",rts_version:"0.2.1-alpha.8"}})}}],[{key:"pluginName",get:function(){return"logger"}},{key:"defaultConfig",get:function(){return{appId:"",enable:!0,showUserIdInErrorPanel:!0}}}]),n}(QA);function Hj(e,t){return"number"!=typeof e?"-":t?t(e):e.toString()}var Gj,jj=function(e){oP(n,e);var t=lP(n);function n(){var e,r;Ry(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Uy(Yx(r=t.call.apply(t,Nm(e=[this]).call(e,o))),"_pollTimer",void 0),Uy(Yx(r),"_visible",void 0),Uy(Yx(r),"_playPlugin",void 0),r}return Fy(n,[{key:"_streamType",get:function(){return kF.getStreamType(this.player.config.url)}},{key:"afterCreate",value:function(){var e=this;this._playPlugin=this.player.plugins[this._streamType],this.player.on(lV.ERROR,(function(){return e.close()})),this.config.visible&&this.player.once(lV.LOADED_DATA,(function(){return e.open()}))}},{key:"open",value:function(){var e;this._visible||(hk(e=["flv","hls"]).call(e,this._streamType)?this.player.plugins[this._streamType]?(this.root.style.display="block",this._tick(),this._visible=!0):console.warn("不支持或未加载".concat(this._streamType,"插件")):console.warn("仅支持flv和hls格式的信息展示"))}},{key:"close",value:function(){this._visible&&(clearTimeout(this._pollTimer),this.root.innerHTML="",this.root.style.display="none",this._visible=!1)}},{key:"destroy",value:function(){var e=this;this.close(),this.player.off(lV.LOADED_DATA,(function(){return e.open()})),this.player.off(lV.ERROR,(function(){return e.close()}))}},{key:"render",value:function(){return'\n <xg-live-panel class="veplayer-live-panel">\n </xg-live-panel>\n '}},{key:"_tick",value:function(){var e=this;clearTimeout(this._pollTimer),this._renderPanel(),this._pollTimer=window.setTimeout((function(){e._tick()}),this.config.interval)}},{key:"_getStats",value:function(){var e;return null===(e=this._playPlugin)||void 0===e?void 0:e.getStats()}},{key:"_getPanelData",value:function(){var e,t,n,r,i=this._getStats()||{},o="".concat(this._streamType,"_live"),a=this._playPlugin.softDecode,s=[(e=Mm(Mm({},i),{},{format:o}),{rows:[{key:"format",labelTextKey:"FORMAT",value:null!==(t=null==e?void 0:e.format)&&void 0!==t?t:"-"},{key:"fps",labelTextKey:"FPS",value:Hj(e.fps,(function(e){return"".concat(e," fps")}))},{key:"bitrate",labelTextKey:"BITRATE",value:Hj(e.bitrate,(function(e){return"".concat(e/1e3," kbps")}))},{key:"gop",labelTextKey:"GOP",value:Hj(e.gop,(function(e){return"".concat(e," frames")}))},{key:"resolution",labelTextKey:"RESOLUTION",value:Nm(n="".concat(Hj(e.height)," * ")).call(n,Hj(e.height))},{key:"encodeType",labelTextKey:"ENCODE_TYPE",value:null!==(r=e.encodeType)&&void 0!==r?r:"-"},{key:"bufferEnd",labelTextKey:"BUFFER_END",value:Hj(e.bufferEnd)},{key:"currentTime",labelTextKey:"CURRENT_TIME",value:Hj(e.currentTime,(function(e){return e.toFixed(6)+"s"}))}]})];return a&&s.push(function(e){return{titleTextKey:"DECODE_INFO",rows:[{key:"decodeEfficiency",labelTextKey:"DECODE_EFFICIENCY",value:Hj(e.decodeFps,(function(e){return e+"frames/s"}))},{key:"decodeCost",labelTextKey:"DECODE_COST",value:Hj(e.decodeFps,(function(e){return(e?(1e3/e).toFixed():0)+"ms"}))}]}}(i)),s}},{key:"_renderPanel",value:function(){var e=this,t=this._getPanelData(),n=this.root;n&&(n.innerHTML="",t.forEach((function(t){e._renderGroup(n,t)})))}},{key:"_renderGroup",value:function(e,t){var n=this,r=t.title,i=t.titleTextKey,o=t.rows,a=this.player.config.i18nManager;if(r||i){var s,l=this._genTitleDom(null!==(s=a.getText(i))&&void 0!==s?s:r);e.appendChild(l)}o.forEach((function(t){var r=n._genRowDom(t);e.appendChild(r)}))}},{key:"_genTitleDom",value:function(e){var t=kC.createDom("xg-live-panel","",void 0,"veplayer-live-panel-row"),n=kC.createDom("xg-live-panel",e,void 0,"veplayer-live-panel-row-title");return t.appendChild(n),t}},{key:"_genRowDom",value:function(e){var t=this.player.config.i18nManager,n=kC.createDom("veplayer-live-panel-row","",void 0,"veplayer-live-panel-row"),r=kC.createDom("xg-live-panel",t.getText(e.labelTextKey),void 0,"veplayer-live-panel-row-label");n.appendChild(r);var i=kC.createDom("xg-live-panel",e.value);return n.appendChild(i),n}}],[{key:"pluginName",get:function(){return"infoPanel"}},{key:"defaultConfig",get:function(){return{visible:!1,interval:500}}}]),n}(QA),zj=Mm(Mm({},$F),{},{INVALID_PARAMETER:"The imported parameter is empty, please pass in necessary parameters such as the stream address",FORMAT:"format",FPS:"fps",BITRATE:"bitrate",GOP:"gop",RESOLUTION:"resolution",ENCODE_TYPE:"encodeType",BUFFER_END:"bufferEnd",CURRENT_TIME:"currentTime",DECODE_EFFICIENCY:"efficiency",DECODE_COST:"cost",DECODE_INFO:"decodeInfo",REFRESH:"refresh"}),Kj=Mm(Mm({},ZF),{},{INVALID_PARAMETER:"入参为空,请传入流地址等必要参数",FORMAT:"格式",FPS:"帧率",BITRATE:"码率",GOP:"GOP",RESOLUTION:"视频分辨率",ENCODE_TYPE:"编码方式",BUFFER_END:"Buffer 水位",CURRENT_TIME:"播放进度",DECODE_EFFICIENCY:"解码效率",DECODE_COST:"解码消耗",DECODE_INFO:"软解信息",REFRESH:"刷新"}),Wj=["getDrmConfig"],qj=function(){var e=sy(oy().mark((function e(t,n){var r,i,o,a,s,l,u,c,h,f,d;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=VN(t.drm),!t.url||r!==NN.Fairplay){e.next=18;break}return e.prev=2,a=null!==(i=null==t||null===(o=t.drm)||void 0===o?void 0:o.fairplay)&&void 0!==i?i:{},s=a.getDrmConfig,l=tm(a,Wj),e.next=6,Hw.all([uF(VL.PluginDrm).then((function(e){return e.DrmPlugin})).catch((function(){})),null==s?void 0:s({url:t.url})]);case 6:return u=e.sent,c=XM(u,2),h=c[0],f=c[1],d=AE({},l,null==t?void 0:t.drm,f),f&&(null==n||n.updateDrmConfig(f)),e.abrupt("return",{options:{drm:d},plugins:h?[h]:[]});case 15:e.prev=15,e.t0=e.catch(2),console.log(e.t0);case 18:return e.abrupt("return",{});case 19:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(t,n){return e.apply(this,arguments)}}(),Xj=function(){var e=sy(oy().mark((function e(t){var n,r,i,o,a,s;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("rtm"!==(o=t.url&&_F(t.url))){e.next=3;break}return e.abrupt("return",{});case 3:if(a="flv"===o?null==t||null===(n=t.flv)||void 0===n?void 0:n.abr:null==t||null===(r=t.hls)||void 0===r?void 0:r.abr){e.next=6;break}return e.abrupt("return",{});case 6:return e.next=8,uF(VL.PluginAbr).catch((function(){}));case 8:return s=e.sent,e.abrupt("return",{options:Uy({},"flv"===o?"abr":"hlsabr",Mm(Mm({},a),{},{open:null===(i=a.enable)||void 0===i||i})),plugins:["flv"===o?null==s?void 0:s.AbrPlugin:null==s?void 0:s.HlsAbrPlugin]});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();JF.extend([{LANG:"zh-cn",TEXT:Kj},{LANG:"en",TEXT:zj}]);var Yj={autoplay:{muted:!0}},$j=Nm(Gj=[]).call(Gj,Iy(jF),[hV,Vj,jj]),Zj=function(e){return e.H264="h264",e}(Zj||{}),Jj=function(e){oP(r,e);var t,n=lP(r);function r(e){return Ry(this,r),n.call(this,e)}return Fy(r,[{key:"playTime",get:function(){var e;if(null===(e=this._player)||void 0===e||null===(e=e.played)||void 0===e||!e.length)return 0;for(var t=this._player.played.length,n=0,r=0;r<t;r++){var i,o,a=null===(i=this._player)||void 0===i?void 0:i.played.start(r);n+=(null===(o=this._player)||void 0===o?void 0:o.played.end(r))-a}return n}},{key:"openLog",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.logger.open()}},{key:"closeLog",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.logger.close()}},{key:"openInfoPanel",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.infopanel.open()}},{key:"closeInfoPanel",value:function(){var e;null===(e=this._player.plugins)||void 0===e||e.infopanel.close()}},{key:"openAbr",value:function(){var e,t,n=this.url&&_F(this.url);"flv"!==n?"hls"===n&&(null===(e=this._player.plugins)||void 0===e||null===(e=e.hlsabr)||void 0===e||e.switchAbr(!0)):null===(t=this._player.plugins)||void 0===t||null===(t=t.abr)||void 0===t||t.switchAbr(!0)}},{key:"closeAbr",value:function(){var e,t,n=this.url&&_F(this.url);"flv"!==n?"hls"===n&&(null===(e=this._player.plugins)||void 0===e||null===(e=e.hlsabr)||void 0===e||e.switchAbr(!1)):null===(t=this._player.plugins)||void 0===t||null===(t=t.abr)||void 0===t||t.switchAbr(!1)}},{key:"updateDrmConfig",value:function(e){var t;null===(t=this._player)||void 0===t||null===(t=t.plugins)||void 0===t||null===(t=t.drm)||void 0===t||t.updateDrmConfig(e)}},{key:"switchAbr",value:function(e){var t;if(null!==(t=this._player.plugins)&&void 0!==t&&t.abr){if(void 0!==(null==e?void 0:e.bitrate)){var n=this._player.plugins.abr.config.urls[e.bitrate];if(!n)return;this.switch(n,{seamless:!0}),this._player.plugins.abr.bitrate=e.bitrate}var r;if(void 0!==(null==e?void 0:e.enable))null===(r=this._player.plugins)||void 0===r||r.abr.switchAbr(e.enable)}}},{key:"getRTMNetWorkInfo",value:function(){var e;return null===(e=this._player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.rts)||void 0===e?void 0:e.getNetWorkInfo()}},{key:"getRTMStats",value:(t=sy(oy().mark((function e(){var t;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null===(t=this._player)||void 0===t||null===(t=t.plugins)||void 0===t||null===(t=t.rts)||void 0===t?void 0:t.getStatsSnapshoot());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getFLVStats",value:function(){var e;return null===(e=this._player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.flv)||void 0===e?void 0:e.getStats()}}]),r}(rU);function Qj(e){return ez.apply(this,arguments)}function ez(){return ez=sy(oy().mark((function e(t){var n,r,i,o,a,s,l;return oy().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=void 0,t&&(t.url||t.playlist)){e.next=3;break}throw IN(xN.INVALID_PARAMETER,new JF);case 3:return o=new JF({lang:null==t?void 0:t.lang,i18n:null==t?void 0:t.i18n}),a=Mm(Mm({},t),{},{plugins:Nm(n=[]).call(n,Iy($j),Iy(null!==(r=t.plugins)&&void 0!==r?r:[]))}),e.next=7,rU.create(Mm(Mm(Mm({},Yj),a),{},{isLive:!0,i18nManager:o,preProcessUrl:function(e){return{url:Bj(e)}},preparePlugins:function(e){return sy(oy().mark((function t(){var n,r,o,s,l,u,c,h,f,d,p,v,g,y,m;return oy().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Hw.all([GN(Mm(Mm({},a),{},{url:e}),i),qj(Mm(Mm({},a),{},{url:e}),i),Xj(Mm(Mm({},a),{},{url:e}))]);case 2:return r=t.sent,o=XM(r,3),s=o[0],l=o[1],u=o[2],h=(c=null!=s?s:{}).options,f=c.plugins,p=(d=null!=l?l:{}).options,v=d.plugins,y=(g=null!=u?u:{}).options,m=g.plugins,t.abrupt("return",{options:AE({},h,p,y),plugins:Nm(n=[]).call(n,Iy(null!=f?f:[]),Iy(null!=v?v:[]),Iy(null!=m?m:[]))});case 11:case"end":return t.stop()}}),t)})))()}}),Jj);case 7:return(i=e.sent)&&(l=null===(s=i)||void 0===s||null===(s=s._player)||void 0===s||null===(s=s.config)||void 0===s?void 0:s._RTMdegrade)&&i.emit("degrade",{originRtmUrl:l._originRtmUrl,code:"NOT_SUPPORT",message:"not support rtm or h264",isRTMSupported:l._isRTMSupported,isRTMSupportCodec:l._isRTMSupportCodec}),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e)}))),ez.apply(this,arguments)}var tz,nz=Object.freeze({__proto__:null,ErrorCode:xN,Events:lV});tz="umd",aF.setModuleSystem(tz);var rz=kF.isMseSupported,iz=kF.isSoftDecodeSupported;void 0!==VePlayer.registerPlugin?VePlayer.registerPlugin(VL.BizLive,{createLivePlayer:Qj}):sF(VL.BizLive,{createLivePlayer:Qj}),e.Codec=t,e.DecodeType=r,e.Degradation=n,e.DynamicModule=VL,e.EN=$F,e.ListType=CL,e.POSITIONS=eU,e.Plugin=QA,e.RTMCodec=Zj,e.Sniffer=PC,e.ZH_CN=ZF,e.createLivePlayer=Qj,e.isMseSupported=rz,e.isRTMSupportCodec=ON,e.isRTMSupported=RN,e.isSoftDecodeSupported=iz,e.live=nz,e.load=uF,e.register=lF,e.registerPlugin=sF,e.util=kF}));
|