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