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