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