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