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