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