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