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