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