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