@vkontakte/videoplayer-statistics 1.0.82-dev.39d52b6a.0 → 1.0.82-dev.4ccf1d04.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +3 -3
- package/es2015.esm.js +3 -3
- package/es2018.cjs.js +3 -3
- package/es2018.esm.js +3 -3
- package/es2024.cjs.js +3 -3
- package/es2024.esm.js +3 -3
- package/esnext.cjs.js +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +3 -3
- package/types/index.d.ts +2 -0
- package/types/mediascopePixel/MediascopePixel.d.ts +40 -0
- package/types/mediascopePixel/Stopwatch.d.ts +12 -0
- package/types/mediascopePixel/types.d.ts +9 -0
- package/types/mediascopePixel/utils/image.d.ts +1 -0
- package/types/oneStat/config.d.ts +1 -0
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-statistics v1.0.82-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-statistics v1.0.82-dev.4ccf1d04.0
|
|
3
|
+
* Tue, 22 Jul 2025 09:39:04 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-82/doc/
|
|
5
5
|
*/
|
|
6
|
-
var Fd=Object.create;var st=Object.defineProperty;var Ud=Object.getOwnPropertyDescriptor;var Bd=Object.getOwnPropertyNames;var jd=Object.getPrototypeOf,Wd=Object.prototype.hasOwnProperty;var a=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Hd=(r,e)=>{for(var t in e)st(r,t,{get:e[t],enumerable:!0})},Kd=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Bd(e))!Wd.call(r,o)&&o!==t&&st(r,o,{get:()=>e[o],enumerable:!(i=Ud(e,o))||i.enumerable});return r};var w=(r,e,t)=>(t=r!=null?Fd(jd(r)):{},Kd(e||!r||!r.__esModule?st(t,"default",{value:r,enumerable:!0}):t,r));var S=a((ut,qo)=>{"use strict";var qe=function(r){return r&&r.Math===Math&&r};qo.exports=qe(typeof globalThis=="object"&&globalThis)||qe(typeof window=="object"&&window)||qe(typeof self=="object"&&self)||qe(typeof global=="object"&&global)||qe(typeof ut=="object"&&ut)||function(){return this}()||Function("return this")()});var O=a((CI,xo)=>{"use strict";xo.exports=function(r){try{return!!r()}catch(e){return!0}}});var xe=a((NI,Ro)=>{"use strict";var Gd=O();Ro.exports=!Gd(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var ct=a((LI,ko)=>{"use strict";var zd=xe(),Lo=Function.prototype,Co=Lo.apply,No=Lo.call;ko.exports=typeof Reflect=="object"&&Reflect.apply||(zd?No.bind(Co):function(){return No.apply(Co,arguments)})});var q=a((kI,Mo)=>{"use strict";var Do=xe(),$o=Function.prototype,lt=$o.call,Qd=Do&&$o.bind.bind(lt,lt);Mo.exports=Do?Qd:function(r){return function(){return lt.apply(r,arguments)}}});var Re=a((DI,Fo)=>{"use strict";var Vo=q(),Yd=Vo({}.toString),Jd=Vo("".slice);Fo.exports=function(r){return Jd(Yd(r),8,-1)}});var dt=a(($I,Uo)=>{"use strict";var Xd=Re(),Zd=q();Uo.exports=function(r){if(Xd(r)==="Function")return Zd(r)}});var _=a((MI,Bo)=>{"use strict";var ft=typeof document=="object"&&document.all;Bo.exports=typeof ft=="undefined"&&ft!==void 0?function(r){return typeof r=="function"||r===ft}:function(r){return typeof r=="function"}});var x=a((VI,jo)=>{"use strict";var ef=O();jo.exports=!ef(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var D=a((FI,Wo)=>{"use strict";var rf=xe(),sr=Function.prototype.call;Wo.exports=rf?sr.bind(sr):function(){return sr.apply(sr,arguments)}});var pt=a(Go=>{"use strict";var Ho={}.propertyIsEnumerable,Ko=Object.getOwnPropertyDescriptor,tf=Ko&&!Ho.call({1:2},1);Go.f=tf?function(e){var t=Ko(this,e);return!!t&&t.enumerable}:Ho});var Ce=a((BI,zo)=>{"use strict";zo.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Yo=a((jI,Qo)=>{"use strict";var of=q(),nf=O(),af=Re(),ht=Object,sf=of("".split);Qo.exports=nf(function(){return!ht("z").propertyIsEnumerable(0)})?function(r){return af(r)==="String"?sf(r,""):ht(r)}:ht});var Ne=a((WI,Jo)=>{"use strict";Jo.exports=function(r){return r==null}});var ae=a((HI,Xo)=>{"use strict";var uf=Ne(),cf=TypeError;Xo.exports=function(r){if(uf(r))throw new cf("Can't call method on "+r);return r}});var J=a((KI,Zo)=>{"use strict";var lf=Yo(),df=ae();Zo.exports=function(r){return lf(df(r))}});var $=a((GI,en)=>{"use strict";var ff=_();en.exports=function(r){return typeof r=="object"?r!==null:ff(r)}});var Le=a((zI,rn)=>{"use strict";rn.exports={}});var W=a((QI,on)=>{"use strict";var vt=Le(),gt=S(),pf=_(),tn=function(r){return pf(r)?r:void 0};on.exports=function(r,e){return arguments.length<2?tn(vt[r])||tn(gt[r]):vt[r]&&vt[r][e]||gt[r]&>[r][e]}});var ur=a((YI,nn)=>{"use strict";var hf=q();nn.exports=hf({}.isPrototypeOf)});var X=a((JI,un)=>{"use strict";var vf=S(),an=vf.navigator,sn=an&&an.userAgent;un.exports=sn?String(sn):""});var bt=a((XI,hn)=>{"use strict";var pn=S(),mt=X(),cn=pn.process,ln=pn.Deno,dn=cn&&cn.versions||ln&&ln.version,fn=dn&&dn.v8,M,cr;fn&&(M=fn.split("."),cr=M[0]>0&&M[0]<4?1:+(M[0]+M[1]));!cr&&mt&&(M=mt.match(/Edge\/(\d+)/),(!M||M[1]>=74)&&(M=mt.match(/Chrome\/(\d+)/),M&&(cr=+M[1])));hn.exports=cr});var yt=a((ZI,gn)=>{"use strict";var vn=bt(),gf=O(),mf=S(),bf=mf.String;gn.exports=!!Object.getOwnPropertySymbols&&!gf(function(){var r=Symbol("symbol detection");return!bf(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&vn&&vn<41})});var It=a((eS,mn)=>{"use strict";var yf=yt();mn.exports=yf&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var St=a((rS,bn)=>{"use strict";var If=W(),Sf=_(),_f=ur(),Pf=It(),Ef=Object;bn.exports=Pf?function(r){return typeof r=="symbol"}:function(r){var e=If("Symbol");return Sf(e)&&_f(e.prototype,Ef(r))}});var ke=a((tS,yn)=>{"use strict";var Tf=String;yn.exports=function(r){try{return Tf(r)}catch(e){return"Object"}}});var H=a((iS,In)=>{"use strict";var wf=_(),Of=ke(),Af=TypeError;In.exports=function(r){if(wf(r))return r;throw new Af(Of(r)+" is not a function")}});var lr=a((oS,Sn)=>{"use strict";var qf=H(),xf=Ne();Sn.exports=function(r,e){var t=r[e];return xf(t)?void 0:qf(t)}});var Pn=a((nS,_n)=>{"use strict";var _t=D(),Pt=_(),Et=$(),Rf=TypeError;_n.exports=function(r,e){var t,i;if(e==="string"&&Pt(t=r.toString)&&!Et(i=_t(t,r))||Pt(t=r.valueOf)&&!Et(i=_t(t,r))||e!=="string"&&Pt(t=r.toString)&&!Et(i=_t(t,r)))return i;throw new Rf("Can't convert object to primitive value")}});var B=a((aS,En)=>{"use strict";En.exports=!0});var On=a((sS,wn)=>{"use strict";var Tn=S(),Cf=Object.defineProperty;wn.exports=function(r,e){try{Cf(Tn,r,{value:e,configurable:!0,writable:!0})}catch(t){Tn[r]=e}return e}});var De=a((uS,xn)=>{"use strict";var Nf=B(),Lf=S(),kf=On(),An="__core-js_shared__",qn=xn.exports=Lf[An]||kf(An,{});(qn.versions||(qn.versions=[])).push({version:"3.38.0",mode:Nf?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Tt=a((cS,Cn)=>{"use strict";var Rn=De();Cn.exports=function(r,e){return Rn[r]||(Rn[r]=e||{})}});var wt=a((lS,Nn)=>{"use strict";var Df=ae(),$f=Object;Nn.exports=function(r){return $f(Df(r))}});var j=a((dS,Ln)=>{"use strict";var Mf=q(),Vf=wt(),Ff=Mf({}.hasOwnProperty);Ln.exports=Object.hasOwn||function(e,t){return Ff(Vf(e),t)}});var Ot=a((fS,kn)=>{"use strict";var Uf=q(),Bf=0,jf=Math.random(),Wf=Uf(1 .toString);kn.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Wf(++Bf+jf,36)}});var R=a((pS,$n)=>{"use strict";var Hf=S(),Kf=Tt(),Dn=j(),Gf=Ot(),zf=yt(),Qf=It(),se=Hf.Symbol,At=Kf("wks"),Yf=Qf?se.for||se:se&&se.withoutSetter||Gf;$n.exports=function(r){return Dn(At,r)||(At[r]=zf&&Dn(se,r)?se[r]:Yf("Symbol."+r)),At[r]}});var Un=a((hS,Fn)=>{"use strict";var Jf=D(),Mn=$(),Vn=St(),Xf=lr(),Zf=Pn(),ep=R(),rp=TypeError,tp=ep("toPrimitive");Fn.exports=function(r,e){if(!Mn(r)||Vn(r))return r;var t=Xf(r,tp),i;if(t){if(e===void 0&&(e="default"),i=Jf(t,r,e),!Mn(i)||Vn(i))return i;throw new rp("Can't convert object to primitive value")}return e===void 0&&(e="number"),Zf(r,e)}});var qt=a((vS,Bn)=>{"use strict";var ip=Un(),op=St();Bn.exports=function(r){var e=ip(r,"string");return op(e)?e:e+""}});var dr=a((gS,Wn)=>{"use strict";var np=S(),jn=$(),xt=np.document,ap=jn(xt)&&jn(xt.createElement);Wn.exports=function(r){return ap?xt.createElement(r):{}}});var Rt=a((mS,Hn)=>{"use strict";var sp=x(),up=O(),cp=dr();Hn.exports=!sp&&!up(function(){return Object.defineProperty(cp("div"),"a",{get:function(){return 7}}).a!==7})});var zn=a(Gn=>{"use strict";var lp=x(),dp=D(),fp=pt(),pp=Ce(),hp=J(),vp=qt(),gp=j(),mp=Rt(),Kn=Object.getOwnPropertyDescriptor;Gn.f=lp?Kn:function(e,t){if(e=hp(e),t=vp(t),mp)try{return Kn(e,t)}catch(i){}if(gp(e,t))return pp(!dp(fp.f,e,t),e[t])}});var Ct=a((yS,Qn)=>{"use strict";var bp=O(),yp=_(),Ip=/#|\.prototype\./,$e=function(r,e){var t=_p[Sp(r)];return t===Ep?!0:t===Pp?!1:yp(e)?bp(e):!!e},Sp=$e.normalize=function(r){return String(r).replace(Ip,".").toLowerCase()},_p=$e.data={},Pp=$e.NATIVE="N",Ep=$e.POLYFILL="P";Qn.exports=$e});var Me=a((IS,Jn)=>{"use strict";var Yn=dt(),Tp=H(),wp=xe(),Op=Yn(Yn.bind);Jn.exports=function(r,e){return Tp(r),e===void 0?r:wp?Op(r,e):function(){return r.apply(e,arguments)}}});var Nt=a((SS,Xn)=>{"use strict";var Ap=x(),qp=O();Xn.exports=Ap&&qp(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var K=a((_S,Zn)=>{"use strict";var xp=$(),Rp=String,Cp=TypeError;Zn.exports=function(r){if(xp(r))return r;throw new Cp(Rp(r)+" is not an object")}});var Z=a(ra=>{"use strict";var Np=x(),Lp=Rt(),kp=Nt(),fr=K(),ea=qt(),Dp=TypeError,Lt=Object.defineProperty,$p=Object.getOwnPropertyDescriptor,kt="enumerable",Dt="configurable",$t="writable";ra.f=Np?kp?function(e,t,i){if(fr(e),t=ea(t),fr(i),typeof e=="function"&&t==="prototype"&&"value"in i&&$t in i&&!i[$t]){var o=$p(e,t);o&&o[$t]&&(e[t]=i.value,i={configurable:Dt in i?i[Dt]:o[Dt],enumerable:kt in i?i[kt]:o[kt],writable:!1})}return Lt(e,t,i)}:Lt:function(e,t,i){if(fr(e),t=ea(t),fr(i),Lp)try{return Lt(e,t,i)}catch(o){}if("get"in i||"set"in i)throw new Dp("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var ue=a((ES,ta)=>{"use strict";var Mp=x(),Vp=Z(),Fp=Ce();ta.exports=Mp?function(r,e,t){return Vp.f(r,e,Fp(1,t))}:function(r,e,t){return r[e]=t,r}});var C=a((TS,oa)=>{"use strict";var Ve=S(),Up=ct(),Bp=dt(),jp=_(),Wp=zn().f,Hp=Ct(),ce=Le(),Kp=Me(),le=ue(),ia=j();De();var Gp=function(r){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,i)}return new r(t,i,o)}return Up(r,this,arguments)};return e.prototype=r.prototype,e};oa.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,n=r.proto,s=i?Ve:o?Ve[t]:Ve[t]&&Ve[t].prototype,u=i?ce:ce[t]||le(ce,t,{})[t],d=u.prototype,l,f,h,c,p,v,g,b,m;for(c in e)l=Hp(i?c:t+(o?".":"#")+c,r.forced),f=!l&&s&&ia(s,c),v=u[c],f&&(r.dontCallGetSet?(m=Wp(s,c),g=m&&m.value):g=s[c]),p=f&&g?g:e[c],!(!l&&!n&&typeof v==typeof p)&&(r.bind&&f?b=Kp(p,Ve):r.wrap&&f?b=Gp(p):n&&jp(p)?b=Bp(p):b=p,(r.sham||p&&p.sham||v&&v.sham)&&le(b,"sham",!0),le(u,c,b),n&&(h=t+"Prototype",ia(ce,h)||le(ce,h,{}),le(ce[h],c,p),r.real&&d&&(l||!d[c])&&le(d,c,p)))}});var aa=a((wS,na)=>{"use strict";var zp=Math.ceil,Qp=Math.floor;na.exports=Math.trunc||function(e){var t=+e;return(t>0?Qp:zp)(t)}});var pr=a((OS,sa)=>{"use strict";var Yp=aa();sa.exports=function(r){var e=+r;return e!==e||e===0?0:Yp(e)}});var ca=a((AS,ua)=>{"use strict";var Jp=pr(),Xp=Math.max,Zp=Math.min;ua.exports=function(r,e){var t=Jp(r);return t<0?Xp(t+e,0):Zp(t,e)}});var Mt=a((qS,la)=>{"use strict";var eh=pr(),rh=Math.min;la.exports=function(r){var e=eh(r);return e>0?rh(e,9007199254740991):0}});var Vt=a((xS,da)=>{"use strict";var th=Mt();da.exports=function(r){return th(r.length)}});var Ft=a((RS,pa)=>{"use strict";var ih=J(),oh=ca(),nh=Vt(),fa=function(r){return function(e,t,i){var o=ih(e),n=nh(o);if(n===0)return!r&&-1;var s=oh(i,n),u;if(r&&t!==t){for(;n>s;)if(u=o[s++],u!==u)return!0}else for(;n>s;s++)if((r||s in o)&&o[s]===t)return r||s||0;return!r&&-1}};pa.exports={includes:fa(!0),indexOf:fa(!1)}});var Ut=a((CS,ha)=>{"use strict";ha.exports=function(){}});var va=a(()=>{"use strict";var ah=C(),sh=Ft().includes,uh=O(),ch=Ut(),lh=uh(function(){return!Array(1).includes()});ah({target:"Array",proto:!0,forced:lh},{includes:function(e){return sh(this,e,arguments.length>1?arguments[1]:void 0)}});ch("includes")});var hr=a((kS,ga)=>{"use strict";var dh=W();ga.exports=dh});var ba=a((DS,ma)=>{"use strict";va();var fh=hr();ma.exports=fh("Array","includes")});var Ia=a(($S,ya)=>{"use strict";var ph=ba();ya.exports=ph});var de=a((MS,Sa)=>{"use strict";var hh=Ia();Sa.exports=hh});var qa=a(()=>{"use strict"});var zt=a((JS,xa)=>{"use strict";var Ue=S(),mh=X(),bh=Re(),vr=function(r){return mh.slice(0,r.length)===r};xa.exports=function(){return vr("Bun/")?"BUN":vr("Cloudflare-Workers")?"CLOUDFLARE":vr("Deno/")?"DENO":vr("Node.js/")?"NODE":Ue.Bun&&typeof Bun.version=="string"?"BUN":Ue.Deno&&typeof Deno.version=="object"?"DENO":bh(Ue.process)==="process"?"NODE":Ue.window&&Ue.document?"BROWSER":"REST"}()});var gr=a((XS,Ra)=>{"use strict";var yh=zt();Ra.exports=yh==="NODE"});var fe=a((ZS,Ca)=>{"use strict";var Ih=ue();Ca.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:Ih(r,e,t),r}});var La=a((e_,Na)=>{"use strict";var Sh=q(),_h=H();Na.exports=function(r,e,t){try{return Sh(_h(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var Da=a((r_,ka)=>{"use strict";var Ph=$();ka.exports=function(r){return Ph(r)||r===null}});var Ma=a((t_,$a)=>{"use strict";var Eh=Da(),Th=String,wh=TypeError;$a.exports=function(r){if(Eh(r))return r;throw new wh("Can't set "+Th(r)+" as a prototype")}});var Qt=a((i_,Va)=>{"use strict";var Oh=La(),Ah=$(),qh=ae(),xh=Ma();Va.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=Oh(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,n){return qh(o),xh(n),Ah(o)&&(r?t(o,n):o.__proto__=n),o}}():void 0)});var mr=a((o_,Ua)=>{"use strict";var Rh=R(),Ch=Rh("toStringTag"),Fa={};Fa[Ch]="z";Ua.exports=String(Fa)==="[object z]"});var Be=a((n_,Ba)=>{"use strict";var Nh=mr(),Lh=_(),br=Re(),kh=R(),Dh=kh("toStringTag"),$h=Object,Mh=br(function(){return arguments}())==="Arguments",Vh=function(r,e){try{return r[e]}catch(t){}};Ba.exports=Nh?br:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=Vh(e=$h(r),Dh))=="string"?t:Mh?br(e):(i=br(e))==="Object"&&Lh(e.callee)?"Arguments":i}});var Wa=a((a_,ja)=>{"use strict";var Fh=mr(),Uh=Be();ja.exports=Fh?{}.toString:function(){return"[object "+Uh(this)+"]"}});var je=a((s_,Ka)=>{"use strict";var Bh=mr(),jh=Z().f,Wh=ue(),Hh=j(),Kh=Wa(),Gh=R(),Ha=Gh("toStringTag");Ka.exports=function(r,e,t,i){var o=t?r:r&&r.prototype;o&&(Hh(o,Ha)||jh(o,Ha,{configurable:!0,value:e}),i&&!Bh&&Wh(o,"toString",Kh))}});var za=a((u_,Ga)=>{"use strict";var zh=Z();Ga.exports=function(r,e,t){return zh.f(r,e,t)}});var Ja=a((c_,Ya)=>{"use strict";var Qh=W(),Yh=za(),Jh=R(),Xh=x(),Qa=Jh("species");Ya.exports=function(r){var e=Qh(r);Xh&&e&&!e[Qa]&&Yh(e,Qa,{configurable:!0,get:function(){return this}})}});var Za=a((l_,Xa)=>{"use strict";var Zh=ur(),ev=TypeError;Xa.exports=function(r,e){if(Zh(e,r))return r;throw new ev("Incorrect invocation")}});var Jt=a((d_,es)=>{"use strict";var rv=q(),tv=_(),Yt=De(),iv=rv(Function.toString);tv(Yt.inspectSource)||(Yt.inspectSource=function(r){return iv(r)});es.exports=Yt.inspectSource});var as=a((f_,ns)=>{"use strict";var ov=q(),nv=O(),rs=_(),av=Be(),sv=W(),uv=Jt(),ts=function(){},is=sv("Reflect","construct"),Xt=/^\s*(?:class|function)\b/,cv=ov(Xt.exec),lv=!Xt.test(ts),We=function(e){if(!rs(e))return!1;try{return is(ts,[],e),!0}catch(t){return!1}},os=function(e){if(!rs(e))return!1;switch(av(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return lv||!!cv(Xt,uv(e))}catch(t){return!0}};os.sham=!0;ns.exports=!is||nv(function(){var r;return We(We.call)||!We(Object)||!We(function(){r=!0})||r})?os:We});var us=a((p_,ss)=>{"use strict";var dv=as(),fv=ke(),pv=TypeError;ss.exports=function(r){if(dv(r))return r;throw new pv(fv(r)+" is not a constructor")}});var Zt=a((h_,ls)=>{"use strict";var cs=K(),hv=us(),vv=Ne(),gv=R(),mv=gv("species");ls.exports=function(r,e){var t=cs(r).constructor,i;return t===void 0||vv(i=cs(t)[mv])?e:hv(i)}});var ei=a((v_,ds)=>{"use strict";var bv=W();ds.exports=bv("document","documentElement")});var ps=a((g_,fs)=>{"use strict";var yv=q();fs.exports=yv([].slice)});var vs=a((m_,hs)=>{"use strict";var Iv=TypeError;hs.exports=function(r,e){if(r<e)throw new Iv("Not enough arguments");return r}});var ri=a((b_,gs)=>{"use strict";var Sv=X();gs.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(Sv)});var li=a((y_,Ts)=>{"use strict";var N=S(),_v=ct(),Pv=Me(),ms=_(),Ev=j(),Es=O(),bs=ei(),Tv=ps(),ys=dr(),wv=vs(),Ov=ri(),Av=gr(),si=N.setImmediate,ui=N.clearImmediate,qv=N.process,ti=N.Dispatch,xv=N.Function,Is=N.MessageChannel,Rv=N.String,ii=0,He={},Ss="onreadystatechange",Ke,ee,oi,ni;Es(function(){Ke=N.location});var ci=function(r){if(Ev(He,r)){var e=He[r];delete He[r],e()}},ai=function(r){return function(){ci(r)}},_s=function(r){ci(r.data)},Ps=function(r){N.postMessage(Rv(r),Ke.protocol+"//"+Ke.host)};(!si||!ui)&&(si=function(e){wv(arguments.length,1);var t=ms(e)?e:xv(e),i=Tv(arguments,1);return He[++ii]=function(){_v(t,void 0,i)},ee(ii),ii},ui=function(e){delete He[e]},Av?ee=function(r){qv.nextTick(ai(r))}:ti&&ti.now?ee=function(r){ti.now(ai(r))}:Is&&!Ov?(oi=new Is,ni=oi.port2,oi.port1.onmessage=_s,ee=Pv(ni.postMessage,ni)):N.addEventListener&&ms(N.postMessage)&&!N.importScripts&&Ke&&Ke.protocol!=="file:"&&!Es(Ps)?(ee=Ps,N.addEventListener("message",_s,!1)):Ss in ys("script")?ee=function(r){bs.appendChild(ys("script"))[Ss]=function(){bs.removeChild(this),ci(r)}}:ee=function(r){setTimeout(ai(r),0)});Ts.exports={set:si,clear:ui}});var As=a((I_,Os)=>{"use strict";var ws=S(),Cv=x(),Nv=Object.getOwnPropertyDescriptor;Os.exports=function(r){if(!Cv)return ws[r];var e=Nv(ws,r);return e&&e.value}});var di=a((S_,xs)=>{"use strict";var qs=function(){this.head=null,this.tail=null};qs.prototype={add:function(r){var e={item:r,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var r=this.head;if(r){var e=this.head=r.next;return e===null&&(this.tail=null),r.item}}};xs.exports=qs});var Cs=a((__,Rs)=>{"use strict";var Lv=X();Rs.exports=/ipad|iphone|ipod/i.test(Lv)&&typeof Pebble!="undefined"});var Ls=a((P_,Ns)=>{"use strict";var kv=X();Ns.exports=/web0s(?!.*chrome)/i.test(kv)});var Us=a((E_,Fs)=>{"use strict";var he=S(),Dv=As(),ks=Me(),fi=li().set,$v=di(),Mv=ri(),Vv=Cs(),Fv=Ls(),pi=gr(),Ds=he.MutationObserver||he.WebKitMutationObserver,$s=he.document,Ms=he.process,yr=he.Promise,gi=Dv("queueMicrotask"),pe,hi,vi,Ir,Vs;gi||(Ge=new $v,ze=function(){var r,e;for(pi&&(r=Ms.domain)&&r.exit();e=Ge.get();)try{e()}catch(t){throw Ge.head&&pe(),t}r&&r.enter()},!Mv&&!pi&&!Fv&&Ds&&$s?(hi=!0,vi=$s.createTextNode(""),new Ds(ze).observe(vi,{characterData:!0}),pe=function(){vi.data=hi=!hi}):!Vv&&yr&&yr.resolve?(Ir=yr.resolve(void 0),Ir.constructor=yr,Vs=ks(Ir.then,Ir),pe=function(){Vs(ze)}):pi?pe=function(){Ms.nextTick(ze)}:(fi=ks(fi,he),pe=function(){fi(ze)}),gi=function(r){Ge.head||pe(),Ge.add(r)});var Ge,ze;Fs.exports=gi});var js=a((T_,Bs)=>{"use strict";Bs.exports=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(t){}}});var Sr=a((w_,Ws)=>{"use strict";Ws.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var Gs=a((O_,Ks)=>{"use strict";var Uv=S(),Bv=_(),Hs=Uv.WeakMap;Ks.exports=Bv(Hs)&&/native code/.test(String(Hs))});var _r=a((A_,Qs)=>{"use strict";var jv=Tt(),Wv=Ot(),zs=jv("keys");Qs.exports=function(r){return zs[r]||(zs[r]=Wv(r))}});var Pr=a((q_,Ys)=>{"use strict";Ys.exports={}});var Ii=a((x_,Zs)=>{"use strict";var Hv=Gs(),Xs=S(),Kv=$(),Gv=ue(),mi=j(),bi=De(),zv=_r(),Qv=Pr(),Js="Object already initialized",yi=Xs.TypeError,Yv=Xs.WeakMap,Er,Qe,Tr,Jv=function(r){return Tr(r)?Qe(r):Er(r,{})},Xv=function(r){return function(e){var t;if(!Kv(e)||(t=Qe(e)).type!==r)throw new yi("Incompatible receiver, "+r+" required");return t}};Hv||bi.state?(V=bi.state||(bi.state=new Yv),V.get=V.get,V.has=V.has,V.set=V.set,Er=function(r,e){if(V.has(r))throw new yi(Js);return e.facade=r,V.set(r,e),e},Qe=function(r){return V.get(r)||{}},Tr=function(r){return V.has(r)}):(re=zv("state"),Qv[re]=!0,Er=function(r,e){if(mi(r,re))throw new yi(Js);return e.facade=r,Gv(r,re,e),e},Qe=function(r){return mi(r,re)?r[re]:{}},Tr=function(r){return mi(r,re)});var V,re;Zs.exports={set:Er,get:Qe,has:Tr,enforce:Jv,getterFor:Xv}});var te=a((R_,eu)=>{"use strict";var Zv=S();eu.exports=Zv.Promise});var ve=a((C_,ou)=>{"use strict";var eg=S(),Ye=te(),rg=_(),tg=Ct(),ig=Jt(),og=R(),ru=zt(),ng=B(),Si=bt(),tu=Ye&&Ye.prototype,ag=og("species"),_i=!1,iu=rg(eg.PromiseRejectionEvent),sg=tg("Promise",function(){var r=ig(Ye),e=r!==String(Ye);if(!e&&Si===66||ng&&!(tu.catch&&tu.finally))return!0;if(!Si||Si<51||!/native code/.test(r)){var t=new Ye(function(n){n(1)}),i=function(n){n(function(){},function(){})},o=t.constructor={};if(o[ag]=i,_i=t.then(function(){})instanceof i,!_i)return!0}return!e&&(ru==="BROWSER"||ru==="DENO")&&!iu});ou.exports={CONSTRUCTOR:sg,REJECTION_EVENT:iu,SUBCLASSING:_i}});var ge=a((N_,au)=>{"use strict";var nu=H(),ug=TypeError,cg=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw new ug("Bad Promise constructor");e=i,t=o}),this.resolve=nu(e),this.reject=nu(t)};au.exports.f=function(r){return new cg(r)}});var Tu=a(()=>{"use strict";var lg=C(),dg=B(),qr=gr(),Q=S(),Ie=D(),su=fe(),uu=Qt(),fg=je(),pg=Ja(),hg=H(),Ar=_(),vg=$(),gg=Za(),mg=Zt(),pu=li().set,Oi=Us(),bg=js(),yg=Sr(),Ig=di(),hu=Ii(),xr=te(),Ai=ve(),vu=ge(),Rr="Promise",gu=Ai.CONSTRUCTOR,Sg=Ai.REJECTION_EVENT,_g=Ai.SUBCLASSING,Pi=hu.getterFor(Rr),Pg=hu.set,me=xr&&xr.prototype,ie=xr,wr=me,mu=Q.TypeError,Ei=Q.document,qi=Q.process,Ti=vu.f,Eg=Ti,Tg=!!(Ei&&Ei.createEvent&&Q.dispatchEvent),bu="unhandledrejection",wg="rejectionhandled",cu=0,yu=1,Og=2,xi=1,Iu=2,Or,lu,Ag,du,Su=function(r){var e;return vg(r)&&Ar(e=r.then)?e:!1},_u=function(r,e){var t=e.value,i=e.state===yu,o=i?r.ok:r.fail,n=r.resolve,s=r.reject,u=r.domain,d,l,f;try{o?(i||(e.rejection===Iu&&xg(e),e.rejection=xi),o===!0?d=t:(u&&u.enter(),d=o(t),u&&(u.exit(),f=!0)),d===r.promise?s(new mu("Promise-chain cycle")):(l=Su(d))?Ie(l,d,n,s):n(d)):s(t)}catch(h){u&&!f&&u.exit(),s(h)}},Pu=function(r,e){r.notified||(r.notified=!0,Oi(function(){for(var t=r.reactions,i;i=t.get();)_u(i,r);r.notified=!1,e&&!r.rejection&&qg(r)}))},Eu=function(r,e,t){var i,o;Tg?(i=Ei.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),Q.dispatchEvent(i)):i={promise:e,reason:t},!Sg&&(o=Q["on"+r])?o(i):r===bu&&bg("Unhandled promise rejection",t)},qg=function(r){Ie(pu,Q,function(){var e=r.facade,t=r.value,i=fu(r),o;if(i&&(o=yg(function(){qr?qi.emit("unhandledRejection",t,e):Eu(bu,e,t)}),r.rejection=qr||fu(r)?Iu:xi,o.error))throw o.value})},fu=function(r){return r.rejection!==xi&&!r.parent},xg=function(r){Ie(pu,Q,function(){var e=r.facade;qr?qi.emit("rejectionHandled",e):Eu(wg,e,r.value)})},be=function(r,e,t){return function(i){r(e,i,t)}},ye=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=Og,Pu(r,!0))},wi=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new mu("Promise can't be resolved itself");var i=Su(e);i?Oi(function(){var o={done:!1};try{Ie(i,e,be(wi,o,r),be(ye,o,r))}catch(n){ye(o,n,r)}}):(r.value=e,r.state=yu,Pu(r,!1))}catch(o){ye({done:!1},o,r)}}};if(gu&&(ie=function(e){gg(this,wr),hg(e),Ie(Or,this);var t=Pi(this);try{e(be(wi,t),be(ye,t))}catch(i){ye(t,i)}},wr=ie.prototype,Or=function(e){Pg(this,{type:Rr,done:!1,notified:!1,parent:!1,reactions:new Ig,rejection:!1,state:cu,value:void 0})},Or.prototype=su(wr,"then",function(e,t){var i=Pi(this),o=Ti(mg(this,ie));return i.parent=!0,o.ok=Ar(e)?e:!0,o.fail=Ar(t)&&t,o.domain=qr?qi.domain:void 0,i.state===cu?i.reactions.add(o):Oi(function(){_u(o,i)}),o.promise}),lu=function(){var r=new Or,e=Pi(r);this.promise=r,this.resolve=be(wi,e),this.reject=be(ye,e)},vu.f=Ti=function(r){return r===ie||r===Ag?new lu(r):Eg(r)},!dg&&Ar(xr)&&me!==Object.prototype)){du=me.then,_g||su(me,"then",function(e,t){var i=this;return new ie(function(o,n){Ie(du,i,o,n)}).then(e,t)},{unsafe:!0});try{delete me.constructor}catch(r){}uu&&uu(me,wr)}lg({global:!0,constructor:!0,wrap:!0,forced:gu},{Promise:ie});fg(ie,Rr,!1,!0);pg(Rr)});var oe=a((D_,wu)=>{"use strict";wu.exports={}});var Au=a(($_,Ou)=>{"use strict";var Rg=R(),Cg=oe(),Ng=Rg("iterator"),Lg=Array.prototype;Ou.exports=function(r){return r!==void 0&&(Cg.Array===r||Lg[Ng]===r)}});var Ri=a((M_,xu)=>{"use strict";var kg=Be(),qu=lr(),Dg=Ne(),$g=oe(),Mg=R(),Vg=Mg("iterator");xu.exports=function(r){if(!Dg(r))return qu(r,Vg)||qu(r,"@@iterator")||$g[kg(r)]}});var Cu=a((V_,Ru)=>{"use strict";var Fg=D(),Ug=H(),Bg=K(),jg=ke(),Wg=Ri(),Hg=TypeError;Ru.exports=function(r,e){var t=arguments.length<2?Wg(r):e;if(Ug(t))return Bg(Fg(t,r));throw new Hg(jg(r)+" is not iterable")}});var ku=a((F_,Lu)=>{"use strict";var Kg=D(),Nu=K(),Gg=lr();Lu.exports=function(r,e,t){var i,o;Nu(r);try{if(i=Gg(r,"return"),!i){if(e==="throw")throw t;return t}i=Kg(i,r)}catch(n){o=!0,i=n}if(e==="throw")throw t;if(o)throw i;return Nu(i),t}});var Nr=a((U_,Vu)=>{"use strict";var zg=Me(),Qg=D(),Yg=K(),Jg=ke(),Xg=Au(),Zg=Vt(),Du=ur(),em=Cu(),rm=Ri(),$u=ku(),tm=TypeError,Cr=function(r,e){this.stopped=r,this.result=e},Mu=Cr.prototype;Vu.exports=function(r,e,t){var i=t&&t.that,o=!!(t&&t.AS_ENTRIES),n=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),u=!!(t&&t.INTERRUPTED),d=zg(e,i),l,f,h,c,p,v,g,b=function(y){return l&&$u(l,"normal",y),new Cr(!0,y)},m=function(y){return o?(Yg(y),u?d(y[0],y[1],b):d(y[0],y[1])):u?d(y,b):d(y)};if(n)l=r.iterator;else if(s)l=r;else{if(f=rm(r),!f)throw new tm(Jg(r)+" is not iterable");if(Xg(f)){for(h=0,c=Zg(r);c>h;h++)if(p=m(r[h]),p&&Du(Mu,p))return p;return new Cr(!1)}l=em(r,f)}for(v=n?r.next:l.next;!(g=Qg(v,l)).done;){try{p=m(g.value)}catch(y){$u(l,"throw",y)}if(typeof p=="object"&&p&&Du(Mu,p))return p}return new Cr(!1)}});var Wu=a((B_,ju)=>{"use strict";var im=R(),Uu=im("iterator"),Bu=!1;try{Fu=0,Ci={next:function(){return{done:!!Fu++}},return:function(){Bu=!0}},Ci[Uu]=function(){return this},Array.from(Ci,function(){throw 2})}catch(r){}var Fu,Ci;ju.exports=function(r,e){try{if(!e&&!Bu)return!1}catch(o){return!1}var t=!1;try{var i={};i[Uu]=function(){return{next:function(){return{done:t=!0}}}},r(i)}catch(o){}return t}});var Ni=a((j_,Hu)=>{"use strict";var om=te(),nm=Wu(),am=ve().CONSTRUCTOR;Hu.exports=am||!nm(function(r){om.all(r).then(void 0,function(){})})});var Ku=a(()=>{"use strict";var sm=C(),um=D(),cm=H(),lm=ge(),dm=Sr(),fm=Nr(),pm=Ni();sm({target:"Promise",stat:!0,forced:pm},{all:function(e){var t=this,i=lm.f(t),o=i.resolve,n=i.reject,s=dm(function(){var u=cm(t.resolve),d=[],l=0,f=1;fm(e,function(h){var c=l++,p=!1;f++,um(u,t,h).then(function(v){p||(p=!0,d[c]=v,--f||o(d))},n)}),--f||o(d)});return s.error&&n(s.value),i.promise}})});var zu=a(()=>{"use strict";var hm=C(),vm=B(),gm=ve().CONSTRUCTOR,ki=te(),mm=W(),bm=_(),ym=fe(),Gu=ki&&ki.prototype;hm({target:"Promise",proto:!0,forced:gm,real:!0},{catch:function(r){return this.then(void 0,r)}});!vm&&bm(ki)&&(Li=mm("Promise").prototype.catch,Gu.catch!==Li&&ym(Gu,"catch",Li,{unsafe:!0}));var Li});var Qu=a(()=>{"use strict";var Im=C(),Sm=D(),_m=H(),Pm=ge(),Em=Sr(),Tm=Nr(),wm=Ni();Im({target:"Promise",stat:!0,forced:wm},{race:function(e){var t=this,i=Pm.f(t),o=i.reject,n=Em(function(){var s=_m(t.resolve);Tm(e,function(u){Sm(s,t,u).then(i.resolve,o)})});return n.error&&o(n.value),i.promise}})});var Yu=a(()=>{"use strict";var Om=C(),Am=ge(),qm=ve().CONSTRUCTOR;Om({target:"Promise",stat:!0,forced:qm},{reject:function(e){var t=Am.f(this),i=t.reject;return i(e),t.promise}})});var Di=a((X_,Ju)=>{"use strict";var xm=K(),Rm=$(),Cm=ge();Ju.exports=function(r,e){if(xm(r),Rm(e)&&e.constructor===r)return e;var t=Cm.f(r),i=t.resolve;return i(e),t.promise}});var ec=a(()=>{"use strict";var Nm=C(),Lm=W(),Xu=B(),km=te(),Zu=ve().CONSTRUCTOR,Dm=Di(),$m=Lm("Promise"),Mm=Xu&&!Zu;Nm({target:"Promise",stat:!0,forced:Xu||Zu},{resolve:function(e){return Dm(Mm&&this===$m?km:this,e)}})});var rc=a(()=>{"use strict";Tu();Ku();zu();Qu();Yu();ec()});var nc=a(()=>{"use strict";var Vm=C(),Fm=B(),Lr=te(),Um=O(),ic=W(),oc=_(),Bm=Zt(),tc=Di(),jm=fe(),Mi=Lr&&Lr.prototype,Wm=!!Lr&&Um(function(){Mi.finally.call({then:function(){}},function(){})});Vm({target:"Promise",proto:!0,real:!0,forced:Wm},{finally:function(r){var e=Bm(this,ic("Promise")),t=oc(r);return this.then(t?function(i){return tc(e,r()).then(function(){return i})}:r,t?function(i){return tc(e,r()).then(function(){throw i})}:r)}});!Fm&&oc(Lr)&&($i=ic("Promise").prototype.finally,Mi.finally!==$i&&jm(Mi,"finally",$i,{unsafe:!0}));var $i});var sc=a((nP,ac)=>{"use strict";qa();rc();nc();var Hm=hr();ac.exports=Hm("Promise","finally")});var cc=a((aP,uc)=>{"use strict";var Km=sc();uc.exports=Km});var Vi=a((sP,lc)=>{"use strict";var Gm=cc();lc.exports=Gm});var fc=a((uP,dc)=>{"use strict";var zm=O();dc.exports=!zm(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var kr=a((cP,hc)=>{"use strict";var Qm=j(),Ym=_(),Jm=wt(),Xm=_r(),Zm=fc(),pc=Xm("IE_PROTO"),Fi=Object,eb=Fi.prototype;hc.exports=Zm?Fi.getPrototypeOf:function(r){var e=Jm(r);if(Qm(e,pc))return e[pc];var t=e.constructor;return Ym(t)&&e instanceof t?t.prototype:e instanceof Fi?eb:null}});var mc=a((lP,gc)=>{"use strict";var rb=q(),Ui=j(),tb=J(),ib=Ft().indexOf,ob=Pr(),vc=rb([].push);gc.exports=function(r,e){var t=tb(r),i=0,o=[],n;for(n in t)!Ui(ob,n)&&Ui(t,n)&&vc(o,n);for(;e.length>i;)Ui(t,n=e[i++])&&(~ib(o,n)||vc(o,n));return o}});var Bi=a((dP,bc)=>{"use strict";bc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var ji=a((fP,yc)=>{"use strict";var nb=mc(),ab=Bi();yc.exports=Object.keys||function(e){return nb(e,ab)}});var Tc=a((pP,Ec)=>{"use strict";var Sc=x(),sb=O(),_c=q(),ub=kr(),cb=ji(),lb=J(),db=pt().f,Pc=_c(db),fb=_c([].push),pb=Sc&&sb(function(){var r=Object.create(null);return r[2]=2,!Pc(r,2)}),Ic=function(r){return function(e){for(var t=lb(e),i=cb(t),o=pb&&ub(t)===null,n=i.length,s=0,u=[],d;n>s;)d=i[s++],(!Sc||(o?d in t:Pc(t,d)))&&fb(u,r?[d,t[d]]:t[d]);return u}};Ec.exports={entries:Ic(!0),values:Ic(!1)}});var wc=a(()=>{"use strict";var hb=C(),vb=Tc().entries;hb({target:"Object",stat:!0},{entries:function(e){return vb(e)}})});var Ac=a((gP,Oc)=>{"use strict";wc();var gb=Le();Oc.exports=gb.Object.entries});var xc=a((mP,qc)=>{"use strict";var mb=Ac();qc.exports=mb});var Se=a((bP,Rc)=>{"use strict";var bb=xc();Rc.exports=bb});var Lc=a((yP,Nc)=>{"use strict";var Wi=x(),yb=j(),Cc=Function.prototype,Ib=Wi&&Object.getOwnPropertyDescriptor,Hi=yb(Cc,"name"),Sb=Hi&&function(){}.name==="something",_b=Hi&&(!Wi||Wi&&Ib(Cc,"name").configurable);Nc.exports={EXISTS:Hi,PROPER:Sb,CONFIGURABLE:_b}});var Dc=a(kc=>{"use strict";var Pb=x(),Eb=Nt(),Tb=Z(),wb=K(),Ob=J(),Ab=ji();kc.f=Pb&&!Eb?Object.defineProperties:function(e,t){wb(e);for(var i=Ob(t),o=Ab(t),n=o.length,s=0,u;n>s;)Tb.f(e,u=o[s++],i[u]);return e}});var Qi=a((SP,jc)=>{"use strict";var qb=K(),xb=Dc(),$c=Bi(),Rb=Pr(),Cb=ei(),Nb=dr(),Lb=_r(),Mc=">",Vc="<",Gi="prototype",zi="script",Uc=Lb("IE_PROTO"),Ki=function(){},Bc=function(r){return Vc+zi+Mc+r+Vc+"/"+zi+Mc},Fc=function(r){r.write(Bc("")),r.close();var e=r.parentWindow.Object;return r=null,e},kb=function(){var r=Nb("iframe"),e="java"+zi+":",t;return r.style.display="none",Cb.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Bc("document.F=Object")),t.close(),t.F},Dr,$r=function(){try{Dr=new ActiveXObject("htmlfile")}catch(e){}$r=typeof document!="undefined"?document.domain&&Dr?Fc(Dr):kb():Fc(Dr);for(var r=$c.length;r--;)delete $r[Gi][$c[r]];return $r()};Rb[Uc]=!0;jc.exports=Object.create||function(e,t){var i;return e!==null?(Ki[Gi]=qb(e),i=new Ki,Ki[Gi]=null,i[Uc]=e):i=$r(),t===void 0?i:xb.f(i,t)}});var Zi=a((_P,Kc)=>{"use strict";var Db=O(),$b=_(),Mb=$(),Vb=Qi(),Wc=kr(),Fb=fe(),Ub=R(),Bb=B(),Xi=Ub("iterator"),Hc=!1,G,Yi,Ji;[].keys&&(Ji=[].keys(),"next"in Ji?(Yi=Wc(Wc(Ji)),Yi!==Object.prototype&&(G=Yi)):Hc=!0);var jb=!Mb(G)||Db(function(){var r={};return G[Xi].call(r)!==r});jb?G={}:Bb&&(G=Vb(G));$b(G[Xi])||Fb(G,Xi,function(){return this});Kc.exports={IteratorPrototype:G,BUGGY_SAFARI_ITERATORS:Hc}});var zc=a((PP,Gc)=>{"use strict";var Wb=Zi().IteratorPrototype,Hb=Qi(),Kb=Ce(),Gb=je(),zb=oe(),Qb=function(){return this};Gc.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=Hb(Wb,{next:Kb(+!i,t)}),Gb(r,o,!1,!0),zb[o]=Qb,r}});var nl=a((EP,ol)=>{"use strict";var Yb=C(),Jb=D(),Mr=B(),tl=Lc(),Xb=_(),Zb=zc(),Qc=kr(),Yc=Qt(),ey=je(),ry=ue(),eo=fe(),ty=R(),Jc=oe(),il=Zi(),iy=tl.PROPER,oy=tl.CONFIGURABLE,Xc=il.IteratorPrototype,Vr=il.BUGGY_SAFARI_ITERATORS,Je=ty("iterator"),Zc="keys",Xe="values",el="entries",rl=function(){return this};ol.exports=function(r,e,t,i,o,n,s){Zb(t,e,i);var u=function(m){if(m===o&&c)return c;if(!Vr&&m&&m in f)return f[m];switch(m){case Zc:return function(){return new t(this,m)};case Xe:return function(){return new t(this,m)};case el:return function(){return new t(this,m)}}return function(){return new t(this)}},d=e+" Iterator",l=!1,f=r.prototype,h=f[Je]||f["@@iterator"]||o&&f[o],c=!Vr&&h||u(o),p=e==="Array"&&f.entries||h,v,g,b;if(p&&(v=Qc(p.call(new r)),v!==Object.prototype&&v.next&&(!Mr&&Qc(v)!==Xc&&(Yc?Yc(v,Xc):Xb(v[Je])||eo(v,Je,rl)),ey(v,d,!0,!0),Mr&&(Jc[d]=rl))),iy&&o===Xe&&h&&h.name!==Xe&&(!Mr&&oy?ry(f,"name",Xe):(l=!0,c=function(){return Jb(h,this)})),o)if(g={values:u(Xe),keys:n?c:u(Zc),entries:u(el)},s)for(b in g)(Vr||l||!(b in f))&&eo(f,b,g[b]);else Yb({target:e,proto:!0,forced:Vr||l},g);return(!Mr||s)&&f[Je]!==c&&eo(f,Je,c,{name:o}),Jc[e]=c,g}});var sl=a((TP,al)=>{"use strict";al.exports=function(r,e){return{value:r,done:e}}});var to=a((wP,fl)=>{"use strict";var ny=J(),ro=Ut(),ul=oe(),ll=Ii(),ay=Z().f,sy=nl(),Fr=sl(),uy=B(),cy=x(),dl="Array Iterator",ly=ll.set,dy=ll.getterFor(dl);fl.exports=sy(Array,"Array",function(r,e){ly(this,{type:dl,target:ny(r),index:0,kind:e})},function(){var r=dy(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=void 0,Fr(void 0,!0);switch(r.kind){case"keys":return Fr(t,!1);case"values":return Fr(e[t],!1)}return Fr([t,e[t]],!1)},"values");var cl=ul.Arguments=ul.Array;ro("keys");ro("values");ro("entries");if(!uy&&cy&&cl.name!=="values")try{ay(cl,"name",{value:"values"})}catch(r){}});var hl=a((OP,pl)=>{"use strict";var fy=x(),py=Z(),hy=Ce();pl.exports=function(r,e,t){fy?py.f(r,e,hy(0,t)):r[e]=t}});var vl=a(()=>{"use strict";var vy=C(),gy=Nr(),my=hl();vy({target:"Object",stat:!0},{fromEntries:function(e){var t={};return gy(e,function(i,o){my(t,i,o)},{AS_ENTRIES:!0}),t}})});var ml=a((xP,gl)=>{"use strict";to();vl();var by=Le();gl.exports=by.Object.fromEntries});var yl=a((RP,bl)=>{"use strict";bl.exports={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}});var Sl=a(()=>{"use strict";to();var yy=yl(),Iy=S(),Sy=je(),Il=oe();for(Ur in yy)Sy(Iy[Ur],Ur),Il[Ur]=Il.Array;var Ur});var Pl=a((LP,_l)=>{"use strict";var _y=ml();Sl();_l.exports=_y});var Tl=a((kP,El)=>{"use strict";var Py=Pl();El.exports=Py});var uo=a((wE,Vl)=>{"use strict";var Ry=Be(),Cy=String;Vl.exports=function(r){if(Ry(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Cy(r)}});var Ul=a((OE,Fl)=>{"use strict";var Ny=pr(),Ly=uo(),ky=ae(),Dy=RangeError;Fl.exports=function(e){var t=Ly(ky(this)),i="",o=Ny(e);if(o<0||o===1/0)throw new Dy("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))o&1&&(i+=t);return i}});var Kl=a((AE,Hl)=>{"use strict";var Wl=q(),$y=Mt(),Bl=uo(),My=Ul(),Vy=ae(),Fy=Wl(My),Uy=Wl("".slice),By=Math.ceil,jl=function(r){return function(e,t,i){var o=Bl(Vy(e)),n=$y(t),s=o.length,u=i===void 0?" ":Bl(i),d,l;return n<=s||u===""?o:(d=n-s,l=Fy(u,By(d/u.length)),l.length>d&&(l=Uy(l,0,d)),r?o+l:l+o)}};Hl.exports={start:jl(!1),end:jl(!0)}});var zl=a((qE,Gl)=>{"use strict";var jy=X();Gl.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(jy)});var Ql=a(()=>{"use strict";var Wy=C(),Hy=Kl().start,Ky=zl();Wy({target:"String",proto:!0,forced:Ky},{padStart:function(e){return Hy(this,e,arguments.length>1?arguments[1]:void 0)}})});var Jl=a((CE,Yl)=>{"use strict";Ql();var Gy=hr();Yl.exports=Gy("String","padStart")});var Zl=a((NE,Xl)=>{"use strict";var zy=Jl();Xl.exports=zy});var co=a((LE,ed)=>{"use strict";var Qy=Zl();ed.exports=Qy});var vo=w(de(),1);var Fe=(s=>(s.PROD="prod",s.VK_ALIAS="vk_alias",s.VIDEOTEST="videotest",s.TEST="test",s.OKCDN="okcdn",s.AUTO="auto",s))(Fe||{}),Bt=(l=>(l.Q144P="mobile",l.Q240P="lowest",l.Q360P="low",l.Q480P="medium",l.Q720P="high",l.Q1080P="fullhd",l.Q1440P="quadhd",l.Q2160P="ultrahd",l.UNKNOWN="unknown",l))(Bt||{}),jt=(p=>(p.MP4="mp4",p.DASH="dash",p.DASH_SEP="dash_sep",p.ONDEMAND_DASH="ondemand_dash",p.HLS="hls",p.ONDEMAND_HLS="ondemand_hls",p.WEBM="webm",p.AV1="av1",p.ONDEMAND_DASH_LIVE="ondemand_dash_live",p.ONDEMAND_HLS_LIVE="ondemand_hls_live",p.WEBRTC="webrtc",p.UNKNOWN="unknown",p.RTMP="rtmp",p))(jt||{});var Wt=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(Wt||{});var Ht=(u=>(u.SLIDER="slider",u.DOUBLE_TAP="double_tap",u.TIME_CODE="time_code",u.EPISODE="episode",u.REWIND="rewind",u.LIVE="live",u.UNKNOWN="unknown",u))(Ht||{}),_a=(n=>(n.GRAPH_SHOW="iGraphShow",n.GRAPH_HIDE="iGraphHide",n.NEXT_AREA="iNextChapterArea",n.NEXT_BUTTON="iNextChapterBtn",n.WATCH_AGAIN="iWatchAgainBtn",n))(_a||{}),Pa={action_play:"ap",action_play_interactive:"api",first_bytes:"fb",player_ready:"pr",first_frame:"ff",seek:"sk",watch_coverage_record:"wr",watch_coverage_live:"wl",empty_buffer:"eb",action_stop:"as",close_at_empty_buffer:"cb",content_error:"er",player_interface_click:"pc",next_movie:"nm",track_switch:"ts",failover:"fo",quality:"qt"},Ea={vsid:"si",isid:"is",vid:"vi",place:"pl",quality:"qt",cdn_host:"ch",stat_type:"st",param:"pm",vk_app_id:"va",track_code:"tc",connection_type:"cnt",connection_reused:"cr",cached_data:"cd",live:"lv",muted:"mu",mode:"mo",subtitles:"sb",failover:"fo",download_speed:"ds",manual_quality:"mq",ref_domain:"rd",direct_url:"du"},Ta={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},wa={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};import{fillWithDefault as vh}from"@vkontakte/videoplayer-shared/es2018";var Oa="CIOPGQJGDIHBABABA",Kt={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var gh={apiEnv:"vk_alias",apiKey:Oa,requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:["quality"],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,clearStorageAtUnload:!0,useVKComIsMobileLogic:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1}},Aa=r=>vh(r,gh);function Gt(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}import{assertNonNullable as tI,combine as sd,fromEvent as ud,isNonNullable as we,isNullable as cd,merge as iI,now as z,observableFrom as oI,once as nI,safeStorage as ld,Subject as aI,Subscription as go,ValueSubject as Yr,createURL as dd}from"@vkontakte/videoplayer-shared/es2018";import{Logger as sI,detectEmbed as uI}from"@vkontakte/videoplayer-shared/es2018";var Br=w(Vi(),1);var wl=w(Se(),1),Ol=w(Tl(),1);var Al=r=>{var o;let{operation:e,custom:t}=r,i=(0,Ol.default)((0,wl.default)(t).map(([n,s])=>{var l,f,h;let u=(l=Ea[n])!=null?l:n,d=s;return s&&(n==="mode"?d=(f=wa[s])!=null?f:s:n==="quality"&&(d=(h=Ta[s])!=null?h:s)),[u,d]}));return{...r,operation:(o=Pa[e])!=null?o:e,custom:i}};var L="1.0.82-dev.39d52b6a.0";import{ValueSubject as Ey,getExponentialDelay as Ty,ErrorCategory as _e}from"@vkontakte/videoplayer-shared/es2018";var wy=/Mobile|mini|Fennec|Android|iP(ad|od|hone)|opera (mini|mobi)/i,Ze=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new Ey(!1);this.params=e}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this._authorizeWithBackoff()}logBeacon(e){let t="log.externalLog",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var s;let t="log.externalLog",i=this.createLogParams(e),o=(s=this.sessionKey)!=null?s:await this._authorizeWithBackoff();if(!o)return;let n=async(u,d=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,o)}catch(l){if(!l||!("error_code"in l)){this.params.error$.next({id:"logRequestUnknown",category:_e.NETWORK,message:`Unknown ${t} error`,thrown:l});return}let f=l==null?void 0:l.error_code;switch(f){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this._authorizeWithBackoff(),d>0?n(u,d-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this._authorizeWithBackoff(),d>0?n(u,d-1):void 0;default:{this.params.error$.next({id:`LogRequest#${f}`,category:_e.EXTERNAL_API,message:`${t} error`,data:l});return}}}};return n(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Br.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let t="WEB",i=!1,o=`@vkontakte/videoplayer-statistics:${L}`;if(this.params.config.useVKComIsMobileLogic){let{appVersion:n}=window.navigator;i=wy.test(n)}else this.params.mobile&&(i=!0);return i&&(t="M_WEB"),this.params.vktvVersion&&(t="SMART_TV",o=this.params.vktvVersion),{collector:"ok.mobile.apps.video",data:JSON.stringify({application:o,platform:t,items:this.params.config.shorten?e.map(Al):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=Ty(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Br.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:_e.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})),()=>this.backoffTimeoutId=0)},e))})}async _authorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:L.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,Br.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:_e.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this._authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:_e.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:_e.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var jr=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:i})}removeEventListener(e,t){if(!(e in this.listeners))return;let i=this.listeners[e];for(let o=0,n=i.length;o<n;o++)if(i[o].callback===t){i.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let i=this.listeners[e.type].slice();for(let o=0,n=i.length;o<n;o++){let s=i[o];try{s.callback.call(this,e)}catch(u){Promise.resolve().then(()=>{throw u})}s.options&&s.options.once&&this.removeEventListener(e.type,s.callback)}return!e.defaultPrevented}},Pe=class extends jr{constructor(){super(),this.listeners||jr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}},er=class{constructor(){Object.defineProperty(this,"signal",{value:new Pe,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let i=e;if(i===void 0)if(typeof document=="undefined")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch(o){i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(er.prototype[Symbol.toStringTag]="AbortController",Pe.prototype[Symbol.toStringTag]="AbortSignal");function Wr(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function io(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!Wr({fetch:e,Request:t,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:n};let n=t;(n&&!n.prototype.hasOwnProperty("signal")||o)&&(n=function(l,f){let h;f&&f.signal&&(h=f.signal,delete f.signal);let c=new t(l,f);return h&&Object.defineProperty(c,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),c},n.prototype=t.prototype);let s=e;return{fetch:(d,l)=>{let f=n&&n.prototype.isPrototypeOf(d)?d.signal:l?l.signal:void 0;if(f){let h;try{h=new DOMException("Aborted","AbortError")}catch(p){h=new Error("Aborted"),h.name="AbortError"}if(f.aborted)return Promise.reject(h);let c=new Promise((p,v)=>{f.addEventListener("abort",()=>v(h),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([c,s(d,l)])}return s(d,l)},Request:n}}var Oy=()=>"fetch"in window,rr=Oy()&&Wr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ql=rr?io({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ee=rr?ql.fetch:window.fetch,rE=rr?ql.Request:window.Request,tE=rr?er:window.AbortController,iE=rr?Pe:window.AbortSignal;var xl=w(de(),1),Rl=w(Se(),1);import{ErrorCategory as Hr,now as oo}from"@vkontakte/videoplayer-shared/es2018";var tr=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=Kt[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await Ee(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),n=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!n)throw new Error("Wrong DNS response");return n}catch(t){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:Hr.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),Kt.vk_alias}finally{this.isApiBaseUrlFetched=!0}}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this._prepareQueryParams({method:e,queryParams:t,sessionKey:i}),n=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,n)}catch(s){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:Hr.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=oo(),n=s=>{if(s instanceof TypeError&&(0,xl.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],s.message)){this.params.error$.next({id:"Network",category:Hr.NETWORK,message:"Request failed",thrown:s});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:Hr.NETWORK,message:"Unhandled request error",thrown:s,data:{method:e,params:t,sessionKey:i,time:oo()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ee(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(s=>{var f,h;let u=Number(s.headers.get("content-length"))===0,d=new Date((f=s.headers.get("date"))!=null?f:"").getTime(),l=oo()-o;if(isFinite(d)&&((h=this.timeSynchronisation)==null||h.addServerTime(d,l)),!u)return s.json().then(c=>Object.prototype.hasOwnProperty.call(c,"error_msg")?Promise.reject(c):c,n)},n)}_prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,Rl.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var Nl=w(de(),1),Ll=w(Se(),1);import{ErrorCategory as Ay,now as qy,safeStorage as ir,debounceFn as Cl}from"@vkontakte/videoplayer-shared/es2018";var Kr="onestat_events",no=r=>e=>e.timestamp+r>=qy(),Gr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return(0,Nl.default)(["action_play","watch_coverage_record","watch_coverage_live"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=Cl(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=ir.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=Cl(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){try{this.flush()}catch(e){this.error$.next({id:"LoggerError",category:Ay.WTF,message:e?String(e):"Unknown logger error",thrown:e})}}readFromStorage(){let e=ir.get(Kr);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var n;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((n=t[this.userSalt])!=null?n:[]).filter(no(this.params.config.storageExpiration));ir.set(Kr,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(no(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],ir.set(Kr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,Ll.default)(e)){let o=i.filter(no(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}ir.set(Kr,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.custom.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.custom.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};import{HttpConnectionType as ao,Surface as Te,VideoFormat as A,VideoQuality as F}from"@vkontakte/videoplayer-core/es2018";import{assertNever as kl}from"@vkontakte/videoplayer-shared/es2018";var Dl=r=>r&&{[F.INVARIANT]:"unknown",[F.Q_144P]:"mobile",[F.Q_240P]:"lowest",[F.Q_360P]:"low",[F.Q_480P]:"medium",[F.Q_576P]:"unknown",[F.Q_720P]:"high",[F.Q_1080P]:"fullhd",[F.Q_1440P]:"quadhd",[F.Q_2160P]:"ultrahd",[F.Q_4320P]:"unknown"}[r],so=r=>r&&{[ao.HTTP1]:"http1",[ao.HTTP2]:"http2",[ao.QUIC]:"http3"}[r],$l=r=>{if(r!==void 0)switch(r){case A.MPEG:return"mp4";case A.DASH:case A.DASH_LIVE:case A.DASH_STREAMS:return"dash";case A.DASH_SEP:return"dash_sep";case A.DASH_ONDEMAND:return"ondemand_dash";case A.DASH_WEBM:case A.DASH_LIVE_WEBM:return"webm";case A.DASH_WEBM_AV1:return"av1";case A.DASH_LIVE_CMAF:return"ondemand_dash_live";case A.HLS:case A.HLS_LIVE:return"hls";case A.HLS_ONDEMAND:return"ondemand_hls";case A.HLS_LIVE_CMAF:return"ondemand_hls_live";case A.WEB_RTC_LIVE:return"webrtc";default:return kl(r)}},zr=r=>{if(r!==void 0)switch(r){case Te.NONE:case Te.INLINE:return;case Te.FULLSCREEN:return"fullscreen";case Te.SECOND_SCREEN:return"chromecast";case Te.PIP:return"pip";case Te.INVISIBLE:return"invisible";default:return kl(r)}},Ml=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var Qr=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};var lo=w(co(),1),rd=()=>(0,lo.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),td=()=>(0,lo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");import{PlaybackState as id}from"@vkontakte/videoplayer-core/es2018";import{filter as od,filterChanged as Yy,fromEvent as Jy,isNullable as nd,map as Xy,merge as fo,Observable as Zy,Subject as po,Subscription as eI,ValueSubject as rI}from"@vkontakte/videoplayer-shared/es2018";var ad=(r,e)=>new Zy(t=>{let i=new eI,o=fo(Jy(window,"beforeunload"),r.events.willDestruct$),n=new rI(void 0),s;i.add(r.info.isLive$.pipe(Yy()).subscribe(I=>{s&&(s.unsubscribe(),n.next(void 0)),I?s=r.info.liveTime$.pipe(Xy(T=>T&&T/1e3)).subscribe(n):s=r.info.position$.subscribe(n),i.add(s)}));let{playing$:u,paused$:d}=r.events,l=r.events.willSeek$.pipe(od(()=>r.info.playbackState$.getValue()===id.PLAYING)),f=r.events.seeked$.pipe(od(()=>r.info.playbackState$.getValue()===id.PLAYING)),h=!1,c=new po;i.add(l.subscribe(()=>{h||c.next(),h=!0})),i.add(f.subscribe(()=>h=!1));let p=new po,v=new po,g=fo(u,f,p),b=fo(d,c,o,r.events.looped$,v),m,y=()=>m=n.getValue(),E=()=>{let I=n.getValue();nd(m)||m===I||nd(I)||(t.next({from:m,to:I}),m=void 0)},k=()=>{v.next(),p.next()};if(i.add(g.subscribe(y)),i.add(b.subscribe(E)),e.forceInterval&&isFinite(e.forceInterval)){let I=0;i.add(g.subscribe(()=>I=window.setTimeout(k,e.forceInterval))),i.add(b.subscribe(()=>window.clearTimeout(I)))}return i});var cI="_one-stat_",fd=`${cI}deviceId`,ho=()=>{let r=new go;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},mo=class{constructor(e,t){this.subscription=new go;this.debugLogger=new sI;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new Yr(void 0);this.isid$=new Yr(void 0);this.zenUid$=new Yr(void 0);this.seekAction$=new Yr("unknown");var d,l,f;this.statContext=e,this.config=Aa((d=t.config)!=null?d:{}),we(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new Qr);let i=new aI;this.experimental={error$:i};let o=ld.get(fd);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=Gt(),ld.set(fd,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:td()),this.zenUid$.next(t.zenUid);let n=new tr({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new Ze({config:this.config,apiTransport:n,refreshAuthToken:t.refreshAuthToken,mobile:(f=this.statContext.mobile)!=null?f:!1,deviceId:this.deviceId,error$:i,vktvVersion:t.vktvVersion}),this.logger=new Gr({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:s,topOrigin:u}=uI();this.isEmbed=s,this.embedParent=u?new URL(u).hostname:void 0,this.subscribe()}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new go,i=(c,p)=>t.add(c.subscribe(p));i(e.events.willStart$,()=>{let c=e.info.position$.getValue();this.logActionPlay({position:c}),this.statContext.projectId&&this.logActionPlayInteractive()}),i(e.events.looped$,()=>{this.resetViewSession(),++this.loopCounter>this.config.maxLoops&&(this.disabled=!0),this.logActionPlay({position:e.info.position$.getValue()})}),i(e.events.seeked$,()=>{this.logSeek({action:this.seekAction$.getValue(),time:e.info.position$.getValue()}),this.seekAction$.next("unknown")}),i(e.events.paused$,()=>{this.logPause({position:e.info.position$.getValue()})}),i(e.events.willResume$,()=>{this.logPlay()}),i(e.events.started$,()=>{this.statContext.clip&&this.logWatchCoverageRecord({start:0,end:0})}),i(e.events.playing$,()=>{this.logPlaying()}),i(ad(e,{forceInterval:this.config.watchCoverageInterval}),c=>{var b,m,y,E;let p=e.info.isLive$.getValue(),v=e.info.atLiveEdge$.getValue(),g={start:parseFloat(c.from.toFixed(3)),end:parseFloat(c.to.toFixed(3))};if(v){let k=(b=e.info.liveLatency$.getValue())!=null?b:0,I=(y=(m=e.info.currentBuffer$.getValue())==null?void 0:m.end)!=null?y:0,T=(E=e.info.liveBufferTime$.getValue())!=null?E:0,nr=Math.round((k-(I-T))*1e3),ar=Math.round(k*1e3);nr&&ar&&(g.latency=nr,g.bufferLatency=ar)}p?this.logWatchCoverageLive(g):this.logWatchCoverageRecord(g)});let o;i(e.info.isStalled$,c=>{c?o=z():(we(o)&&this.logEmptyBuffer({duration:z()-o}),o=void 0)});let n=!1;t.add(e.events.fatalError$.pipe(nI()).subscribe(()=>n=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let p=we(o)?z()-o:void 0;this.logCloseAtEmptyBuffer({duration:p!=null?p:0}),o=void 0}else n||this.logActionStop()}),i(e.events.managedError$,({id:c})=>{this.logError({fatal:!1,errorType:c})}),i(e.events.fatalError$,({id:c})=>{this.logError({fatal:!0,errorType:c})});let s,u,d=!1;i(e.events.firstBytes$,c=>{s=z(),this.logFirstBytes({time:c})}),i(e.events.willStart$,()=>u=z()),i(e.info.currentBuffer$,c=>{!d&&c&&c.end-c.start>0&&we(s)&&(this.logPlayerReady({duration:z()-s}),d=!0)}),i(e.events.firstFrame$,()=>{we(s)&&!d&&(this.logPlayerReady({duration:z()-s}),d=!0),we(u)&&this.logFirstFrame({time:z()-u})});let l;i(e.info.currentVideoStream$,c=>{c&&(l&&c.id!==l&&this.logTrackSwitch(c),l=c.id)});let f;i(e.info.currentAudioStream$,c=>{c&&(f&&c.id!==f&&this.logTrackSwitch(c),f=c.id)}),i(e.info.atLiveEdge$,c=>this.updateContext({liveEdge:c})),i(sd({muted:e.info.muted$,volume:e.info.volume$}),({muted:c,volume:p})=>this.updateContext({audible:!c&&p>0})),i(e.info.currentQuality$,c=>{let p=Dl(c);this.updateContext({quality:p}),p&&this.logQuality(p)}),i(e.info.isAutoQualityEnabled$,c=>this.updateContext({autoQuality:c})),i(e.info.currentFormat$,c=>this.updateContext({contentType:$l(c)})),i(e.info.currentPlaybackRate$,c=>this.updateContext({rate:c})),i(e.info.is3DVideo$,c=>this.updateContext({is3d:c}));let h;return i(e.info.hostname$,c=>{let p=h!==void 0&&h!==c;this.updateContext({cdnHostname:c,failover:p}),p&&this.logFailover(c),h=c}),i(e.info.throughputEstimation$,c=>this.updateContext({downloadSpeed:c})),i(e.info.httpConnectionType$,c=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:so(c)}),this.updateContext({connectionType:so(c)})}),i(e.info.httpConnectionReused$,c=>{cd(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:c}),this.updateContext({connectionReused:c})}),i(e.info.surface$,c=>this.updateContext({mode:zr(c)})),i(sd({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:c,available:p})=>{let v=p.find(({id:b})=>b===c),g=v&&(v.isAuto?`${v.language}_auto`:v.language);this.updateContext({subtitles:g==null?void 0:g.split(".")[0]})}),this.player=e,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){this.uiEvents=e;let{subscription:t,subscribe:i}=ho();return this.player&&(i(e.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),i(e.actionSeek$,this.seekAction$),i(e.inPiP$,o=>{var s;let n=o?"pip":zr((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.inFullscreen$,o=>{var s;let n=o?"fullscreen":zr((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.actionSetSubtitle$,o=>this.updateContext({subtitles:o.split(".")[0]})),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t)),t}attachToAds(e){let{subscription:t,subscribe:i}=ho();return i(e.slotRequested$,()=>this.logAdSlotRequest()),i(e.started$,o=>this.logAdStarted(o)),i(e.paused$,()=>this.logAdPaused()),i(e.resumed$,()=>this.logAdResumed()),i(e.ended$,()=>this.logAdEnded()),i(e.skipped$,()=>this.logAdSkipped()),i(e.clicked$,()=>this.logAdClicked()),i(e.error$,o=>this.logError({errorType:o,fatal:!1})),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToInteractive(e){let{subscription:t,subscribe:i}=ho();return i(e.click$,o=>this.logInterfaceClick(o)),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t),t}authorize(e){return this.api.authorize(e)}pause(){this.logger.pause(),this.oneStatDebugLog({message:"paused"})}resume(){this.logger.resume(),this.oneStatDebugLog({message:"resumed"})}destroy(){this.logger.flush(),this.subscription.unsubscribe(),this.api.destroy(),this.logger.destroy()}resetViewSession(){this.oneStatDebugLog({message:"VSID reset"}),this.vsid$.next(rd())}getDeviceId(){return this.deviceId}setFieldBlacklist(){}logInited(){}logReady(e){this.log({operation:"player_ready",param:String(e.time)})}logStarted(...e){this.logActionPlay(...e)}logPlay(){this.log({operation:"play_toggle"})}logPlaying(){this.log({operation:"playing"})}logPause(e){this.log({operation:"pause",param:String(Math.round(e.position))})}logSeek(e){this.log({operation:"seek",param:e.action,time:e.time})}logFirstBytes(e){this.log({operation:"first_bytes",param:String(e.time)})}logFirstFrame(e){this.log({operation:"first_frame",param:String(e.time)})}logError(e){this.log({operation:"content_error",param:`${e.fatal?"fatal":"recoverable"}_${e.errorType}`})}logWatchCoverageRecord(e){this.log({operation:"watch_coverage_record",param:`${e.start}-${e.end}`},{in_history:this.statContext.inHistory?1:void 0})}logWatchCoverageLive(e){var n,s;let t=(s=(n=this.timeSynchronisation)==null?void 0:n.getOffset())!=null?s:0,i=e.start+t,o=e.end+t;this.log({operation:"watch_coverage_live",param:`${i}-${o}`},{in_history:this.statContext.inHistory?1:void 0,latency:e.latency,buffer_latency:e.bufferLatency})}logEmptyBuffer(e){this.log({operation:"empty_buffer",param:String(e.duration)})}logDownloadSpeed(){}logAdSlotRequest(){this.log({operation:"adv",param:"slot_request"})}logAdStarted(e){this.log({operation:"adv",param:e})}logAdPaused(){this.log({operation:"adv",param:"pause"})}logAdResumed(){this.log({operation:"adv",param:"resume"})}logAdEnded(){this.log({operation:"adv",param:"ended"})}logAdSkipped(){this.log({operation:"adv",param:"skip"})}logAdClicked(){this.log({operation:"adv",param:"click"})}logInterfaceClick(e){this.log({operation:"player_interface_click",param:e})}logNextMovie(e){this.log({operation:"next_movie",param:String(e)})}subscribe(){this.resubscribeBeforeunload();let e=window.navigator.connection;e&&"onchange"in e&&"effectiveType"in e&&this.subscription.add(iI(ud(e,"change"),oI(["init"])).subscribe(()=>this.updateContext({network:Ml(e.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(t=>{console.debug("%c stat ","background:#fa6470;",`component: ${t.component}.`,t.message)})}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=ud(window,"beforeunload").subscribe(()=>this.logger.flush({wantBeacon:!0,clearStorage:this.config.clearStorageAtUnload})),this.subscription.add(this.beforeunloadSubscription)}logPlayerReady(e){this.log({operation:"player_ready",param:String(Math.round(e.duration))})}logActionPlay(e){this.log({operation:"action_play",param:String(Math.round(e.position))})}logActionPlayInteractive(){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(this.statContext.movieId)},{vid:this.statContext.projectId})}logFailover(e){this.log({operation:"failover",param:e})}logCloseAtEmptyBuffer(e){this.log({operation:"close_at_empty_buffer",param:String(Math.round(e.duration))})}logActionStop(){this.log({operation:"action_stop"})}logTrackSwitch(e){this.log({operation:"track_switch",param:e.id})}logQuality(e){this.log({operation:"quality",param:e})}log(e,t={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${e.operation} but statistics is disabled`});return}if((0,vo.default)(this.config.disabledOperations,e.operation)){this.oneStatDebugLog({message:`operation ${e.operation} but it is disabled`});return}this.oneStatDebugLog({message:`operation ${e.operation} ${e.param}`});let i=this.createLogItem(e,t);this.logger.log(i)}createLogItem({operation:e,param:t,time:i},o={}){var p,v,g,b,m,y;let n=(v=(p=this.timeSynchronisation)==null?void 0:p.now())!=null?v:z(),s=this.vsid$.getValue();tI(s);let u=this.isid$.getValue(),d=e==="empty_buffer"||e==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,l=this.statContext.firstConnectionReused,f,h;if(this.isEmbed||this.statContext.place==="embed"){f=this.embedParent;let E=[...new URLSearchParams(location.search).entries()].filter(([k,I])=>(0,vo.default)(this.config.embedUrlParams,k));h=new URLSearchParams(E).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?f=(b=(g=dd(this.statContext.refDomain))==null?void 0:g.hostname)!=null?b:this.statContext.refDomain:document.referrer&&(f=(y=(m=dd(document.referrer))==null?void 0:m.hostname)!=null?y:document.referrer),h=location.href.substring(0,1024));let c={vsid:s,isid:u,vid:this.statContext.movieId,uid:this.zenUid$.getValue(),ct:this.statContext.contentType,place:this.isEmbed?"embed":this.statContext.place,quality:this.statContext.quality,cdn_host:this.statContext.cdnHostname,stat_type:this.statContext.autoplay===!0?"auto":this.statContext.autoplay===!1?"":void 0,param:t,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:d,connection_reused:l===!0?1:l===!1?0:void 0,cached_data:this.statContext.cached===!0?1:this.statContext.cached===!1?0:void 0,live:this.statContext.liveEdge?1:void 0,muted:this.statContext.audible===!1?1:void 0,mode:this.statContext.mode,subtitles:this.statContext.subtitles,download_speed:this.statContext.downloadSpeed,manual_quality:this.statContext.autoQuality?void 0:1,ref_domain:f,direct_url:h,rate:this.statContext.rate===1||cd(this.statContext.rate)?void 0:this.statContext.rate.toFixed(2),view_360:this.statContext.is3d?1:void 0,aid:this.statContext.albumId,vk_playlist_id:this.statContext.vkPlaylistId,...o};for(let E of this.config.disabledCustomFields)delete c[E];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:n,custom:c}}};var Ao={};Hd(Ao,{SeekType:()=>Jr,ThinOneStat:()=>nt,VERSION:()=>L});import{assertNonNullable as EI,detectEmbed as TI,fromEvent as wI,Logger as OI,merge as Dd,safeStorage as $d,Subject as AI,Subscription as Oo,ValueSubject as ot}from"@vkontakte/videoplayer-shared/es2018";import{clientChecker as ne,PlaybackState as Md}from"@vkontakte/videoplayer-core/es2018";import{fillWithDefault as lI}from"@vkontakte/videoplayer-shared/es2018";var Jr=(u=>(u.SLIDER="slider",u.DOUBLE_TAP="double_tap",u.TIME_CODE="time_code",u.EPISODE="episode",u.REWIND="rewind",u.LIVE="live",u.UNKNOWN="unknown",u))(Jr||{});var hd="CIOPGQJGDIHBABABA",bo={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var dI={apiKey:hd,apiEnv:"vk_alias",requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageHeartbeatInterval:15,synchronizeTime:!0,useBeacon:!1,alwaysSendDesktop:!1},vd=r=>lI(r,dI);var yo=w(Vi(),1);import{getExponentialDelay as fI,ErrorCategory as Oe,ValueSubject as pI}from"@vkontakte/videoplayer-shared/es2018";var Xr=class{constructor(e){this.params=e,this.authorized$=new pI(!1),this.consequentAuthErrors=0}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this.authorizeWithBackoff()}logBeacon(e){let t="log.logUvStat",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var u;let t="log.logUvStat",i=this.createLogParams(e),o={},n=(u=this.sessionKey)!=null?u:await this.authorizeWithBackoff();if(!n)return;let s=async(d,l=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,n,o)}catch(f){if(!f||!("error_code"in f)){this.params.error$.next({id:"logRequestUnknown",category:Oe.NETWORK,message:`Unknown ${t} error`,thrown:f});return}let h=f==null?void 0:f.error_code;switch(h){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;default:{this.params.error$.next({id:`LogRequest#${h}`,category:Oe.EXTERNAL_API,message:`${t} error`,data:f});return}}}};return s(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,yo.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){return{collector:"ok.mobile.apps.video",uv_stat_data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${L}`,platform:e[0].platform,product:e[0].product,events:e})}}authorizeWithBackoff(){if(!this.consequentAuthErrors)return this.doAuthorize();let e=fI(this.consequentAuthErrors);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(async()=>{try{let i=await this.doAuthorize();t(i)}catch(i){this.params.error$.next({id:"AuthorizeBackoff",category:Oe.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})}finally{this.backoffTimeoutId=0}},e))})}doAuthorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:L.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,yo.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:Oe.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this.authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:Oe.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:Oe.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var gd=w(de(),1);var md=w(Se(),1);import{now as Io,ErrorCategory as Zr}from"@vkontakte/videoplayer-shared/es2018";var et=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=bo[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this.prepareQueryParams({method:e,queryParams:t,sessionKey:i}),n=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,n)}catch(s){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:Zr.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i,o){let n=Io(),s=u=>{if(u instanceof TypeError&&(0,gd.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:Zr.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"ThinOneStat:ApiTransport:sendRequest",category:Zr.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:t,sessionKey:i,time:Io()-n}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ee(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded",...o},body:this.prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(u=>{var h,c;let d=Number(u.headers.get("content-length"))===0,l=new Date((h=u.headers.get("date"))!=null?h:"").getTime(),f=Io()-n;if(isFinite(l)&&((c=this.timeSynchronisation)==null||c.addServerTime(l,f)),!d)return u.json().then(p=>Object.prototype.hasOwnProperty.call(p,"error_msg")?Promise.reject(p):p,s)},s)}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await Ee(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),n=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!n)throw new Error("Wrong DNS response");return n}catch(t){return this.params.error$.next({id:"ThinOneStat:ApiTransport:resolveApiBaseUrl",category:Zr.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),bo.vk_alias}finally{this.isApiBaseUrlFetched=!0}}prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,md.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var yd=w(de(),1),Id=w(Se(),1);import{ErrorCategory as hI,now as vI,safeStorage as or,debounceFn as bd}from"@vkontakte/videoplayer-shared/es2018";var rt="thinonestat_events",So=r=>e=>e.client_time+r>=vI(),tt=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{event_name:t}=e;return(0,yd.default)(["watch_coverage","watch_coverage_live","watched_n","playback_started"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=bd(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=or.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=bd(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){try{this.flush()}catch(e){this.error$.next({id:"LoggerError",category:hI.WTF,message:String(e)||"Unknown logger error",thrown:e})}}readFromStorage(){let e=or.get(rt);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var n;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((n=t[this.userSalt])!=null?n:[]).filter(So(this.params.config.storageExpiration));or.set(rt,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(So(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],or.set(rt,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,Id.default)(e)){let o=i.filter(So(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}or.set(rt,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};function _o(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}var it=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};import{PlaybackState as Sd}from"@vkontakte/videoplayer-core/es2018";import{Observable as gI,Subscription as mI,ValueSubject as bI,Subject as Po,fromEvent as yI,isNullable as _d,merge as Eo,filter as Pd,filterChanged as Ed}from"@vkontakte/videoplayer-shared/es2018";var Td=(r,e)=>new gI(t=>{let i=new mI,o=new bI(void 0),n;i.add(r.info.isLive$.pipe(Ed()).subscribe(T=>{n&&(n.unsubscribe(),o.next(void 0)),T?n=r.info.liveTime$.pipe(Ed()).subscribe(o):n=r.info.position$.subscribe(o),i.add(n)}));let{playing$:s,paused$:u,ended$:d,looped$:l}=r.events,f=r.events.willSeek$.pipe(Pd(()=>r.info.playbackState$.getValue()===Sd.PLAYING)),h=r.events.seeked$.pipe(Pd(()=>r.info.playbackState$.getValue()===Sd.PLAYING)),c=!1,p=new Po;i.add(f.subscribe(()=>{c||p.next(),c=!0})).add(h.subscribe(()=>c=!1));let v=Eo(yI(window,"beforeunload"),r.events.willDestruct$),g,b=()=>g=o.getValue(),m=()=>{let T=o.getValue();_d(g)||_d(T)||g===T||(t.next({from:g,to:T}),g=void 0)},y=new Po,E=new Po,k=Eo(s,p,y),I=Eo(u,h,v,d,l,E);if(i.add(k.subscribe(b)).add(I.subscribe(m)),e.heartbeatInterval&&isFinite(e.heartbeatInterval)){let T=[],nr=e.heartbeatInterval*1e3,ar=()=>{E.next(),y.next()};i.add(k.subscribe(()=>{let at=window.setTimeout(ar,nr);T.push(at)})).add(I.subscribe(()=>{T.forEach(at=>{window.clearTimeout(at)}),T=[]}))}return i});import{Subscription as II}from"@vkontakte/videoplayer-core/es2018";import{Observable as SI}from"@vkontakte/videoplayer-shared/es2018";var wd=(r,e)=>new SI(t=>{let i=new II,o=1e4,n=0;return i.add(r.info.position$.subscribe(()=>{let s=e.getTotalViewTime()*1e3;s>n&&s%o===0&&(n=s,t.next({target_duration:o,current_tvt:s}))})),i});import{Observable as _I,Subscription as PI,merge as Od}from"@vkontakte/videoplayer-shared/es2018";var Ad=r=>new _I(e=>{let t=new PI,i=0,o=1,n=0,s=!1,u=!1,d=()=>{if(!s)return;let I=Date.now();n+=(I-i)*o,i=I},l=()=>{(!s||u)&&(i=Date.now(),s=!0,u=!1)},f=()=>{s&&(d(),s=!1)},h=()=>{s&&(d(),s=!1,u=!0)},c=I=>{s&&d(),o=I,i=Date.now()},{started$:p,playing$:v,paused$:g,willSeek$:b,ended$:m,willDestruct$:y}=r.events,{currentPlaybackRate$:E}=r.info;t.add(b.subscribe(h)).add(Od(p,v).subscribe(l)).add(Od(g,m,y).subscribe(f)).add(E.subscribe(c));let k=()=>{let I=n;return s&&(I+=(Date.now()-i)*o),Math.floor(I/1e3)};return e.next(k),t});import{assertNever as qd}from"@vkontakte/videoplayer-shared/es2018";import{Surface as Ae,VideoFormat as P,VideoQuality as U}from"@vkontakte/videoplayer-core/es2018";var To=r=>{if(r!==void 0)switch(r){case P.MPEG:return"MP4";case P.DASH:case P.DASH_LIVE:return"DASH";case P.DASH_SEP:return"DASH_SEP";case P.DASH_ONDEMAND:return"ONDEMAND_DASH";case P.HLS_ONDEMAND:return"ONDEMAND_HLS";case P.HLS:case P.HLS_LIVE:return"HLS";case P.DASH_WEBM:case P.DASH_LIVE_WEBM:return"WEBM";case P.DASH_LIVE_CMAF:return"ONDEMAND_DASH_LIVE";case P.HLS_LIVE_CMAF:return"ONDEMAND_HLS_LIVE";case P.WEB_RTC_LIVE:return"WEBRTC";case P.DASH_WEBM_AV1:return"AV1";case P.DASH_STREAMS:return"MULTI_DASH";default:return qd(r)}},Y=r=>{if(r!==void 0)switch(r){case U.Q_144P:return"144p";case U.Q_240P:return"240p";case U.Q_360P:return"360p";case U.Q_480P:return"480p";case U.Q_720P:return"720p";case U.Q_1080P:return"1080p";case U.Q_1440P:return"1440p";case U.Q_2160P:return"2160p";case U.INVARIANT:case U.Q_576P:case U.Q_4320P:return"UNKNOWN";default:return qd(r)}},xd=r=>{if(r!==void 0)switch(r){case"MP4":case"ONDEMAND_DASH":case"ONDEMAND_DASH_LIVE":case"ONDEMAND_HLS":case"ONDEMAND_HLS_LIVE":case"MULTI_DASH":case"WEBM":case"AV1":return"vod";case"DASH":case"HLS":case"WEBRTC":return"live";default:return}},Rd=(r,e,t)=>{var i;if(r&&e)switch(r){case P.MPEG:return t&&e[r]&&e[r][t];default:return(i=e[r])==null?void 0:i.url}},Cd=r=>{if(r!==void 0)switch(r){case Ae.NONE:return;case Ae.INLINE:return"inline";case Ae.FULLSCREEN:return"fullscreen";case Ae.SECOND_SCREEN:return"chromecast";case Ae.PIP:return"pip_external"}},Nd=r=>{if(r!==void 0)return r===Ae.INVISIBLE?"background":"foreground"};var wo=w(co(),1),Ld=()=>(0,wo.default)(Math.floor(Math.random()*2**32).toString(36),13,"0"),kd=()=>(0,wo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var qI="_thin-one-stat_",Vd=`${qI}deviceId`,xI=()=>{let r=new Oo;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},nt=class{constructor(e,t){this.debugLogger=new OI;this.thinOneStatDebugLog=this.debugLogger.createComponentLog("ThinOneStat");this.eventNumber=1;this.seekAction$=new ot("unknown");this.playerSize$=new ot({width:0,height:0});this.vsid$=new ot(void 0);this.isid$=new ot(void 0);var d,l;this.statContext=e,this.config=vd((d=t.config)!=null?d:{}),this.subscription=new Oo,this.config.synchronizeTime&&(this.timeSynchronisation=new it);let i=new AI,o=$d.get(Vd);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=_o(),$d.set(Vd,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:kd());let n=new et({error$:i,config:this.config,timeSynchronisation:this.timeSynchronisation});this.api=new Xr({config:this.config,apiTransport:n,error$:i,deviceId:this.deviceId,refreshAuthToken:t.refreshAuthToken}),this.logger=new tt({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:s,topOrigin:u}=TI();this.isEmbed=s,this.embedHostname=u?new URL(u).hostname:void 0}authorize(e){return this.api.authorize(e)}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new Oo,i=(n,s)=>t.add(n.subscribe(s));i(Ad(e),n=>{this.getTotalViewTime=n}),i(e.info.isLive$,n=>this.isLive=n),i(e.info.position$,n=>this.position=n);let o;return i(e.info.hostname$,n=>{o!==void 0&&o!==n&&this.logFailover({cdn_host:n}),this.cdnHostname=o=n}),i(Td(e,{heartbeatInterval:this.config.watchCoverageHeartbeatInterval}),n=>{let s=Math.round(n.from*1e3),u=Math.round(n.to*1e3),d={watch_interval:`${s}-${u}`,in_history:!!this.statContext.inHistory,content_type:To(e.info.currentFormat$.getValue()),playback_quality:Y(e.info.currentQuality$.getValue()),recom_info:this.statContext.recomInfo};if(!e.info.isLive$.getValue())this.logWatchCoverage(d);else{let f=e.info.atLiveEdge$.getValue();this.logWatchCoverageLive({...d,live:!!f})}}),i(wd(e,{getTotalViewTime:this.getTotalViewTime}),n=>{this.logWatchedN(n)}),i(Dd(e.events.willStart$,e.events.looped$),n=>{var u;n&&this.resetViewSession();let s={isid:this.isid$.getValue(),stream_profile:xd(To(e.info.currentFormat$.getValue())),dpi:ne.display.pixelRatio,web_layout:ne.device.isMobile?"mobile":"desktop",iframe_host:this.isEmbed?(u=this.embedHostname)!=null?u:void 0:null,from_downloads:!0,preloaded:this.statContext.preload,navigation:this.statContext.navigation,recom_info:this.statContext.recomInfo};this.logStartSession(s)}),i(e.events.willReady$,()=>{if(this.statContext.preload){let n=e.info.currentFormat$.getValue(),s=e.info.availableSources$.getValue(),u=e.info.currentBuffer$.getValue(),d=e.info.currentQuality$.getValue(),l={target_buffer_time:u?u.end-u.start:void 0,playback_url:Rd(n,s,d),playback_quality:Y(d)};this.logPreloadStarted(l)}}),i(e.events.ready$,()=>{if(this.statContext.preload){let n=e.info.currentBuffer$.getValue(),s={buffer_time:n?n.end-n.start:void 0};this.logPreloadEnded(s)}}),i(e.events.playing$,()=>{this.logPlay()}),i(e.info.playbackState$,n=>{var s;if(n===Md.PLAYING){let u=e.info.currentBuffer$.getValue(),d={buffer_time:u?u.end-u.start:void 0};if(this.logPlaying(d),this.isStarted)this.logResume();else{this.isStarted=!0;let l=e.info.currentQuality$.getValue(),f=e.info.isAutoQualityEnabled$.getValue(),h=e.info.muted$.getValue(),c=e.info.volume$.getValue(),p=e.info.surface$.getValue(),v=e.info.availableTextTracks$.getValue(),g=e.info.currentTextTrack$.getValue(),b=e.info.currentAudioStream$.getValue(),m=e.info.currentPlaybackRate$.getValue(),y={playback_quality:Y(l),user_quality:f?"auto":Y(l),player_width:this.playerSize$.getValue().width,player_height:this.playerSize$.getValue().height,muted:h,sound_volume:c,buffer_time:u?Math.round(u.end-u.start):void 0,mode:Cd(p),visibility:Nd(p),subtitles_enabled:!!g,auto_subtitles:!!((s=v.find(({id:E})=>E===g))!=null&&s.isAuto),audio_track_lang:b==null?void 0:b.language,playback_rate:m,recom_info:this.statContext.recomInfo};this.logPlaybackStarted(y)}}else n===Md.PAUSED&&this.logPause()}),i(e.events.willSeek$,({to:n})=>{let s={target_position:n,seek_type:this.seekAction$.getValue()};this.logSeeking(s)}),i(e.events.seeked$,()=>{let s={target_position:e.info.position$.getValue(),seek_type:this.seekAction$.getValue()};this.logSeeked(s),this.seekAction$.next("unknown")}),i(Dd(e.info.isBuffering$,e.info.isStalled$),n=>{n&&this.logShowLoader()}),i(e.info.currentQuality$,n=>{var s,u;if(n){let d=e.info.isAutoQualityEnabled$.getValue(),l=(s=e.info.currentVideoStream$.getValue())==null?void 0:s.codec,f=(u=e.info.currentAudioStream$.getValue())==null?void 0:u.codec,h={user_quality:d?"auto":Y(n),playback_quality:Y(n),download_quality:Y(n),codec_info:l&&f?`${l},${f}`:void 0,manual_switch:!d};this.logQualityChanged(h)}}),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){let{subscribe:t,subscription:i}=xI();return t(e.actionSeek$,this.seekAction$),t(e.playerSize$,this.playerSize$),this.subscription.add(i),i}getDeviceId(){return this.deviceId}resetViewSession(){this.thinOneStatDebugLog({message:"VSID reset"}),this.vsid$.next(Ld()),this.eventNumber=0}destroy(){this.api.destroy()}createRequiredParams(e){let t=this.vsid$.getValue();EI(t);let i=this.eventNumber++;return{vsid:t,uv_movie_id:this.statContext.movieId,event_name:e,client_time:Date.now(),application:`@vkontakte/videoplayer-statistics:${L}`,platform:`web:${ne.device.isMobile?"mobile":"desktop"}`,product:this.statContext.product,event_number:i,playback_position:this.isLive?void 0:Math.round(this.position),current_tvt:this.getTotalViewTime(),cdn_host:this.cdnHostname}}createRequiredFatParams(){return{stats_version:L,browser:ne.browser.current,browser_version:String(ne.browser.currentVersion),os:ne.device.current,os_version:"",device_type:ne.device.isMobile?"mobile":"desktop",navigation:this.statContext.navigation}}log(e,t,i=!1){let o=this.createRequiredParams(e),n={};i&&(n=this.createRequiredFatParams()),this.logger.log({...o,...n,...t})}logWatchCoverage(e){this.log("watch_coverage",e,!0)}logWatchCoverageLive(e){this.log("watch_coverage_live",e,!0)}logWatchedN(e){this.log("watched_n",e,!0)}logStartSession(e){this.log("start_session",e,!0)}logPreloadStarted(e){this.log("preload_started",e)}logPreloadEnded(e){this.log("preload_ended",e)}logPlaybackStarted(e){this.log("playback_started",e,!0)}logPlay(){this.log("play")}logPlaying(e){this.log("playing",e)}logPause(){this.log("pause")}logResume(){this.log("resume")}logSeeking(e){this.log("seeking",e)}logSeeked(e){this.log("seeked",e)}logShowLoader(){this.log("show_loader")}logQualityChanged(e){this.log("quality_changed",e)}logFailover(e){this.log("failover",e)}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=wI(window,"beforeunload").subscribe(()=>{}),this.subscription.add(this.beforeunloadSubscription)}};export{Fe as ApiEnv,Wt as ConnectionType,jt as ContentType,_a as InteractiveInterfaceClick,mo as OneStat,Bt as Quality,Ht as SeekAction,Ao as ThinOneStat,L as VERSION};
|
|
6
|
+
var Xd=Object.create;var ur=Object.defineProperty;var Zd=Object.getOwnPropertyDescriptor;var ef=Object.getOwnPropertyNames;var tf=Object.getPrototypeOf,rf=Object.prototype.hasOwnProperty;var a=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),of=(t,e)=>{for(var r in e)ur(t,r,{get:e[r],enumerable:!0})},nf=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ef(e))!rf.call(t,o)&&o!==r&&ur(t,o,{get:()=>e[o],enumerable:!(i=Zd(e,o))||i.enumerable});return t};var w=(t,e,r)=>(r=t!=null?Xd(tf(t)):{},nf(e||!t||!t.__esModule?ur(r,"default",{value:t,enumerable:!0}):r,t));var S=a((cr,Ro)=>{"use strict";var Re=function(t){return t&&t.Math===Math&&t};Ro.exports=Re(typeof globalThis=="object"&&globalThis)||Re(typeof window=="object"&&window)||Re(typeof self=="object"&&self)||Re(typeof global=="object"&&global)||Re(typeof cr=="object"&&cr)||function(){return this}()||Function("return this")()});var O=a((zI,Co)=>{"use strict";Co.exports=function(t){try{return!!t()}catch(e){return!0}}});var Ce=a((QI,Lo)=>{"use strict";var af=O();Lo.exports=!af(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")})});var lr=a((YI,$o)=>{"use strict";var sf=Ce(),Do=Function.prototype,ko=Do.apply,No=Do.call;$o.exports=typeof Reflect=="object"&&Reflect.apply||(sf?No.bind(ko):function(){return No.apply(ko,arguments)})});var x=a((JI,Fo)=>{"use strict";var Mo=Ce(),Vo=Function.prototype,dr=Vo.call,uf=Mo&&Vo.bind.bind(dr,dr);Fo.exports=Mo?uf:function(t){return function(){return dr.apply(t,arguments)}}});var Le=a((XI,Bo)=>{"use strict";var Uo=x(),cf=Uo({}.toString),lf=Uo("".slice);Bo.exports=function(t){return lf(cf(t),8,-1)}});var fr=a((ZI,jo)=>{"use strict";var df=Le(),ff=x();jo.exports=function(t){if(df(t)==="Function")return ff(t)}});var _=a((eS,Wo)=>{"use strict";var pr=typeof document=="object"&&document.all;Wo.exports=typeof pr=="undefined"&&pr!==void 0?function(t){return typeof t=="function"||t===pr}:function(t){return typeof t=="function"}});var q=a((tS,Ho)=>{"use strict";var pf=O();Ho.exports=!pf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var D=a((rS,Ko)=>{"use strict";var hf=Ce(),st=Function.prototype.call;Ko.exports=hf?st.bind(st):function(){return st.apply(st,arguments)}});var hr=a(Qo=>{"use strict";var Go={}.propertyIsEnumerable,zo=Object.getOwnPropertyDescriptor,vf=zo&&!Go.call({1:2},1);Qo.f=vf?function(e){var r=zo(this,e);return!!r&&r.enumerable}:Go});var ke=a((oS,Yo)=>{"use strict";Yo.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var Xo=a((nS,Jo)=>{"use strict";var gf=x(),mf=O(),bf=Le(),vr=Object,yf=gf("".split);Jo.exports=mf(function(){return!vr("z").propertyIsEnumerable(0)})?function(t){return bf(t)==="String"?yf(t,""):vr(t)}:vr});var Ne=a((aS,Zo)=>{"use strict";Zo.exports=function(t){return t==null}});var se=a((sS,en)=>{"use strict";var If=Ne(),Sf=TypeError;en.exports=function(t){if(If(t))throw new Sf("Can't call method on "+t);return t}});var J=a((uS,tn)=>{"use strict";var _f=Xo(),Pf=se();tn.exports=function(t){return _f(Pf(t))}});var $=a((cS,rn)=>{"use strict";var Ef=_();rn.exports=function(t){return typeof t=="object"?t!==null:Ef(t)}});var ue=a((lS,on)=>{"use strict";on.exports={}});var W=a((dS,an)=>{"use strict";var gr=ue(),mr=S(),Tf=_(),nn=function(t){return Tf(t)?t:void 0};an.exports=function(t,e){return arguments.length<2?nn(gr[t])||nn(mr[t]):gr[t]&&gr[t][e]||mr[t]&&mr[t][e]}});var ut=a((fS,sn)=>{"use strict";var wf=x();sn.exports=wf({}.isPrototypeOf)});var X=a((pS,ln)=>{"use strict";var Of=S(),un=Of.navigator,cn=un&&un.userAgent;ln.exports=cn?String(cn):""});var yr=a((hS,gn)=>{"use strict";var vn=S(),br=X(),dn=vn.process,fn=vn.Deno,pn=dn&&dn.versions||fn&&fn.version,hn=pn&&pn.v8,M,ct;hn&&(M=hn.split("."),ct=M[0]>0&&M[0]<4?1:+(M[0]+M[1]));!ct&&br&&(M=br.match(/Edge\/(\d+)/),(!M||M[1]>=74)&&(M=br.match(/Chrome\/(\d+)/),M&&(ct=+M[1])));gn.exports=ct});var Ir=a((vS,bn)=>{"use strict";var mn=yr(),Af=O(),xf=S(),qf=xf.String;bn.exports=!!Object.getOwnPropertySymbols&&!Af(function(){var t=Symbol("symbol detection");return!qf(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&mn&&mn<41})});var Sr=a((gS,yn)=>{"use strict";var Rf=Ir();yn.exports=Rf&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var _r=a((mS,In)=>{"use strict";var Cf=W(),Lf=_(),kf=ut(),Nf=Sr(),Df=Object;In.exports=Nf?function(t){return typeof t=="symbol"}:function(t){var e=Cf("Symbol");return Lf(e)&&kf(e.prototype,Df(t))}});var De=a((bS,Sn)=>{"use strict";var $f=String;Sn.exports=function(t){try{return $f(t)}catch(e){return"Object"}}});var H=a((yS,_n)=>{"use strict";var Mf=_(),Vf=De(),Ff=TypeError;_n.exports=function(t){if(Mf(t))return t;throw new Ff(Vf(t)+" is not a function")}});var lt=a((IS,Pn)=>{"use strict";var Uf=H(),Bf=Ne();Pn.exports=function(t,e){var r=t[e];return Bf(r)?void 0:Uf(r)}});var Tn=a((SS,En)=>{"use strict";var Pr=D(),Er=_(),Tr=$(),jf=TypeError;En.exports=function(t,e){var r,i;if(e==="string"&&Er(r=t.toString)&&!Tr(i=Pr(r,t))||Er(r=t.valueOf)&&!Tr(i=Pr(r,t))||e!=="string"&&Er(r=t.toString)&&!Tr(i=Pr(r,t)))return i;throw new jf("Can't convert object to primitive value")}});var B=a((_S,wn)=>{"use strict";wn.exports=!0});var xn=a((PS,An)=>{"use strict";var On=S(),Wf=Object.defineProperty;An.exports=function(t,e){try{Wf(On,t,{value:e,configurable:!0,writable:!0})}catch(r){On[t]=e}return e}});var $e=a((ES,Cn)=>{"use strict";var Hf=B(),Kf=S(),Gf=xn(),qn="__core-js_shared__",Rn=Cn.exports=Kf[qn]||Gf(qn,{});(Rn.versions||(Rn.versions=[])).push({version:"3.43.0",mode:Hf?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var wr=a((TS,kn)=>{"use strict";var Ln=$e();kn.exports=function(t,e){return Ln[t]||(Ln[t]=e||{})}});var Or=a((wS,Nn)=>{"use strict";var zf=se(),Qf=Object;Nn.exports=function(t){return Qf(zf(t))}});var j=a((OS,Dn)=>{"use strict";var Yf=x(),Jf=Or(),Xf=Yf({}.hasOwnProperty);Dn.exports=Object.hasOwn||function(e,r){return Xf(Jf(e),r)}});var Ar=a((AS,$n)=>{"use strict";var Zf=x(),ep=0,tp=Math.random(),rp=Zf(1.1.toString);$n.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+rp(++ep+tp,36)}});var R=a((xS,Vn)=>{"use strict";var ip=S(),op=wr(),Mn=j(),np=Ar(),ap=Ir(),sp=Sr(),ce=ip.Symbol,xr=op("wks"),up=sp?ce.for||ce:ce&&ce.withoutSetter||np;Vn.exports=function(t){return Mn(xr,t)||(xr[t]=ap&&Mn(ce,t)?ce[t]:up("Symbol."+t)),xr[t]}});var jn=a((qS,Bn)=>{"use strict";var cp=D(),Fn=$(),Un=_r(),lp=lt(),dp=Tn(),fp=R(),pp=TypeError,hp=fp("toPrimitive");Bn.exports=function(t,e){if(!Fn(t)||Un(t))return t;var r=lp(t,hp),i;if(r){if(e===void 0&&(e="default"),i=cp(r,t,e),!Fn(i)||Un(i))return i;throw new pp("Can't convert object to primitive value")}return e===void 0&&(e="number"),dp(t,e)}});var qr=a((RS,Wn)=>{"use strict";var vp=jn(),gp=_r();Wn.exports=function(t){var e=vp(t,"string");return gp(e)?e:e+""}});var dt=a((CS,Kn)=>{"use strict";var mp=S(),Hn=$(),Rr=mp.document,bp=Hn(Rr)&&Hn(Rr.createElement);Kn.exports=function(t){return bp?Rr.createElement(t):{}}});var Cr=a((LS,Gn)=>{"use strict";var yp=q(),Ip=O(),Sp=dt();Gn.exports=!yp&&!Ip(function(){return Object.defineProperty(Sp("div"),"a",{get:function(){return 7}}).a!==7})});var Yn=a(Qn=>{"use strict";var _p=q(),Pp=D(),Ep=hr(),Tp=ke(),wp=J(),Op=qr(),Ap=j(),xp=Cr(),zn=Object.getOwnPropertyDescriptor;Qn.f=_p?zn:function(e,r){if(e=wp(e),r=Op(r),xp)try{return zn(e,r)}catch(i){}if(Ap(e,r))return Tp(!Pp(Ep.f,e,r),e[r])}});var Lr=a((NS,Jn)=>{"use strict";var qp=O(),Rp=_(),Cp=/#|\.prototype\./,Me=function(t,e){var r=kp[Lp(t)];return r===Dp?!0:r===Np?!1:Rp(e)?qp(e):!!e},Lp=Me.normalize=function(t){return String(t).replace(Cp,".").toLowerCase()},kp=Me.data={},Np=Me.NATIVE="N",Dp=Me.POLYFILL="P";Jn.exports=Me});var Ve=a((DS,Zn)=>{"use strict";var Xn=fr(),$p=H(),Mp=Ce(),Vp=Xn(Xn.bind);Zn.exports=function(t,e){return $p(t),e===void 0?t:Mp?Vp(t,e):function(){return t.apply(e,arguments)}}});var kr=a(($S,ea)=>{"use strict";var Fp=q(),Up=O();ea.exports=Fp&&Up(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var K=a((MS,ta)=>{"use strict";var Bp=$(),jp=String,Wp=TypeError;ta.exports=function(t){if(Bp(t))return t;throw new Wp(jp(t)+" is not an object")}});var Z=a(ia=>{"use strict";var Hp=q(),Kp=Cr(),Gp=kr(),ft=K(),ra=qr(),zp=TypeError,Nr=Object.defineProperty,Qp=Object.getOwnPropertyDescriptor,Dr="enumerable",$r="configurable",Mr="writable";ia.f=Hp?Gp?function(e,r,i){if(ft(e),r=ra(r),ft(i),typeof e=="function"&&r==="prototype"&&"value"in i&&Mr in i&&!i[Mr]){var o=Qp(e,r);o&&o[Mr]&&(e[r]=i.value,i={configurable:$r in i?i[$r]:o[$r],enumerable:Dr in i?i[Dr]:o[Dr],writable:!1})}return Nr(e,r,i)}:Nr:function(e,r,i){if(ft(e),r=ra(r),ft(i),Kp)try{return Nr(e,r,i)}catch(o){}if("get"in i||"set"in i)throw new zp("Accessors not supported");return"value"in i&&(e[r]=i.value),e}});var le=a((FS,oa)=>{"use strict";var Yp=q(),Jp=Z(),Xp=ke();oa.exports=Yp?function(t,e,r){return Jp.f(t,e,Xp(1,r))}:function(t,e,r){return t[e]=r,t}});var C=a((US,aa)=>{"use strict";var Fe=S(),Zp=lr(),eh=fr(),th=_(),rh=Yn().f,ih=Lr(),de=ue(),oh=Ve(),fe=le(),na=j();$e();var nh=function(t){var e=function(r,i,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,i)}return new t(r,i,o)}return Zp(t,this,arguments)};return e.prototype=t.prototype,e};aa.exports=function(t,e){var r=t.target,i=t.global,o=t.stat,n=t.proto,s=i?Fe:o?Fe[r]:Fe[r]&&Fe[r].prototype,u=i?de:de[r]||fe(de,r,{})[r],d=u.prototype,l,p,h,c,f,v,g,b,m;for(c in e)l=ih(i?c:r+(o?".":"#")+c,t.forced),p=!l&&s&&na(s,c),v=u[c],p&&(t.dontCallGetSet?(m=rh(s,c),g=m&&m.value):g=s[c]),f=p&&g?g:e[c],!(!l&&!n&&typeof v==typeof f)&&(t.bind&&p?b=oh(f,Fe):t.wrap&&p?b=nh(f):n&&th(f)?b=eh(f):b=f,(t.sham||f&&f.sham||v&&v.sham)&&fe(b,"sham",!0),fe(u,c,b),n&&(h=r+"Prototype",na(de,h)||fe(de,h,{}),fe(de[h],c,f),t.real&&d&&(l||!d[c])&&fe(d,c,f)))}});var ua=a((BS,sa)=>{"use strict";var ah=Math.ceil,sh=Math.floor;sa.exports=Math.trunc||function(e){var r=+e;return(r>0?sh:ah)(r)}});var pt=a((jS,ca)=>{"use strict";var uh=ua();ca.exports=function(t){var e=+t;return e!==e||e===0?0:uh(e)}});var da=a((WS,la)=>{"use strict";var ch=pt(),lh=Math.max,dh=Math.min;la.exports=function(t,e){var r=ch(t);return r<0?lh(r+e,0):dh(r,e)}});var Vr=a((HS,fa)=>{"use strict";var fh=pt(),ph=Math.min;fa.exports=function(t){var e=fh(t);return e>0?ph(e,9007199254740991):0}});var Fr=a((KS,pa)=>{"use strict";var hh=Vr();pa.exports=function(t){return hh(t.length)}});var Ur=a((GS,va)=>{"use strict";var vh=J(),gh=da(),mh=Fr(),ha=function(t){return function(e,r,i){var o=vh(e),n=mh(o);if(n===0)return!t&&-1;var s=gh(i,n),u;if(t&&r!==r){for(;n>s;)if(u=o[s++],u!==u)return!0}else for(;n>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}};va.exports={includes:ha(!0),indexOf:ha(!1)}});var Br=a((zS,ga)=>{"use strict";ga.exports=function(){}});var ma=a(()=>{"use strict";var bh=C(),yh=Ur().includes,Ih=O(),Sh=Br(),_h=Ih(function(){return!Array(1).includes()});bh({target:"Array",proto:!0,forced:_h},{includes:function(e){return yh(this,e,arguments.length>1?arguments[1]:void 0)}});Sh("includes")});var ht=a((JS,ba)=>{"use strict";var Ph=W();ba.exports=Ph});var Ia=a((XS,ya)=>{"use strict";ma();var Eh=ht();ya.exports=Eh("Array","includes")});var _a=a((ZS,Sa)=>{"use strict";var Th=Ia();Sa.exports=Th});var pe=a((e_,Pa)=>{"use strict";var wh=_a();Pa.exports=wh});var Ra=a(()=>{"use strict"});var Qr=a((p_,Ca)=>{"use strict";var Be=S(),xh=X(),qh=Le(),vt=function(t){return xh.slice(0,t.length)===t};Ca.exports=function(){return vt("Bun/")?"BUN":vt("Cloudflare-Workers")?"CLOUDFLARE":vt("Deno/")?"DENO":vt("Node.js/")?"NODE":Be.Bun&&typeof Bun.version=="string"?"BUN":Be.Deno&&typeof Deno.version=="object"?"DENO":qh(Be.process)==="process"?"NODE":Be.window&&Be.document?"BROWSER":"REST"}()});var gt=a((h_,La)=>{"use strict";var Rh=Qr();La.exports=Rh==="NODE"});var he=a((v_,ka)=>{"use strict";var Ch=le();ka.exports=function(t,e,r,i){return i&&i.enumerable?t[e]=r:Ch(t,e,r),t}});var Da=a((g_,Na)=>{"use strict";var Lh=x(),kh=H();Na.exports=function(t,e,r){try{return Lh(kh(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(i){}}});var Ma=a((m_,$a)=>{"use strict";var Nh=$();$a.exports=function(t){return Nh(t)||t===null}});var Fa=a((b_,Va)=>{"use strict";var Dh=Ma(),$h=String,Mh=TypeError;Va.exports=function(t){if(Dh(t))return t;throw new Mh("Can't set "+$h(t)+" as a prototype")}});var Yr=a((y_,Ua)=>{"use strict";var Vh=Da(),Fh=$(),Uh=se(),Bh=Fa();Ua.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=Vh(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch(i){}return function(o,n){return Uh(o),Bh(n),Fh(o)&&(t?r(o,n):o.__proto__=n),o}}():void 0)});var mt=a((I_,ja)=>{"use strict";var jh=R(),Wh=jh("toStringTag"),Ba={};Ba[Wh]="z";ja.exports=String(Ba)==="[object z]"});var je=a((S_,Wa)=>{"use strict";var Hh=mt(),Kh=_(),bt=Le(),Gh=R(),zh=Gh("toStringTag"),Qh=Object,Yh=bt(function(){return arguments}())==="Arguments",Jh=function(t,e){try{return t[e]}catch(r){}};Wa.exports=Hh?bt:function(t){var e,r,i;return t===void 0?"Undefined":t===null?"Null":typeof(r=Jh(e=Qh(t),zh))=="string"?r:Yh?bt(e):(i=bt(e))==="Object"&&Kh(e.callee)?"Arguments":i}});var Ka=a((__,Ha)=>{"use strict";var Xh=mt(),Zh=je();Ha.exports=Xh?{}.toString:function(){return"[object "+Zh(this)+"]"}});var We=a((P_,za)=>{"use strict";var ev=mt(),tv=Z().f,rv=le(),iv=j(),ov=Ka(),nv=R(),Ga=nv("toStringTag");za.exports=function(t,e,r,i){var o=r?t:t&&t.prototype;o&&(iv(o,Ga)||tv(o,Ga,{configurable:!0,value:e}),i&&!ev&&rv(o,"toString",ov))}});var Ya=a((E_,Qa)=>{"use strict";var av=Z();Qa.exports=function(t,e,r){return av.f(t,e,r)}});var Za=a((T_,Xa)=>{"use strict";var sv=W(),uv=Ya(),cv=R(),lv=q(),Ja=cv("species");Xa.exports=function(t){var e=sv(t);lv&&e&&!e[Ja]&&uv(e,Ja,{configurable:!0,get:function(){return this}})}});var ts=a((w_,es)=>{"use strict";var dv=ut(),fv=TypeError;es.exports=function(t,e){if(dv(e,t))return t;throw new fv("Incorrect invocation")}});var Xr=a((O_,rs)=>{"use strict";var pv=x(),hv=_(),Jr=$e(),vv=pv(Function.toString);hv(Jr.inspectSource)||(Jr.inspectSource=function(t){return vv(t)});rs.exports=Jr.inspectSource});var us=a((A_,ss)=>{"use strict";var gv=x(),mv=O(),is=_(),bv=je(),yv=W(),Iv=Xr(),os=function(){},ns=yv("Reflect","construct"),Zr=/^\s*(?:class|function)\b/,Sv=gv(Zr.exec),_v=!Zr.test(os),He=function(e){if(!is(e))return!1;try{return ns(os,[],e),!0}catch(r){return!1}},as=function(e){if(!is(e))return!1;switch(bv(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _v||!!Sv(Zr,Iv(e))}catch(r){return!0}};as.sham=!0;ss.exports=!ns||mv(function(){var t;return He(He.call)||!He(Object)||!He(function(){t=!0})||t})?as:He});var ls=a((x_,cs)=>{"use strict";var Pv=us(),Ev=De(),Tv=TypeError;cs.exports=function(t){if(Pv(t))return t;throw new Tv(Ev(t)+" is not a constructor")}});var ei=a((q_,fs)=>{"use strict";var ds=K(),wv=ls(),Ov=Ne(),Av=R(),xv=Av("species");fs.exports=function(t,e){var r=ds(t).constructor,i;return r===void 0||Ov(i=ds(r)[xv])?e:wv(i)}});var ti=a((R_,ps)=>{"use strict";var qv=W();ps.exports=qv("document","documentElement")});var vs=a((C_,hs)=>{"use strict";var Rv=x();hs.exports=Rv([].slice)});var ms=a((L_,gs)=>{"use strict";var Cv=TypeError;gs.exports=function(t,e){if(t<e)throw new Cv("Not enough arguments");return t}});var ri=a((k_,bs)=>{"use strict";var Lv=X();bs.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(Lv)});var di=a((N_,Os)=>{"use strict";var L=S(),kv=lr(),Nv=Ve(),ys=_(),Dv=j(),ws=O(),Is=ti(),$v=vs(),Ss=dt(),Mv=ms(),Vv=ri(),Fv=gt(),ui=L.setImmediate,ci=L.clearImmediate,Uv=L.process,ii=L.Dispatch,Bv=L.Function,_s=L.MessageChannel,jv=L.String,oi=0,Ke={},Ps="onreadystatechange",Ge,ee,ni,ai;ws(function(){Ge=L.location});var li=function(t){if(Dv(Ke,t)){var e=Ke[t];delete Ke[t],e()}},si=function(t){return function(){li(t)}},Es=function(t){li(t.data)},Ts=function(t){L.postMessage(jv(t),Ge.protocol+"//"+Ge.host)};(!ui||!ci)&&(ui=function(e){Mv(arguments.length,1);var r=ys(e)?e:Bv(e),i=$v(arguments,1);return Ke[++oi]=function(){kv(r,void 0,i)},ee(oi),oi},ci=function(e){delete Ke[e]},Fv?ee=function(t){Uv.nextTick(si(t))}:ii&&ii.now?ee=function(t){ii.now(si(t))}:_s&&!Vv?(ni=new _s,ai=ni.port2,ni.port1.onmessage=Es,ee=Nv(ai.postMessage,ai)):L.addEventListener&&ys(L.postMessage)&&!L.importScripts&&Ge&&Ge.protocol!=="file:"&&!ws(Ts)?(ee=Ts,L.addEventListener("message",Es,!1)):Ps in Ss("script")?ee=function(t){Is.appendChild(Ss("script"))[Ps]=function(){Is.removeChild(this),li(t)}}:ee=function(t){setTimeout(si(t),0)});Os.exports={set:ui,clear:ci}});var qs=a((D_,xs)=>{"use strict";var As=S(),Wv=q(),Hv=Object.getOwnPropertyDescriptor;xs.exports=function(t){if(!Wv)return As[t];var e=Hv(As,t);return e&&e.value}});var fi=a(($_,Cs)=>{"use strict";var Rs=function(){this.head=null,this.tail=null};Rs.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t){var e=this.head=t.next;return e===null&&(this.tail=null),t.item}}};Cs.exports=Rs});var ks=a((M_,Ls)=>{"use strict";var Kv=X();Ls.exports=/ipad|iphone|ipod/i.test(Kv)&&typeof Pebble!="undefined"});var Ds=a((V_,Ns)=>{"use strict";var Gv=X();Ns.exports=/web0s(?!.*chrome)/i.test(Gv)});var js=a((F_,Bs)=>{"use strict";var ge=S(),zv=qs(),$s=Ve(),pi=di().set,Qv=fi(),Yv=ri(),Jv=ks(),Xv=Ds(),hi=gt(),Ms=ge.MutationObserver||ge.WebKitMutationObserver,Vs=ge.document,Fs=ge.process,yt=ge.Promise,mi=zv("queueMicrotask"),ve,vi,gi,It,Us;mi||(ze=new Qv,Qe=function(){var t,e;for(hi&&(t=Fs.domain)&&t.exit();e=ze.get();)try{e()}catch(r){throw ze.head&&ve(),r}t&&t.enter()},!Yv&&!hi&&!Xv&&Ms&&Vs?(vi=!0,gi=Vs.createTextNode(""),new Ms(Qe).observe(gi,{characterData:!0}),ve=function(){gi.data=vi=!vi}):!Jv&&yt&&yt.resolve?(It=yt.resolve(void 0),It.constructor=yt,Us=$s(It.then,It),ve=function(){Us(Qe)}):hi?ve=function(){Fs.nextTick(Qe)}:(pi=$s(pi,ge),ve=function(){pi(Qe)}),mi=function(t){ze.head||ve(),ze.add(t)});var ze,Qe;Bs.exports=mi});var Hs=a((U_,Ws)=>{"use strict";Ws.exports=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch(r){}}});var St=a((B_,Ks)=>{"use strict";Ks.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}});var Qs=a((j_,zs)=>{"use strict";var Zv=S(),eg=_(),Gs=Zv.WeakMap;zs.exports=eg(Gs)&&/native code/.test(String(Gs))});var _t=a((W_,Js)=>{"use strict";var tg=wr(),rg=Ar(),Ys=tg("keys");Js.exports=function(t){return Ys[t]||(Ys[t]=rg(t))}});var Pt=a((H_,Xs)=>{"use strict";Xs.exports={}});var Si=a((K_,tu)=>{"use strict";var ig=Qs(),eu=S(),og=$(),ng=le(),bi=j(),yi=$e(),ag=_t(),sg=Pt(),Zs="Object already initialized",Ii=eu.TypeError,ug=eu.WeakMap,Et,Ye,Tt,cg=function(t){return Tt(t)?Ye(t):Et(t,{})},lg=function(t){return function(e){var r;if(!og(e)||(r=Ye(e)).type!==t)throw new Ii("Incompatible receiver, "+t+" required");return r}};ig||yi.state?(V=yi.state||(yi.state=new ug),V.get=V.get,V.has=V.has,V.set=V.set,Et=function(t,e){if(V.has(t))throw new Ii(Zs);return e.facade=t,V.set(t,e),e},Ye=function(t){return V.get(t)||{}},Tt=function(t){return V.has(t)}):(te=ag("state"),sg[te]=!0,Et=function(t,e){if(bi(t,te))throw new Ii(Zs);return e.facade=t,ng(t,te,e),e},Ye=function(t){return bi(t,te)?t[te]:{}},Tt=function(t){return bi(t,te)});var V,te;tu.exports={set:Et,get:Ye,has:Tt,enforce:cg,getterFor:lg}});var re=a((G_,ru)=>{"use strict";var dg=S();ru.exports=dg.Promise});var me=a((z_,au)=>{"use strict";var fg=S(),Je=re(),pg=_(),hg=Lr(),vg=Xr(),gg=R(),iu=Qr(),mg=B(),_i=yr(),ou=Je&&Je.prototype,bg=gg("species"),Pi=!1,nu=pg(fg.PromiseRejectionEvent),yg=hg("Promise",function(){var t=vg(Je),e=t!==String(Je);if(!e&&_i===66||mg&&!(ou.catch&&ou.finally))return!0;if(!_i||_i<51||!/native code/.test(t)){var r=new Je(function(n){n(1)}),i=function(n){n(function(){},function(){})},o=r.constructor={};if(o[bg]=i,Pi=r.then(function(){})instanceof i,!Pi)return!0}return!e&&(iu==="BROWSER"||iu==="DENO")&&!nu});au.exports={CONSTRUCTOR:yg,REJECTION_EVENT:nu,SUBCLASSING:Pi}});var be=a((Q_,uu)=>{"use strict";var su=H(),Ig=TypeError,Sg=function(t){var e,r;this.promise=new t(function(i,o){if(e!==void 0||r!==void 0)throw new Ig("Bad Promise constructor");e=i,r=o}),this.resolve=su(e),this.reject=su(r)};uu.exports.f=function(t){return new Sg(t)}});var Au=a(()=>{"use strict";var _g=C(),Pg=B(),xt=gt(),Q=S(),Eg=ue(),_e=D(),cu=he(),lu=Yr(),Tg=We(),wg=Za(),Og=H(),At=_(),Ag=$(),xg=ts(),qg=ei(),vu=di().set,Ai=js(),Rg=Hs(),Cg=St(),Lg=fi(),gu=Si(),qt=re(),xi=me(),mu=be(),Rt="Promise",bu=xi.CONSTRUCTOR,kg=xi.REJECTION_EVENT,Ng=xi.SUBCLASSING,Ei=gu.getterFor(Rt),Dg=gu.set,ye=qt&&qt.prototype,ie=qt,wt=ye,yu=Q.TypeError,Ti=Q.document,qi=Q.process,wi=mu.f,$g=wi,Mg=!!(Ti&&Ti.createEvent&&Q.dispatchEvent),Iu="unhandledrejection",Vg="rejectionhandled",du=0,Su=1,Fg=2,Ri=1,_u=2,Ot,fu,Pu,pu,Eu=function(t){var e;return Ag(t)&&At(e=t.then)?e:!1},Tu=function(t,e){var r=e.value,i=e.state===Su,o=i?t.ok:t.fail,n=t.resolve,s=t.reject,u=t.domain,d,l,p;try{o?(i||(e.rejection===_u&&Bg(e),e.rejection=Ri),o===!0?d=r:(u&&u.enter(),d=o(r),u&&(u.exit(),p=!0)),d===t.promise?s(new yu("Promise-chain cycle")):(l=Eu(d))?_e(l,d,n,s):n(d)):s(r)}catch(h){u&&!p&&u.exit(),s(h)}},wu=function(t,e){t.notified||(t.notified=!0,Ai(function(){for(var r=t.reactions,i;i=r.get();)Tu(i,t);t.notified=!1,e&&!t.rejection&&Ug(t)}))},Ou=function(t,e,r){var i,o;Mg?(i=Ti.createEvent("Event"),i.promise=e,i.reason=r,i.initEvent(t,!1,!0),Q.dispatchEvent(i)):i={promise:e,reason:r},!kg&&(o=Q["on"+t])?o(i):t===Iu&&Rg("Unhandled promise rejection",r)},Ug=function(t){_e(vu,Q,function(){var e=t.facade,r=t.value,i=hu(t),o;if(i&&(o=Cg(function(){xt?qi.emit("unhandledRejection",r,e):Ou(Iu,e,r)}),t.rejection=xt||hu(t)?_u:Ri,o.error))throw o.value})},hu=function(t){return t.rejection!==Ri&&!t.parent},Bg=function(t){_e(vu,Q,function(){var e=t.facade;xt?qi.emit("rejectionHandled",e):Ou(Vg,e,t.value)})},Ie=function(t,e,r){return function(i){t(e,i,r)}},Se=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=Fg,wu(t,!0))},Oi=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new yu("Promise can't be resolved itself");var i=Eu(e);i?Ai(function(){var o={done:!1};try{_e(i,e,Ie(Oi,o,t),Ie(Se,o,t))}catch(n){Se(o,n,t)}}):(t.value=e,t.state=Su,wu(t,!1))}catch(o){Se({done:!1},o,t)}}};if(bu&&(ie=function(e){xg(this,wt),Og(e),_e(Ot,this);var r=Ei(this);try{e(Ie(Oi,r),Ie(Se,r))}catch(i){Se(r,i)}},wt=ie.prototype,Ot=function(e){Dg(this,{type:Rt,done:!1,notified:!1,parent:!1,reactions:new Lg,rejection:!1,state:du,value:null})},Ot.prototype=cu(wt,"then",function(e,r){var i=Ei(this),o=wi(qg(this,ie));return i.parent=!0,o.ok=At(e)?e:!0,o.fail=At(r)&&r,o.domain=xt?qi.domain:void 0,i.state===du?i.reactions.add(o):Ai(function(){Tu(o,i)}),o.promise}),fu=function(){var t=new Ot,e=Ei(t);this.promise=t,this.resolve=Ie(Oi,e),this.reject=Ie(Se,e)},mu.f=wi=function(t){return t===ie||t===Pu?new fu(t):$g(t)},!Pg&&At(qt)&&ye!==Object.prototype)){pu=ye.then,Ng||cu(ye,"then",function(e,r){var i=this;return new ie(function(o,n){_e(pu,i,o,n)}).then(e,r)},{unsafe:!0});try{delete ye.constructor}catch(t){}lu&&lu(ye,wt)}_g({global:!0,constructor:!0,wrap:!0,forced:bu},{Promise:ie});Pu=Eg.Promise;Tg(ie,Rt,!1,!0);wg(Rt)});var oe=a((X_,xu)=>{"use strict";xu.exports={}});var Ru=a((Z_,qu)=>{"use strict";var jg=R(),Wg=oe(),Hg=jg("iterator"),Kg=Array.prototype;qu.exports=function(t){return t!==void 0&&(Wg.Array===t||Kg[Hg]===t)}});var Ci=a((eP,Lu)=>{"use strict";var Gg=je(),Cu=lt(),zg=Ne(),Qg=oe(),Yg=R(),Jg=Yg("iterator");Lu.exports=function(t){if(!zg(t))return Cu(t,Jg)||Cu(t,"@@iterator")||Qg[Gg(t)]}});var Nu=a((tP,ku)=>{"use strict";var Xg=D(),Zg=H(),em=K(),tm=De(),rm=Ci(),im=TypeError;ku.exports=function(t,e){var r=arguments.length<2?rm(t):e;if(Zg(r))return em(Xg(r,t));throw new im(tm(t)+" is not iterable")}});var Mu=a((rP,$u)=>{"use strict";var om=D(),Du=K(),nm=lt();$u.exports=function(t,e,r){var i,o;Du(t);try{if(i=nm(t,"return"),!i){if(e==="throw")throw r;return r}i=om(i,t)}catch(n){o=!0,i=n}if(e==="throw")throw r;if(o)throw i;return Du(i),r}});var Lt=a((iP,Bu)=>{"use strict";var am=Ve(),sm=D(),um=K(),cm=De(),lm=Ru(),dm=Fr(),Vu=ut(),fm=Nu(),pm=Ci(),Fu=Mu(),hm=TypeError,Ct=function(t,e){this.stopped=t,this.result=e},Uu=Ct.prototype;Bu.exports=function(t,e,r){var i=r&&r.that,o=!!(r&&r.AS_ENTRIES),n=!!(r&&r.IS_RECORD),s=!!(r&&r.IS_ITERATOR),u=!!(r&&r.INTERRUPTED),d=am(e,i),l,p,h,c,f,v,g,b=function(y){return l&&Fu(l,"normal"),new Ct(!0,y)},m=function(y){return o?(um(y),u?d(y[0],y[1],b):d(y[0],y[1])):u?d(y,b):d(y)};if(n)l=t.iterator;else if(s)l=t;else{if(p=pm(t),!p)throw new hm(cm(t)+" is not iterable");if(lm(p)){for(h=0,c=dm(t);c>h;h++)if(f=m(t[h]),f&&Vu(Uu,f))return f;return new Ct(!1)}l=fm(t,p)}for(v=n?t.next:l.next;!(g=sm(v,l)).done;){try{f=m(g.value)}catch(y){Fu(l,"throw",y)}if(typeof f=="object"&&f&&Vu(Uu,f))return f}return new Ct(!1)}});var Gu=a((oP,Ku)=>{"use strict";var vm=R(),Wu=vm("iterator"),Hu=!1;try{ju=0,Li={next:function(){return{done:!!ju++}},return:function(){Hu=!0}},Li[Wu]=function(){return this},Array.from(Li,function(){throw 2})}catch(t){}var ju,Li;Ku.exports=function(t,e){try{if(!e&&!Hu)return!1}catch(o){return!1}var r=!1;try{var i={};i[Wu]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(o){}return r}});var ki=a((nP,zu)=>{"use strict";var gm=re(),mm=Gu(),bm=me().CONSTRUCTOR;zu.exports=bm||!mm(function(t){gm.all(t).then(void 0,function(){})})});var Qu=a(()=>{"use strict";var ym=C(),Im=D(),Sm=H(),_m=be(),Pm=St(),Em=Lt(),Tm=ki();ym({target:"Promise",stat:!0,forced:Tm},{all:function(e){var r=this,i=_m.f(r),o=i.resolve,n=i.reject,s=Pm(function(){var u=Sm(r.resolve),d=[],l=0,p=1;Em(e,function(h){var c=l++,f=!1;p++,Im(u,r,h).then(function(v){f||(f=!0,d[c]=v,--p||o(d))},n)}),--p||o(d)});return s.error&&n(s.value),i.promise}})});var Ju=a(()=>{"use strict";var wm=C(),Om=B(),Am=me().CONSTRUCTOR,Di=re(),xm=W(),qm=_(),Rm=he(),Yu=Di&&Di.prototype;wm({target:"Promise",proto:!0,forced:Am,real:!0},{catch:function(t){return this.then(void 0,t)}});!Om&&qm(Di)&&(Ni=xm("Promise").prototype.catch,Yu.catch!==Ni&&Rm(Yu,"catch",Ni,{unsafe:!0}));var Ni});var Xu=a(()=>{"use strict";var Cm=C(),Lm=D(),km=H(),Nm=be(),Dm=St(),$m=Lt(),Mm=ki();Cm({target:"Promise",stat:!0,forced:Mm},{race:function(e){var r=this,i=Nm.f(r),o=i.reject,n=Dm(function(){var s=km(r.resolve);$m(e,function(u){Lm(s,r,u).then(i.resolve,o)})});return n.error&&o(n.value),i.promise}})});var Zu=a(()=>{"use strict";var Vm=C(),Fm=be(),Um=me().CONSTRUCTOR;Vm({target:"Promise",stat:!0,forced:Um},{reject:function(e){var r=Fm.f(this),i=r.reject;return i(e),r.promise}})});var $i=a((hP,ec)=>{"use strict";var Bm=K(),jm=$(),Wm=be();ec.exports=function(t,e){if(Bm(t),jm(e)&&e.constructor===t)return e;var r=Wm.f(t),i=r.resolve;return i(e),r.promise}});var ic=a(()=>{"use strict";var Hm=C(),Km=W(),tc=B(),Gm=re(),rc=me().CONSTRUCTOR,zm=$i(),Qm=Km("Promise"),Ym=tc&&!rc;Hm({target:"Promise",stat:!0,forced:tc||rc},{resolve:function(e){return zm(Ym&&this===Qm?Gm:this,e)}})});var oc=a(()=>{"use strict";Au();Qu();Ju();Xu();Zu();ic()});var uc=a(()=>{"use strict";var Jm=C(),Xm=B(),kt=re(),Zm=O(),ac=W(),sc=_(),eb=ei(),nc=$i(),tb=he(),Vi=kt&&kt.prototype,rb=!!kt&&Zm(function(){Vi.finally.call({then:function(){}},function(){})});Jm({target:"Promise",proto:!0,real:!0,forced:rb},{finally:function(t){var e=eb(this,ac("Promise")),r=sc(t);return this.then(r?function(i){return nc(e,t()).then(function(){return i})}:t,r?function(i){return nc(e,t()).then(function(){throw i})}:t)}});!Xm&&sc(kt)&&(Mi=ac("Promise").prototype.finally,Vi.finally!==Mi&&tb(Vi,"finally",Mi,{unsafe:!0}));var Mi});var lc=a((SP,cc)=>{"use strict";Ra();oc();uc();var ib=ht();cc.exports=ib("Promise","finally")});var fc=a((_P,dc)=>{"use strict";var ob=lc();dc.exports=ob});var Fi=a((PP,pc)=>{"use strict";var nb=fc();pc.exports=nb});var vc=a((EP,hc)=>{"use strict";var ab=O();hc.exports=!ab(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})});var Nt=a((TP,mc)=>{"use strict";var sb=j(),ub=_(),cb=Or(),lb=_t(),db=vc(),gc=lb("IE_PROTO"),Ui=Object,fb=Ui.prototype;mc.exports=db?Ui.getPrototypeOf:function(t){var e=cb(t);if(sb(e,gc))return e[gc];var r=e.constructor;return ub(r)&&e instanceof r?r.prototype:e instanceof Ui?fb:null}});var Ic=a((wP,yc)=>{"use strict";var pb=x(),Bi=j(),hb=J(),vb=Ur().indexOf,gb=Pt(),bc=pb([].push);yc.exports=function(t,e){var r=hb(t),i=0,o=[],n;for(n in r)!Bi(gb,n)&&Bi(r,n)&&bc(o,n);for(;e.length>i;)Bi(r,n=e[i++])&&(~vb(o,n)||bc(o,n));return o}});var ji=a((OP,Sc)=>{"use strict";Sc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Wi=a((AP,_c)=>{"use strict";var mb=Ic(),bb=ji();_c.exports=Object.keys||function(e){return mb(e,bb)}});var Ac=a((xP,Oc)=>{"use strict";var Ec=q(),yb=O(),Tc=x(),Ib=Nt(),Sb=Wi(),_b=J(),Pb=hr().f,wc=Tc(Pb),Eb=Tc([].push),Tb=Ec&&yb(function(){var t=Object.create(null);return t[2]=2,!wc(t,2)}),Pc=function(t){return function(e){for(var r=_b(e),i=Sb(r),o=Tb&&Ib(r)===null,n=i.length,s=0,u=[],d;n>s;)d=i[s++],(!Ec||(o?d in r:wc(r,d)))&&Eb(u,t?[d,r[d]]:r[d]);return u}};Oc.exports={entries:Pc(!0),values:Pc(!1)}});var xc=a(()=>{"use strict";var wb=C(),Ob=Ac().entries;wb({target:"Object",stat:!0},{entries:function(e){return Ob(e)}})});var Rc=a((CP,qc)=>{"use strict";xc();var Ab=ue();qc.exports=Ab.Object.entries});var Lc=a((LP,Cc)=>{"use strict";var xb=Rc();Cc.exports=xb});var Pe=a((kP,kc)=>{"use strict";var qb=Lc();kc.exports=qb});var $c=a((NP,Dc)=>{"use strict";var Hi=q(),Rb=j(),Nc=Function.prototype,Cb=Hi&&Object.getOwnPropertyDescriptor,Ki=Rb(Nc,"name"),Lb=Ki&&function(){}.name==="something",kb=Ki&&(!Hi||Hi&&Cb(Nc,"name").configurable);Dc.exports={EXISTS:Ki,PROPER:Lb,CONFIGURABLE:kb}});var Vc=a(Mc=>{"use strict";var Nb=q(),Db=kr(),$b=Z(),Mb=K(),Vb=J(),Fb=Wi();Mc.f=Nb&&!Db?Object.defineProperties:function(e,r){Mb(e);for(var i=Vb(r),o=Fb(r),n=o.length,s=0,u;n>s;)$b.f(e,u=o[s++],i[u]);return e}});var Yi=a(($P,Kc)=>{"use strict";var Ub=K(),Bb=Vc(),Fc=ji(),jb=Pt(),Wb=ti(),Hb=dt(),Kb=_t(),Uc=">",Bc="<",zi="prototype",Qi="script",Wc=Kb("IE_PROTO"),Gi=function(){},Hc=function(t){return Bc+Qi+Uc+t+Bc+"/"+Qi+Uc},jc=function(t){t.write(Hc("")),t.close();var e=t.parentWindow.Object;return t=null,e},Gb=function(){var t=Hb("iframe"),e="java"+Qi+":",r;return t.style.display="none",Wb.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(Hc("document.F=Object")),r.close(),r.F},Dt,$t=function(){try{Dt=new ActiveXObject("htmlfile")}catch(e){}$t=typeof document!="undefined"?document.domain&&Dt?jc(Dt):Gb():jc(Dt);for(var t=Fc.length;t--;)delete $t[zi][Fc[t]];return $t()};jb[Wc]=!0;Kc.exports=Object.create||function(e,r){var i;return e!==null?(Gi[zi]=Ub(e),i=new Gi,Gi[zi]=null,i[Wc]=e):i=$t(),r===void 0?i:Bb.f(i,r)}});var eo=a((MP,Qc)=>{"use strict";var zb=O(),Qb=_(),Yb=$(),Jb=Yi(),Gc=Nt(),Xb=he(),Zb=R(),ey=B(),Zi=Zb("iterator"),zc=!1,G,Ji,Xi;[].keys&&(Xi=[].keys(),"next"in Xi?(Ji=Gc(Gc(Xi)),Ji!==Object.prototype&&(G=Ji)):zc=!0);var ty=!Yb(G)||zb(function(){var t={};return G[Zi].call(t)!==t});ty?G={}:ey&&(G=Jb(G));Qb(G[Zi])||Xb(G,Zi,function(){return this});Qc.exports={IteratorPrototype:G,BUGGY_SAFARI_ITERATORS:zc}});var Jc=a((VP,Yc)=>{"use strict";var ry=eo().IteratorPrototype,iy=Yi(),oy=ke(),ny=We(),ay=oe(),sy=function(){return this};Yc.exports=function(t,e,r,i){var o=e+" Iterator";return t.prototype=iy(ry,{next:oy(+!i,r)}),ny(t,o,!1,!0),ay[o]=sy,t}});var ul=a((FP,sl)=>{"use strict";var uy=C(),cy=D(),Mt=B(),nl=$c(),ly=_(),dy=Jc(),Xc=Nt(),Zc=Yr(),fy=We(),py=le(),to=he(),hy=R(),el=oe(),al=eo(),vy=nl.PROPER,gy=nl.CONFIGURABLE,tl=al.IteratorPrototype,Vt=al.BUGGY_SAFARI_ITERATORS,Xe=hy("iterator"),rl="keys",Ze="values",il="entries",ol=function(){return this};sl.exports=function(t,e,r,i,o,n,s){dy(r,e,i);var u=function(m){if(m===o&&c)return c;if(!Vt&&m&&m in p)return p[m];switch(m){case rl:return function(){return new r(this,m)};case Ze:return function(){return new r(this,m)};case il:return function(){return new r(this,m)}}return function(){return new r(this)}},d=e+" Iterator",l=!1,p=t.prototype,h=p[Xe]||p["@@iterator"]||o&&p[o],c=!Vt&&h||u(o),f=e==="Array"&&p.entries||h,v,g,b;if(f&&(v=Xc(f.call(new t)),v!==Object.prototype&&v.next&&(!Mt&&Xc(v)!==tl&&(Zc?Zc(v,tl):ly(v[Xe])||to(v,Xe,ol)),fy(v,d,!0,!0),Mt&&(el[d]=ol))),vy&&o===Ze&&h&&h.name!==Ze&&(!Mt&&gy?py(p,"name",Ze):(l=!0,c=function(){return cy(h,this)})),o)if(g={values:u(Ze),keys:n?c:u(rl),entries:u(il)},s)for(b in g)(Vt||l||!(b in p))&&to(p,b,g[b]);else uy({target:e,proto:!0,forced:Vt||l},g);return(!Mt||s)&&p[Xe]!==c&&to(p,Xe,c,{name:o}),el[e]=c,g}});var ll=a((UP,cl)=>{"use strict";cl.exports=function(t,e){return{value:t,done:e}}});var io=a((BP,vl)=>{"use strict";var my=J(),ro=Br(),dl=oe(),pl=Si(),by=Z().f,yy=ul(),Ft=ll(),Iy=B(),Sy=q(),hl="Array Iterator",_y=pl.set,Py=pl.getterFor(hl);vl.exports=yy(Array,"Array",function(t,e){_y(this,{type:hl,target:my(t),index:0,kind:e})},function(){var t=Py(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,Ft(void 0,!0);switch(t.kind){case"keys":return Ft(r,!1);case"values":return Ft(e[r],!1)}return Ft([r,e[r]],!1)},"values");var fl=dl.Arguments=dl.Array;ro("keys");ro("values");ro("entries");if(!Iy&&Sy&&fl.name!=="values")try{by(fl,"name",{value:"values"})}catch(t){}});var ml=a((jP,gl)=>{"use strict";var Ey=q(),Ty=Z(),wy=ke();gl.exports=function(t,e,r){Ey?Ty.f(t,e,wy(0,r)):t[e]=r}});var bl=a(()=>{"use strict";var Oy=C(),Ay=Lt(),xy=ml();Oy({target:"Object",stat:!0},{fromEntries:function(e){var r={};return Ay(e,function(i,o){xy(r,i,o)},{AS_ENTRIES:!0}),r}})});var Il=a((KP,yl)=>{"use strict";io();bl();var qy=ue();yl.exports=qy.Object.fromEntries});var _l=a((GP,Sl)=>{"use strict";Sl.exports={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}});var El=a(()=>{"use strict";io();var Ry=_l(),Cy=S(),Ly=We(),Pl=oe();for(Ut in Ry)Ly(Cy[Ut],Ut),Pl[Ut]=Pl.Array;var Ut});var wl=a((YP,Tl)=>{"use strict";var ky=Il();El();Tl.exports=ky});var Al=a((JP,Ol)=>{"use strict";var Ny=wl();Ol.exports=Ny});var co=a((KE,Wl)=>{"use strict";var jy=je(),Wy=String;Wl.exports=function(t){if(jy(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Wy(t)}});var Kl=a((GE,Hl)=>{"use strict";var Hy=pt(),Ky=co(),Gy=se(),zy=RangeError;Hl.exports=function(e){var r=Ky(Gy(this)),i="",o=Hy(e);if(o<0||o===1/0)throw new zy("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(r+=r))o&1&&(i+=r);return i}});var Jl=a((zE,Yl)=>{"use strict";var Ql=x(),Qy=Vr(),Gl=co(),Yy=Kl(),Jy=se(),Xy=Ql(Yy),Zy=Ql("".slice),eI=Math.ceil,zl=function(t){return function(e,r,i){var o=Gl(Jy(e)),n=Qy(r),s=o.length,u=i===void 0?" ":Gl(i),d,l;return n<=s||u===""?o:(d=n-s,l=Xy(u,eI(d/u.length)),l.length>d&&(l=Zy(l,0,d)),t?o+l:l+o)}};Yl.exports={start:zl(!1),end:zl(!0)}});var Zl=a((QE,Xl)=>{"use strict";var tI=X();Xl.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(tI)});var ed=a(()=>{"use strict";var rI=C(),iI=Jl().start,oI=Zl();rI({target:"String",proto:!0,forced:oI},{padStart:function(e){return iI(this,e,arguments.length>1?arguments[1]:void 0)}})});var rd=a((XE,td)=>{"use strict";ed();var nI=ht();td.exports=nI("String","padStart")});var od=a((ZE,id)=>{"use strict";var aI=rd();id.exports=aI});var lo=a((eT,nd)=>{"use strict";var sI=od();nd.exports=sI});var go=w(pe(),1);var Ue=(s=>(s.PROD="prod",s.VK_ALIAS="vk_alias",s.VIDEOTEST="videotest",s.TEST="test",s.OKCDN="okcdn",s.AUTO="auto",s))(Ue||{}),jr=(l=>(l.Q144P="mobile",l.Q240P="lowest",l.Q360P="low",l.Q480P="medium",l.Q720P="high",l.Q1080P="fullhd",l.Q1440P="quadhd",l.Q2160P="ultrahd",l.UNKNOWN="unknown",l))(jr||{}),Wr=(f=>(f.MP4="mp4",f.DASH="dash",f.DASH_SEP="dash_sep",f.ONDEMAND_DASH="ondemand_dash",f.HLS="hls",f.ONDEMAND_HLS="ondemand_hls",f.WEBM="webm",f.AV1="av1",f.ONDEMAND_DASH_LIVE="ondemand_dash_live",f.ONDEMAND_HLS_LIVE="ondemand_hls_live",f.WEBRTC="webrtc",f.UNKNOWN="unknown",f.RTMP="rtmp",f))(Wr||{});var Hr=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(Hr||{});var Kr=(u=>(u.SLIDER="slider",u.DOUBLE_TAP="double_tap",u.TIME_CODE="time_code",u.EPISODE="episode",u.REWIND="rewind",u.LIVE="live",u.UNKNOWN="unknown",u))(Kr||{}),Ea=(n=>(n.GRAPH_SHOW="iGraphShow",n.GRAPH_HIDE="iGraphHide",n.NEXT_AREA="iNextChapterArea",n.NEXT_BUTTON="iNextChapterBtn",n.WATCH_AGAIN="iWatchAgainBtn",n))(Ea||{}),Ta={action_play:"ap",action_play_interactive:"api",first_bytes:"fb",player_ready:"pr",first_frame:"ff",seek:"sk",watch_coverage_record:"wr",watch_coverage_live:"wl",empty_buffer:"eb",action_stop:"as",close_at_empty_buffer:"cb",content_error:"er",player_interface_click:"pc",next_movie:"nm",track_switch:"ts",failover:"fo",quality:"qt"},wa={vsid:"si",isid:"is",vid:"vi",place:"pl",quality:"qt",cdn_host:"ch",stat_type:"st",param:"pm",vk_app_id:"va",track_code:"tc",connection_type:"cnt",connection_reused:"cr",cached_data:"cd",live:"lv",muted:"mu",mode:"mo",subtitles:"sb",failover:"fo",download_speed:"ds",manual_quality:"mq",ref_domain:"rd",direct_url:"du"},Oa={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},Aa={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};import{fillWithDefault as Oh}from"@vkontakte/videoplayer-shared/es2018";var xa="CIOPGQJGDIHBABABA",Gr={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var Ah={apiEnv:"vk_alias",apiKey:xa,requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:["quality"],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,clearStorageAtUnload:!0,useVKComIsMobileLogic:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1},useKeepalive:!1},qa=t=>Oh(t,Ah);function zr(){let t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),r=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(r<=2&&(r=33554432+Math.random()*16777216|0),i=r&15,r=r>>4,e[o]=t[o===19?i&3|8:i]);return e.join("")}import{assertNonNullable as hI,combine as fd,fromEvent as pd,isNonNullable as Ae,isNullable as hd,merge as vI,now as z,observableFrom as gI,once as mI,safeStorage as vd,Subject as bI,Subscription as mo,ValueSubject as Yt,createURL as gd}from"@vkontakte/videoplayer-shared/es2018";import{Logger as yI,detectEmbed as II}from"@vkontakte/videoplayer-shared/es2018";var Bt=w(Fi(),1);var xl=w(Pe(),1),ql=w(Al(),1);var Rl=t=>{var o;let{operation:e,custom:r}=t,i=(0,ql.default)((0,xl.default)(r).map(([n,s])=>{var l,p,h;let u=(l=wa[n])!=null?l:n,d=s;return s&&(n==="mode"?d=(p=Aa[s])!=null?p:s:n==="quality"&&(d=(h=Oa[s])!=null?h:s)),[u,d]}));return{...t,operation:(o=Ta[e])!=null?o:e,custom:i}};var k="1.0.82-dev.4ccf1d04.0";import{ValueSubject as Dy,getExponentialDelay as $y,ErrorCategory as Ee}from"@vkontakte/videoplayer-shared/es2018";var My=/Mobile|mini|Fennec|Android|iP(ad|od|hone)|opera (mini|mobi)/i,et=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new Dy(!1);this.params=e}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this._authorizeWithBackoff()}logBeacon(e){let r="log.externalLog",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(r,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var s;let r="log.externalLog",i=this.createLogParams(e),o=(s=this.sessionKey)!=null?s:await this._authorizeWithBackoff();if(!o)return;let n=async(u,d=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(r,i,o)}catch(l){if(!l||!("error_code"in l)){this.params.error$.next({id:"logRequestUnknown",category:Ee.NETWORK,message:`Unknown ${r} error`,thrown:l});return}let p=l==null?void 0:l.error_code;switch(p){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this._authorizeWithBackoff(),d>0?n(u,d-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this._authorizeWithBackoff(),d>0?n(u,d-1):void 0;default:{this.params.error$.next({id:`LogRequest#${p}`,category:Ee.EXTERNAL_API,message:`${r} error`,data:l});return}}}};return n(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Bt.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let r="WEB",i=!1,o=`@vkontakte/videoplayer-statistics:${k}`;if(this.params.config.useVKComIsMobileLogic){let{appVersion:n}=window.navigator;i=My.test(n)}else this.params.mobile&&(i=!0);return i&&(r="M_WEB"),this.params.vktvVersion&&(r="SMART_TV",o=this.params.vktvVersion),{collector:"ok.mobile.apps.video",data:JSON.stringify({application:o,platform:r,items:this.params.config.shorten?e.map(Rl):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=$y(this.consequentAuthErrors,this.params.config.backoff);return new Promise(r=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Bt.default)(this._authorize().then(r).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:Ee.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})),()=>this.backoffTimeoutId=0)},e))})}async _authorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",r={session_data:{version:2,device_id:this.params.deviceId,client_version:k.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(r.session_data.auth_token=this.authToken,r.session_data.version=3),this.authorizePromise=(0,Bt.default)(this.params.apiTransport.sendRequest(e,r).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:Ee.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this._authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:Ee.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:Ee.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var{NativeAbortSignal:lE,NativeAbortController:dE}=function(t){return{NativeAbortSignal:t.AbortSignal,NativeAbortController:t.AbortController}}(typeof self!="undefined"?self:global);function Cl(t){let e;try{e=new Event("abort")}catch(r){typeof document!="undefined"?document.createEvent?(e=document.createEvent("Event"),e.initEvent("abort",!1,!1)):(e=document.createEventObject(),e.type="abort"):e={type:"abort",bubbles:!1,cancelable:!1}}return e.reason=t,e}function Ll(t){if(t===void 0)if(typeof document=="undefined")t=new Error("This operation was aborted"),t.name="AbortError";else try{t=new DOMException("signal is aborted without reason"),Object.defineProperty(t,"name",{value:"AbortError"})}catch(e){t=new Error("This operation was aborted"),t.name="AbortError"}return t}var jt=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,r,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:r,options:i})}removeEventListener(e,r){if(!(e in this.listeners))return;let i=this.listeners[e];for(let o=0,n=i.length;o<n;o++)if(i[o].callback===r){i.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let i=this.listeners[e.type].slice();for(let o=0,n=i.length;o<n;o++){let s=i[o];try{s.callback.call(this,e)}catch(u){Promise.resolve().then(()=>{throw u})}s.options&&s.options.once&&this.removeEventListener(e.type,s.callback)}return!e.defaultPrevented}},Te=class extends jt{constructor(){super(),this.listeners||jt.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}throwIfAborted(){let{aborted:e,reason:r="Aborted"}=this;if(e)throw r}static timeout(e){let r=new ne;return setTimeout(()=>r.abort(new DOMException(`This signal is timeout in ${e}ms`,"TimeoutError")),e),r.signal}static any(e){let r=new ne;function i(){r.abort(this.reason),o()}function o(){for(let n of e)n.removeEventListener("abort",i)}for(let n of e)if(n.aborted){r.abort(n.reason);break}else n.addEventListener("abort",i);return r.signal}},ne=class{constructor(){Object.defineProperty(this,"signal",{value:new Te,writable:!0,configurable:!0})}abort(e){let r=Ll(e),i=Cl(r);this.signal.reason=r,this.signal.dispatchEvent(i)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(ne.prototype[Symbol.toStringTag]="AbortController",Te.prototype[Symbol.toStringTag]="AbortSignal");function Wt(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof t.Request=="function"&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}function oo(t){typeof t=="function"&&(t={fetch:t});let{fetch:e,Request:r=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=t;if(!Wt({fetch:e,Request:r,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:n};let n=r;(n&&!n.prototype.hasOwnProperty("signal")||o)&&(n=function(l,p){let h;p&&p.signal&&(h=p.signal,delete p.signal);let c=new r(l,p);return h&&Object.defineProperty(c,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),c},n.prototype=r.prototype);let s=e;return{fetch:(d,l)=>{let p=n&&n.prototype.isPrototypeOf(d)?d.signal:l?l.signal:void 0;if(p){let h;try{h=new DOMException("Aborted","AbortError")}catch(f){h=new Error("Aborted"),h.name="AbortError"}if(p.aborted)return Promise.reject(h);let c=new Promise((f,v)=>{p.addEventListener("abort",()=>v(h),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([c,s(d,l)])}return s(d,l)},Request:n}}var Vy=()=>"fetch"in window,tt=Vy()&&Wt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),kl=tt?oo({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,we=tt?kl.fetch:window.fetch,SE=tt?kl.Request:window.Request,_E=tt?ne:window.AbortController,PE=tt?Te:window.AbortSignal;var Nl=w(pe(),1),Dl=w(Pe(),1);import{ErrorCategory as Ht,now as no}from"@vkontakte/videoplayer-shared/es2018";var rt=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=Gr[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let r=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await we(r,{method:"GET",mode:"cors",cache:"no-cache"})).json(),n=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!n)throw new Error("Wrong DNS response");return n}catch(r){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:Ht.NETWORK,message:"Unhandled resolve api base url error",thrown:r}),Gr.vk_alias}finally{this.isApiBaseUrlFetched=!0}}sendBeacon(e,r,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this._prepareQueryParams({method:e,queryParams:r,sessionKey:i}),n=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,n)}catch(s){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:Ht.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:r}})}return!1}async sendRequest(e,r,i){let o=no(),n=u=>{if(u instanceof TypeError&&(0,Nl.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:Ht.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:Ht.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:r,sessionKey:i,time:no()-o}})};this.apiBaseUrl=await this.resolveApiBaseUrl();let s={method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:e,queryParams:r,sessionKey:i})};return this.params.config.useKeepalive&&(s.keepalive=!0),we(`${this.apiBaseUrl}/fb.do`,s).then(u=>{var h,c;let d=Number(u.headers.get("content-length"))===0,l=new Date((h=u.headers.get("date"))!=null?h:"").getTime(),p=no()-o;if(isFinite(l)&&((c=this.timeSynchronisation)==null||c.addServerTime(l,p)),!d)return u.json().then(f=>Object.prototype.hasOwnProperty.call(f,"error_msg")?Promise.reject(f):f,n)},n)}_prepareQueryParams(e){let r=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&r.append("session_key",e.sessionKey),(0,Dl.default)(e.queryParams).forEach(([i,o])=>r.append(i,typeof o=="string"?o:JSON.stringify(o))),r}};var Ml=w(pe(),1),Vl=w(Pe(),1);import{ErrorCategory as Fy,now as Uy,safeStorage as it,debounceFn as $l}from"@vkontakte/videoplayer-shared/es2018";var Kt="onestat_events",ao=t=>e=>e.timestamp+t>=Uy(),Gt=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:r}=e;return(0,Ml.default)(["action_play","watch_coverage_record","watch_coverage_live"],r)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=$l(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let r=it.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=$l(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:r}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){try{this.flush()}catch(e){this.error$.next({id:"LoggerError",category:Fy.WTF,message:e?String(e):"Unknown logger error",thrown:e})}}readFromStorage(){let e=it.get(Kt);try{return e?JSON.parse(e):{}}catch(r){}return{}}addToStorage(e){var n;if(!this.userSalt){this.unsaltedStorage.push(e);return}let r=this.readFromStorage(),o=((n=r[this.userSalt])!=null?n:[]).filter(ao(this.params.config.storageExpiration));it.set(Kt,JSON.stringify({...r,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(ao(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],it.set(Kt,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[r,i]of(0,Vl.default)(e)){let o=i.filter(ao(this.params.config.storageExpiration));o.length?e[r]=o:delete e[r],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}it.set(Kt,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.custom.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.custom.vsid)}flush({wantBeacon:e,clearStorage:r}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),r&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};import{HttpConnectionType as so,Surface as Oe,VideoFormat as A,VideoQuality as F}from"@vkontakte/videoplayer-core/es2018";import{assertNever as Fl}from"@vkontakte/videoplayer-shared/es2018";var Ul=t=>t&&{[F.INVARIANT]:"unknown",[F.Q_144P]:"mobile",[F.Q_240P]:"lowest",[F.Q_360P]:"low",[F.Q_480P]:"medium",[F.Q_576P]:"unknown",[F.Q_720P]:"high",[F.Q_1080P]:"fullhd",[F.Q_1440P]:"quadhd",[F.Q_2160P]:"ultrahd",[F.Q_4320P]:"unknown"}[t],uo=t=>t&&{[so.HTTP1]:"http1",[so.HTTP2]:"http2",[so.QUIC]:"http3"}[t],Bl=t=>{if(t!==void 0)switch(t){case A.MPEG:return"mp4";case A.DASH:case A.DASH_LIVE:case A.DASH_STREAMS:return"dash";case A.DASH_SEP:return"dash_sep";case A.DASH_ONDEMAND:return"ondemand_dash";case A.DASH_WEBM:case A.DASH_LIVE_WEBM:return"webm";case A.DASH_WEBM_AV1:return"av1";case A.DASH_LIVE_CMAF:return"ondemand_dash_live";case A.HLS:case A.HLS_LIVE:return"hls";case A.HLS_ONDEMAND:return"ondemand_hls";case A.HLS_LIVE_CMAF:return"ondemand_hls_live";case A.WEB_RTC_LIVE:return"webrtc";default:return Fl(t)}},zt=t=>{if(t!==void 0)switch(t){case Oe.NONE:case Oe.INLINE:return;case Oe.FULLSCREEN:return"fullscreen";case Oe.SECOND_SCREEN:return"chromecast";case Oe.PIP:return"pip";case Oe.INVISIBLE:return"invisible";default:return Fl(t)}},jl=t=>{switch(t){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var Qt=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var r;return e.setTime(e.getTime()+((r=this.offset)!=null?r:0)),e}addServerTime(e,r){let i=Date.now(),o=e-i-r/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};var fo=w(lo(),1),ad=()=>(0,fo.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),sd=()=>(0,fo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");import{PlaybackState as ud}from"@vkontakte/videoplayer-core/es2018";import{filter as cd,filterChanged as uI,fromEvent as cI,isNullable as ld,map as lI,merge as po,Observable as dI,Subject as ho,Subscription as fI,ValueSubject as pI}from"@vkontakte/videoplayer-shared/es2018";var dd=(t,e)=>new dI(r=>{let i=new fI,o=po(cI(window,"beforeunload"),t.events.willDestruct$),n=new pI(void 0),s;i.add(t.info.isLive$.pipe(uI()).subscribe(I=>{s&&(s.unsubscribe(),n.next(void 0)),I?s=t.info.liveTime$.pipe(lI(T=>T&&T/1e3)).subscribe(n):s=t.info.position$.subscribe(n),i.add(s)}));let{playing$:u,paused$:d}=t.events,l=t.events.willSeek$.pipe(cd(()=>t.info.playbackState$.getValue()===ud.PLAYING)),p=t.events.seeked$.pipe(cd(()=>t.info.playbackState$.getValue()===ud.PLAYING)),h=!1,c=new ho;i.add(l.subscribe(()=>{h||c.next(),h=!0})),i.add(p.subscribe(()=>h=!1));let f=new ho,v=new ho,g=po(u,p,f),b=po(d,c,o,t.events.looped$,v),m,y=()=>m=n.getValue(),E=()=>{let I=n.getValue();ld(m)||m===I||ld(I)||(r.next({from:m,to:I}),m=void 0)},N=()=>{v.next(),f.next()};if(i.add(g.subscribe(y)),i.add(b.subscribe(E)),e.forceInterval&&isFinite(e.forceInterval)){let I=0;i.add(g.subscribe(()=>I=window.setTimeout(N,e.forceInterval))),i.add(b.subscribe(()=>window.clearTimeout(I)))}return i});var SI="_one-stat_",md=`${SI}deviceId`,vo=()=>{let t=new mo;return{subscription:t,subscribe:(e,r)=>{e&&t.add(e.subscribe(r))}}},bo=class{constructor(e,r){this.subscription=new mo;this.debugLogger=new yI;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new Yt(void 0);this.isid$=new Yt(void 0);this.zenUid$=new Yt(void 0);this.seekAction$=new Yt("unknown");var d,l,p;this.statContext=e,this.config=qa((d=r.config)!=null?d:{}),Ae(r.apiEnv)&&(this.config.apiEnv=r.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new Qt);let i=new bI;this.experimental={error$:i};let o=vd.get(md);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=zr(),vd.set(md,this.deviceId)),this.resetViewSession(),r.useIsid&&this.isid$.next((l=r.isid)!=null?l:sd()),this.zenUid$.next(r.zenUid);let n=new rt({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new et({config:this.config,apiTransport:n,refreshAuthToken:r.refreshAuthToken,mobile:(p=this.statContext.mobile)!=null?p:!1,deviceId:this.deviceId,error$:i,vktvVersion:r.vktvVersion}),this.logger=new Gt({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:r.userSalt});let{isEmbed:s,topOrigin:u}=II();this.isEmbed=s,this.embedParent=u?new URL(u).hostname:void 0,this.subscribe()}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let r=new mo,i=(c,f)=>r.add(c.subscribe(f));i(e.events.willStart$,()=>{let c=e.info.position$.getValue();this.logActionPlay({position:c}),this.statContext.projectId&&this.logActionPlayInteractive()}),i(e.events.looped$,()=>{this.resetViewSession(),++this.loopCounter>this.config.maxLoops&&(this.disabled=!0),this.logActionPlay({position:e.info.position$.getValue()})}),i(e.events.seeked$,()=>{this.logSeek({action:this.seekAction$.getValue(),time:e.info.position$.getValue()}),this.seekAction$.next("unknown")}),i(e.events.paused$,()=>{this.logPause({position:e.info.position$.getValue()})}),i(e.events.willResume$,()=>{this.logPlay()}),i(e.events.started$,()=>{this.statContext.clip&&this.logWatchCoverageRecord({start:0,end:0})}),i(e.events.playing$,()=>{this.logPlaying()}),i(dd(e,{forceInterval:this.config.watchCoverageInterval}),c=>{var b,m,y,E;let f=e.info.isLive$.getValue(),v=e.info.atLiveEdge$.getValue(),g={start:parseFloat(c.from.toFixed(3)),end:parseFloat(c.to.toFixed(3))};if(v){let N=(b=e.info.liveLatency$.getValue())!=null?b:0,I=(y=(m=e.info.currentBuffer$.getValue())==null?void 0:m.end)!=null?y:0,T=(E=e.info.liveBufferTime$.getValue())!=null?E:0,nt=Math.round((N-(I-T))*1e3),at=Math.round(N*1e3);nt&&at&&(g.latency=nt,g.bufferLatency=at)}f?this.logWatchCoverageLive(g):this.logWatchCoverageRecord(g)});let o;i(e.info.isStalled$,c=>{c?o=z():(Ae(o)&&this.logEmptyBuffer({duration:z()-o}),o=void 0)});let n=!1;r.add(e.events.fatalError$.pipe(mI()).subscribe(()=>n=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let f=Ae(o)?z()-o:void 0;this.logCloseAtEmptyBuffer({duration:f!=null?f:0}),o=void 0}else n||this.logActionStop()}),i(e.events.managedError$,({id:c})=>{this.logError({fatal:!1,errorType:c})}),i(e.events.fatalError$,({id:c})=>{this.logError({fatal:!0,errorType:c})});let s,u,d=!1;i(e.events.firstBytes$,c=>{s=z(),this.logFirstBytes({time:c})}),i(e.events.willStart$,()=>u=z()),i(e.info.currentBuffer$,c=>{!d&&c&&c.end-c.start>0&&Ae(s)&&(this.logPlayerReady({duration:z()-s}),d=!0)}),i(e.events.firstFrame$,()=>{Ae(s)&&!d&&(this.logPlayerReady({duration:z()-s}),d=!0),Ae(u)&&this.logFirstFrame({time:z()-u})});let l;i(e.info.currentVideoStream$,c=>{c&&(l&&c.id!==l&&this.logTrackSwitch(c),l=c.id)});let p;i(e.info.currentAudioStream$,c=>{c&&(p&&c.id!==p&&this.logTrackSwitch(c),p=c.id)}),i(e.info.atLiveEdge$,c=>this.updateContext({liveEdge:c})),i(fd({muted:e.info.muted$,volume:e.info.volume$}),({muted:c,volume:f})=>this.updateContext({audible:!c&&f>0})),i(e.info.currentQuality$,c=>{let f=Ul(c);this.updateContext({quality:f}),f&&this.logQuality(f)}),i(e.info.isAutoQualityEnabled$,c=>this.updateContext({autoQuality:c})),i(e.info.currentFormat$,c=>this.updateContext({contentType:Bl(c)})),i(e.info.currentPlaybackRate$,c=>this.updateContext({rate:c})),i(e.info.is3DVideo$,c=>this.updateContext({is3d:c}));let h;return i(e.info.hostname$,c=>{let f=h!==void 0&&h!==c;this.updateContext({cdnHostname:c,failover:f}),f&&this.logFailover(c),h=c}),i(e.info.throughputEstimation$,c=>this.updateContext({downloadSpeed:c})),i(e.info.httpConnectionType$,c=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:uo(c)}),this.updateContext({connectionType:uo(c)})}),i(e.info.httpConnectionReused$,c=>{hd(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:c}),this.updateContext({connectionReused:c})}),i(e.info.surface$,c=>this.updateContext({mode:zt(c)})),i(fd({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:c,available:f})=>{let v=f.find(({id:b})=>b===c),g=v&&(v.isAuto?`${v.language}_auto`:v.language);this.updateContext({subtitles:g==null?void 0:g.split(".")[0]})}),this.player=e,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(r),r}attachToUi(e){this.uiEvents=e;let{subscription:r,subscribe:i}=vo();return this.player&&(i(e.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),i(e.actionSeek$,this.seekAction$),i(e.inPiP$,o=>{var s;let n=o?"pip":zt((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.inFullscreen$,o=>{var s;let n=o?"fullscreen":zt((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.actionSetSubtitle$,o=>this.updateContext({subtitles:o.split(".")[0]})),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(r)),r}attachToAds(e){let{subscription:r,subscribe:i}=vo();return i(e.slotRequested$,()=>this.logAdSlotRequest()),i(e.started$,o=>this.logAdStarted(o)),i(e.paused$,()=>this.logAdPaused()),i(e.resumed$,()=>this.logAdResumed()),i(e.ended$,()=>this.logAdEnded()),i(e.skipped$,()=>this.logAdSkipped()),i(e.clicked$,()=>this.logAdClicked()),i(e.error$,o=>this.logError({errorType:o,fatal:!1})),this.resubscribeBeforeunload(),this.subscription.add(r),r}attachToInteractive(e){let{subscription:r,subscribe:i}=vo();return i(e.click$,o=>this.logInterfaceClick(o)),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(r),r}authorize(e){return this.api.authorize(e)}pause(){this.logger.pause(),this.oneStatDebugLog({message:"paused"})}resume(){this.logger.resume(),this.oneStatDebugLog({message:"resumed"})}destroy(){this.logger.flush(),this.subscription.unsubscribe(),this.api.destroy(),this.logger.destroy()}resetViewSession(){this.oneStatDebugLog({message:"VSID reset"}),this.vsid$.next(ad())}getDeviceId(){return this.deviceId}setFieldBlacklist(){}logInited(){}logReady(e){this.log({operation:"player_ready",param:String(e.time)})}logStarted(...e){this.logActionPlay(...e)}logPlay(){this.log({operation:"play_toggle"})}logPlaying(){this.log({operation:"playing"})}logPause(e){this.log({operation:"pause",param:String(Math.round(e.position))})}logSeek(e){this.log({operation:"seek",param:e.action,time:e.time})}logFirstBytes(e){this.log({operation:"first_bytes",param:String(e.time)})}logFirstFrame(e){this.log({operation:"first_frame",param:String(e.time)})}logError(e){this.log({operation:"content_error",param:`${e.fatal?"fatal":"recoverable"}_${e.errorType}`})}logWatchCoverageRecord(e){this.log({operation:"watch_coverage_record",param:`${e.start}-${e.end}`},{in_history:this.statContext.inHistory?1:void 0})}logWatchCoverageLive(e){var n,s;let r=(s=(n=this.timeSynchronisation)==null?void 0:n.getOffset())!=null?s:0,i=e.start+r,o=e.end+r;this.log({operation:"watch_coverage_live",param:`${i}-${o}`},{in_history:this.statContext.inHistory?1:void 0,latency:e.latency,buffer_latency:e.bufferLatency})}logEmptyBuffer(e){this.log({operation:"empty_buffer",param:String(e.duration)})}logDownloadSpeed(){}logAdSlotRequest(){this.log({operation:"adv",param:"slot_request"})}logAdStarted(e){this.log({operation:"adv",param:e})}logAdPaused(){this.log({operation:"adv",param:"pause"})}logAdResumed(){this.log({operation:"adv",param:"resume"})}logAdEnded(){this.log({operation:"adv",param:"ended"})}logAdSkipped(){this.log({operation:"adv",param:"skip"})}logAdClicked(){this.log({operation:"adv",param:"click"})}logInterfaceClick(e){this.log({operation:"player_interface_click",param:e})}logNextMovie(e){this.log({operation:"next_movie",param:String(e)})}subscribe(){this.resubscribeBeforeunload();let e=window.navigator.connection;e&&"onchange"in e&&"effectiveType"in e&&this.subscription.add(vI(pd(e,"change"),gI(["init"])).subscribe(()=>this.updateContext({network:jl(e.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(r=>{console.debug("%c stat ","background:#fa6470;",`component: ${r.component}.`,r.message)})}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=pd(window,"beforeunload").subscribe(()=>this.logger.flush({wantBeacon:!0,clearStorage:this.config.clearStorageAtUnload})),this.subscription.add(this.beforeunloadSubscription)}logPlayerReady(e){this.log({operation:"player_ready",param:String(Math.round(e.duration))})}logActionPlay(e){this.log({operation:"action_play",param:String(Math.round(e.position))})}logActionPlayInteractive(){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(this.statContext.movieId)},{vid:this.statContext.projectId})}logFailover(e){this.log({operation:"failover",param:e})}logCloseAtEmptyBuffer(e){this.log({operation:"close_at_empty_buffer",param:String(Math.round(e.duration))})}logActionStop(){this.log({operation:"action_stop"})}logTrackSwitch(e){this.log({operation:"track_switch",param:e.id})}logQuality(e){this.log({operation:"quality",param:e})}log(e,r={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${e.operation} but statistics is disabled`});return}if((0,go.default)(this.config.disabledOperations,e.operation)){this.oneStatDebugLog({message:`operation ${e.operation} but it is disabled`});return}this.oneStatDebugLog({message:`operation ${e.operation} ${e.param}`});let i=this.createLogItem(e,r);this.logger.log(i)}createLogItem({operation:e,param:r,time:i},o={}){var f,v,g,b,m,y;let n=(v=(f=this.timeSynchronisation)==null?void 0:f.now())!=null?v:z(),s=this.vsid$.getValue();hI(s);let u=this.isid$.getValue(),d=e==="empty_buffer"||e==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,l=this.statContext.firstConnectionReused,p,h;if(this.isEmbed||this.statContext.place==="embed"){p=this.embedParent;let E=[...new URLSearchParams(location.search).entries()].filter(([N,I])=>(0,go.default)(this.config.embedUrlParams,N));h=new URLSearchParams(E).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?p=(b=(g=gd(this.statContext.refDomain))==null?void 0:g.hostname)!=null?b:this.statContext.refDomain:document.referrer&&(p=(y=(m=gd(document.referrer))==null?void 0:m.hostname)!=null?y:document.referrer),h=location.href.substring(0,1024));let c={vsid:s,isid:u,vid:this.statContext.movieId,uid:this.zenUid$.getValue(),ct:this.statContext.contentType,place:this.isEmbed?"embed":this.statContext.place,quality:this.statContext.quality,cdn_host:this.statContext.cdnHostname,stat_type:this.statContext.autoplay===!0?"auto":this.statContext.autoplay===!1?"":void 0,param:r,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:d,connection_reused:l===!0?1:l===!1?0:void 0,cached_data:this.statContext.cached===!0?1:this.statContext.cached===!1?0:void 0,live:this.statContext.liveEdge?1:void 0,muted:this.statContext.audible===!1?1:void 0,mode:this.statContext.mode,subtitles:this.statContext.subtitles,download_speed:this.statContext.downloadSpeed,manual_quality:this.statContext.autoQuality?void 0:1,ref_domain:p,direct_url:h,rate:this.statContext.rate===1||hd(this.statContext.rate)?void 0:this.statContext.rate.toFixed(2),view_360:this.statContext.is3d?1:void 0,aid:this.statContext.albumId,vk_playlist_id:this.statContext.vkPlaylistId,...o};for(let E of this.config.disabledCustomFields)delete c[E];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:n,custom:c}}};var xo={};of(xo,{SeekType:()=>Jt,ThinOneStat:()=>nr,VERSION:()=>k});import{assertNonNullable as DI,detectEmbed as $I,fromEvent as MI,Logger as VI,merge as Ud,safeStorage as Bd,Subject as FI,Subscription as Ao,ValueSubject as or}from"@vkontakte/videoplayer-shared/es2018";import{clientChecker as ae,PlaybackState as jd}from"@vkontakte/videoplayer-core/es2018";import{fillWithDefault as _I}from"@vkontakte/videoplayer-shared/es2018";var Jt=(u=>(u.SLIDER="slider",u.DOUBLE_TAP="double_tap",u.TIME_CODE="time_code",u.EPISODE="episode",u.REWIND="rewind",u.LIVE="live",u.UNKNOWN="unknown",u))(Jt||{});var yd="CIOPGQJGDIHBABABA",yo={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var PI={apiKey:yd,apiEnv:"vk_alias",requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageHeartbeatInterval:15,synchronizeTime:!0,useBeacon:!1,alwaysSendDesktop:!1},Id=t=>_I(t,PI);var Io=w(Fi(),1);import{getExponentialDelay as EI,ErrorCategory as xe,ValueSubject as TI}from"@vkontakte/videoplayer-shared/es2018";var Xt=class{constructor(e){this.params=e,this.authorized$=new TI(!1),this.consequentAuthErrors=0}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this.authorizeWithBackoff()}logBeacon(e){let r="log.logUvStat",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(r,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var u;let r="log.logUvStat",i=this.createLogParams(e),o={},n=(u=this.sessionKey)!=null?u:await this.authorizeWithBackoff();if(!n)return;let s=async(d,l=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(r,i,n,o)}catch(p){if(!p||!("error_code"in p)){this.params.error$.next({id:"logRequestUnknown",category:xe.NETWORK,message:`Unknown ${r} error`,thrown:p});return}let h=p==null?void 0:p.error_code;switch(h){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;default:{this.params.error$.next({id:`LogRequest#${h}`,category:xe.EXTERNAL_API,message:`${r} error`,data:p});return}}}};return s(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Io.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){return{collector:"ok.mobile.apps.video",uv_stat_data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${k}`,platform:e[0].platform,product:e[0].product,events:e})}}authorizeWithBackoff(){if(!this.consequentAuthErrors)return this.doAuthorize();let e=EI(this.consequentAuthErrors);return new Promise(r=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(async()=>{try{let i=await this.doAuthorize();r(i)}catch(i){this.params.error$.next({id:"AuthorizeBackoff",category:xe.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})}finally{this.backoffTimeoutId=0}},e))})}doAuthorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",r={session_data:{version:2,device_id:this.params.deviceId,client_version:k.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(r.session_data.auth_token=this.authToken,r.session_data.version=3),this.authorizePromise=(0,Io.default)(this.params.apiTransport.sendRequest(e,r).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:xe.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this.authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:xe.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:xe.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var Sd=w(pe(),1);var _d=w(Pe(),1);import{now as So,ErrorCategory as Zt}from"@vkontakte/videoplayer-shared/es2018";var er=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=yo[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}sendBeacon(e,r,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this.prepareQueryParams({method:e,queryParams:r,sessionKey:i}),n=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,n)}catch(s){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:Zt.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:r}})}return!1}async sendRequest(e,r,i,o){let n=So(),s=u=>{if(u instanceof TypeError&&(0,Sd.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:Zt.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"ThinOneStat:ApiTransport:sendRequest",category:Zt.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:r,sessionKey:i,time:So()-n}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),we(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded",...o},body:this.prepareQueryParams({method:e,queryParams:r,sessionKey:i})}).then(u=>{var h,c;let d=Number(u.headers.get("content-length"))===0,l=new Date((h=u.headers.get("date"))!=null?h:"").getTime(),p=So()-n;if(isFinite(l)&&((c=this.timeSynchronisation)==null||c.addServerTime(l,p)),!d)return u.json().then(f=>Object.prototype.hasOwnProperty.call(f,"error_msg")?Promise.reject(f):f,s)},s)}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let r=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await we(r,{method:"GET",mode:"cors",cache:"no-cache"})).json(),n=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!n)throw new Error("Wrong DNS response");return n}catch(r){return this.params.error$.next({id:"ThinOneStat:ApiTransport:resolveApiBaseUrl",category:Zt.NETWORK,message:"Unhandled resolve api base url error",thrown:r}),yo.vk_alias}finally{this.isApiBaseUrlFetched=!0}}prepareQueryParams(e){let r=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&r.append("session_key",e.sessionKey),(0,_d.default)(e.queryParams).forEach(([i,o])=>r.append(i,typeof o=="string"?o:JSON.stringify(o))),r}};var Ed=w(pe(),1),Td=w(Pe(),1);import{ErrorCategory as wI,now as OI,safeStorage as ot,debounceFn as Pd}from"@vkontakte/videoplayer-shared/es2018";var tr="thinonestat_events",_o=t=>e=>e.client_time+t>=OI(),rr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{event_name:r}=e;return(0,Ed.default)(["watch_coverage","watch_coverage_live","watched_n","playback_started"],r)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=Pd(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let r=ot.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=Pd(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:r}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){try{this.flush()}catch(e){this.error$.next({id:"LoggerError",category:wI.WTF,message:String(e)||"Unknown logger error",thrown:e})}}readFromStorage(){let e=ot.get(tr);try{return e?JSON.parse(e):{}}catch(r){}return{}}addToStorage(e){var n;if(!this.userSalt){this.unsaltedStorage.push(e);return}let r=this.readFromStorage(),o=((n=r[this.userSalt])!=null?n:[]).filter(_o(this.params.config.storageExpiration));ot.set(tr,JSON.stringify({...r,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(_o(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],ot.set(tr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[r,i]of(0,Td.default)(e)){let o=i.filter(_o(this.params.config.storageExpiration));o.length?e[r]=o:delete e[r],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}ot.set(tr,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.vsid)}flush({wantBeacon:e,clearStorage:r}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),r&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};function Po(){let t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),r=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(r<=2&&(r=33554432+Math.random()*16777216|0),i=r&15,r=r>>4,e[o]=t[o===19?i&3|8:i]);return e.join("")}var ir=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var r;return e.setTime(e.getTime()+((r=this.offset)!=null?r:0)),e}addServerTime(e,r){let i=Date.now(),o=e-i-r/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};import{PlaybackState as wd}from"@vkontakte/videoplayer-core/es2018";import{Observable as AI,Subscription as xI,ValueSubject as qI,Subject as Eo,fromEvent as RI,isNullable as Od,merge as To,filter as Ad,filterChanged as xd}from"@vkontakte/videoplayer-shared/es2018";var qd=(t,e)=>new AI(r=>{let i=new xI,o=new qI(void 0),n;i.add(t.info.isLive$.pipe(xd()).subscribe(T=>{n&&(n.unsubscribe(),o.next(void 0)),T?n=t.info.liveTime$.pipe(xd()).subscribe(o):n=t.info.position$.subscribe(o),i.add(n)}));let{playing$:s,paused$:u,ended$:d,looped$:l}=t.events,p=t.events.willSeek$.pipe(Ad(()=>t.info.playbackState$.getValue()===wd.PLAYING)),h=t.events.seeked$.pipe(Ad(()=>t.info.playbackState$.getValue()===wd.PLAYING)),c=!1,f=new Eo;i.add(p.subscribe(()=>{c||f.next(),c=!0})).add(h.subscribe(()=>c=!1));let v=To(RI(window,"beforeunload"),t.events.willDestruct$),g,b=()=>g=o.getValue(),m=()=>{let T=o.getValue();Od(g)||Od(T)||g===T||(r.next({from:g,to:T}),g=void 0)},y=new Eo,E=new Eo,N=To(s,f,y),I=To(u,h,v,d,l,E);if(i.add(N.subscribe(b)).add(I.subscribe(m)),e.heartbeatInterval&&isFinite(e.heartbeatInterval)){let T=[],nt=e.heartbeatInterval*1e3,at=()=>{E.next(),y.next()};i.add(N.subscribe(()=>{let sr=window.setTimeout(at,nt);T.push(sr)})).add(I.subscribe(()=>{T.forEach(sr=>{window.clearTimeout(sr)}),T=[]}))}return i});import{Subscription as CI}from"@vkontakte/videoplayer-core/es2018";import{Observable as LI}from"@vkontakte/videoplayer-shared/es2018";var Rd=(t,e)=>new LI(r=>{let i=new CI,o=1e4,n=0;return i.add(t.info.position$.subscribe(()=>{let s=e.getTotalViewTime()*1e3;s>n&&s%o===0&&(n=s,r.next({target_duration:o,current_tvt:s}))})),i});import{Observable as kI,Subscription as NI,merge as Cd}from"@vkontakte/videoplayer-shared/es2018";var Ld=t=>new kI(e=>{let r=new NI,i=0,o=1,n=0,s=!1,u=!1,d=()=>{if(!s)return;let I=Date.now();n+=(I-i)*o,i=I},l=()=>{(!s||u)&&(i=Date.now(),s=!0,u=!1)},p=()=>{s&&(d(),s=!1)},h=()=>{s&&(d(),s=!1,u=!0)},c=I=>{s&&d(),o=I,i=Date.now()},{started$:f,playing$:v,paused$:g,willSeek$:b,ended$:m,willDestruct$:y}=t.events,{currentPlaybackRate$:E}=t.info;r.add(b.subscribe(h)).add(Cd(f,v).subscribe(l)).add(Cd(g,m,y).subscribe(p)).add(E.subscribe(c));let N=()=>{let I=n;return s&&(I+=(Date.now()-i)*o),Math.floor(I/1e3)};return e.next(N),r});import{assertNever as kd}from"@vkontakte/videoplayer-shared/es2018";import{Surface as qe,VideoFormat as P,VideoQuality as U}from"@vkontakte/videoplayer-core/es2018";var wo=t=>{if(t!==void 0)switch(t){case P.MPEG:return"MP4";case P.DASH:case P.DASH_LIVE:return"DASH";case P.DASH_SEP:return"DASH_SEP";case P.DASH_ONDEMAND:return"ONDEMAND_DASH";case P.HLS_ONDEMAND:return"ONDEMAND_HLS";case P.HLS:case P.HLS_LIVE:return"HLS";case P.DASH_WEBM:case P.DASH_LIVE_WEBM:return"WEBM";case P.DASH_LIVE_CMAF:return"ONDEMAND_DASH_LIVE";case P.HLS_LIVE_CMAF:return"ONDEMAND_HLS_LIVE";case P.WEB_RTC_LIVE:return"WEBRTC";case P.DASH_WEBM_AV1:return"AV1";case P.DASH_STREAMS:return"MULTI_DASH";default:return kd(t)}},Y=t=>{if(t!==void 0)switch(t){case U.Q_144P:return"144p";case U.Q_240P:return"240p";case U.Q_360P:return"360p";case U.Q_480P:return"480p";case U.Q_720P:return"720p";case U.Q_1080P:return"1080p";case U.Q_1440P:return"1440p";case U.Q_2160P:return"2160p";case U.INVARIANT:case U.Q_576P:case U.Q_4320P:return"UNKNOWN";default:return kd(t)}},Nd=t=>{if(t!==void 0)switch(t){case"MP4":case"ONDEMAND_DASH":case"ONDEMAND_DASH_LIVE":case"ONDEMAND_HLS":case"ONDEMAND_HLS_LIVE":case"MULTI_DASH":case"WEBM":case"AV1":return"vod";case"DASH":case"HLS":case"WEBRTC":return"live";default:return}},Dd=(t,e,r)=>{var i;if(t&&e)switch(t){case P.MPEG:return r&&e[t]&&e[t][r];default:return(i=e[t])==null?void 0:i.url}},$d=t=>{if(t!==void 0)switch(t){case qe.NONE:return;case qe.INLINE:return"inline";case qe.FULLSCREEN:return"fullscreen";case qe.SECOND_SCREEN:return"chromecast";case qe.PIP:return"pip_external"}},Md=t=>{if(t!==void 0)return t===qe.INVISIBLE?"background":"foreground"};var Oo=w(lo(),1),Vd=()=>(0,Oo.default)(Math.floor(Math.random()*2**32).toString(36),13,"0"),Fd=()=>(0,Oo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var UI="_thin-one-stat_",Wd=`${UI}deviceId`,BI=()=>{let t=new Ao;return{subscription:t,subscribe:(e,r)=>{e&&t.add(e.subscribe(r))}}},nr=class{constructor(e,r){this.debugLogger=new VI;this.thinOneStatDebugLog=this.debugLogger.createComponentLog("ThinOneStat");this.eventNumber=1;this.seekAction$=new or("unknown");this.playerSize$=new or({width:0,height:0});this.vsid$=new or(void 0);this.isid$=new or(void 0);var d,l;this.statContext=e,this.config=Id((d=r.config)!=null?d:{}),this.subscription=new Ao,this.config.synchronizeTime&&(this.timeSynchronisation=new ir);let i=new FI,o=Bd.get(Wd);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=Po(),Bd.set(Wd,this.deviceId)),this.resetViewSession(),r.useIsid&&this.isid$.next((l=r.isid)!=null?l:Fd());let n=new er({error$:i,config:this.config,timeSynchronisation:this.timeSynchronisation});this.api=new Xt({config:this.config,apiTransport:n,error$:i,deviceId:this.deviceId,refreshAuthToken:r.refreshAuthToken}),this.logger=new rr({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:r.userSalt});let{isEmbed:s,topOrigin:u}=$I();this.isEmbed=s,this.embedHostname=u?new URL(u).hostname:void 0}authorize(e){return this.api.authorize(e)}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let r=new Ao,i=(n,s)=>r.add(n.subscribe(s));i(Ld(e),n=>{this.getTotalViewTime=n}),i(e.info.isLive$,n=>this.isLive=n),i(e.info.position$,n=>this.position=n);let o;return i(e.info.hostname$,n=>{o!==void 0&&o!==n&&this.logFailover({cdn_host:n}),this.cdnHostname=o=n}),i(qd(e,{heartbeatInterval:this.config.watchCoverageHeartbeatInterval}),n=>{let s=Math.round(n.from*1e3),u=Math.round(n.to*1e3),d={watch_interval:`${s}-${u}`,in_history:!!this.statContext.inHistory,content_type:wo(e.info.currentFormat$.getValue()),playback_quality:Y(e.info.currentQuality$.getValue()),recom_info:this.statContext.recomInfo};if(!e.info.isLive$.getValue())this.logWatchCoverage(d);else{let p=e.info.atLiveEdge$.getValue();this.logWatchCoverageLive({...d,live:!!p})}}),i(Rd(e,{getTotalViewTime:this.getTotalViewTime}),n=>{this.logWatchedN(n)}),i(Ud(e.events.willStart$,e.events.looped$),n=>{var u;n&&this.resetViewSession();let s={isid:this.isid$.getValue(),stream_profile:Nd(wo(e.info.currentFormat$.getValue())),dpi:ae.display.pixelRatio,web_layout:ae.device.isMobile?"mobile":"desktop",iframe_host:this.isEmbed?(u=this.embedHostname)!=null?u:void 0:null,from_downloads:!0,preloaded:this.statContext.preload,navigation:this.statContext.navigation,recom_info:this.statContext.recomInfo};this.logStartSession(s)}),i(e.events.willReady$,()=>{if(this.statContext.preload){let n=e.info.currentFormat$.getValue(),s=e.info.availableSources$.getValue(),u=e.info.currentBuffer$.getValue(),d=e.info.currentQuality$.getValue(),l={target_buffer_time:u?u.end-u.start:void 0,playback_url:Dd(n,s,d),playback_quality:Y(d)};this.logPreloadStarted(l)}}),i(e.events.ready$,()=>{if(this.statContext.preload){let n=e.info.currentBuffer$.getValue(),s={buffer_time:n?n.end-n.start:void 0};this.logPreloadEnded(s)}}),i(e.events.playing$,()=>{this.logPlay()}),i(e.info.playbackState$,n=>{var s;if(n===jd.PLAYING){let u=e.info.currentBuffer$.getValue(),d={buffer_time:u?u.end-u.start:void 0};if(this.logPlaying(d),this.isStarted)this.logResume();else{this.isStarted=!0;let l=e.info.currentQuality$.getValue(),p=e.info.isAutoQualityEnabled$.getValue(),h=e.info.muted$.getValue(),c=e.info.volume$.getValue(),f=e.info.surface$.getValue(),v=e.info.availableTextTracks$.getValue(),g=e.info.currentTextTrack$.getValue(),b=e.info.currentAudioStream$.getValue(),m=e.info.currentPlaybackRate$.getValue(),y={playback_quality:Y(l),user_quality:p?"auto":Y(l),player_width:this.playerSize$.getValue().width,player_height:this.playerSize$.getValue().height,muted:h,sound_volume:c,buffer_time:u?Math.round(u.end-u.start):void 0,mode:$d(f),visibility:Md(f),subtitles_enabled:!!g,auto_subtitles:!!((s=v.find(({id:E})=>E===g))!=null&&s.isAuto),audio_track_lang:b==null?void 0:b.language,playback_rate:m,recom_info:this.statContext.recomInfo};this.logPlaybackStarted(y)}}else n===jd.PAUSED&&this.logPause()}),i(e.events.willSeek$,({to:n})=>{let s={target_position:n,seek_type:this.seekAction$.getValue()};this.logSeeking(s)}),i(e.events.seeked$,()=>{let s={target_position:e.info.position$.getValue(),seek_type:this.seekAction$.getValue()};this.logSeeked(s),this.seekAction$.next("unknown")}),i(Ud(e.info.isBuffering$,e.info.isStalled$),n=>{n&&this.logShowLoader()}),i(e.info.currentQuality$,n=>{var s,u;if(n){let d=e.info.isAutoQualityEnabled$.getValue(),l=(s=e.info.currentVideoStream$.getValue())==null?void 0:s.codec,p=(u=e.info.currentAudioStream$.getValue())==null?void 0:u.codec,h={user_quality:d?"auto":Y(n),playback_quality:Y(n),download_quality:Y(n),codec_info:l&&p?`${l},${p}`:void 0,manual_switch:!d};this.logQualityChanged(h)}}),this.resubscribeBeforeunload(),this.subscription.add(r),r}attachToUi(e){let{subscribe:r,subscription:i}=BI();return r(e.actionSeek$,this.seekAction$),r(e.playerSize$,this.playerSize$),this.subscription.add(i),i}getDeviceId(){return this.deviceId}resetViewSession(){this.thinOneStatDebugLog({message:"VSID reset"}),this.vsid$.next(Vd()),this.eventNumber=0}destroy(){this.api.destroy()}createRequiredParams(e){let r=this.vsid$.getValue();DI(r);let i=this.eventNumber++;return{vsid:r,uv_movie_id:this.statContext.movieId,event_name:e,client_time:Date.now(),application:`@vkontakte/videoplayer-statistics:${k}`,platform:`web:${ae.device.isMobile?"mobile":"desktop"}`,product:this.statContext.product,event_number:i,playback_position:this.isLive?void 0:Math.round(this.position),current_tvt:this.getTotalViewTime(),cdn_host:this.cdnHostname}}createRequiredFatParams(){return{stats_version:k,browser:ae.browser.current,browser_version:String(ae.browser.currentVersion),os:ae.device.current,os_version:"",device_type:ae.device.isMobile?"mobile":"desktop",navigation:this.statContext.navigation}}log(e,r,i=!1){let o=this.createRequiredParams(e),n={};i&&(n=this.createRequiredFatParams()),this.logger.log({...o,...n,...r})}logWatchCoverage(e){this.log("watch_coverage",e,!0)}logWatchCoverageLive(e){this.log("watch_coverage_live",e,!0)}logWatchedN(e){this.log("watched_n",e,!0)}logStartSession(e){this.log("start_session",e,!0)}logPreloadStarted(e){this.log("preload_started",e)}logPreloadEnded(e){this.log("preload_ended",e)}logPlaybackStarted(e){this.log("playback_started",e,!0)}logPlay(){this.log("play")}logPlaying(e){this.log("playing",e)}logPause(){this.log("pause")}logResume(){this.log("resume")}logSeeking(e){this.log("seeking",e)}logSeeked(e){this.log("seeked",e)}logShowLoader(){this.log("show_loader")}logQualityChanged(e){this.log("quality_changed",e)}logFailover(e){this.log("failover",e)}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=MI(window,"beforeunload").subscribe(()=>{}),this.subscription.add(this.beforeunloadSubscription)}};var Hd={};var jI=(t,e={})=>{let i=e.timeout||1,o=performance.now();return window.setTimeout(()=>{t({get didTimeout(){return e.timeout?!1:performance.now()-o-1>i},timeRemaining(){return Math.max(0,1+(performance.now()-o))}})},1)},WI=t=>window.clearTimeout(t),Kd=t=>typeof t=="function"&&(t==null?void 0:t.toString().endsWith("{ [native code] }")),Gd=!Kd(window.requestIdleCallback)||!Kd(window.cancelIdleCallback),zd=Gd?jI:window.requestIdleCallback,Qd=Gd?WI:window.cancelIdleCallback;import{PlaybackState as Jd,Subscription as HI}from"@vkontakte/videoplayer-core/es2018";import{Logger as KI}from"@vkontakte/videoplayer-shared/es2018";var ar=class{constructor(){this.startTime=null;this.stopTime=null;this.accumulatedTime=0}get time(){return Math.floor(this.timeMs/1e3)}get timeMs(){var r;return this.startTime===null?0:((r=this.stopTime)!=null?r:this.now())-this.startTime-this.accumulatedTime}get isRunning(){return this.startTime!==null&&this.stopTime===null}start(){this.isRunning||(this.stopTime!==null?(this.accumulatedTime+=this.now()-this.stopTime,this.stopTime=null):this.startTime=this.now())}stop(){this.isRunning&&(this.stopTime=this.now())}reset(){this.startTime=null,this.stopTime=null,this.accumulatedTime=0}now(){return Date.now()}};var Yd=()=>window.Image?new Image:document.createElement("img");var qo=class{constructor(e){this.position=0;this.started=!1;this.heartbeatPixels=[];this.heartbeatLastTimeSent={};this.idleCallbackIds=[];this.stopwatch=new ar;this.subscription=new HI;this.params=e;let r=new KI;this.log=r.createComponentLog("MediascopePixel")}attachTo(e){this.subscription.add(e.info.playbackState$.subscribe(r=>this.onPlaybackState(r))).add(e.info.position$.subscribe(r=>this.onPosition(r))).add(e.info.atLiveEdge$.subscribe(r=>this.isActiveLive=r)),this.subscription.add(e.events.willSeek$.subscribe(()=>this.onWillSeek())).add(e.events.seeked$.subscribe(()=>this.onSeeked())).add(e.events.ended$.subscribe(()=>this.onEnded()))}destroy(){this.stopwatch.reset(),this.subscription.unsubscribe(),window.clearTimeout(this.heartbeatFirstTimeoutId),this.idleCallbackIds.forEach(e=>Qd(e)),this.send("stop")}onPlaybackState(e){e===Jd.PLAYING?this.started?this.play():this.start():e===Jd.PAUSED&&this.pause()}start(){var i,o,n;this.started=!0,this.stopwatch.start(),this.send("start"),this.heartbeatPixels=this.prepareHeartbeatPixels(),this.heartbeatInterval=(i=this.heartbeatPixels[0])==null?void 0:i.interval;let e=(o=this.heartbeatPixels[0])==null?void 0:o.url,r=(n=this.heartbeatPixels[0])==null?void 0:n.delay;if(r!==void 0&&e)try{this.heartbeatFirstTimeoutId=window.setTimeout(()=>{this.sendHeartbeat(e)},r*1e3)}catch(s){this.log({message:s.message})}}play(){this.stopwatch.start(),this.send("resume")}pause(){this.stopwatch.stop(),this.send("pause")}onPosition(e){if(this.position=e,this.heartbeatInterval&&this.stopwatch.time!==0&&this.stopwatch.time%this.heartbeatInterval===0)for(let[r,{url:i}]of this.heartbeatPixels.entries())this.heartbeatLastTimeSent[r]!==this.stopwatch.time&&(this.heartbeatLastTimeSent[r]=this.stopwatch.time,this.sendHeartbeat(i))}onWillSeek(){this.started&&this.send("stop")}onSeeked(){this.started&&this.send("start")}onEnded(){this.stopwatch.stop(),this.send("stop")}validatePixels(e,r){return e==null?void 0:e.filter(i=>i.event===r.event&&r.keys.every(o=>!!i[o]))}getFrameTimestamp(){let e;if(this.isActiveLive){let r=Math.floor(Math.random()*25)+5;e=Date.now()/1e3-r}else e=this.position||0;return Math.floor(e)}getUTC(){return Math.floor(Date.now()/1e3)}prepareUrl(e){let r=new URL(e);return r.pathname=r.pathname.replace("{@fts_fake_sec}",String(this.getFrameTimestamp())).replace("{@utc_sec}",String(this.getUTC())),r.search=[...new URLSearchParams(r.search)].filter(([i,o])=>!/={@[\w]+}/.test(`${i}=${o}`)).map(i=>i.join("=")).join("&"),r.toString()}preparePixels(e){return this.validatePixels(this.params.pixels,{event:e,keys:["url"]})}prepareHeartbeatPixels(){return this.validatePixels(this.params.pixels,{event:"heartbeat",keys:["url","interval"]})}call(e){try{this.idleCallbackIds.push(zd(()=>Yd().src=this.prepareUrl(e)))}catch(r){this.log({message:r.message})}}send(e){let r=this.preparePixels(e);for(let{url:i}of r)this.call(i)}sendHeartbeat(e){this.call(e)}};export{Ue as ApiEnv,Hr as ConnectionType,Wr as ContentType,Ea as InteractiveInterfaceClick,qo as MediascopePixel,Hd as MediascopePixelTypes,bo as OneStat,jr as Quality,Kr as SeekAction,xo as ThinOneStat,k as VERSION};
|