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