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