@vkontakte/videoplayer-statistics 1.0.88-dev.83e1418a.0 → 1.0.88-dev.ebe69522.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.83e1418a.0
3
- * Mon, 29 Sep 2025 09:58:53 GMT
2
+ * @vkontakte/videoplayer-statistics v1.0.88-dev.ebe69522.0
3
+ * Wed, 01 Oct 2025 08:08:55 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.83e1418a.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 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 L=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=L(),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=L();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=L(),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=L();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 kr=a((wI,Tn)=>{"use strict";var En=x(),Lr=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&&Lr&&(W=Lr.match(/Edge\/(\d+)/),(!W||W[1]>=74)&&(W=Lr.match(/Chrome\/(\d+)/),W&&(yt=+W[1])));Tn.exports=yt});var Nr=a((AI,An)=>{"use strict";var wn=kr(),_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(),Lf=Ye(),kf=TypeError;Rn.exports=function(t){if(Cf(t))return t;throw new kf(Lf(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 kn=a((LI,Ln)=>{"use strict";var Mr=j(),Vr=O(),Fr=H(),$f=TypeError;Ln.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((kI,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=L(),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=L(),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=kn(),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(),Lp=sa(sa.bind);ua.exports=function(t,e){return Rp(t),e===void 0?t:Cp?Lp(t,e):function(){return t.apply(e,arguments)}}});var zr=a((zI,ca)=>{"use strict";var kp=N(),Np=C();ca.exports=kp&&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(),Lh=String;Ha.exports=function(t){if(Ch(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Lh(t)}});var Ka=a((wS,Wa)=>{"use strict";var kh=Pt(),Nh=si(),Dh=_e(),$h=RangeError;Wa.exports=function(e){var r=Nh(Dh(this)),i="",o=kh(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=L(),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((LS,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 Lt=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=L(),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=L(),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,ks)=>{"use strict";var qv=L(),Rv=C(),qs=O(),Cv=tt(),Lv=ee(),kv=di(),Rs=function(){},Cs=Lv("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}},Ls=function(e){if(!qs(e))return!1;switch(Cv(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Dv||!!Nv(fi,kv(e))}catch(r){return!0}};Ls.sham=!0;ks.exports=!Cs||Rv(function(){var t;return ot(ot.call)||!ot(Object)||!ot(function(){t=!0})||t})?Ls: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=L();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=Lt(),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=Lt(),du=Ce.MutationObserver||Ce.WebKitMutationObserver,fu=Ce.document,pu=Ce.process,kt=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&&kt&&kt.resolve?(Nt=kt.resolve(void 0),Nt.constructor=kt,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 ki=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",Li=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 Li("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 Li(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 Li(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 Le=a((m_,Lu)=>{"use strict";var wg=x(),lt=ve(),Ag=O(),xg=Qr(),Og=di(),qg=D(),qu=ui(),Rg=J(),Ni=kr(),Ru=lt&&lt.prototype,Cg=qg("species"),Di=!1,Cu=Ag(wg.PromiseRejectionEvent),Lg=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});Lu.exports={CONSTRUCTOR:Lg,REJECTION_EVENT:Cu,SUBCLASSING:Di}});var ke=a((b_,Nu)=>{"use strict";var ku=te(),kg=TypeError,Ng=function(t){var e,r;this.promise=new t(function(i,o){if(e!==void 0||r!==void 0)throw new kg("Bad Promise constructor");e=i,r=o}),this.resolve=ku(e),this.reject=ku(r)};Nu.exports.f=function(t){return new Ng(t)}});var tc=a(()=>{"use strict";var Dg=$(),$g=J(),Ht=Lt(),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=ki(),Wt=ve(),Ui=Le(),Hu=ke(),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=Le().CONSTRUCTOR;Sc.exports=Cm||!Rm(function(t){qm.all(t).then(void 0,function(){})})});var _c=a(()=>{"use strict";var Lm=$(),km=j(),Nm=te(),Dm=ke(),$m=Dt(),Mm=Qt(),Vm=Gi();Lm({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++,km(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=Le().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=ke(),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=ke(),tb=Le().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=ke();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=Le().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(),Lc=ee(),kc=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,Lc("Promise")),r=kc(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&&kc(zt)&&(Ji=Lc("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=L(),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(),Lb=C(),Xc=L(),kb=Yt(),Nb=io(),Db=le(),$b=Or().f,Zc=Xc($b),Mb=Xc([].push),Vb=Jc&&Lb(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&&kb(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,kl)=>{"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(),Ll=ho(),Oy=Cl.PROPER,qy=Cl.CONFIGURABLE,xl=Ll.IteratorPrototype,er=Ll.BUGGY_SAFARI_ITERATORS,dt=xy("iterator"),Ol="keys",ft="values",ql="entries",Rl=function(){return this};kl.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=ki(),Cy=fe().f,Ly=Nl(),tr=$l(),ky=J(),Ny=N(),Bl="Array Iterator",Dy=Fl.set,$y=Fl.getterFor(Bl);Ul.exports=Ly(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(!ky&&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:()=>ko,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}},La=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||{}),ka={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=ka[e])!=null?o:e,custom:i})};var V="1.0.88-dev.ebe69522.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:kP,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(),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 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,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,Y=(k=e.info.liveBufferTime$.getValue())!=null?k: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&&La(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)},k=new P.Subject,U=new P.Subject,w=(0,P.merge)(d,v,k),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(),k.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$:k}=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(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 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}},Lo=(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 Ld=R(Rt(),1);var kd=()=>(0,Ld.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:kd());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(),k=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:Lo(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:k==null?void 0:k.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:Lo(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 ko={};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)}};