@vkontakte/videoplayer-statistics 1.0.49 → 1.0.50-dev.6dfddf68.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/esnext.cjs.js +4 -4
- package/esnext.esm.js +4 -4
- package/evergreen.esm.js +4 -4
- package/package.json +8 -8
- package/types/Api.d.ts +38 -0
- package/types/ApiTransport.d.ts +26 -0
- package/types/Logger.d.ts +37 -0
- package/{index.d.ts → types/OneStat.d.ts} +21 -184
- package/types/config.d.ts +29 -0
- package/types/env.d.ts +7 -0
- package/types/index.d.ts +6 -0
- package/types/types.d.ts +43 -0
- package/types/uiEvents.d.ts +24 -0
- package/types/utils/mappers.d.ts +7 -0
- package/types/utils/shorten.d.ts +2 -0
- package/types/utils/timeSynchronisation.d.ts +10 -0
- package/types/utils/uuid.d.ts +1 -0
- package/types/utils/vsid.d.ts +2 -0
- package/types/utils/watchCoverage.d.ts +6 -0
- package/types/values.d.ts +85 -0
package/es2015.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-statistics v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-statistics v1.0.50-dev.6dfddf68.0
|
|
3
|
+
* Mon, 24 Jun 2024 09:57:55 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-50/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var u=require("@vkontakte/videoplayer-shared/es2015.cjs.js"),p=require("@vkontakte/videoplayer-core/es2015.cjs.js"),Je=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $e=function(e){return e&&e.Math==Math&&e},E=$e(typeof globalThis=="object"&&globalThis)||$e(typeof window=="object"&&window)||$e(typeof self=="object"&&self)||$e(typeof Je=="object"&&Je)||function(){return this}()||Je||Function("return this")(),P=function(e){try{return!!e()}catch(t){return!0}},_a=P,Ue=!_a(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Pa=Ue,Zn=Function.prototype,Ar=Zn.apply,Cr=Zn.call,eo=typeof Reflect=="object"&&Reflect.apply||(Pa?Cr.bind(Ar):function(){return Cr.apply(Ar,arguments)}),to=Ue,ro=Function.prototype,Ft=ro.call,Ia=to&&ro.bind.bind(Ft,Ft),I=to?Ia:function(e){return function(){return Ft.apply(e,arguments)}},no=I,wa=no({}.toString),Ra=no("".slice),fe=function(e){return Ra(wa(e),8,-1)},Aa=fe,Ca=I,oo=function(e){if(Aa(e)==="Function")return Ca(e)},Mt=typeof document=="object"&&document.all,Na=typeof Mt=="undefined"&&Mt!==void 0,ao={all:Mt,IS_HTMLDDA:Na},io=ao,La=io.all,m=io.IS_HTMLDDA?function(e){return typeof e=="function"||e===La}:function(e){return typeof e=="function"},ir={},xa=P,B=!xa(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Da=Ue,me=Function.prototype.call,_=Da?me.bind(me):function(){return me.apply(me,arguments)},so={},uo={}.propertyIsEnumerable,co=Object.getOwnPropertyDescriptor,ja=co&&!uo.call({1:2},1);so.f=ja?function(t){var r=co(this,t);return!!r&&r.enumerable}:uo;var Ve=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},ka=I,Fa=P,Ma=fe,Xe=Object,Ba=ka("".split),Ua=Fa(function(){return!Xe("z").propertyIsEnumerable(0)})?function(e){return Ma(e)=="String"?Ba(e,""):Xe(e)}:Xe,ve=function(e){return e==null},Va=ve,Ga=TypeError,sr=function(e){if(Va(e))throw Ga("Can't call method on "+e);return e},Ka=Ua,Ha=sr,de=function(e){return Ka(Ha(e))},Nr=m,lo=ao,Wa=lo.all,x=lo.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Nr(e)||e===Wa}:function(e){return typeof e=="object"?e!==null:Nr(e)},ur={},Ze=ur,et=E,qa=m,Lr=function(e){return qa(e)?e:void 0},K=function(e,t){return arguments.length<2?Lr(Ze[e])||Lr(et[e]):Ze[e]&&Ze[e][t]||et[e]&&et[e][t]},Qa=I,Ge=Qa({}.isPrototypeOf),Ke=typeof navigator!="undefined"&&String(navigator.userAgent)||"",fo=E,tt=Ke,xr=fo.process,Dr=fo.Deno,jr=xr&&xr.versions||Dr&&Dr.version,kr=jr&&jr.v8,w,je;kr&&(w=kr.split("."),je=w[0]>0&&w[0]<4?1:+(w[0]+w[1]));!je&&tt&&(w=tt.match(/Edge\/(\d+)/),(!w||w[1]>=74)&&(w=tt.match(/Chrome\/(\d+)/),w&&(je=+w[1])));var vo=je,Fr=vo,za=P,Ya=E,Ja=Ya.String,ho=!!Object.getOwnPropertySymbols&&!za(function(){var e=Symbol();return!Ja(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Fr&&Fr<41}),Xa=ho,po=Xa&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Za=K,ei=m,ti=Ge,ri=po,ni=Object,go=ri?function(e){return typeof e=="symbol"}:function(e){var t=Za("Symbol");return ei(t)&&ti(t.prototype,ni(e))},oi=String,He=function(e){try{return oi(e)}catch(t){return"Object"}},ai=m,ii=He,si=TypeError,H=function(e){if(ai(e))return e;throw si(ii(e)+" is not a function")},ui=H,ci=ve,We=function(e,t){var r=e[t];return ci(r)?void 0:ui(r)},rt=_,nt=m,ot=x,li=TypeError,fi=function(e,t){var r,n;if(t==="string"&&nt(r=e.toString)&&!ot(n=rt(r,e))||nt(r=e.valueOf)&&!ot(n=rt(r,e))||t!=="string"&&nt(r=e.toString)&&!ot(n=rt(r,e)))return n;throw li("Can't convert object to primitive value")},bo={exports:{}},vi=!0,Mr=E,di=Object.defineProperty,hi=function(e,t){try{di(Mr,e,{value:t,configurable:!0,writable:!0})}catch(r){Mr[e]=t}return t},pi=E,gi=hi,Br="__core-js_shared__",bi=pi[Br]||gi(Br,{}),cr=bi,Ur=cr;(bo.exports=function(e,t){return Ur[e]||(Ur[e]=t!==void 0?t:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var yo=bo.exports,yi=sr,$i=Object,lr=function(e){return $i(yi(e))},mi=I,Si=lr,Ei=mi({}.hasOwnProperty),A=Object.hasOwn||function(t,r){return Ei(Si(t),r)},Ti=I,Oi=0,_i=Math.random(),Pi=Ti(1 .toString),$o=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Pi(++Oi+_i,36)},Ii=E,wi=yo,Vr=A,Ri=$o,Ai=ho,Ci=po,X=Ii.Symbol,at=wi("wks"),Ni=Ci?X.for||X:X&&X.withoutSetter||Ri,T=function(e){return Vr(at,e)||(at[e]=Ai&&Vr(X,e)?X[e]:Ni("Symbol."+e)),at[e]},Li=_,Gr=x,Kr=go,xi=We,Di=fi,ji=T,ki=TypeError,Fi=ji("toPrimitive"),Mi=function(e,t){if(!Gr(e)||Kr(e))return e;var r=xi(e,Fi),n;if(r){if(t===void 0&&(t="default"),n=Li(r,e,t),!Gr(n)||Kr(n))return n;throw ki("Can't convert object to primitive value")}return t===void 0&&(t="number"),Di(e,t)},Bi=Mi,Ui=go,fr=function(e){var t=Bi(e,"string");return Ui(t)?t:t+""},Vi=E,Hr=x,Bt=Vi.document,Gi=Hr(Bt)&&Hr(Bt.createElement),vr=function(e){return Gi?Bt.createElement(e):{}},Ki=B,Hi=P,Wi=vr,mo=!Ki&&!Hi(function(){return Object.defineProperty(Wi("div"),"a",{get:function(){return 7}}).a!=7}),qi=B,Qi=_,zi=so,Yi=Ve,Ji=de,Xi=fr,Zi=A,es=mo,Wr=Object.getOwnPropertyDescriptor;ir.f=qi?Wr:function(t,r){if(t=Ji(t),r=Xi(r),es)try{return Wr(t,r)}catch(n){}if(Zi(t,r))return Yi(!Qi(zi.f,t,r),t[r])};var ts=P,rs=m,ns=/#|\.prototype\./,he=function(e,t){var r=as[os(e)];return r==ss?!0:r==is?!1:rs(t)?ts(t):!!t},os=he.normalize=function(e){return String(e).replace(ns,".").toLowerCase()},as=he.data={},is=he.NATIVE="N",ss=he.POLYFILL="P",So=he,qr=oo,us=H,cs=Ue,ls=qr(qr.bind),qe=function(e,t){return us(e),t===void 0?e:cs?ls(e,t):function(){return e.apply(t,arguments)}},W={},fs=B,vs=P,Eo=fs&&vs(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ds=x,hs=String,ps=TypeError,D=function(e){if(ds(e))return e;throw ps(hs(e)+" is not an object")},gs=B,bs=mo,ys=Eo,Se=D,Qr=fr,$s=TypeError,it=Object.defineProperty,ms=Object.getOwnPropertyDescriptor,st="enumerable",ut="configurable",ct="writable";W.f=gs?ys?function(t,r,n){if(Se(t),r=Qr(r),Se(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ct in n&&!n[ct]){var o=ms(t,r);o&&o[ct]&&(t[r]=n.value,n={configurable:ut in n?n[ut]:o[ut],enumerable:st in n?n[st]:o[st],writable:!1})}return it(t,r,n)}:it:function(t,r,n){if(Se(t),r=Qr(r),Se(n),bs)try{return it(t,r,n)}catch(o){}if("get"in n||"set"in n)throw $s("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Ss=B,Es=W,Ts=Ve,pe=Ss?function(e,t,r){return Es.f(e,t,Ts(1,r))}:function(e,t,r){return e[t]=r,e},Ee=E,Os=eo,_s=oo,Ps=m,Is=ir.f,ws=So,q=ur,Rs=qe,Q=pe,zr=A,As=function(e){var t=function(r,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,o)}return Os(e,this,arguments)};return t.prototype=e.prototype,t},C=function(e,t){var r=e.target,n=e.global,o=e.stat,i=e.proto,s=n?Ee:o?Ee[r]:(Ee[r]||{}).prototype,c=n?q:q[r]||Q(q,r,{})[r],v=c.prototype,f,a,l,d,h,g,b,$,y;for(d in t)f=ws(n?d:r+(o?".":"#")+d,e.forced),a=!f&&s&&zr(s,d),g=c[d],a&&(e.dontCallGetSet?(y=Is(s,d),b=y&&y.value):b=s[d]),h=a&&b?b:t[d],!(a&&typeof g==typeof h)&&(e.bind&&a?$=Rs(h,Ee):e.wrap&&a?$=As(h):i&&Ps(h)?$=_s(h):$=h,(e.sham||h&&h.sham||g&&g.sham)&&Q($,"sham",!0),Q(c,d,$),i&&(l=r+"Prototype",zr(q,l)||Q(q,l,{}),Q(q[l],d,h),e.real&&v&&(f||!v[d])&&Q(v,d,h)))},Cs=x,Ns=fe,Ls=T,xs=Ls("match"),Ds=function(e){var t;return Cs(e)&&((t=e[xs])!==void 0?!!t:Ns(e)=="RegExp")},js=T,ks=js("toStringTag"),To={};To[ks]="z";var dr=String(To)==="[object z]",Fs=dr,Ms=m,Le=fe,Bs=T,Us=Bs("toStringTag"),Vs=Object,Gs=Le(function(){return arguments}())=="Arguments",Ks=function(e,t){try{return e[t]}catch(r){}},ge=Fs?Le:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Ks(t=Vs(e),Us))=="string"?r:Gs?Le(t):(n=Le(t))=="Object"&&Ms(t.callee)?"Arguments":n},Hs=ge,Ws=String,qs=function(e){if(Hs(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Ws(e)},Qs=D,zs=function(){var e=Qs(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Ys=_,Js=A,Xs=Ge,Zs=zs,Yr=RegExp.prototype,eu=function(e){var t=e.flags;return t===void 0&&!("flags"in Yr)&&!Js(e,"flags")&&Xs(Yr,e)?Ys(Zs,e):t},hr=I,tu=lr,ru=Math.floor,lt=hr("".charAt),nu=hr("".replace),ft=hr("".slice),ou=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,au=/\$([$&'`]|\d{1,2})/g,iu=function(e,t,r,n,o,i){var s=r+e.length,c=n.length,v=au;return o!==void 0&&(o=tu(o),v=ou),nu(i,v,function(f,a){var l;switch(lt(a,0)){case"$":return"$";case"&":return e;case"`":return ft(t,0,r);case"'":return ft(t,s);case"<":l=o[ft(a,1,-1)];break;default:var d=+a;if(d===0)return f;if(d>c){var h=ru(d/10);return h===0?f:h<=c?n[h-1]===void 0?lt(a,1):n[h-1]+lt(a,1):f}l=n[d-1]}return l===void 0?"":l})},su=C,uu=_,pr=I,Jr=sr,cu=m,lu=ve,fu=Ds,z=qs,vu=We,du=eu,hu=iu,pu=T,gu=pu("replace"),bu=TypeError,Oo=pr("".indexOf),yu=pr("".replace),Xr=pr("".slice),$u=Math.max,Zr=function(e,t,r){return r>e.length?-1:t===""?r:Oo(e,t,r)};su({target:"String",proto:!0},{replaceAll:function(t,r){var n=Jr(this),o,i,s,c,v,f,a,l,d,h=0,g=0,b="";if(!lu(t)){if(o=fu(t),o&&(i=z(Jr(du(t))),!~Oo(i,"g")))throw bu("`.replaceAll` does not allow non-global regexes");if(s=vu(t,gu),s)return uu(s,t,n,r);if(o)return yu(z(n),t,r)}for(c=z(n),v=z(t),f=cu(r),f||(r=z(r)),a=v.length,l=$u(1,a),h=Zr(c,v,0);h!==-1;)d=f?z(r(v,h,c)):hu(v,c,h,[],void 0,r),b+=Xr(c,g,h)+d,g=h+a,h=Zr(c,v,h+l);return g<c.length&&(b+=Xr(c,g)),b}});var mu=K,_o=mu,Su=_o,Eu=Su("String","replaceAll"),Tu=Eu,Ou=Tu,_u=Ou,Pu=_u,Iu=ar(Pu);exports.ApiEnv=void 0;(function(e){e.PROD="prod",e.VK_ALIAS="vk_alias",e.VIDEOTEST="videotest",e.TEST="test",e.AUTO="auto"})(exports.ApiEnv||(exports.ApiEnv={}));exports.Quality=void 0;(function(e){e.Q144P="mobile",e.Q240P="lowest",e.Q360P="low",e.Q480P="medium",e.Q720P="high",e.Q1080P="fullhd",e.Q1440P="quadhd",e.Q2160P="ultrahd",e.UNKNOWN="unknown"})(exports.Quality||(exports.Quality={}));exports.ContentType=void 0;(function(e){e.MP4="mp4",e.DASH="dash",e.DASH_SEP="dash_sep",e.ONDEMAND_DASH="ondemand_dash",e.HLS="hls",e.ONDEMAND_HLS="ondemand_hls",e.WEBM="webm",e.AV1="av1",e.ONDEMAND_DASH_LIVE="ondemand_dash_live",e.ONDEMAND_HLS_LIVE="ondemand_hls_live",e.WEBRTC="webrtc",e.UNKNOWN="unknown",e.RTMP="rtmp"})(exports.ContentType||(exports.ContentType={}));var ke;(function(e){e.AUTO="auto",e.MANUAL=""})(ke||(ke={}));exports.ConnectionType=void 0;(function(e){e.HTTP1="http1",e.HTTP2="http2",e.HTTP3="http3"})(exports.ConnectionType||(exports.ConnectionType={}));var N;(function(e){e[e.YES=1]="YES",e[e.NO=0]="NO"})(N||(N={}));var Z;(function(e){e.EXCELLENT="excellent",e.GOOD="good",e.POOR="poor"})(Z||(Z={}));var F;(function(e){e.PIP="pip",e.FULLSCREEN="fullscreen",e.EXTERNAL="external",e.PREFETCH="prefetch",e.AIRPLAY="airplay",e.CHROMECAST="chromecast",e.INVISIBLE="invisible"})(F||(F={}));exports.SeekAction=void 0;(function(e){e.SLIDER="slider",e.DOUBLE_TAP="double_tap",e.TIME_CODE="time_code",e.EPISODE="episode",e.REWIND="rewind",e.LIVE="live",e.UNKNOWN="unknown"})(exports.SeekAction||(exports.SeekAction={}));exports.InteractiveInterfaceClick=void 0;(function(e){e.GRAPH_SHOW="iGraphShow",e.GRAPH_HIDE="iGraphHide",e.NEXT_AREA="iNextChapterArea",e.NEXT_BUTTON="iNextChapterBtn",e.WATCH_AGAIN="iWatchAgainBtn"})(exports.InteractiveInterfaceClick||(exports.InteractiveInterfaceClick={}));const wu={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"},Ru={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"},Au={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},Cu={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"},Nu={apiEnv:exports.ApiEnv.VK_ALIAS,requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:[],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1}},Lu=e=>u.fillWithDefault(e,Nu);function xu(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),t=new Array(36);let r=0,n,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?t[o]="-":o===14?t[o]="4":(r<=2&&(r=33554432+Math.random()*16777216|0),n=r&15,r=r>>4,t[o]=e[o===19?n&3|8:n]);return t.join("")}function k(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function c(a){try{f(n.next(a))}catch(l){s(l)}}function v(a){try{f(n.throw(a))}catch(l){s(l)}}function f(a){a.done?i(a.value):o(a.value).then(c,v)}f((n=n.apply(e,t||[])).next())})}var Du=fe,Qe=typeof process!="undefined"&&Du(process)=="process",ju=pe,gr=function(e,t,r,n){return n&&n.enumerable?e[t]=r:ju(e,t,r),e},ku=dr,Fu=ge,Mu=ku?{}.toString:function(){return"[object "+Fu(this)+"]"},Bu=dr,Uu=W.f,Vu=pe,Gu=A,Ku=Mu,Hu=T,en=Hu("toStringTag"),br=function(e,t,r,n){if(e){var o=r?e:e.prototype;Gu(o,en)||Uu(o,en,{configurable:!0,value:t}),n&&!Bu&&Vu(o,"toString",Ku)}},Wu=W,qu=function(e,t,r){return Wu.f(e,t,r)},Qu=K,zu=qu,Yu=T,Ju=B,tn=Yu("species"),Xu=function(e){var t=Qu(e);Ju&&t&&!t[tn]&&zu(t,tn,{configurable:!0,get:function(){return this}})},Zu=Ge,ec=TypeError,tc=function(e,t){if(Zu(t,e))return e;throw ec("Incorrect invocation")},rc=I,nc=m,Ut=cr,oc=rc(Function.toString);nc(Ut.inspectSource)||(Ut.inspectSource=function(e){return oc(e)});var Po=Ut.inspectSource,ac=I,ic=P,Io=m,sc=ge,uc=K,cc=Po,wo=function(){},lc=[],Ro=uc("Reflect","construct"),yr=/^\s*(?:class|function)\b/,fc=ac(yr.exec),vc=!yr.exec(wo),ie=function(t){if(!Io(t))return!1;try{return Ro(wo,lc,t),!0}catch(r){return!1}},Ao=function(t){if(!Io(t))return!1;switch(sc(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return vc||!!fc(yr,cc(t))}catch(r){return!0}};Ao.sham=!0;var dc=!Ro||ic(function(){var e;return ie(ie.call)||!ie(Object)||!ie(function(){e=!0})||e})?Ao:ie,hc=dc,pc=He,gc=TypeError,bc=function(e){if(hc(e))return e;throw gc(pc(e)+" is not a constructor")},rn=D,yc=bc,$c=ve,mc=T,Sc=mc("species"),Co=function(e,t){var r=rn(e).constructor,n;return r===void 0||$c(n=rn(r)[Sc])?t:yc(n)},Ec=K,No=Ec("document","documentElement"),Tc=I,Oc=Tc([].slice),_c=TypeError,Pc=function(e,t){if(e<t)throw _c("Not enough arguments");return e},Ic=Ke,Lo=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ic),O=E,wc=eo,Rc=qe,nn=m,Ac=A,xo=P,on=No,Cc=Oc,an=vr,Nc=Pc,Lc=Lo,xc=Qe,Vt=O.setImmediate,Gt=O.clearImmediate,Dc=O.process,vt=O.Dispatch,jc=O.Function,sn=O.MessageChannel,kc=O.String,dt=0,se={},un="onreadystatechange",ce,U,ht,pt;xo(function(){ce=O.location});var $r=function(e){if(Ac(se,e)){var t=se[e];delete se[e],t()}},gt=function(e){return function(){$r(e)}},cn=function(e){$r(e.data)},ln=function(e){O.postMessage(kc(e),ce.protocol+"//"+ce.host)};(!Vt||!Gt)&&(Vt=function(t){Nc(arguments.length,1);var r=nn(t)?t:jc(t),n=Cc(arguments,1);return se[++dt]=function(){wc(r,void 0,n)},U(dt),dt},Gt=function(t){delete se[t]},xc?U=function(e){Dc.nextTick(gt(e))}:vt&&vt.now?U=function(e){vt.now(gt(e))}:sn&&!Lc?(ht=new sn,pt=ht.port2,ht.port1.onmessage=cn,U=Rc(pt.postMessage,pt)):O.addEventListener&&nn(O.postMessage)&&!O.importScripts&&ce&&ce.protocol!=="file:"&&!xo(ln)?(U=ln,O.addEventListener("message",cn,!1)):un in an("script")?U=function(e){on.appendChild(an("script"))[un]=function(){on.removeChild(this),$r(e)}}:U=function(e){setTimeout(gt(e),0)});var Do={set:Vt,clear:Gt},jo=function(){this.head=null,this.tail=null};jo.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var ko=jo,Fc=Ke,Mc=/ipad|iphone|ipod/i.test(Fc)&&typeof Pebble!="undefined",Bc=Ke,Uc=/web0s(?!.*chrome)/i.test(Bc),G=E,fn=qe,Vc=ir.f,bt=Do.set,Gc=ko,Kc=Lo,Hc=Mc,Wc=Uc,yt=Qe,vn=G.MutationObserver||G.WebKitMutationObserver,dn=G.document,hn=G.process,Te=G.Promise,pn=Vc(G,"queueMicrotask"),Kt=pn&&pn.value,Y,$t,mt,Oe,gn;if(!Kt){var _e=new Gc,Pe=function(){var e,t;for(yt&&(e=hn.domain)&&e.exit();t=_e.get();)try{t()}catch(r){throw _e.head&&Y(),r}e&&e.enter()};!Kc&&!yt&&!Wc&&vn&&dn?($t=!0,mt=dn.createTextNode(""),new vn(Pe).observe(mt,{characterData:!0}),Y=function(){mt.data=$t=!$t}):!Hc&&Te&&Te.resolve?(Oe=Te.resolve(void 0),Oe.constructor=Te,gn=fn(Oe.then,Oe),Y=function(){gn(Pe)}):yt?Y=function(){hn.nextTick(Pe)}:(bt=fn(bt,G),Y=function(){bt(Pe)}),Kt=function(e){_e.head||Y(),_e.add(e)}}var qc=Kt,Qc=function(e,t){try{arguments.length==1?console.error(e):console.error(e,t)}catch(r){}},mr=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},zc=E,Yc=m,bn=zc.WeakMap,Jc=Yc(bn)&&/native code/.test(String(bn)),Xc=yo,Zc=$o,yn=Xc("keys"),Sr=function(e){return yn[e]||(yn[e]=Zc(e))},Er={},el=Jc,Fo=E,tl=x,rl=pe,St=A,Et=cr,nl=Sr,ol=Er,$n="Object already initialized",Ht=Fo.TypeError,al=Fo.WeakMap,Fe,le,Me,il=function(e){return Me(e)?le(e):Fe(e,{})},sl=function(e){return function(t){var r;if(!tl(t)||(r=le(t)).type!==e)throw Ht("Incompatible receiver, "+e+" required");return r}};if(el||Et.state){var R=Et.state||(Et.state=new al);R.get=R.get,R.has=R.has,R.set=R.set,Fe=function(e,t){if(R.has(e))throw Ht($n);return t.facade=e,R.set(e,t),t},le=function(e){return R.get(e)||{}},Me=function(e){return R.has(e)}}else{var J=nl("state");ol[J]=!0,Fe=function(e,t){if(St(e,J))throw Ht($n);return t.facade=e,rl(e,J,t),t},le=function(e){return St(e,J)?e[J]:{}},Me=function(e){return St(e,J)}}var Mo={set:Fe,get:le,has:Me,enforce:il,getterFor:sl},ul=E,ne=ul.Promise,Bo=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",cl=Bo,ll=Qe,fl=!cl&&!ll&&typeof window=="object"&&typeof document=="object",vl=E,ue=ne,dl=m,hl=So,pl=Po,gl=T,bl=fl,yl=Bo,Tt=vo,mn=ue&&ue.prototype,$l=gl("species"),Wt=!1,Uo=dl(vl.PromiseRejectionEvent),ml=hl("Promise",function(){var e=pl(ue),t=e!==String(ue);if(!t&&Tt===66||!(mn.catch&&mn.finally))return!0;if(!Tt||Tt<51||!/native code/.test(e)){var r=new ue(function(i){i(1)}),n=function(i){i(function(){},function(){})},o=r.constructor={};if(o[$l]=n,Wt=r.then(function(){})instanceof n,!Wt)return!0}return!t&&(bl||yl)&&!Uo}),be={CONSTRUCTOR:ml,REJECTION_EVENT:Uo,SUBCLASSING:Wt},oe={},Sn=H,Sl=TypeError,El=function(e){var t,r;this.promise=new e(function(n,o){if(t!==void 0||r!==void 0)throw Sl("Bad Promise constructor");t=n,r=o}),this.resolve=Sn(t),this.reject=Sn(r)};oe.f=function(e){return new El(e)};var Tl=C,Be=Qe,M=E,ye=_,Ol=gr,_l=br,Pl=Xu,Il=H,qt=m,wl=x,Rl=tc,Al=Co,Vo=Do.set,Tr=qc,Cl=Qc,Nl=mr,Ll=ko,Go=Mo,Qt=ne,Or=be,Ko=oe,ze="Promise",Ho=Or.CONSTRUCTOR,xl=Or.REJECTION_EVENT;Or.SUBCLASSING;var Ot=Go.getterFor(ze),Dl=Go.set,jl=Qt&&Qt.prototype,ee=Qt,_t=jl,Wo=M.TypeError,zt=M.document,_r=M.process,Yt=Ko.f,kl=Yt,Fl=!!(zt&&zt.createEvent&&M.dispatchEvent),qo="unhandledrejection",Ml="rejectionhandled",En=0,Qo=1,Bl=2,Pr=1,zo=2,Ie,Tn,Ul,Yo=function(e){var t;return wl(e)&&qt(t=e.then)?t:!1},Jo=function(e,t){var r=t.value,n=t.state==Qo,o=n?e.ok:e.fail,i=e.resolve,s=e.reject,c=e.domain,v,f,a;try{o?(n||(t.rejection===zo&&Gl(t),t.rejection=Pr),o===!0?v=r:(c&&c.enter(),v=o(r),c&&(c.exit(),a=!0)),v===e.promise?s(Wo("Promise-chain cycle")):(f=Yo(v))?ye(f,v,i,s):i(v)):s(r)}catch(l){c&&!a&&c.exit(),s(l)}},Xo=function(e,t){e.notified||(e.notified=!0,Tr(function(){for(var r=e.reactions,n;n=r.get();)Jo(n,e);e.notified=!1,t&&!e.rejection&&Vl(e)}))},Zo=function(e,t,r){var n,o;Fl?(n=zt.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),M.dispatchEvent(n)):n={promise:t,reason:r},!xl&&(o=M["on"+e])?o(n):e===qo&&Cl("Unhandled promise rejection",r)},Vl=function(e){ye(Vo,M,function(){var t=e.facade,r=e.value,n=On(e),o;if(n&&(o=Nl(function(){Be?_r.emit("unhandledRejection",r,t):Zo(qo,t,r)}),e.rejection=Be||On(e)?zo:Pr,o.error))throw o.value})},On=function(e){return e.rejection!==Pr&&!e.parent},Gl=function(e){ye(Vo,M,function(){var t=e.facade;Be?_r.emit("rejectionHandled",t):Zo(Ml,t,e.value)})},te=function(e,t,r){return function(n){e(t,n,r)}},re=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=Bl,Xo(e,!0))},Jt=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Wo("Promise can't be resolved itself");var n=Yo(t);n?Tr(function(){var o={done:!1};try{ye(n,t,te(Jt,o,e),te(re,o,e))}catch(i){re(o,i,e)}}):(e.value=t,e.state=Qo,Xo(e,!1))}catch(o){re({done:!1},o,e)}}};Ho&&(ee=function(t){Rl(this,_t),Il(t),ye(Ie,this);var r=Ot(this);try{t(te(Jt,r),te(re,r))}catch(n){re(r,n)}},_t=ee.prototype,Ie=function(t){Dl(this,{type:ze,done:!1,notified:!1,parent:!1,reactions:new Ll,rejection:!1,state:En,value:void 0})},Ie.prototype=Ol(_t,"then",function(t,r){var n=Ot(this),o=Yt(Al(this,ee));return n.parent=!0,o.ok=qt(t)?t:!0,o.fail=qt(r)&&r,o.domain=Be?_r.domain:void 0,n.state==En?n.reactions.add(o):Tr(function(){Jo(o,n)}),o.promise}),Tn=function(){var e=new Ie,t=Ot(e);this.promise=e,this.resolve=te(Jt,t),this.reject=te(re,t)},Ko.f=Yt=function(e){return e===ee||e===Ul?new Tn(e):kl(e)});Tl({global:!0,constructor:!0,wrap:!0,forced:Ho},{Promise:ee});_l(ee,ze,!1,!0);Pl(ze);var ae={},Kl=T,Hl=ae,Wl=Kl("iterator"),ql=Array.prototype,Ql=function(e){return e!==void 0&&(Hl.Array===e||ql[Wl]===e)},zl=Math.ceil,Yl=Math.floor,Jl=Math.trunc||function(t){var r=+t;return(r>0?Yl:zl)(r)},Xl=Jl,ea=function(e){var t=+e;return t!==t||t===0?0:Xl(t)},Zl=ea,ef=Math.min,tf=function(e){return e>0?ef(Zl(e),9007199254740991):0},rf=tf,ta=function(e){return rf(e.length)},nf=ge,_n=We,of=ve,af=ae,sf=T,uf=sf("iterator"),ra=function(e){if(!of(e))return _n(e,uf)||_n(e,"@@iterator")||af[nf(e)]},cf=_,lf=H,ff=D,vf=He,df=ra,hf=TypeError,pf=function(e,t){var r=arguments.length<2?df(e):t;if(lf(r))return ff(cf(r,e));throw hf(vf(e)+" is not iterable")},gf=_,Pn=D,bf=We,yf=function(e,t,r){var n,o;Pn(e);try{if(n=bf(e,"return"),!n){if(t==="throw")throw r;return r}n=gf(n,e)}catch(i){o=!0,n=i}if(t==="throw")throw r;if(o)throw n;return Pn(n),r},$f=qe,mf=_,Sf=D,Ef=He,Tf=Ql,Of=ta,In=Ge,_f=pf,Pf=ra,wn=yf,If=TypeError,xe=function(e,t){this.stopped=e,this.result=t},Rn=xe.prototype,Ir=function(e,t,r){var n=r&&r.that,o=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),s=!!(r&&r.IS_ITERATOR),c=!!(r&&r.INTERRUPTED),v=$f(t,n),f,a,l,d,h,g,b,$=function(S){return f&&wn(f,"normal",S),new xe(!0,S)},y=function(S){return o?(Sf(S),c?v(S[0],S[1],$):v(S[0],S[1])):c?v(S,$):v(S)};if(i)f=e.iterator;else if(s)f=e;else{if(a=Pf(e),!a)throw If(Ef(e)+" is not iterable");if(Tf(a)){for(l=0,d=Of(e);d>l;l++)if(h=y(e[l]),h&&In(Rn,h))return h;return new xe(!1)}f=_f(e,a)}for(g=i?e.next:f.next;!(b=mf(g,f)).done;){try{h=y(b.value)}catch(S){wn(f,"throw",S)}if(typeof h=="object"&&h&&In(Rn,h))return h}return new xe(!1)},wf=T,na=wf("iterator"),oa=!1;try{var Rf=0,An={next:function(){return{done:!!Rf++}},return:function(){oa=!0}};An[na]=function(){return this},Array.from(An,function(){throw 2})}catch(e){}var Af=function(e,t){if(!t&&!oa)return!1;var r=!1;try{var n={};n[na]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(o){}return r},Cf=ne,Nf=Af,Lf=be.CONSTRUCTOR,aa=Lf||!Nf(function(e){Cf.all(e).then(void 0,function(){})}),xf=C,Df=_,jf=H,kf=oe,Ff=mr,Mf=Ir,Bf=aa;xf({target:"Promise",stat:!0,forced:Bf},{all:function(t){var r=this,n=kf.f(r),o=n.resolve,i=n.reject,s=Ff(function(){var c=jf(r.resolve),v=[],f=0,a=1;Mf(t,function(l){var d=f++,h=!1;a++,Df(c,r,l).then(function(g){h||(h=!0,v[d]=g,--a||o(v))},i)}),--a||o(v)});return s.error&&i(s.value),n.promise}});var Uf=C,Vf=be.CONSTRUCTOR,Cn=ne;Cn&&Cn.prototype;Uf({target:"Promise",proto:!0,forced:Vf,real:!0},{catch:function(e){return this.then(void 0,e)}});var Gf=C,Kf=_,Hf=H,Wf=oe,qf=mr,Qf=Ir,zf=aa;Gf({target:"Promise",stat:!0,forced:zf},{race:function(t){var r=this,n=Wf.f(r),o=n.reject,i=qf(function(){var s=Hf(r.resolve);Qf(t,function(c){Kf(s,r,c).then(n.resolve,o)})});return i.error&&o(i.value),n.promise}});var Yf=C,Jf=_,Xf=oe,Zf=be.CONSTRUCTOR;Yf({target:"Promise",stat:!0,forced:Zf},{reject:function(t){var r=Xf.f(this);return Jf(r.reject,void 0,t),r.promise}});var ev=D,tv=x,rv=oe,ia=function(e,t){if(ev(e),tv(t)&&t.constructor===e)return t;var r=rv.f(e),n=r.resolve;return n(t),r.promise},nv=C,ov=K,av=vi,iv=ne,sv=be.CONSTRUCTOR,uv=ia,cv=ov("Promise"),lv=!sv;nv({target:"Promise",stat:!0,forced:av},{resolve:function(t){return uv(lv&&this===cv?iv:this,t)}});var fv=C,Xt=ne,vv=P,dv=K,hv=m,pv=Co,Nn=ia,gv=Xt&&Xt.prototype,bv=!!Xt&&vv(function(){gv.finally.call({then:function(){}},function(){})});fv({target:"Promise",proto:!0,real:!0,forced:bv},{finally:function(e){var t=pv(this,dv("Promise")),r=hv(e);return this.then(r?function(n){return Nn(t,e()).then(function(){return n})}:e,r?function(n){return Nn(t,e()).then(function(){throw n})}:e)}});var yv=_o,$v=yv("Promise","finally"),mv=$v,Sv=mv,Ev=Sv,Tv=Ev,Pt=ar(Tv),Zt=B,Ov=A,sa=Function.prototype,_v=Zt&&Object.getOwnPropertyDescriptor,wr=Ov(sa,"name"),Pv=wr&&function(){}.name==="something",Iv=wr&&(!Zt||Zt&&_v(sa,"name").configurable),wv={EXISTS:wr,PROPER:Pv,CONFIGURABLE:Iv},ua={},Rv=ea,Av=Math.max,Cv=Math.min,Nv=function(e,t){var r=Rv(e);return r<0?Av(r+t,0):Cv(r,t)},Lv=de,xv=Nv,Dv=ta,Ln=function(e){return function(t,r,n){var o=Lv(t),i=Dv(o),s=xv(n,i),c;if(e&&r!=r){for(;i>s;)if(c=o[s++],c!=c)return!0}else for(;i>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},jv={includes:Ln(!0),indexOf:Ln(!1)},kv=I,It=A,Fv=de,Mv=jv.indexOf,Bv=Er,xn=kv([].push),Uv=function(e,t){var r=Fv(e),n=0,o=[],i;for(i in r)!It(Bv,i)&&It(r,i)&&xn(o,i);for(;t.length>n;)It(r,i=t[n++])&&(~Mv(o,i)||xn(o,i));return o},ca=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Vv=Uv,Gv=ca,Kv=Object.keys||function(t){return Vv(t,Gv)},Hv=B,Wv=Eo,qv=W,Qv=D,zv=de,Yv=Kv;ua.f=Hv&&!Wv?Object.defineProperties:function(t,r){Qv(t);for(var n=zv(r),o=Yv(r),i=o.length,s=0,c;i>s;)qv.f(t,c=o[s++],n[c]);return t};var Jv=D,Xv=ua,Dn=ca,Zv=Er,ed=No,td=vr,rd=Sr,jn=">",kn="<",er="prototype",tr="script",la=rd("IE_PROTO"),wt=function(){},fa=function(e){return kn+tr+jn+e+kn+"/"+tr+jn},Fn=function(e){e.write(fa("")),e.close();var t=e.parentWindow.Object;return e=null,t},nd=function(){var e=td("iframe"),t="java"+tr+":",r;return e.style.display="none",ed.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(fa("document.F=Object")),r.close(),r.F},we,De=function(){try{we=new ActiveXObject("htmlfile")}catch(t){}De=typeof document!="undefined"?document.domain&&we?Fn(we):nd():Fn(we);for(var e=Dn.length;e--;)delete De[er][Dn[e]];return De()};Zv[la]=!0;var va=Object.create||function(t,r){var n;return t!==null?(wt[er]=Jv(t),n=new wt,wt[er]=null,n[la]=t):n=De(),r===void 0?n:Xv.f(n,r)},od=P,ad=!od(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),id=A,sd=m,ud=lr,cd=Sr,ld=ad,Mn=cd("IE_PROTO"),rr=Object,fd=rr.prototype,da=ld?rr.getPrototypeOf:function(e){var t=ud(e);if(id(t,Mn))return t[Mn];var r=t.constructor;return sd(r)&&t instanceof r?r.prototype:t instanceof rr?fd:null},vd=P,dd=m,hd=x,pd=va,Bn=da,gd=gr,bd=T,nr=bd("iterator"),ha=!1,L,Rt,At;[].keys&&(At=[].keys(),"next"in At?(Rt=Bn(Bn(At)),Rt!==Object.prototype&&(L=Rt)):ha=!0);var yd=!hd(L)||vd(function(){var e={};return L[nr].call(e)!==e});yd?L={}:L=pd(L);dd(L[nr])||gd(L,nr,function(){return this});var pa={IteratorPrototype:L,BUGGY_SAFARI_ITERATORS:ha},$d=pa.IteratorPrototype,md=va,Sd=Ve,Ed=br,Td=ae,Od=function(){return this},_d=function(e,t,r,n){var o=t+" Iterator";return e.prototype=md($d,{next:Sd(+!n,r)}),Ed(e,o,!1,!0),Td[o]=Od,e},Pd=C,Id=_,ga=wv,wd=_d,Rd=da,Ad=br,Un=gr,Cd=T,Vn=ae,ba=pa,Nd=ga.PROPER;ga.CONFIGURABLE;ba.IteratorPrototype;var Re=ba.BUGGY_SAFARI_ITERATORS,Ct=Cd("iterator"),Gn="keys",Ae="values",Kn="entries",Ld=function(){return this},xd=function(e,t,r,n,o,i,s){wd(r,t,n);var c=function(y){if(y===o&&d)return d;if(!Re&&y in a)return a[y];switch(y){case Gn:return function(){return new r(this,y)};case Ae:return function(){return new r(this,y)};case Kn:return function(){return new r(this,y)}}return function(){return new r(this)}},v=t+" Iterator",f=!1,a=e.prototype,l=a[Ct]||a["@@iterator"]||o&&a[o],d=!Re&&l||c(o),h=t=="Array"&&a.entries||l,g,b,$;if(h&&(g=Rd(h.call(new e)),g!==Object.prototype&&g.next&&(Ad(g,v,!0,!0),Vn[v]=Ld)),Nd&&o==Ae&&l&&l.name!==Ae&&(f=!0,d=function(){return Id(l,this)}),o)if(b={values:c(Ae),keys:i?d:c(Gn),entries:c(Kn)},s)for($ in b)(Re||f||!($ in a))&&Un(a,$,b[$]);else Pd({target:t,proto:!0,forced:Re||f},b);return s&&a[Ct]!==d&&Un(a,Ct,d,{name:o}),Vn[t]=d,b},Dd=function(e,t){return{value:e,done:t}},jd=de,Hn=ae,ya=Mo;W.f;var kd=xd,Ce=Dd,$a="Array Iterator",Fd=ya.set,Md=ya.getterFor($a);kd(Array,"Array",function(e,t){Fd(this,{type:$a,target:jd(e),index:0,kind:t})},function(){var e=Md(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,Ce(void 0,!0)):r=="keys"?Ce(n,!1):r=="values"?Ce(t[n],!1):Ce([n,t[n]],!1)},"values");Hn.Arguments=Hn.Array;var Bd=fr,Ud=W,Vd=Ve,Gd=function(e,t,r){var n=Bd(t);n in e?Ud.f(e,n,Vd(0,r)):e[n]=r},Kd=C,Hd=Ir,Wd=Gd;Kd({target:"Object",stat:!0},{fromEntries:function(t){var r={};return Hd(t,function(n,o){Wd(r,n,o)},{AS_ENTRIES:!0}),r}});var qd=ur,Qd=qd.Object.fromEntries,zd={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},Yd=zd,Jd=E,Xd=ge,Zd=pe,Wn=ae,eh=T,qn=eh("toStringTag");for(var Nt in Yd){var Qn=Jd[Nt],Lt=Qn&&Qn.prototype;Lt&&Xd(Lt)!==qn&&Zd(Lt,qn,Nt),Wn[Nt]=Wn.Array}var th=Qd,rh=th,nh=rh,oh=nh,ah=ar(oh);const ih=e=>{var t;const{operation:r,custom:n}=e,o=ah(Object.entries(n).map(([i,s])=>{var c,v,f;const a=(c=Ru[i])!==null&&c!==void 0?c:i;let l=s;return s&&(i==="mode"?l=(v=Cu[s])!==null&&v!==void 0?v:s:i==="quality"&&(l=(f=Au[s])!==null&&f!==void 0?f:s)),[a,l]}));return Object.assign(Object.assign({},e),{operation:(t=wu[r])!==null&&t!==void 0?t:r,custom:o})},or="1.0.49",sh="CIOPGQJGDIHBABABA",zn={[exports.ApiEnv.PROD]:"https://api.ok.ru",[exports.ApiEnv.VK_ALIAS]:"https://api.mycdn.me",[exports.ApiEnv.VIDEOTEST]:"https://videotestapi.ok.ru/api",[exports.ApiEnv.TEST]:"https://apitest.ok.ru",[exports.ApiEnv.AUTO]:""};var V;(function(e){e[e.PARAM_SESSION_EXPIRED=102]="PARAM_SESSION_EXPIRED",e[e.PARAM_SESSION_KEY=103]="PARAM_SESSION_KEY",e[e.PARAM_SIGNATURE=104]="PARAM_SIGNATURE",e[e.AUTH_LOGIN=401]="AUTH_LOGIN"})(V||(V={}));class uh{constructor(t){this.consequentAuthErrors=0,this.authorized$=new u.ValueSubject(!1),this.params=t}authorize(t){return k(this,void 0,void 0,function*(){return this.authToken=t!=null?t:yield this.refreshAuthToken(),this._authorizeWithBackoff()})}logBeacon(t){const r="log.externalLog",n=this.createLogParams(t),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(r,n,o)||this.logRequest(t)}logRequest(t){var r;return k(this,void 0,void 0,function*(){const n="log.externalLog",o=this.createLogParams(t),i=(r=this.sessionKey)!==null&&r!==void 0?r:yield this._authorizeWithBackoff();if(!i)return;const s=(c,v=this.params.config.requestRetryCount)=>k(this,void 0,void 0,function*(){try{return yield this.params.apiTransport.sendRequest(n,o,i)}catch(f){if(!f||!("error_code"in f)){this.params.error$.next({id:"logRequestUnknown",category:u.ErrorCategory.NETWORK,message:`Unknown ${n} error`,thrown:f});return}const a=f==null?void 0:f.error_code;switch(a){case V.PARAM_SESSION_EXPIRED:case V.PARAM_SESSION_KEY:case V.PARAM_SIGNATURE:return this.authorized$.next(!1),this.sessionKey=yield this._authorizeWithBackoff(),v>0?s(c,v-1):void 0;case V.AUTH_LOGIN:return this.authorized$.next(!1),this.authToken=yield this.refreshAuthToken(),this.sessionKey=yield this._authorizeWithBackoff(),v>0?s(c,v-1):void 0;default:{this.params.error$.next({id:`LogRequest#${a}`,category:u.ErrorCategory.EXTERNAL_API,message:`${n} error`,data:f});return}}}});return s(t)})}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}refreshAuthToken(){return k(this,void 0,void 0,function*(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=Pt(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise})}createLogParams(t){return{collector:"ok.mobile.apps.video",data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${or}`,platform:this.params.mobile?"M_WEB":"WEB",items:this.params.config.shorten?t.map(ih):t})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();const t=u.getExponentialDelay(this.consequentAuthErrors,this.params.config.backoff);return new Promise(r=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{Pt(this._authorize().then(r).catch(n=>this.params.error$.next({id:"AuthorizeBackoff",category:u.ErrorCategory.NETWORK,message:"Otherwise unhandled error in authorization",thrown:n})),()=>this.backoffTimeoutId=0)},t))})}_authorize(){return k(this,void 0,void 0,function*(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);const t="auth.anonymLogin",r={session_data:{version:2,device_id:this.params.uuid,client_version:or.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=Pt(this.params.apiTransport.sendRequest(t,r).then(n=>{var o;return(!n||!n.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:u.ErrorCategory.EXTERNAL_API,message:"No session key",data:n}),this.sessionKey=(o=n==null?void 0:n.session_key)!==null&&o!==void 0?o:void 0,this.sessionKey}).catch(n=>k(this,void 0,void 0,function*(){this.sessionKey=void 0;const o=n==null?void 0:n.error_code;switch(o){case V.AUTH_LOGIN:return this.authToken=yield this.refreshAuthToken(),this._authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:u.ErrorCategory.EXTERNAL_API,message:"authorize error",data:n}):this.params.error$.next({id:"AuthorizeUnknown",category:u.ErrorCategory.NETWORK,message:"authorize error",thrown:n})})),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise})}}class Yn{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,r,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:r,options:n})}removeEventListener(t,r){if(!(t in this.listeners))return;const n=this.listeners[t];for(let o=0,i=n.length;o<i;o++)if(n[o].callback===r){n.splice(o,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const n=this.listeners[t.type].slice();for(let o=0,i=n.length;o<i;o++){const s=n[o];try{s.callback.call(this,t)}catch(c){Promise.resolve().then(()=>{throw c})}s.options&&s.options.once&&this.removeEventListener(t.type,s.callback)}return!t.defaultPrevented}}class ma extends Yn{constructor(){super(),this.listeners||Yn.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(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ch{constructor(){Object.defineProperty(this,"signal",{value:new ma,writable:!0,configurable:!0})}abort(t){let r;try{r=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}let n=t;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(r)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(ch.prototype[Symbol.toStringTag]="AbortController",ma.prototype[Symbol.toStringTag]="AbortSignal");function Sa(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function lh(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!Sa({fetch:t,Request:r,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:t,Request:i};let i=r;(i&&!i.prototype.hasOwnProperty("signal")||o)&&(i=function(f,a){let l;a&&a.signal&&(l=a.signal,delete a.signal);const d=new r(f,a);return l&&Object.defineProperty(d,"signal",{writable:!1,enumerable:!1,configurable:!0,value:l}),d},i.prototype=r.prototype);const s=t;return{fetch:(v,f)=>{const a=i&&i.prototype.isPrototypeOf(v)?v.signal:f?f.signal:void 0;if(a){let l;try{l=new DOMException("Aborted","AbortError")}catch(h){l=new Error("Aborted"),l.name="AbortError"}if(a.aborted)return Promise.reject(l);const d=new Promise((h,g)=>{a.addEventListener("abort",()=>g(l),{once:!0})});return f&&f.signal&&delete f.signal,Promise.race([d,s(v,f)])}return s(v,f)},Request:i}}const Rr=Sa({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Ea=Rr?lh({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Jn=Rr?Ea.fetch:window.fetch;Rr?Ea.Request:window.Request;class fh{constructor(t){this.params=t,this.apiKey=t.apiKey,this.apiEnv=t.config.apiEnv,this.apiBaseUrl=zn[this.apiEnv],this.timeSynchronisation=t.timeSynchronisation,this.isApiBaseUrlFetched=!1}resolveApiBaseUrl(){var t;return k(this,void 0,void 0,function*(){if(this.apiEnv!==exports.ApiEnv.AUTO||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{const r=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=yield(yield Jn(r,{method:"GET",mode:"cors",cache:"no-cache"})).json(),i=(t=o==null?void 0:o.Answer[0])===null||t===void 0?void 0:t.data;if(!i)throw new Error("Wrong DNS response");return i}catch(r){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:u.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:r}),zn[exports.ApiEnv.VK_ALIAS]}finally{this.isApiBaseUrlFetched=!0}})}sendBeacon(t,r,n){if(!window.Blob||!window.navigator.sendBeacon)return!1;const o=this._prepareQueryParams({method:t,queryParams:r,sessionKey:n}),i=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,i)}catch(s){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:u.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:t,params:r}})}return!1}sendRequest(t,r,n){return k(this,void 0,void 0,function*(){const o=u.now(),i=s=>{if(s instanceof TypeError&&["Failed to fetch","NetworkError when attempting to fetch resource."].includes(s.message)){this.params.error$.next({id:"Network",category:u.ErrorCategory.NETWORK,message:"Request failed",thrown:s});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:u.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:s,data:{method:t,params:r,sessionKey:n,time:u.now()-o}})};return this.apiBaseUrl=yield this.resolveApiBaseUrl(),Jn(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:t,queryParams:r,sessionKey:n})}).then(s=>{var c,v;const f=Number(s.headers.get("content-length"))===0,a=new Date((c=s.headers.get("date"))!==null&&c!==void 0?c:"").getTime(),l=u.now()-o;if(isFinite(a)&&((v=this.timeSynchronisation)===null||v===void 0||v.addServerTime(a,l)),!f)return s.json().then(d=>Object.prototype.hasOwnProperty.call(d,"error_msg")?Promise.reject(d):d,i)},i)})}_prepareQueryParams(t){const r=new URLSearchParams({format:"JSON",method:t.method,application_key:this.apiKey});return t.sessionKey!==void 0&&r.append("session_key",t.sessionKey),Object.entries(t.queryParams).forEach(([n,o])=>r.append(n,typeof o=="string"?o:JSON.stringify(o))),r}}const Ne="onestat_events",xt=e=>t=>t.timestamp+e>=u.now();class vh{constructor(t){this.unsaltedStorage=[],this.isPaused=!1,this.isUrgent=n=>{const{operation:o}=n;return["action_play","watch_coverage_record","watch_coverage_live"].includes(o)},this.params=t,this.api=t.api,this.error$=t.error$,this.userSalt=t.userSalt,this.loggerDebugLog=t.debugLogger.createComponentLog("stat logger"),this.firstFlush=u.debounceFn(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});const r=u.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=u.debounceFn(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:r}),this.subscription=this.api.authorized$.subscribe(n=>{n&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){var t;try{this.flush()}catch(r){this.error$.next({id:"LoggerError",category:u.ErrorCategory.WTF,message:(t=String(r))!==null&&t!==void 0?t:"Unknown logger error",thrown:r})}}readFromStorage(){const t=u.safeStorage.get(Ne);try{return t?JSON.parse(t):{}}catch(r){}return{}}addToStorage(t){var r;if(!this.userSalt){this.unsaltedStorage.push(t);return}const n=this.readFromStorage(),i=((r=n[this.userSalt])!==null&&r!==void 0?r:[]).filter(xt(this.params.config.storageExpiration));u.safeStorage.set(Ne,JSON.stringify(Object.assign(Object.assign({},n),{[this.userSalt]:[...i,t]})))}getFromStorage(){var t;return this.userSalt?((t=this.readFromStorage()[this.userSalt])!==null&&t!==void 0?t:[]).filter(xt(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}const t=this.readFromStorage();delete t[this.userSalt],u.safeStorage.set(Ne,JSON.stringify(t))}housekeepStorage(){const t=this.readFromStorage();for(const[r,n]of Object.entries(t)){const o=n.filter(xt(this.params.config.storageExpiration));o.length?t[r]=o:delete t[r],this.loggerDebugLog({message:`${n.length} retrieved from storage, ${o.length} of them actual`})}u.safeStorage.set(Ne,JSON.stringify(t))}log(t){this.addToStorage(t),!this.isPaused&&(this.isUrgent(t)?this.flush():this.lastVsid!==t.custom.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=t.custom.vsid)}flush(t=!1){const r=this.getFromStorage();r.length!==0&&(this.api.authorized$.getValue()?(t&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${r.length} events through beacon`}),this.api.logBeacon(r)):(this.loggerDebugLog({message:`Flushing ${r.length} events`}),this.api.logRequest(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()}}const dh=e=>e&&{[p.VideoQuality.INVARIANT]:exports.Quality.UNKNOWN,[p.VideoQuality.Q_144P]:exports.Quality.Q144P,[p.VideoQuality.Q_240P]:exports.Quality.Q240P,[p.VideoQuality.Q_360P]:exports.Quality.Q360P,[p.VideoQuality.Q_480P]:exports.Quality.Q480P,[p.VideoQuality.Q_720P]:exports.Quality.Q720P,[p.VideoQuality.Q_1080P]:exports.Quality.Q1080P,[p.VideoQuality.Q_1440P]:exports.Quality.Q1440P,[p.VideoQuality.Q_2160P]:exports.Quality.Q2160P,[p.VideoQuality.Q_4320P]:exports.Quality.UNKNOWN}[e],Xn=e=>e&&{[p.HttpConnectionType.HTTP1]:exports.ConnectionType.HTTP1,[p.HttpConnectionType.HTTP2]:exports.ConnectionType.HTTP2,[p.HttpConnectionType.QUIC]:exports.ConnectionType.HTTP3}[e],hh=e=>{if(e!==void 0)switch(e){case p.VideoFormat.MPEG:return exports.ContentType.MP4;case p.VideoFormat.DASH_LIVE:return exports.ContentType.DASH;case p.VideoFormat.DASH_SEP:return exports.ContentType.DASH_SEP;case p.VideoFormat.DASH_ONDEMAND:return exports.ContentType.ONDEMAND_DASH;case p.VideoFormat.DASH_WEBM:case p.VideoFormat.DASH_LIVE_WEBM:return exports.ContentType.WEBM;case p.VideoFormat.DASH_WEBM_AV1:return exports.ContentType.AV1;case p.VideoFormat.DASH_LIVE_CMAF:return exports.ContentType.ONDEMAND_DASH_LIVE;case p.VideoFormat.HLS:case p.VideoFormat.HLS_LIVE:return exports.ContentType.HLS;case p.VideoFormat.HLS_ONDEMAND:return exports.ContentType.ONDEMAND_HLS;case p.VideoFormat.HLS_LIVE_CMAF:return exports.ContentType.ONDEMAND_HLS_LIVE;case p.VideoFormat.WEB_RTC_LIVE:return exports.ContentType.WEBRTC;default:return u.assertNever(e)}},Dt=e=>{if(e!==void 0)switch(e){case p.Surface.NONE:case p.Surface.INLINE:return;case p.Surface.FULLSCREEN:return F.FULLSCREEN;case p.Surface.SECOND_SCREEN:return F.CHROMECAST;case p.Surface.PIP:return F.PIP;case p.Surface.INVISIBLE:return F.INVISIBLE;default:return u.assertNever(e)}},ph=e=>{switch(e){case"slow-2g":return Z.POOR;case"2g":return Z.POOR;case"3g":return Z.GOOD;case"4g":return Z.EXCELLENT}};class gh{constructor(t){this.offset=void 0,this.offset=t}getOffset(){var t;return(t=this.offset)!==null&&t!==void 0?t:0}setOffset(t){this.offset=t}now(){var t;return Date.now()+((t=this.offset)!==null&&t!==void 0?t:0)}date(t=new Date){var r;return t.setTime(t.getTime()+((r=this.offset)!==null&&r!==void 0?r:0)),t}addServerTime(t,r){const n=Date.now(),o=t-n-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)}}const bh=()=>Math.floor(Math.random()*Math.pow(2,32)).toString(36).padStart(7,"0"),yh=()=>Math.floor(Math.random()*Math.pow(2,64)).toString(36).padStart(13,"0"),$h=(e,t)=>new u.Observable(r=>{const n=new u.Subscription,o=u.merge(u.fromEvent(window,"beforeunload"),e.events.willDestruct$),i=new u.ValueSubject(void 0);let s;n.add(e.info.isLive$.pipe(u.filterChanged()).subscribe(j=>{s&&(s.unsubscribe(),i.next(void 0)),j?s=e.info.liveTime$.pipe(u.map(Ye=>Ye&&Ye/1e3)).subscribe(i):s=e.info.position$.subscribe(i),n.add(s)}));const{playing$:c,paused$:v}=e.events,f=e.events.willSeek$.pipe(u.filter(()=>e.info.playbackState$.getValue()===p.PlaybackState.PLAYING)),a=e.events.seeked$.pipe(u.filter(()=>e.info.playbackState$.getValue()===p.PlaybackState.PLAYING));let l=!1;const d=new u.Subject;n.add(f.subscribe(()=>{l||d.next(),l=!0})),n.add(a.subscribe(()=>l=!1));const h=new u.Subject,g=new u.Subject,b=u.merge(c,a,h),$=u.merge(v,d,o,e.events.looped$,g);let y;const S=()=>y=i.getValue(),Ta=()=>{const j=i.getValue();u.isNullable(y)||y===j||u.isNullable(j)||(r.next({from:y,to:j}),y=void 0)},Oa=()=>{g.next(),h.next()};if(n.add(b.subscribe(S)),n.add($.subscribe(Ta)),t.forceInterval&&isFinite(t.forceInterval)){let j=0;n.add(b.subscribe(()=>j=window.setTimeout(Oa,t.forceInterval))),n.add($.subscribe(()=>window.clearTimeout(j)))}return n}),mh="_one-stat_",jt=`${mh}uuid`,kt=()=>{const e=new u.Subscription;return{subscription:e,subscribe:(t,r)=>{t&&e.add(t.subscribe(r))}}};class Sh{constructor(t,r){var n,o,i;this.subscription=new u.Subscription,this.debugLogger=new u.Logger,this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat"),this.loopCounter=0,this.disabled=!1,this.vsid$=new u.ValueSubject(void 0),this.isid$=new u.ValueSubject(void 0),this.seekAction$=new u.ValueSubject(exports.SeekAction.UNKNOWN),this.statContext=t,this.config=Lu((n=r.config)!==null&&n!==void 0?n:{}),u.isNonNullable(r.apiEnv)&&(this.config.apiEnv=r.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new gh);const s=new u.Subject;this.experimental={error$:s};const c=u.safeStorage.get(jt);c?c.startsWith('"')&&c.endsWith('"')?(this.uuid=Iu(c,'"',""),u.safeStorage.set(jt,this.uuid)):this.uuid=c:(this.uuid=xu(),u.safeStorage.set(jt,this.uuid)),this.resetViewSession(),r.useIsid&&this.isid$.next((o=r.isid)!==null&&o!==void 0?o:yh());const v=new fh({apiKey:sh,config:this.config,error$:s,timeSynchronisation:this.timeSynchronisation});this.api=new uh({config:this.config,apiTransport:v,refreshAuthToken:r.refreshAuthToken,mobile:(i=this.statContext.mobile)!==null&&i!==void 0?i:!1,uuid:this.uuid,error$:s}),this.logger=new vh({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:s,userSalt:r.userSalt});const{isEmbed:f,host:a}=u.detectEmbed();this.isEmbed=f,this.embedParent=a,this.subscribe()}updateContext(t){this.statContext=Object.assign(Object.assign({},this.statContext),t)}attachTo(t){const r=new u.Subscription,n=(a,l)=>r.add(a.subscribe(l));n(t.events.willStart$,()=>{const a=t.info.position$.getValue();this.logActionPlay({position:a}),this.statContext.projectId&&this.logActionPlayInteractive({position:a})}),n(t.events.looped$,()=>{this.resetViewSession(),++this.loopCounter>this.config.maxLoops&&(this.disabled=!0),this.logActionPlay({position:t.info.position$.getValue()})}),n(t.events.seeked$,()=>{this.logSeek({action:this.seekAction$.getValue(),time:t.info.position$.getValue()}),this.seekAction$.next(exports.SeekAction.UNKNOWN)}),n(t.events.paused$,()=>{this.logPause({position:t.info.position$.getValue()})}),n(t.events.willResume$,()=>{this.logPlay()}),n(t.events.started$,()=>{this.statContext.clip&&this.logWatchCoverageRecord({start:0,end:0})}),n($h(t,{forceInterval:this.config.watchCoverageInterval}),a=>{const l=t.info.isLive$.getValue(),d={start:parseFloat(a.from.toFixed(3)),end:parseFloat(a.to.toFixed(3))};l?this.logWatchCoverageLive(d):this.logWatchCoverageRecord(d)});let o;n(t.info.isStalled$,a=>{a?o=u.now():(u.isNonNullable(o)&&this.logEmptyBuffer({duration:u.now()-o}),o=void 0)});let i=!1;r.add(t.events.fatalError$.pipe(u.once()).subscribe(()=>i=!0)),n(t.events.willStop$,()=>{if(t.info.isStalled$.getValue()){const l=u.isNonNullable(o)?u.now()-o:void 0;this.logCloseAtEmptyBuffer({duration:l!=null?l:0}),o=void 0}else i||this.logActionStop()}),n(t.events.managedError$,({id:a})=>{this.logError({fatal:!1,errorType:a})}),n(t.events.fatalError$,({id:a})=>{this.logError({fatal:!0,errorType:a})});let s,c,v=!1;n(t.events.firstBytes$,a=>{s=u.now(),this.logFirstBytes({time:a})}),n(t.events.willStart$,()=>c=u.now()),n(t.info.currentBuffer$,a=>{!v&&a&&a.end-a.start>0&&u.isNonNullable(s)&&(this.logPlayerReady({duration:u.now()-s}),v=!0)}),n(t.events.firstFrame$,()=>{u.isNonNullable(s)&&!v&&(this.logPlayerReady({duration:u.now()-s}),v=!0),u.isNonNullable(c)&&this.logFirstFrame({time:u.now()-c})}),n(t.info.atLiveEdge$,a=>this.updateContext({liveEdge:a})),n(u.combine({muted:t.info.muted$,volume:t.info.volume$}),({muted:a,volume:l})=>this.updateContext({audible:!a&&l>0})),n(t.info.currentQuality$,a=>this.updateContext({quality:dh(a)})),n(t.info.isAutoQualityEnabled$,a=>this.updateContext({autoQuality:a})),n(t.info.currentFormat$,a=>this.updateContext({contentType:hh(a)})),n(t.info.currentPlaybackRate$,a=>this.updateContext({rate:a})),n(t.info.is3DVideo$,a=>this.updateContext({is3d:a}));let f;return n(t.info.hostname$,a=>{const l=f!==void 0&&f!==a;this.updateContext({cdnHostname:a,failover:l}),l&&this.logFailover(a),f=a}),n(t.info.throughputEstimation$,a=>this.updateContext({downloadSpeed:a})),n(t.info.httpConnectionType$,a=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:Xn(a)}),this.updateContext({connectionType:Xn(a)})}),n(t.info.httpConnectionReused$,a=>{u.isNullable(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:a}),this.updateContext({connectionReused:a})}),n(t.info.surface$,a=>this.updateContext({mode:Dt(a)})),n(u.combine({current:t.info.currentTextTrack$,available:t.info.availableTextTracks$}),({current:a,available:l})=>{const d=l.find(({id:g})=>g===a),h=d&&(d.isAuto?`${d.language}_auto`:d.language);this.updateContext({subtitles:h})}),this.player=t,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(r),r}attachToUi(t){this.uiEvents=t;const{subscription:r,subscribe:n}=kt();return this.player&&(n(t.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),n(t.actionSeek$,this.seekAction$),n(t.inPiP$,o=>{var i;const s=o?F.PIP:Dt((i=this.player)===null||i===void 0?void 0:i.info.surface$.getValue());this.updateContext({mode:s})}),n(t.inFullscreen$,o=>{var i;const s=o?F.FULLSCREEN:Dt((i=this.player)===null||i===void 0?void 0:i.info.surface$.getValue());this.updateContext({mode:s})}),n(t.actionSetSubtitle$,o=>this.updateContext({subtitles:o})),n(t.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(r)),r}attachToAds(t){const{subscription:r,subscribe:n}=kt();return n(t.slotRequested$,()=>this.logAdSlotRequest()),n(t.started$,o=>this.logAdStarted(o)),n(t.paused$,()=>this.logAdPaused()),n(t.resumed$,()=>this.logAdResumed()),n(t.ended$,()=>this.logAdEnded()),n(t.skipped$,()=>this.logAdSkipped()),n(t.clicked$,()=>this.logAdClicked()),this.resubscribeBeforeunload(),this.subscription.add(r),r}attachToInteractive(t){const{subscription:r,subscribe:n}=kt();return n(t.click$,o=>this.logInterfaceClick(o)),n(t.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(r),r}authorize(t){return this.api.authorize(t)}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"}),this.vsid$.next(bh())}getDeviceId(){return this.uuid}setFieldBlacklist(){}logInited(){}logReady(t){this.log({operation:"player_ready",param:String(t.time)})}logStarted(...t){this.logActionPlay(...t)}logPlay(){this.log({operation:"play_toggle"})}logPause(t){this.log({operation:"pause",param:String(Math.round(t.position))})}logSeek(t){this.log({operation:"seek",param:t.action,time:t.time})}logFirstBytes(t){this.log({operation:"first_bytes",param:String(t.time)})}logFirstFrame(t){this.log({operation:"first_frame",param:String(t.time)})}logError(t){this.log({operation:"content_error",param:`${t.fatal?"fatal":"recoverable"}_${t.errorType}`})}logWatchCoverageRecord(t){this.log({operation:"watch_coverage_record",param:`${t.start}-${t.end}`})}logWatchCoverageLive(t){var r,n;const o=(n=(r=this.timeSynchronisation)===null||r===void 0?void 0:r.getOffset())!==null&&n!==void 0?n:0,i=t.start+o,s=t.end+o;this.log({operation:"watch_coverage_live",param:`${i}-${s}`})}logEmptyBuffer(t){this.log({operation:"empty_buffer",param:String(t.duration)})}logDownloadSpeed(){}logAdSlotRequest(){this.log({operation:"adv",param:"slot_request"})}logAdStarted(t){this.log({operation:"adv",param:t})}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(t){this.log({operation:"player_interface_click",param:t})}logNextMovie(t){this.log({operation:"next_movie",param:String(t)})}subscribe(){this.resubscribeBeforeunload();const t=window.navigator.connection;t&&"onchange"in t&&"effectiveType"in t&&this.subscription.add(u.merge(u.fromEvent(t,"change"),u.observableFrom(["init"])).subscribe(()=>this.updateContext({network:ph(t.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(r=>{console.debug("%c stat ","background:#fa6470;",`component: ${r.component}.`,r.message)})}resubscribeBeforeunload(){var t;(t=this.beforeunloadSubscription)===null||t===void 0||t.unsubscribe(),this.beforeunloadSubscription=u.fromEvent(window,"beforeunload").subscribe(()=>this.logger.flush(!0)),this.subscription.add(this.beforeunloadSubscription)}logPlayerReady(t){this.log({operation:"player_ready",param:String(Math.round(t.duration))})}logActionPlay(t){this.log({operation:"action_play",param:String(Math.round(t.position))})}logActionPlayInteractive(t){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(Math.round(t.position))},{vid:this.statContext.projectId})}logFailover(t){this.log({operation:"failover",param:t})}logCloseAtEmptyBuffer(t){this.log({operation:"close_at_empty_buffer",param:String(Math.round(t.duration))})}logActionStop(){this.log({operation:"action_stop"})}log(t,r={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${t.operation} but statistics is disabled`});return}if(this.config.disabledOperations.includes(t.operation)){this.oneStatDebugLog({message:`operation ${t.operation} but it is disabled`});return}this.oneStatDebugLog({message:`operation ${t.operation} ${t.param}`});const n=this.createLogItem(t,r);this.logger.log(n)}createLogItem({operation:t,param:r,time:n},o={}){var i,s;const c=(s=(i=this.timeSynchronisation)===null||i===void 0?void 0:i.now())!==null&&s!==void 0?s:u.now(),v=this.vsid$.getValue();u.assertNonNullable(v);const f=this.isid$.getValue(),a=t==="empty_buffer"||t==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,l=this.statContext.firstConnectionReused;let d,h;if(this.isEmbed){d=this.embedParent;const b=[...new URLSearchParams(location.search).entries()].filter(([$,y])=>this.config.embedUrlParams.includes($));h=new URLSearchParams(b).toString()}else this.statContext.place==="direct"&&((this.statContext.refDomain||document.referrer)&&(d=new URL(this.statContext.refDomain||document.referrer).hostname),h=location.href.substring(0,1024));const g=Object.assign({vsid:v,isid:f,vid:this.statContext.movieId,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?ke.AUTO:this.statContext.autoplay===!1?ke.MANUAL:void 0,param:r,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:a,connection_reused:l===!0?N.YES:l===!1?N.NO:void 0,cached_data:this.statContext.cached===!0?N.YES:this.statContext.cached===!1?N.NO:void 0,live:this.statContext.liveEdge?N.YES:void 0,muted:this.statContext.audible===!1?N.YES:void 0,mode:this.statContext.mode,subtitles:this.statContext.subtitles,download_speed:this.statContext.downloadSpeed,manual_quality:this.statContext.autoQuality?void 0:N.YES,ref_domain:d,direct_url:h,rate:this.statContext.rate===1||u.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(const b of this.config.disabledCustomFields)delete g[b];return{operation:t,type:1,time:n,network:this.statContext.network,timestamp:c,custom:g}}}exports.OneStat=Sh;exports.VERSION=or;
|
|
6
|
+
"use strict";var hl=Object.create;var Se=Object.defineProperty,gl=Object.defineProperties,ml=Object.getOwnPropertyDescriptor,bl=Object.getOwnPropertyDescriptors,yl=Object.getOwnPropertyNames,Gi=Object.getOwnPropertySymbols,Sl=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty,Il=Object.prototype.propertyIsEnumerable;var Ki=(r,e,t)=>e in r?Se(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,W=(r,e)=>{for(var t in e||(e={}))Wi.call(e,t)&&Ki(r,t,e[t]);if(Gi)for(var t of Gi(e))Il.call(e,t)&&Ki(r,t,e[t]);return r},Ge=(r,e)=>gl(r,bl(e));var n=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),El=(r,e)=>{for(var t in e)Se(r,t,{get:e[t],enumerable:!0})},Hi=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of yl(e))!Wi.call(r,o)&&o!==t&&Se(r,o,{get:()=>e[o],enumerable:!(i=ml(e,o))||i.enumerable});return r};var Ur=(r,e,t)=>(t=r!=null?hl(Sl(r)):{},Hi(e||!r||!r.__esModule?Se(t,"default",{value:r,enumerable:!0}):t,r)),ql=r=>Hi(Se({},"__esModule",{value:!0}),r);var M=(r,e,t)=>new Promise((i,o)=>{var a=f=>{try{l(t.next(f))}catch(d){o(d)}},u=f=>{try{l(t.throw(f))}catch(d){o(d)}},l=f=>f.done?i(f.value):Promise.resolve(f.value).then(a,u);l((t=t.apply(r,e)).next())});var zi=n(()=>{"use strict"});var Qi=n(()=>{"use strict"});var P=n((Yi,Ji)=>{"use strict";var Ke=function(r){return r&&r.Math==Math&&r};Ji.exports=Ke(typeof globalThis=="object"&&globalThis)||Ke(typeof window=="object"&&window)||Ke(typeof self=="object"&&self)||Ke(typeof global=="object"&&global)||function(){return this}()||Yi||Function("return this")()});var x=n((Tb,Xi)=>{"use strict";Xi.exports=function(r){try{return!!r()}catch(e){return!0}}});var Ie=n((Ob,Zi)=>{"use strict";var Pl=x();Zi.exports=!Pl(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var Vr=n((_b,io)=>{"use strict";var Tl=Ie(),to=Function.prototype,eo=to.apply,ro=to.call;io.exports=typeof Reflect=="object"&&Reflect.apply||(Tl?ro.bind(eo):function(){return ro.apply(eo,arguments)})});var O=n((xb,ao)=>{"use strict";var oo=Ie(),no=Function.prototype,Gr=no.call,Ol=oo&&no.bind.bind(Gr,Gr);ao.exports=oo?Ol:function(r){return function(){return Gr.apply(r,arguments)}}});var te=n((Rb,uo)=>{"use strict";var so=O(),_l=so({}.toString),xl=so("".slice);uo.exports=function(r){return xl(_l(r),8,-1)}});var Kr=n((wb,co)=>{"use strict";var Rl=te(),wl=O();co.exports=function(r){if(Rl(r)==="Function")return wl(r)}});var Hr=n((Ab,lo)=>{"use strict";var Wr=typeof document=="object"&&document.all,Al=typeof Wr=="undefined"&&Wr!==void 0;lo.exports={all:Wr,IS_HTMLDDA:Al}});var I=n((Cb,po)=>{"use strict";var fo=Hr(),Cl=fo.all;po.exports=fo.IS_HTMLDDA?function(r){return typeof r=="function"||r===Cl}:function(r){return typeof r=="function"}});var j=n((Nb,vo)=>{"use strict";var Nl=x();vo.exports=!Nl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var _=n((Lb,ho)=>{"use strict";var Ll=Ie(),We=Function.prototype.call;ho.exports=Ll?We.bind(We):function(){return We.apply(We,arguments)}});var yo=n(bo=>{"use strict";var go={}.propertyIsEnumerable,mo=Object.getOwnPropertyDescriptor,kl=mo&&!go.call({1:2},1);bo.f=kl?function(e){var t=mo(this,e);return!!t&&t.enumerable}:go});var Ee=n((Db,So)=>{"use strict";So.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Eo=n(($b,Io)=>{"use strict";var Dl=O(),$l=x(),Ml=te(),zr=Object,jl=Dl("".split);Io.exports=$l(function(){return!zr("z").propertyIsEnumerable(0)})?function(r){return Ml(r)=="String"?jl(r,""):zr(r)}:zr});var ie=n((Mb,qo)=>{"use strict";qo.exports=function(r){return r==null}});var He=n((jb,Po)=>{"use strict";var Fl=ie(),Bl=TypeError;Po.exports=function(r){if(Fl(r))throw Bl("Can't call method on "+r);return r}});var oe=n((Fb,To)=>{"use strict";var Ul=Eo(),Vl=He();To.exports=function(r){return Ul(Vl(r))}});var F=n((Bb,xo)=>{"use strict";var Oo=I(),_o=Hr(),Gl=_o.all;xo.exports=_o.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:Oo(r)||r===Gl}:function(r){return typeof r=="object"?r!==null:Oo(r)}});var ze=n((Ub,Ro)=>{"use strict";Ro.exports={}});var B=n((Vb,Ao)=>{"use strict";var Qr=ze(),Yr=P(),Kl=I(),wo=function(r){return Kl(r)?r:void 0};Ao.exports=function(r,e){return arguments.length<2?wo(Qr[r])||wo(Yr[r]):Qr[r]&&Qr[r][e]||Yr[r]&&Yr[r][e]}});var qe=n((Gb,Co)=>{"use strict";var Wl=O();Co.exports=Wl({}.isPrototypeOf)});var Pe=n((Kb,No)=>{"use strict";No.exports=typeof navigator!="undefined"&&String(navigator.userAgent)||""});var Xr=n((Wb,jo)=>{"use strict";var Mo=P(),Jr=Pe(),Lo=Mo.process,ko=Mo.Deno,Do=Lo&&Lo.versions||ko&&ko.version,$o=Do&&Do.v8,A,Qe;$o&&(A=$o.split("."),Qe=A[0]>0&&A[0]<4?1:+(A[0]+A[1]));!Qe&&Jr&&(A=Jr.match(/Edge\/(\d+)/),(!A||A[1]>=74)&&(A=Jr.match(/Chrome\/(\d+)/),A&&(Qe=+A[1])));jo.exports=Qe});var Zr=n((Hb,Bo)=>{"use strict";var Fo=Xr(),Hl=x(),zl=P(),Ql=zl.String;Bo.exports=!!Object.getOwnPropertySymbols&&!Hl(function(){var r=Symbol();return!Ql(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Fo&&Fo<41})});var et=n((zb,Uo)=>{"use strict";var Yl=Zr();Uo.exports=Yl&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var rt=n((Qb,Vo)=>{"use strict";var Jl=B(),Xl=I(),Zl=qe(),ef=et(),rf=Object;Vo.exports=ef?function(r){return typeof r=="symbol"}:function(r){var e=Jl("Symbol");return Xl(e)&&Zl(e.prototype,rf(r))}});var Te=n((Yb,Go)=>{"use strict";var tf=String;Go.exports=function(r){try{return tf(r)}catch(e){return"Object"}}});var U=n((Jb,Ko)=>{"use strict";var of=I(),nf=Te(),af=TypeError;Ko.exports=function(r){if(of(r))return r;throw af(nf(r)+" is not a function")}});var Oe=n((Xb,Wo)=>{"use strict";var sf=U(),uf=ie();Wo.exports=function(r,e){var t=r[e];return uf(t)?void 0:sf(t)}});var zo=n((Zb,Ho)=>{"use strict";var tt=_(),it=I(),ot=F(),cf=TypeError;Ho.exports=function(r,e){var t,i;if(e==="string"&&it(t=r.toString)&&!ot(i=tt(t,r))||it(t=r.valueOf)&&!ot(i=tt(t,r))||e!=="string"&&it(t=r.toString)&&!ot(i=tt(t,r)))return i;throw cf("Can't convert object to primitive value")}});var C=n((ey,Qo)=>{"use strict";Qo.exports=!0});var Xo=n((ry,Jo)=>{"use strict";var Yo=P(),lf=Object.defineProperty;Jo.exports=function(r,e){try{lf(Yo,r,{value:e,configurable:!0,writable:!0})}catch(t){Yo[r]=e}return e}});var Ye=n((ty,en)=>{"use strict";var ff=P(),df=Xo(),Zo="__core-js_shared__",pf=ff[Zo]||df(Zo,{});en.exports=pf});var nt=n((iy,tn)=>{"use strict";var vf=C(),rn=Ye();(tn.exports=function(r,e){return rn[r]||(rn[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.31.0",mode:vf?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Je=n((oy,on)=>{"use strict";var hf=He(),gf=Object;on.exports=function(r){return gf(hf(r))}});var N=n((ny,nn)=>{"use strict";var mf=O(),bf=Je(),yf=mf({}.hasOwnProperty);nn.exports=Object.hasOwn||function(e,t){return yf(bf(e),t)}});var at=n((ay,an)=>{"use strict";var Sf=O(),If=0,Ef=Math.random(),qf=Sf(1 .toString);an.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+qf(++If+Ef,36)}});var T=n((sy,un)=>{"use strict";var Pf=P(),Tf=nt(),sn=N(),Of=at(),_f=Zr(),xf=et(),ne=Pf.Symbol,st=Tf("wks"),Rf=xf?ne.for||ne:ne&&ne.withoutSetter||Of;un.exports=function(r){return sn(st,r)||(st[r]=_f&&sn(ne,r)?ne[r]:Rf("Symbol."+r)),st[r]}});var dn=n((uy,fn)=>{"use strict";var wf=_(),cn=F(),ln=rt(),Af=Oe(),Cf=zo(),Nf=T(),Lf=TypeError,kf=Nf("toPrimitive");fn.exports=function(r,e){if(!cn(r)||ln(r))return r;var t=Af(r,kf),i;if(t){if(e===void 0&&(e="default"),i=wf(t,r,e),!cn(i)||ln(i))return i;throw Lf("Can't convert object to primitive value")}return e===void 0&&(e="number"),Cf(r,e)}});var Xe=n((cy,pn)=>{"use strict";var Df=dn(),$f=rt();pn.exports=function(r){var e=Df(r,"string");return $f(e)?e:e+""}});var Ze=n((ly,hn)=>{"use strict";var Mf=P(),vn=F(),ut=Mf.document,jf=vn(ut)&&vn(ut.createElement);hn.exports=function(r){return jf?ut.createElement(r):{}}});var ct=n((fy,gn)=>{"use strict";var Ff=j(),Bf=x(),Uf=Ze();gn.exports=!Ff&&!Bf(function(){return Object.defineProperty(Uf("div"),"a",{get:function(){return 7}}).a!=7})});var lt=n(bn=>{"use strict";var Vf=j(),Gf=_(),Kf=yo(),Wf=Ee(),Hf=oe(),zf=Xe(),Qf=N(),Yf=ct(),mn=Object.getOwnPropertyDescriptor;bn.f=Vf?mn:function(e,t){if(e=Hf(e),t=zf(t),Yf)try{return mn(e,t)}catch(i){}if(Qf(e,t))return Wf(!Gf(Kf.f,e,t),e[t])}});var ft=n((py,yn)=>{"use strict";var Jf=x(),Xf=I(),Zf=/#|\.prototype\./,_e=function(r,e){var t=rd[ed(r)];return t==id?!0:t==td?!1:Xf(e)?Jf(e):!!e},ed=_e.normalize=function(r){return String(r).replace(Zf,".").toLowerCase()},rd=_e.data={},td=_e.NATIVE="N",id=_e.POLYFILL="P";yn.exports=_e});var xe=n((vy,In)=>{"use strict";var Sn=Kr(),od=U(),nd=Ie(),ad=Sn(Sn.bind);In.exports=function(r,e){return od(r),e===void 0?r:nd?ad(r,e):function(){return r.apply(e,arguments)}}});var dt=n((hy,En)=>{"use strict";var sd=j(),ud=x();En.exports=sd&&ud(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var L=n((gy,qn)=>{"use strict";var cd=F(),ld=String,fd=TypeError;qn.exports=function(r){if(cd(r))return r;throw fd(ld(r)+" is not an object")}});var z=n(Tn=>{"use strict";var dd=j(),pd=ct(),vd=dt(),er=L(),Pn=Xe(),hd=TypeError,pt=Object.defineProperty,gd=Object.getOwnPropertyDescriptor,vt="enumerable",ht="configurable",gt="writable";Tn.f=dd?vd?function(e,t,i){if(er(e),t=Pn(t),er(i),typeof e=="function"&&t==="prototype"&&"value"in i&> in i&&!i[gt]){var o=gd(e,t);o&&o[gt]&&(e[t]=i.value,i={configurable:ht in i?i[ht]:o[ht],enumerable:vt in i?i[vt]:o[vt],writable:!1})}return pt(e,t,i)}:pt:function(e,t,i){if(er(e),t=Pn(t),er(i),pd)try{return pt(e,t,i)}catch(o){}if("get"in i||"set"in i)throw hd("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Q=n((by,On)=>{"use strict";var md=j(),bd=z(),yd=Ee();On.exports=md?function(r,e,t){return bd.f(r,e,yd(1,t))}:function(r,e,t){return r[e]=t,r}});var k=n((yy,xn)=>{"use strict";var rr=P(),Sd=Vr(),Id=Kr(),Ed=I(),qd=lt().f,Pd=ft(),ae=ze(),Td=xe(),se=Q(),_n=N(),Od=function(r){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,i)}return new r(t,i,o)}return Sd(r,this,arguments)};return e.prototype=r.prototype,e};xn.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,a=r.proto,u=i?rr:o?rr[t]:(rr[t]||{}).prototype,l=i?ae:ae[t]||se(ae,t,{})[t],f=l.prototype,d,s,c,v,p,m,y,E,S;for(v in e)d=Pd(i?v:t+(o?".":"#")+v,r.forced),s=!d&&u&&_n(u,v),m=l[v],s&&(r.dontCallGetSet?(S=qd(u,v),y=S&&S.value):y=u[v]),p=s&&y?y:e[v],!(s&&typeof m==typeof p)&&(r.bind&&s?E=Td(p,rr):r.wrap&&s?E=Od(p):a&&Ed(p)?E=Id(p):E=p,(r.sham||p&&p.sham||m&&m.sham)&&se(E,"sham",!0),se(l,v,E),a&&(c=t+"Prototype",_n(ae,c)||se(ae,c,{}),se(ae[c],v,p),r.real&&f&&(d||!f[v])&&se(f,v,p)))}});var wn=n((Sy,Rn)=>{"use strict";var _d=F(),xd=te(),Rd=T(),wd=Rd("match");Rn.exports=function(r){var e;return _d(r)&&((e=r[wd])!==void 0?!!e:xd(r)=="RegExp")}});var tr=n((Iy,Cn)=>{"use strict";var Ad=T(),Cd=Ad("toStringTag"),An={};An[Cd]="z";Cn.exports=String(An)==="[object z]"});var ue=n((Ey,Nn)=>{"use strict";var Nd=tr(),Ld=I(),ir=te(),kd=T(),Dd=kd("toStringTag"),$d=Object,Md=ir(function(){return arguments}())=="Arguments",jd=function(r,e){try{return r[e]}catch(t){}};Nn.exports=Nd?ir:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=jd(e=$d(r),Dd))=="string"?t:Md?ir(e):(i=ir(e))=="Object"&&Ld(e.callee)?"Arguments":i}});var kn=n((qy,Ln)=>{"use strict";var Fd=ue(),Bd=String;Ln.exports=function(r){if(Fd(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Bd(r)}});var $n=n((Py,Dn)=>{"use strict";var Ud=L();Dn.exports=function(){var r=Ud(this),e="";return r.hasIndices&&(e+="d"),r.global&&(e+="g"),r.ignoreCase&&(e+="i"),r.multiline&&(e+="m"),r.dotAll&&(e+="s"),r.unicode&&(e+="u"),r.unicodeSets&&(e+="v"),r.sticky&&(e+="y"),e}});var Fn=n((Ty,jn)=>{"use strict";var Vd=_(),Gd=N(),Kd=qe(),Wd=$n(),Mn=RegExp.prototype;jn.exports=function(r){var e=r.flags;return e===void 0&&!("flags"in Mn)&&!Gd(r,"flags")&&Kd(Mn,r)?Vd(Wd,r):e}});var Un=n((Oy,Bn)=>{"use strict";var yt=O(),Hd=Je(),zd=Math.floor,mt=yt("".charAt),Qd=yt("".replace),bt=yt("".slice),Yd=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Jd=/\$([$&'`]|\d{1,2})/g;Bn.exports=function(r,e,t,i,o,a){var u=t+r.length,l=i.length,f=Jd;return o!==void 0&&(o=Hd(o),f=Yd),Qd(a,f,function(d,s){var c;switch(mt(s,0)){case"$":return"$";case"&":return r;case"`":return bt(e,0,t);case"'":return bt(e,u);case"<":c=o[bt(s,1,-1)];break;default:var v=+s;if(v===0)return d;if(v>l){var p=zd(v/10);return p===0?d:p<=l?i[p-1]===void 0?mt(s,1):i[p-1]+mt(s,1):d}c=i[v-1]}return c===void 0?"":c})}});var Hn=n(()=>{"use strict";var Xd=k(),Zd=_(),St=O(),Vn=He(),ep=I(),rp=ie(),tp=wn(),ce=kn(),ip=Oe(),op=Fn(),np=Un(),ap=T(),sp=C(),up=ap("replace"),cp=TypeError,Wn=St("".indexOf),lp=St("".replace),Gn=St("".slice),fp=Math.max,Kn=function(r,e,t){return t>r.length?-1:e===""?t:Wn(r,e,t)};Xd({target:"String",proto:!0},{replaceAll:function(e,t){var i=Vn(this),o,a,u,l,f,d,s,c,v,p=0,m=0,y="";if(!rp(e)){if(o=tp(e),o&&(a=ce(Vn(op(e))),!~Wn(a,"g")))throw cp("`.replaceAll` does not allow non-global regexes");if(u=ip(e,up),u)return Zd(u,e,i,t);if(sp&&o)return lp(ce(i),e,t)}for(l=ce(i),f=ce(e),d=ep(t),d||(t=ce(t)),s=f.length,c=fp(1,s),p=Kn(l,f,0);p!==-1;)v=d?ce(t(f,p,l)):np(f,l,p,[],void 0,t),y+=Gn(l,m,p)+v,m=p+s,p=Kn(l,f,p+c);return m<l.length&&(y+=Gn(l,m)),y}})});var It=n((Ry,zn)=>{"use strict";var dp=B();zn.exports=dp});var Yn=n((wy,Qn)=>{"use strict";zi();Qi();Hn();var pp=It();Qn.exports=pp("String","replaceAll")});var Xn=n((Ay,Jn)=>{"use strict";var vp=Yn();Jn.exports=vp});var ea=n((Cy,Zn)=>{"use strict";var hp=Xn();Zn.exports=hp});var sa=n(()=>{"use strict"});var Re=n((By,ua)=>{"use strict";var mp=te();ua.exports=typeof process!="undefined"&&mp(process)=="process"});var fe=n((Uy,ca)=>{"use strict";var bp=Q();ca.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:bp(r,e,t),r}});var fa=n((Vy,la)=>{"use strict";var yp=O(),Sp=U();la.exports=function(r,e,t){try{return yp(Sp(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var pa=n((Gy,da)=>{"use strict";var Ip=I(),Ep=String,qp=TypeError;da.exports=function(r){if(typeof r=="object"||Ip(r))return r;throw qp("Can't set "+Ep(r)+" as a prototype")}});var Pt=n((Ky,va)=>{"use strict";var Pp=fa(),Tp=L(),Op=pa();va.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=Pp(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,a){return Tp(o),Op(a),r?t(o,a):o.__proto__=a,o}}():void 0)});var ga=n((Wy,ha)=>{"use strict";var _p=tr(),xp=ue();ha.exports=_p?{}.toString:function(){return"[object "+xp(this)+"]"}});var ur=n((Hy,ba)=>{"use strict";var Rp=tr(),wp=z().f,Ap=Q(),Cp=N(),Np=ga(),Lp=T(),ma=Lp("toStringTag");ba.exports=function(r,e,t,i){if(r){var o=t?r:r.prototype;Cp(o,ma)||wp(o,ma,{configurable:!0,value:e}),i&&!Rp&&Ap(o,"toString",Np)}}});var Sa=n((zy,ya)=>{"use strict";var kp=z();ya.exports=function(r,e,t){return kp.f(r,e,t)}});var qa=n((Qy,Ea)=>{"use strict";var Dp=B(),$p=Sa(),Mp=T(),jp=j(),Ia=Mp("species");Ea.exports=function(r){var e=Dp(r);jp&&e&&!e[Ia]&&$p(e,Ia,{configurable:!0,get:function(){return this}})}});var Ta=n((Yy,Pa)=>{"use strict";var Fp=qe(),Bp=TypeError;Pa.exports=function(r,e){if(Fp(e,r))return r;throw Bp("Incorrect invocation")}});var Ot=n((Jy,Oa)=>{"use strict";var Up=O(),Vp=I(),Tt=Ye(),Gp=Up(Function.toString);Vp(Tt.inspectSource)||(Tt.inspectSource=function(r){return Gp(r)});Oa.exports=Tt.inspectSource});var Ca=n((Xy,Aa)=>{"use strict";var Kp=O(),Wp=x(),_a=I(),Hp=ue(),zp=B(),Qp=Ot(),xa=function(){},Yp=[],Ra=zp("Reflect","construct"),_t=/^\s*(?:class|function)\b/,Jp=Kp(_t.exec),Xp=!_t.exec(xa),we=function(e){if(!_a(e))return!1;try{return Ra(xa,Yp,e),!0}catch(t){return!1}},wa=function(e){if(!_a(e))return!1;switch(Hp(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Xp||!!Jp(_t,Qp(e))}catch(t){return!0}};wa.sham=!0;Aa.exports=!Ra||Wp(function(){var r;return we(we.call)||!we(Object)||!we(function(){r=!0})||r})?wa:we});var La=n((Zy,Na)=>{"use strict";var Zp=Ca(),ev=Te(),rv=TypeError;Na.exports=function(r){if(Zp(r))return r;throw rv(ev(r)+" is not a constructor")}});var xt=n((eS,Da)=>{"use strict";var ka=L(),tv=La(),iv=ie(),ov=T(),nv=ov("species");Da.exports=function(r,e){var t=ka(r).constructor,i;return t===void 0||iv(i=ka(t)[nv])?e:tv(i)}});var Rt=n((rS,$a)=>{"use strict";var av=B();$a.exports=av("document","documentElement")});var ja=n((tS,Ma)=>{"use strict";var sv=O();Ma.exports=sv([].slice)});var Ba=n((iS,Fa)=>{"use strict";var uv=TypeError;Fa.exports=function(r,e){if(r<e)throw uv("Not enough arguments");return r}});var wt=n((oS,Ua)=>{"use strict";var cv=Pe();Ua.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(cv)});var jt=n((nS,Ja)=>{"use strict";var R=P(),lv=Vr(),fv=xe(),Va=I(),dv=N(),Ya=x(),Ga=Rt(),pv=ja(),Ka=Ze(),vv=Ba(),hv=wt(),gv=Re(),Dt=R.setImmediate,$t=R.clearImmediate,mv=R.process,At=R.Dispatch,bv=R.Function,Wa=R.MessageChannel,yv=R.String,Ct=0,Ae={},Ha="onreadystatechange",Ce,Y,Nt,Lt;Ya(function(){Ce=R.location});var Mt=function(r){if(dv(Ae,r)){var e=Ae[r];delete Ae[r],e()}},kt=function(r){return function(){Mt(r)}},za=function(r){Mt(r.data)},Qa=function(r){R.postMessage(yv(r),Ce.protocol+"//"+Ce.host)};(!Dt||!$t)&&(Dt=function(e){vv(arguments.length,1);var t=Va(e)?e:bv(e),i=pv(arguments,1);return Ae[++Ct]=function(){lv(t,void 0,i)},Y(Ct),Ct},$t=function(e){delete Ae[e]},gv?Y=function(r){mv.nextTick(kt(r))}:At&&At.now?Y=function(r){At.now(kt(r))}:Wa&&!hv?(Nt=new Wa,Lt=Nt.port2,Nt.port1.onmessage=za,Y=fv(Lt.postMessage,Lt)):R.addEventListener&&Va(R.postMessage)&&!R.importScripts&&Ce&&Ce.protocol!=="file:"&&!Ya(Qa)?(Y=Qa,R.addEventListener("message",za,!1)):Ha in Ka("script")?Y=function(r){Ga.appendChild(Ka("script"))[Ha]=function(){Ga.removeChild(this),Mt(r)}}:Y=function(r){setTimeout(kt(r),0)});Ja.exports={set:Dt,clear:$t}});var Ft=n((aS,Za)=>{"use strict";var Xa=function(){this.head=null,this.tail=null};Xa.prototype={add:function(r){var e={item:r,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var r=this.head;if(r){var e=this.head=r.next;return e===null&&(this.tail=null),r.item}}};Za.exports=Xa});var rs=n((sS,es)=>{"use strict";var Sv=Pe();es.exports=/ipad|iphone|ipod/i.test(Sv)&&typeof Pebble!="undefined"});var is=n((uS,ts)=>{"use strict";var Iv=Pe();ts.exports=/web0s(?!.*chrome)/i.test(Iv)});var fs=n((cS,ls)=>{"use strict";var J=P(),os=xe(),Ev=lt().f,Bt=jt().set,qv=Ft(),Pv=wt(),Tv=rs(),Ov=is(),Ut=Re(),ns=J.MutationObserver||J.WebKitMutationObserver,as=J.document,ss=J.process,cr=J.Promise,us=Ev(J,"queueMicrotask"),Kt=us&&us.value,de,Vt,Gt,lr,cs;Kt||(Ne=new qv,Le=function(){var r,e;for(Ut&&(r=ss.domain)&&r.exit();e=Ne.get();)try{e()}catch(t){throw Ne.head&&de(),t}r&&r.enter()},!Pv&&!Ut&&!Ov&&ns&&as?(Vt=!0,Gt=as.createTextNode(""),new ns(Le).observe(Gt,{characterData:!0}),de=function(){Gt.data=Vt=!Vt}):!Tv&&cr&&cr.resolve?(lr=cr.resolve(void 0),lr.constructor=cr,cs=os(lr.then,lr),de=function(){cs(Le)}):Ut?de=function(){ss.nextTick(Le)}:(Bt=os(Bt,J),de=function(){Bt(Le)}),Kt=function(r){Ne.head||de(),Ne.add(r)});var Ne,Le;ls.exports=Kt});var ps=n((lS,ds)=>{"use strict";ds.exports=function(r,e){try{arguments.length==1?console.error(r):console.error(r,e)}catch(t){}}});var fr=n((fS,vs)=>{"use strict";vs.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var ms=n((dS,gs)=>{"use strict";var _v=P(),xv=I(),hs=_v.WeakMap;gs.exports=xv(hs)&&/native code/.test(String(hs))});var dr=n((pS,ys)=>{"use strict";var Rv=nt(),wv=at(),bs=Rv("keys");ys.exports=function(r){return bs[r]||(bs[r]=wv(r))}});var pr=n((vS,Ss)=>{"use strict";Ss.exports={}});var Qt=n((hS,qs)=>{"use strict";var Av=ms(),Es=P(),Cv=F(),Nv=Q(),Wt=N(),Ht=Ye(),Lv=dr(),kv=pr(),Is="Object already initialized",zt=Es.TypeError,Dv=Es.WeakMap,vr,ke,hr,$v=function(r){return hr(r)?ke(r):vr(r,{})},Mv=function(r){return function(e){var t;if(!Cv(e)||(t=ke(e)).type!==r)throw zt("Incompatible receiver, "+r+" required");return t}};Av||Ht.state?(D=Ht.state||(Ht.state=new Dv),D.get=D.get,D.has=D.has,D.set=D.set,vr=function(r,e){if(D.has(r))throw zt(Is);return e.facade=r,D.set(r,e),e},ke=function(r){return D.get(r)||{}},hr=function(r){return D.has(r)}):(X=Lv("state"),kv[X]=!0,vr=function(r,e){if(Wt(r,X))throw zt(Is);return e.facade=r,Nv(r,X,e),e},ke=function(r){return Wt(r,X)?r[X]:{}},hr=function(r){return Wt(r,X)});var D,X;qs.exports={set:vr,get:ke,has:hr,enforce:$v,getterFor:Mv}});var Z=n((gS,Ps)=>{"use strict";var jv=P();Ps.exports=jv.Promise});var Yt=n((mS,Ts)=>{"use strict";Ts.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"});var _s=n((bS,Os)=>{"use strict";var Fv=Yt(),Bv=Re();Os.exports=!Fv&&!Bv&&typeof window=="object"&&typeof document=="object"});var pe=n((yS,ws)=>{"use strict";var Uv=P(),De=Z(),Vv=I(),Gv=ft(),Kv=Ot(),Wv=T(),Hv=_s(),zv=Yt(),Qv=C(),Jt=Xr(),xs=De&&De.prototype,Yv=Wv("species"),Xt=!1,Rs=Vv(Uv.PromiseRejectionEvent),Jv=Gv("Promise",function(){var r=Kv(De),e=r!==String(De);if(!e&&Jt===66||Qv&&!(xs.catch&&xs.finally))return!0;if(!Jt||Jt<51||!/native code/.test(r)){var t=new De(function(a){a(1)}),i=function(a){a(function(){},function(){})},o=t.constructor={};if(o[Yv]=i,Xt=t.then(function(){})instanceof i,!Xt)return!0}return!e&&(Hv||zv)&&!Rs});ws.exports={CONSTRUCTOR:Jv,REJECTION_EVENT:Rs,SUBCLASSING:Xt}});var ve=n((SS,Cs)=>{"use strict";var As=U(),Xv=TypeError,Zv=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw Xv("Bad Promise constructor");e=i,t=o}),this.resolve=As(e),this.reject=As(t)};Cs.exports.f=function(r){return new Zv(r)}});var Js=n(()=>{"use strict";var eh=k(),rh=C(),yr=Re(),H=P(),be=_(),Ns=fe(),Ls=Pt(),th=ur(),ih=qa(),oh=U(),br=I(),nh=F(),ah=Ta(),sh=xt(),js=jt().set,ii=fs(),uh=ps(),ch=fr(),lh=Ft(),Fs=Qt(),Sr=Z(),oi=pe(),Bs=ve(),Ir="Promise",Us=oi.CONSTRUCTOR,fh=oi.REJECTION_EVENT,dh=oi.SUBCLASSING,Zt=Fs.getterFor(Ir),ph=Fs.set,he=Sr&&Sr.prototype,ee=Sr,gr=he,Vs=H.TypeError,ei=H.document,ni=H.process,ri=Bs.f,vh=ri,hh=!!(ei&&ei.createEvent&&H.dispatchEvent),Gs="unhandledrejection",gh="rejectionhandled",ks=0,Ks=1,mh=2,ai=1,Ws=2,mr,Ds,bh,$s,Hs=function(r){var e;return nh(r)&&br(e=r.then)?e:!1},zs=function(r,e){var t=e.value,i=e.state==Ks,o=i?r.ok:r.fail,a=r.resolve,u=r.reject,l=r.domain,f,d,s;try{o?(i||(e.rejection===Ws&&Sh(e),e.rejection=ai),o===!0?f=t:(l&&l.enter(),f=o(t),l&&(l.exit(),s=!0)),f===r.promise?u(Vs("Promise-chain cycle")):(d=Hs(f))?be(d,f,a,u):a(f)):u(t)}catch(c){l&&!s&&l.exit(),u(c)}},Qs=function(r,e){r.notified||(r.notified=!0,ii(function(){for(var t=r.reactions,i;i=t.get();)zs(i,r);r.notified=!1,e&&!r.rejection&&yh(r)}))},Ys=function(r,e,t){var i,o;hh?(i=ei.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),H.dispatchEvent(i)):i={promise:e,reason:t},!fh&&(o=H["on"+r])?o(i):r===Gs&&uh("Unhandled promise rejection",t)},yh=function(r){be(js,H,function(){var e=r.facade,t=r.value,i=Ms(r),o;if(i&&(o=ch(function(){yr?ni.emit("unhandledRejection",t,e):Ys(Gs,e,t)}),r.rejection=yr||Ms(r)?Ws:ai,o.error))throw o.value})},Ms=function(r){return r.rejection!==ai&&!r.parent},Sh=function(r){be(js,H,function(){var e=r.facade;yr?ni.emit("rejectionHandled",e):Ys(gh,e,r.value)})},ge=function(r,e,t){return function(i){r(e,i,t)}},me=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=mh,Qs(r,!0))},ti=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw Vs("Promise can't be resolved itself");var i=Hs(e);i?ii(function(){var o={done:!1};try{be(i,e,ge(ti,o,r),ge(me,o,r))}catch(a){me(o,a,r)}}):(r.value=e,r.state=Ks,Qs(r,!1))}catch(o){me({done:!1},o,r)}}};if(Us&&(ee=function(e){ah(this,gr),oh(e),be(mr,this);var t=Zt(this);try{e(ge(ti,t),ge(me,t))}catch(i){me(t,i)}},gr=ee.prototype,mr=function(e){ph(this,{type:Ir,done:!1,notified:!1,parent:!1,reactions:new lh,rejection:!1,state:ks,value:void 0})},mr.prototype=Ns(gr,"then",function(e,t){var i=Zt(this),o=ri(sh(this,ee));return i.parent=!0,o.ok=br(e)?e:!0,o.fail=br(t)&&t,o.domain=yr?ni.domain:void 0,i.state==ks?i.reactions.add(o):ii(function(){zs(o,i)}),o.promise}),Ds=function(){var r=new mr,e=Zt(r);this.promise=r,this.resolve=ge(ti,e),this.reject=ge(me,e)},Bs.f=ri=function(r){return r===ee||r===bh?new Ds(r):vh(r)},!rh&&br(Sr)&&he!==Object.prototype)){$s=he.then,dh||Ns(he,"then",function(e,t){var i=this;return new ee(function(o,a){be($s,i,o,a)}).then(e,t)},{unsafe:!0});try{delete he.constructor}catch(r){}Ls&&Ls(he,gr)}eh({global:!0,constructor:!0,wrap:!0,forced:Us},{Promise:ee});th(ee,Ir,!1,!0);ih(Ir)});var re=n((qS,Xs)=>{"use strict";Xs.exports={}});var eu=n((PS,Zs)=>{"use strict";var Ih=T(),Eh=re(),qh=Ih("iterator"),Ph=Array.prototype;Zs.exports=function(r){return r!==void 0&&(Eh.Array===r||Ph[qh]===r)}});var tu=n((TS,ru)=>{"use strict";var Th=Math.ceil,Oh=Math.floor;ru.exports=Math.trunc||function(e){var t=+e;return(t>0?Oh:Th)(t)}});var si=n((OS,iu)=>{"use strict";var _h=tu();iu.exports=function(r){var e=+r;return e!==e||e===0?0:_h(e)}});var nu=n((_S,ou)=>{"use strict";var xh=si(),Rh=Math.min;ou.exports=function(r){return r>0?Rh(xh(r),9007199254740991):0}});var ui=n((xS,au)=>{"use strict";var wh=nu();au.exports=function(r){return wh(r.length)}});var ci=n((RS,uu)=>{"use strict";var Ah=ue(),su=Oe(),Ch=ie(),Nh=re(),Lh=T(),kh=Lh("iterator");uu.exports=function(r){if(!Ch(r))return su(r,kh)||su(r,"@@iterator")||Nh[Ah(r)]}});var lu=n((wS,cu)=>{"use strict";var Dh=_(),$h=U(),Mh=L(),jh=Te(),Fh=ci(),Bh=TypeError;cu.exports=function(r,e){var t=arguments.length<2?Fh(r):e;if($h(t))return Mh(Dh(t,r));throw Bh(jh(r)+" is not iterable")}});var pu=n((AS,du)=>{"use strict";var Uh=_(),fu=L(),Vh=Oe();du.exports=function(r,e,t){var i,o;fu(r);try{if(i=Vh(r,"return"),!i){if(e==="throw")throw t;return t}i=Uh(i,r)}catch(a){o=!0,i=a}if(e==="throw")throw t;if(o)throw i;return fu(i),t}});var qr=n((CS,mu)=>{"use strict";var Gh=xe(),Kh=_(),Wh=L(),Hh=Te(),zh=eu(),Qh=ui(),vu=qe(),Yh=lu(),Jh=ci(),hu=pu(),Xh=TypeError,Er=function(r,e){this.stopped=r,this.result=e},gu=Er.prototype;mu.exports=function(r,e,t){var i=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),u=!!(t&&t.IS_ITERATOR),l=!!(t&&t.INTERRUPTED),f=Gh(e,i),d,s,c,v,p,m,y,E=function(q){return d&&hu(d,"normal",q),new Er(!0,q)},S=function(q){return o?(Wh(q),l?f(q[0],q[1],E):f(q[0],q[1])):l?f(q,E):f(q)};if(a)d=r.iterator;else if(u)d=r;else{if(s=Jh(r),!s)throw Xh(Hh(r)+" is not iterable");if(zh(s)){for(c=0,v=Qh(r);v>c;c++)if(p=S(r[c]),p&&vu(gu,p))return p;return new Er(!1)}d=Yh(r,s)}for(m=a?r.next:d.next;!(y=Kh(m,d)).done;){try{p=S(y.value)}catch(q){hu(d,"throw",q)}if(typeof p=="object"&&p&&vu(gu,p))return p}return new Er(!1)}});var Eu=n((NS,Iu)=>{"use strict";var Zh=T(),yu=Zh("iterator"),Su=!1;try{bu=0,li={next:function(){return{done:!!bu++}},return:function(){Su=!0}},li[yu]=function(){return this},Array.from(li,function(){throw 2})}catch(r){}var bu,li;Iu.exports=function(r,e){if(!e&&!Su)return!1;var t=!1;try{var i={};i[yu]=function(){return{next:function(){return{done:t=!0}}}},r(i)}catch(o){}return t}});var fi=n((LS,qu)=>{"use strict";var eg=Z(),rg=Eu(),tg=pe().CONSTRUCTOR;qu.exports=tg||!rg(function(r){eg.all(r).then(void 0,function(){})})});var Pu=n(()=>{"use strict";var ig=k(),og=_(),ng=U(),ag=ve(),sg=fr(),ug=qr(),cg=fi();ig({target:"Promise",stat:!0,forced:cg},{all:function(e){var t=this,i=ag.f(t),o=i.resolve,a=i.reject,u=sg(function(){var l=ng(t.resolve),f=[],d=0,s=1;ug(e,function(c){var v=d++,p=!1;s++,og(l,t,c).then(function(m){p||(p=!0,f[v]=m,--s||o(f))},a)}),--s||o(f)});return u.error&&a(u.value),i.promise}})});var Ou=n(()=>{"use strict";var lg=k(),fg=C(),dg=pe().CONSTRUCTOR,pi=Z(),pg=B(),vg=I(),hg=fe(),Tu=pi&&pi.prototype;lg({target:"Promise",proto:!0,forced:dg,real:!0},{catch:function(r){return this.then(void 0,r)}});!fg&&vg(pi)&&(di=pg("Promise").prototype.catch,Tu.catch!==di&&hg(Tu,"catch",di,{unsafe:!0}));var di});var _u=n(()=>{"use strict";var gg=k(),mg=_(),bg=U(),yg=ve(),Sg=fr(),Ig=qr(),Eg=fi();gg({target:"Promise",stat:!0,forced:Eg},{race:function(e){var t=this,i=yg.f(t),o=i.reject,a=Sg(function(){var u=bg(t.resolve);Ig(e,function(l){mg(u,t,l).then(i.resolve,o)})});return a.error&&o(a.value),i.promise}})});var xu=n(()=>{"use strict";var qg=k(),Pg=_(),Tg=ve(),Og=pe().CONSTRUCTOR;qg({target:"Promise",stat:!0,forced:Og},{reject:function(e){var t=Tg.f(this);return Pg(t.reject,void 0,e),t.promise}})});var vi=n((VS,Ru)=>{"use strict";var _g=L(),xg=F(),Rg=ve();Ru.exports=function(r,e){if(_g(r),xg(e)&&e.constructor===r)return e;var t=Rg.f(r),i=t.resolve;return i(e),t.promise}});var Cu=n(()=>{"use strict";var wg=k(),Ag=B(),wu=C(),Cg=Z(),Au=pe().CONSTRUCTOR,Ng=vi(),Lg=Ag("Promise"),kg=wu&&!Au;wg({target:"Promise",stat:!0,forced:wu||Au},{resolve:function(e){return Ng(kg&&this===Lg?Cg:this,e)}})});var Nu=n(()=>{"use strict";Js();Pu();Ou();_u();xu();Cu()});var $u=n(()=>{"use strict";var Dg=k(),$g=C(),Pr=Z(),Mg=x(),ku=B(),Du=I(),jg=xt(),Lu=vi(),Fg=fe(),gi=Pr&&Pr.prototype,Bg=!!Pr&&Mg(function(){gi.finally.call({then:function(){}},function(){})});Dg({target:"Promise",proto:!0,real:!0,forced:Bg},{finally:function(r){var e=jg(this,ku("Promise")),t=Du(r);return this.then(t?function(i){return Lu(e,r()).then(function(){return i})}:r,t?function(i){return Lu(e,r()).then(function(){throw i})}:r)}});!$g&&Du(Pr)&&(hi=ku("Promise").prototype.finally,gi.finally!==hi&&Fg(gi,"finally",hi,{unsafe:!0}));var hi});var ju=n((YS,Mu)=>{"use strict";sa();Nu();$u();var Ug=It();Mu.exports=Ug("Promise","finally")});var Bu=n((JS,Fu)=>{"use strict";var Vg=ju();Fu.exports=Vg});var Vu=n((XS,Uu)=>{"use strict";var Gg=Bu();Uu.exports=Gg});var Ku=n((ZS,Gu)=>{"use strict";Gu.exports=function(){}});var zu=n((eI,Hu)=>{"use strict";var mi=j(),Kg=N(),Wu=Function.prototype,Wg=mi&&Object.getOwnPropertyDescriptor,bi=Kg(Wu,"name"),Hg=bi&&function(){}.name==="something",zg=bi&&(!mi||mi&&Wg(Wu,"name").configurable);Hu.exports={EXISTS:bi,PROPER:Hg,CONFIGURABLE:zg}});var Yu=n((rI,Qu)=>{"use strict";var Qg=si(),Yg=Math.max,Jg=Math.min;Qu.exports=function(r,e){var t=Qg(r);return t<0?Yg(t+e,0):Jg(t,e)}});var Zu=n((tI,Xu)=>{"use strict";var Xg=oe(),Zg=Yu(),em=ui(),Ju=function(r){return function(e,t,i){var o=Xg(e),a=em(o),u=Zg(i,a),l;if(r&&t!=t){for(;a>u;)if(l=o[u++],l!=l)return!0}else for(;a>u;u++)if((r||u in o)&&o[u]===t)return r||u||0;return!r&&-1}};Xu.exports={includes:Ju(!0),indexOf:Ju(!1)}});var tc=n((iI,rc)=>{"use strict";var rm=O(),yi=N(),tm=oe(),im=Zu().indexOf,om=pr(),ec=rm([].push);rc.exports=function(r,e){var t=tm(r),i=0,o=[],a;for(a in t)!yi(om,a)&&yi(t,a)&&ec(o,a);for(;e.length>i;)yi(t,a=e[i++])&&(~im(o,a)||ec(o,a));return o}});var Si=n((oI,ic)=>{"use strict";ic.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var nc=n((nI,oc)=>{"use strict";var nm=tc(),am=Si();oc.exports=Object.keys||function(e){return nm(e,am)}});var sc=n(ac=>{"use strict";var sm=j(),um=dt(),cm=z(),lm=L(),fm=oe(),dm=nc();ac.f=sm&&!um?Object.defineProperties:function(e,t){lm(e);for(var i=fm(t),o=dm(t),a=o.length,u=0,l;a>u;)cm.f(e,l=o[u++],i[l]);return e}});var Pi=n((sI,vc)=>{"use strict";var pm=L(),vm=sc(),uc=Si(),hm=pr(),gm=Rt(),mm=Ze(),bm=dr(),cc=">",lc="<",Ei="prototype",qi="script",dc=bm("IE_PROTO"),Ii=function(){},pc=function(r){return lc+qi+cc+r+lc+"/"+qi+cc},fc=function(r){r.write(pc("")),r.close();var e=r.parentWindow.Object;return r=null,e},ym=function(){var r=mm("iframe"),e="java"+qi+":",t;return r.style.display="none",gm.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(pc("document.F=Object")),t.close(),t.F},Tr,Or=function(){try{Tr=new ActiveXObject("htmlfile")}catch(e){}Or=typeof document!="undefined"?document.domain&&Tr?fc(Tr):ym():fc(Tr);for(var r=uc.length;r--;)delete Or[Ei][uc[r]];return Or()};hm[dc]=!0;vc.exports=Object.create||function(e,t){var i;return e!==null?(Ii[Ei]=pm(e),i=new Ii,Ii[Ei]=null,i[dc]=e):i=Or(),t===void 0?i:vm.f(i,t)}});var gc=n((uI,hc)=>{"use strict";var Sm=x();hc.exports=!Sm(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var Oi=n((cI,bc)=>{"use strict";var Im=N(),Em=I(),qm=Je(),Pm=dr(),Tm=gc(),mc=Pm("IE_PROTO"),Ti=Object,Om=Ti.prototype;bc.exports=Tm?Ti.getPrototypeOf:function(r){var e=qm(r);if(Im(e,mc))return e[mc];var t=e.constructor;return Em(t)&&e instanceof t?t.prototype:e instanceof Ti?Om:null}});var wi=n((lI,Ic)=>{"use strict";var _m=x(),xm=I(),Rm=F(),wm=Pi(),yc=Oi(),Am=fe(),Cm=T(),Nm=C(),Ri=Cm("iterator"),Sc=!1,V,_i,xi;[].keys&&(xi=[].keys(),"next"in xi?(_i=yc(yc(xi)),_i!==Object.prototype&&(V=_i)):Sc=!0);var Lm=!Rm(V)||_m(function(){var r={};return V[Ri].call(r)!==r});Lm?V={}:Nm&&(V=wm(V));xm(V[Ri])||Am(V,Ri,function(){return this});Ic.exports={IteratorPrototype:V,BUGGY_SAFARI_ITERATORS:Sc}});var qc=n((fI,Ec)=>{"use strict";var km=wi().IteratorPrototype,Dm=Pi(),$m=Ee(),Mm=ur(),jm=re(),Fm=function(){return this};Ec.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=Dm(km,{next:$m(+!i,t)}),Mm(r,o,!1,!0),jm[o]=Fm,r}});var Lc=n((dI,Nc)=>{"use strict";var Bm=k(),Um=_(),_r=C(),Ac=zu(),Vm=I(),Gm=qc(),Pc=Oi(),Tc=Pt(),Km=ur(),Wm=Q(),Ai=fe(),Hm=T(),Oc=re(),Cc=wi(),zm=Ac.PROPER,Qm=Ac.CONFIGURABLE,_c=Cc.IteratorPrototype,xr=Cc.BUGGY_SAFARI_ITERATORS,$e=Hm("iterator"),xc="keys",Me="values",Rc="entries",wc=function(){return this};Nc.exports=function(r,e,t,i,o,a,u){Gm(t,e,i);var l=function(S){if(S===o&&v)return v;if(!xr&&S in s)return s[S];switch(S){case xc:return function(){return new t(this,S)};case Me:return function(){return new t(this,S)};case Rc:return function(){return new t(this,S)}}return function(){return new t(this)}},f=e+" Iterator",d=!1,s=r.prototype,c=s[$e]||s["@@iterator"]||o&&s[o],v=!xr&&c||l(o),p=e=="Array"&&s.entries||c,m,y,E;if(p&&(m=Pc(p.call(new r)),m!==Object.prototype&&m.next&&(!_r&&Pc(m)!==_c&&(Tc?Tc(m,_c):Vm(m[$e])||Ai(m,$e,wc)),Km(m,f,!0,!0),_r&&(Oc[f]=wc))),zm&&o==Me&&c&&c.name!==Me&&(!_r&&Qm?Wm(s,"name",Me):(d=!0,v=function(){return Um(c,this)})),o)if(y={values:l(Me),keys:a?v:l(xc),entries:l(Rc)},u)for(E in y)(xr||d||!(E in s))&&Ai(s,E,y[E]);else Bm({target:e,proto:!0,forced:xr||d},y);return(!_r||u)&&s[$e]!==v&&Ai(s,$e,v,{name:o}),Oc[e]=v,y}});var Dc=n((pI,kc)=>{"use strict";kc.exports=function(r,e){return{value:r,done:e}}});var Ni=n((vI,Bc)=>{"use strict";var Ym=oe(),Ci=Ku(),$c=re(),jc=Qt(),Jm=z().f,Xm=Lc(),Rr=Dc(),Zm=C(),eb=j(),Fc="Array Iterator",rb=jc.set,tb=jc.getterFor(Fc);Bc.exports=Xm(Array,"Array",function(r,e){rb(this,{type:Fc,target:Ym(r),index:0,kind:e})},function(){var r=tb(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,Rr(void 0,!0)):t=="keys"?Rr(i,!1):t=="values"?Rr(e[i],!1):Rr([i,e[i]],!1)},"values");var Mc=$c.Arguments=$c.Array;Ci("keys");Ci("values");Ci("entries");if(!Zm&&eb&&Mc.name!=="values")try{Jm(Mc,"name",{value:"values"})}catch(r){}});var Vc=n((hI,Uc)=>{"use strict";var ib=Xe(),ob=z(),nb=Ee();Uc.exports=function(r,e,t){var i=ib(e);i in r?ob.f(r,i,nb(0,t)):r[i]=t}});var Gc=n(()=>{"use strict";var ab=k(),sb=qr(),ub=Vc();ab({target:"Object",stat:!0},{fromEntries:function(e){var t={};return sb(e,function(i,o){ub(t,i,o)},{AS_ENTRIES:!0}),t}})});var Wc=n((bI,Kc)=>{"use strict";Ni();Gc();var cb=ze();Kc.exports=cb.Object.fromEntries});var zc=n((yI,Hc)=>{"use strict";Hc.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 Jc=n(()=>{"use strict";Ni();var lb=zc(),fb=P(),db=ue(),pb=Q(),Qc=re(),vb=T(),Yc=vb("toStringTag");for(wr in lb)Li=fb[wr],Ar=Li&&Li.prototype,Ar&&db(Ar)!==Yc&&pb(Ar,Yc,wr),Qc[wr]=Qc.Array;var Li,Ar,wr});var Zc=n((EI,Xc)=>{"use strict";var hb=Wc();Jc();Xc.exports=hb});var rl=n((qI,el)=>{"use strict";var gb=Zc();el.exports=gb});var yb={};El(yb,{ApiEnv:()=>le,ConnectionType:()=>ar,ContentType:()=>nr,InteractiveInterfaceClick:()=>Et,OneStat:()=>jr,Quality:()=>or,SeekAction:()=>sr,VERSION:()=>je});module.exports=ql(yb);var dl=Ur(ea(),1);var le=(a=>(a.PROD="prod",a.VK_ALIAS="vk_alias",a.VIDEOTEST="videotest",a.TEST="test",a.AUTO="auto",a))(le||{}),or=(d=>(d.Q144P="mobile",d.Q240P="lowest",d.Q360P="low",d.Q480P="medium",d.Q720P="high",d.Q1080P="fullhd",d.Q1440P="quadhd",d.Q2160P="ultrahd",d.UNKNOWN="unknown",d))(or||{}),nr=(p=>(p.MP4="mp4",p.DASH="dash",p.DASH_SEP="dash_sep",p.ONDEMAND_DASH="ondemand_dash",p.HLS="hls",p.ONDEMAND_HLS="ondemand_hls",p.WEBM="webm",p.AV1="av1",p.ONDEMAND_DASH_LIVE="ondemand_dash_live",p.ONDEMAND_HLS_LIVE="ondemand_hls_live",p.WEBRTC="webrtc",p.UNKNOWN="unknown",p.RTMP="rtmp",p))(nr||{});var ar=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(ar||{});var sr=(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))(sr||{}),Et=(a=>(a.GRAPH_SHOW="iGraphShow",a.GRAPH_HIDE="iGraphHide",a.NEXT_AREA="iNextChapterArea",a.NEXT_BUTTON="iNextChapterBtn",a.WATCH_AGAIN="iWatchAgainBtn",a))(Et||{}),ra={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"},ta={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"},ia={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},oa={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};var na=require("@vkontakte/videoplayer-shared"),gp={apiEnv:"vk_alias",requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:[],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1}},aa=r=>(0,na.fillWithDefault)(r,gp);function qt(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}var h=require("@vkontakte/videoplayer-shared"),Fr=require("@vkontakte/videoplayer-shared");var Cr=Ur(Vu(),1);var tl=Ur(rl(),1);var il=r=>{var o;let{operation:e,custom:t}=r,i=(0,tl.default)(Object.entries(t).map(([a,u])=>{var d,s,c;let l=(d=ta[a])!=null?d:a,f=u;return u&&(a==="mode"?f=(s=oa[u])!=null?s:u:a==="quality"&&(f=(c=ia[u])!=null?c:u)),[l,f]}));return Ge(W({},r),{operation:(o=ra[e])!=null?o:e,custom:i})};var je="__VERSION__",ol="CIOPGQJGDIHBABABA",ki={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",auto:""};var $=require("@vkontakte/videoplayer-shared");var Fe=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new $.ValueSubject(!1);this.params=e}authorize(e){return M(this,null,function*(){return this.authToken=e!=null?e:yield this.refreshAuthToken(),this._authorizeWithBackoff()})}logBeacon(e){let t="log.externalLog",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e)}logRequest(e){return M(this,null,function*(){var u;let t="log.externalLog",i=this.createLogParams(e),o=(u=this.sessionKey)!=null?u:yield this._authorizeWithBackoff();if(!o)return;let a=(d,...s)=>M(this,[d,...s],function*(l,f=this.params.config.requestRetryCount){try{return yield this.params.apiTransport.sendRequest(t,i,o)}catch(c){if(!c||!("error_code"in c)){this.params.error$.next({id:"logRequestUnknown",category:$.ErrorCategory.NETWORK,message:`Unknown ${t} error`,thrown:c});return}let v=c==null?void 0:c.error_code;switch(v){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=yield this._authorizeWithBackoff(),f>0?a(l,f-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=yield this.refreshAuthToken(),this.sessionKey=yield this._authorizeWithBackoff(),f>0?a(l,f-1):void 0;default:{this.params.error$.next({id:`LogRequest#${v}`,category:$.ErrorCategory.EXTERNAL_API,message:`${t} error`,data:c});return}}}});return a(e)})}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}refreshAuthToken(){return M(this,null,function*(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Cr.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise})}createLogParams(e){return{collector:"ok.mobile.apps.video",data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${je}`,platform:this.params.mobile?"M_WEB":"WEB",items:this.params.config.shorten?e.map(il):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=(0,$.getExponentialDelay)(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Cr.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:$.ErrorCategory.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})),()=>this.backoffTimeoutId=0)},e))})}_authorize(){return M(this,null,function*(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.uuid,client_version:je.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,Cr.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:$.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=>M(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:$.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:$.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 Nr=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:i})}removeEventListener(e,t){if(!(e in this.listeners))return;let i=this.listeners[e];for(let o=0,a=i.length;o<a;o++)if(i[o].callback===t){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,a=i.length;o<a;o++){let u=i[o];try{u.callback.call(this,e)}catch(l){Promise.resolve().then(()=>{throw l})}u.options&&u.options.once&&this.removeEventListener(e.type,u.callback)}return!e.defaultPrevented}},ye=class extends Nr{constructor(){super(),this.listeners||Nr.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)}},Be=class{constructor(){Object.defineProperty(this,"signal",{value:new ye,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let i=e;if(i===void 0)if(typeof document=="undefined")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch(o){i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(Be.prototype[Symbol.toStringTag]="AbortController",ye.prototype[Symbol.toStringTag]="AbortSignal");function Lr(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function Di(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!Lr({fetch:e,Request:t,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(d,s){let c;s&&s.signal&&(c=s.signal,delete s.signal);let v=new t(d,s);return c&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:c}),v},a.prototype=t.prototype);let u=e;return{fetch:(f,d)=>{let s=a&&a.prototype.isPrototypeOf(f)?f.signal:d?d.signal:void 0;if(s){let c;try{c=new DOMException("Aborted","AbortError")}catch(p){c=new Error("Aborted"),c.name="AbortError"}if(s.aborted)return Promise.reject(c);let v=new Promise((p,m)=>{s.addEventListener("abort",()=>m(c),{once:!0})});return d&&d.signal&&delete d.signal,Promise.race([v,u(f,d)])}return u(f,d)},Request:a}}var Ue=Lr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),nl=Ue?Di({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,$i=Ue?nl.fetch:window.fetch,KI=Ue?nl.Request:window.Request,WI=Ue?Be:window.AbortController,HI=Ue?ye:window.AbortSignal;var G=require("@vkontakte/videoplayer-shared");var Ve=class{constructor(e){this.params=e,this.apiKey=e.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=ki[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}resolveApiBaseUrl(){return M(this,null,function*(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=yield(yield $i(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),a=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!a)throw new Error("Wrong DNS response");return a}catch(t){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:G.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),ki.vk_alias}finally{this.isApiBaseUrlFetched=!0}})}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this._prepareQueryParams({method:e,queryParams:t,sessionKey:i}),a=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,a)}catch(u){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:G.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:u,data:{method:e,params:t}})}return!1}sendRequest(e,t,i){return M(this,null,function*(){let o=(0,G.now)(),a=u=>{if(u instanceof TypeError&&["Failed to fetch","NetworkError when attempting to fetch resource."].includes(u.message)){this.params.error$.next({id:"Network",category:G.ErrorCategory.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:G.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:t,sessionKey:i,time:(0,G.now)()-o}})};return this.apiBaseUrl=yield this.resolveApiBaseUrl(),$i(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(u=>{var s,c;let l=Number(u.headers.get("content-length"))===0,f=new Date((s=u.headers.get("date"))!=null?s:"").getTime(),d=(0,G.now)()-o;if(isFinite(f)&&((c=this.timeSynchronisation)==null||c.addServerTime(f,d)),!l)return u.json().then(v=>Object.prototype.hasOwnProperty.call(v,"error_msg")?Promise.reject(v):v,a)},a)})}_prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),Object.entries(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var w=require("@vkontakte/videoplayer-shared");var kr="onestat_events",Mi=r=>e=>e.timestamp+r>=(0,w.now)(),Dr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return["action_play","watch_coverage_record","watch_coverage_live"].includes(t)};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,w.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=w.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,w.debounceFn)(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){var e;try{this.flush()}catch(t){this.error$.next({id:"LoggerError",category:w.ErrorCategory.WTF,message:(e=String(t))!=null?e:"Unknown logger error",thrown:t})}}readFromStorage(){let e=w.safeStorage.get(kr);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var a;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((a=t[this.userSalt])!=null?a:[]).filter(Mi(this.params.config.storageExpiration));w.safeStorage.set(kr,JSON.stringify(Ge(W({},t),{[this.userSalt]:[...o,e]})))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(Mi(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],w.safeStorage.set(kr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of Object.entries(e)){let o=i.filter(Mi(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}w.safeStorage.set(kr,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(e=!1){let t=this.getFromStorage();t.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${t.length} events through beacon`}),this.api.logBeacon(t)):(this.loggerDebugLog({message:`Flushing ${t.length} events`}),this.api.logRequest(t)),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 g=require("@vkontakte/videoplayer-core"),ji=require("@vkontakte/videoplayer-shared");var al=r=>r&&{[g.VideoQuality.INVARIANT]:"unknown",[g.VideoQuality.Q_144P]:"mobile",[g.VideoQuality.Q_240P]:"lowest",[g.VideoQuality.Q_360P]:"low",[g.VideoQuality.Q_480P]:"medium",[g.VideoQuality.Q_720P]:"high",[g.VideoQuality.Q_1080P]:"fullhd",[g.VideoQuality.Q_1440P]:"quadhd",[g.VideoQuality.Q_2160P]:"ultrahd",[g.VideoQuality.Q_4320P]:"unknown"}[r],Fi=r=>r&&{[g.HttpConnectionType.HTTP1]:"http1",[g.HttpConnectionType.HTTP2]:"http2",[g.HttpConnectionType.QUIC]:"http3"}[r],sl=r=>{if(r!==void 0)switch(r){case g.VideoFormat.MPEG:return"mp4";case g.VideoFormat.DASH_LIVE:return"dash";case g.VideoFormat.DASH_SEP:return"dash_sep";case g.VideoFormat.DASH_ONDEMAND:return"ondemand_dash";case g.VideoFormat.DASH_WEBM:case g.VideoFormat.DASH_LIVE_WEBM:return"webm";case g.VideoFormat.DASH_WEBM_AV1:return"av1";case g.VideoFormat.DASH_LIVE_CMAF:return"ondemand_dash_live";case g.VideoFormat.HLS:case g.VideoFormat.HLS_LIVE:return"hls";case g.VideoFormat.HLS_ONDEMAND:return"ondemand_hls";case g.VideoFormat.HLS_LIVE_CMAF:return"ondemand_hls_live";case g.VideoFormat.WEB_RTC_LIVE:return"webrtc";default:return(0,ji.assertNever)(r)}},$r=r=>{if(r!==void 0)switch(r){case g.Surface.NONE:case g.Surface.INLINE:return;case g.Surface.FULLSCREEN:return"fullscreen";case g.Surface.SECOND_SCREEN:return"chromecast";case g.Surface.PIP:return"pip";case g.Surface.INVISIBLE:return"invisible";default:return(0,ji.assertNever)(r)}},ul=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var Mr=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 t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/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 cl=()=>Math.floor(Math.random()*4294967296).toString(36).padStart(7,"0"),ll=()=>Math.floor(Math.random()*18446744073709552e3).toString(36).padStart(13,"0");var Bi=require("@vkontakte/videoplayer-core"),b=require("@vkontakte/videoplayer-shared"),fl=(r,e)=>new b.Observable(t=>{let i=new b.Subscription,o=(0,b.merge)((0,b.fromEvent)(window,"beforeunload"),r.events.willDestruct$),a=new b.ValueSubject(void 0),u;i.add(r.info.isLive$.pipe((0,b.filterChanged)()).subscribe(K=>{u&&(u.unsubscribe(),a.next(void 0)),K?u=r.info.liveTime$.pipe((0,b.map)(Br=>Br&&Br/1e3)).subscribe(a):u=r.info.position$.subscribe(a),i.add(u)}));let{playing$:l,paused$:f}=r.events,d=r.events.willSeek$.pipe((0,b.filter)(()=>r.info.playbackState$.getValue()===Bi.PlaybackState.PLAYING)),s=r.events.seeked$.pipe((0,b.filter)(()=>r.info.playbackState$.getValue()===Bi.PlaybackState.PLAYING)),c=!1,v=new b.Subject;i.add(d.subscribe(()=>{c||v.next(),c=!0})),i.add(s.subscribe(()=>c=!1));let p=new b.Subject,m=new b.Subject,y=(0,b.merge)(l,s,p),E=(0,b.merge)(f,v,o,r.events.looped$,m),S,q=()=>S=a.getValue(),pl=()=>{let K=a.getValue();(0,b.isNullable)(S)||S===K||(0,b.isNullable)(K)||(t.next({from:S,to:K}),S=void 0)},vl=()=>{m.next(),p.next()};if(i.add(y.subscribe(q)),i.add(E.subscribe(pl)),e.forceInterval&&isFinite(e.forceInterval)){let K=0;i.add(y.subscribe(()=>K=window.setTimeout(vl,e.forceInterval))),i.add(E.subscribe(()=>window.clearTimeout(K)))}return i});var bb="_one-stat_",Ui=`${bb}uuid`,Vi=()=>{let r=new h.Subscription;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},jr=class{constructor(e,t){this.subscription=new h.Subscription;this.debugLogger=new Fr.Logger;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new h.ValueSubject(void 0);this.isid$=new h.ValueSubject(void 0);this.seekAction$=new h.ValueSubject("unknown");var f,d,s;this.statContext=e,this.config=aa((f=t.config)!=null?f:{}),(0,h.isNonNullable)(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new Mr);let i=new h.Subject;this.experimental={error$:i};let o=h.safeStorage.get(Ui);o?o.startsWith('"')&&o.endsWith('"')?(this.uuid=(0,dl.default)(o,'"',""),h.safeStorage.set(Ui,this.uuid)):this.uuid=o:(this.uuid=qt(),h.safeStorage.set(Ui,this.uuid)),this.resetViewSession(),t.useIsid&&this.isid$.next((d=t.isid)!=null?d:ll());let a=new Ve({apiKey:ol,config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new Fe({config:this.config,apiTransport:a,refreshAuthToken:t.refreshAuthToken,mobile:(s=this.statContext.mobile)!=null?s:!1,uuid:this.uuid,error$:i}),this.logger=new Dr({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:u,host:l}=(0,Fr.detectEmbed)();this.isEmbed=u,this.embedParent=l,this.subscribe()}updateContext(e){this.statContext=W(W({},this.statContext),e)}attachTo(e){let t=new h.Subscription,i=(s,c)=>t.add(s.subscribe(c));i(e.events.willStart$,()=>{let s=e.info.position$.getValue();this.logActionPlay({position:s}),this.statContext.projectId&&this.logActionPlayInteractive({position:s})}),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(fl(e,{forceInterval:this.config.watchCoverageInterval}),s=>{let c=e.info.isLive$.getValue(),v={start:parseFloat(s.from.toFixed(3)),end:parseFloat(s.to.toFixed(3))};c?this.logWatchCoverageLive(v):this.logWatchCoverageRecord(v)});let o;i(e.info.isStalled$,s=>{s?o=(0,h.now)():((0,h.isNonNullable)(o)&&this.logEmptyBuffer({duration:(0,h.now)()-o}),o=void 0)});let a=!1;t.add(e.events.fatalError$.pipe((0,h.once)()).subscribe(()=>a=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let c=(0,h.isNonNullable)(o)?(0,h.now)()-o:void 0;this.logCloseAtEmptyBuffer({duration:c!=null?c:0}),o=void 0}else a||this.logActionStop()}),i(e.events.managedError$,({id:s})=>{this.logError({fatal:!1,errorType:s})}),i(e.events.fatalError$,({id:s})=>{this.logError({fatal:!0,errorType:s})});let u,l,f=!1;i(e.events.firstBytes$,s=>{u=(0,h.now)(),this.logFirstBytes({time:s})}),i(e.events.willStart$,()=>l=(0,h.now)()),i(e.info.currentBuffer$,s=>{!f&&s&&s.end-s.start>0&&(0,h.isNonNullable)(u)&&(this.logPlayerReady({duration:(0,h.now)()-u}),f=!0)}),i(e.events.firstFrame$,()=>{(0,h.isNonNullable)(u)&&!f&&(this.logPlayerReady({duration:(0,h.now)()-u}),f=!0),(0,h.isNonNullable)(l)&&this.logFirstFrame({time:(0,h.now)()-l})}),i(e.info.atLiveEdge$,s=>this.updateContext({liveEdge:s})),i((0,h.combine)({muted:e.info.muted$,volume:e.info.volume$}),({muted:s,volume:c})=>this.updateContext({audible:!s&&c>0})),i(e.info.currentQuality$,s=>this.updateContext({quality:al(s)})),i(e.info.isAutoQualityEnabled$,s=>this.updateContext({autoQuality:s})),i(e.info.currentFormat$,s=>this.updateContext({contentType:sl(s)})),i(e.info.currentPlaybackRate$,s=>this.updateContext({rate:s})),i(e.info.is3DVideo$,s=>this.updateContext({is3d:s}));let d;return i(e.info.hostname$,s=>{let c=d!==void 0&&d!==s;this.updateContext({cdnHostname:s,failover:c}),c&&this.logFailover(s),d=s}),i(e.info.throughputEstimation$,s=>this.updateContext({downloadSpeed:s})),i(e.info.httpConnectionType$,s=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:Fi(s)}),this.updateContext({connectionType:Fi(s)})}),i(e.info.httpConnectionReused$,s=>{(0,h.isNullable)(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:s}),this.updateContext({connectionReused:s})}),i(e.info.surface$,s=>this.updateContext({mode:$r(s)})),i((0,h.combine)({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:s,available:c})=>{let v=c.find(({id:m})=>m===s),p=v&&(v.isAuto?`${v.language}_auto`:v.language);this.updateContext({subtitles:p})}),this.player=e,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){this.uiEvents=e;let{subscription:t,subscribe:i}=Vi();return this.player&&(i(e.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),i(e.actionSeek$,this.seekAction$),i(e.inPiP$,o=>{var u;let a=o?"pip":$r((u=this.player)==null?void 0:u.info.surface$.getValue());this.updateContext({mode:a})}),i(e.inFullscreen$,o=>{var u;let a=o?"fullscreen":$r((u=this.player)==null?void 0:u.info.surface$.getValue());this.updateContext({mode:a})}),i(e.actionSetSubtitle$,o=>this.updateContext({subtitles:o})),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t)),t}attachToAds(e){let{subscription:t,subscribe:i}=Vi();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()),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToInteractive(e){let{subscription:t,subscribe:i}=Vi();return i(e.click$,o=>this.logInterfaceClick(o)),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t),t}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"}),this.vsid$.next(cl())}getDeviceId(){return this.uuid}setFieldBlacklist(){}logInited(){}logReady(e){this.log({operation:"player_ready",param:String(e.time)})}logStarted(...e){this.logActionPlay(...e)}logPlay(){this.log({operation:"play_toggle"})}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}`})}logWatchCoverageLive(e){var a,u;let t=(u=(a=this.timeSynchronisation)==null?void 0:a.getOffset())!=null?u:0,i=e.start+t,o=e.end+t;this.log({operation:"watch_coverage_live",param:`${i}-${o}`})}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,h.merge)((0,h.fromEvent)(e,"change"),(0,h.observableFrom)(["init"])).subscribe(()=>this.updateContext({network:ul(e.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(t=>{console.debug("%c stat ","background:#fa6470;",`component: ${t.component}.`,t.message)})}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=(0,h.fromEvent)(window,"beforeunload").subscribe(()=>this.logger.flush(!0)),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(e){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(Math.round(e.position))},{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"})}log(e,t={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${e.operation} but statistics is disabled`});return}if(this.config.disabledOperations.includes(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,t);this.logger.log(i)}createLogItem({operation:e,param:t,time:i},o={}){var p,m;let a=(m=(p=this.timeSynchronisation)==null?void 0:p.now())!=null?m:(0,h.now)(),u=this.vsid$.getValue();(0,h.assertNonNullable)(u);let l=this.isid$.getValue(),f=e==="empty_buffer"||e==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,d=this.statContext.firstConnectionReused,s,c;if(this.isEmbed){s=this.embedParent;let y=[...new URLSearchParams(location.search).entries()].filter(([E,S])=>this.config.embedUrlParams.includes(E));c=new URLSearchParams(y).toString()}else this.statContext.place==="direct"&&((this.statContext.refDomain||document.referrer)&&(s=new URL(this.statContext.refDomain||document.referrer).hostname),c=location.href.substring(0,1024));let v=W({vsid:u,isid:l,vid:this.statContext.movieId,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:t,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:f,connection_reused:d===!0?1:d===!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:s,direct_url:c,rate:this.statContext.rate===1||(0,h.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 y of this.config.disabledCustomFields)delete v[y];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:a,custom:v}}};
|