@vkontakte/videoplayer-shared 1.0.98-dev.b7ed8d2a3.0 → 1.0.99-dev.0bc518265.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es2015.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.98-dev.b7ed8d2a3.0
3
- * Fri, 31 Jul 2026 12:23:58 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-98/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.99-dev.0bc518265.0
3
+ * Fri, 14 Aug 2026 11:38:56 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-99/doc/
5
5
  */
6
- function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,g=Object.getOwnPropertyNames,ee=Object.getOwnPropertyDescriptor,te=Object.prototype.hasOwnProperty;function _(e){return this[e]}var v=e=>{var t=(y??=new WeakMap).get(e),n;if(t)return t;if(t=h({},`__esModule`,{value:!0}),e&&typeof e==`object`||typeof e==`function`)for(var r of g(e))te.call(t,r)||h(t,r,{get:_.bind(e,r),enumerable:!(n=ee(e,r))||n.enumerable});return y.set(e,t),t},y,ne=e=>e;function re(e,t){this[e]=ne.bind(null,t)}var b=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:re.bind(t,n)})},x={};b(x,{withoutNullable:()=>de,videoSizeToQuality:()=>Ne,videoQualityToHeight:()=>Pe,videoHeightToQuality:()=>Me,urlCanParsePolyfilled:()=>ar,timeout:()=>Ke,timeCodeToString:()=>ze,throttleFn:()=>Ve,throttle:()=>it,tap:()=>vt,suppressAbort:()=>Nt,stringTrimStart:()=>qn,stringTrimRight:()=>Xn,stringTrimLeft:()=>Yn,stringTrimEnd:()=>Jn,stringReplaceAll:()=>Kn,stringPadStart:()=>Gn,stringPadEnd:()=>Wn,stringMatchAll:()=>Un,stringAt:()=>Hn,skip:()=>bt,shareReplay:()=>St,safeStorage:()=>be,requestIdleCallbackPolyfilled:()=>nr,promiseWithResolvers:()=>kn,promiseTry:()=>On,promiseFinally:()=>Dn,promiseAny:()=>En,promiseAllSettled:()=>Tn,pairwise:()=>gt,once:()=>ht,observeElementSize:()=>wt,observableFrom:()=>Ye,objectValues:()=>wn,objectHasOwn:()=>Cn,objectFromEntries:()=>xn,objectEntries:()=>bn,nowInt:()=>_e,now:()=>ge,noop:()=>w,merge:()=>Ge,mapTo:()=>mt,map:()=>V,loadVKLangPack:()=>Kt,isValidURL:()=>Et,isNullable:()=>O,isNonNullable:()=>D,isLowerOrEqual:()=>ke,isLower:()=>L,isInvariantQuality:()=>R,isIntersecting:()=>Dt,isHigherOrEqual:()=>Oe,isHigher:()=>De,isBrowserWindow:()=>me,isAbortError:()=>Mt,interval:()=>qe,interpolate:()=>At,includesPolyfilled:()=>ir,globalThisPolyfill:()=>yn,getWindow:()=>k,getVideoQualityLabel:()=>Le,getTraceSubscriptionMethod:()=>Ft,getRangeAroundIndex:()=>jt,getPlayerId:()=>kt,getMessageFromError:()=>Pt,getHighestQuality:()=>Ae,getExponentialDelay:()=>ye,fromEvent:()=>Xe,flattenObject:()=>H,filterChanged:()=>ut,filter:()=>ot,fillWithDefault:()=>Re,fetchPolyfilled:()=>Rn,devNull:()=>Zt,detectEmbed:()=>P,debounceFn:()=>Be,debounce:()=>tt,createDIContainer:()=>cn,combine:()=>We,cloneDeepWith:()=>z,cloneDeep:()=>He,clearVideoElement:()=>Tt,checkNever:()=>ae,cancelIdleCallbackPolyfilled:()=>rr,buffer:()=>Qe,atPolyfilled:()=>Zn,assertQualityIsExact:()=>Ie,assertNullable:()=>ue,assertNotEmptyArray:()=>fe,assertNonNullable:()=>le,assertNever:()=>C,assertEmptyArray:()=>pe,arrayWith:()=>vn,arrayToSpliced:()=>_n,arrayToSorted:()=>gn,arrayToReversed:()=>hn,arrayIncludes:()=>mn,arrayFlatMap:()=>pn,arrayFlat:()=>fn,arrayFindLastIndex:()=>dn,arrayFindLast:()=>un,arrayAt:()=>ln,areQualitiesExact:()=>Fe,addScript:()=>he,abortable:()=>ve,VideoQuality:()=>F,ValueSubject:()=>B,VKNumericLanguage:()=>Wt,VERSION:()=>ie,TracerFactory:()=>Ht,SubscriptionRemovable:()=>Ze,Subscription:()=>S,Subject:()=>E,RequestPolyfilled:()=>zn,ReplaySubject:()=>Ue,Observable:()=>T,Logger:()=>ce,InternalsExposure:()=>Xt,InterfaceLanguage:()=>Yt,InjectionToken:()=>sn,INTERNAL_EXPOSE_GLOBAL_KEY:()=>q,ErrorCategory:()=>Ut,CircularBuffer:()=>U,AppTracer:()=>Y,AbortSignalPolyfilled:()=>Vn,AbortControllerPolyfilled:()=>Bn}),module.exports=v(x);var ie=`1.0.98-dev.b7ed8d2a3.0`;class S{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var C=e=>{throw Error(`${e} is value of unexpected type`)},ae=e=>{},w=()=>{},oe=e=>{throw console.error(e),e},se=e=>{console.error(e)};class T{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?se:oe,r;r=t?typeof t==`function`?{next:t,error:w}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:w};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new S().add(()=>{switch(i.next=w,i.error=w,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return C(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class E extends T{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new S().add(()=>this.subscribers.delete(t))}}class ce{constructor(){this.log$=new E,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function le(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function ue(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function D(e){return e!=null}function O(e){return e==null}var de=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>D(t)));function fe(e,t){if(!e?.length)throw Error(t)}function pe(e,t){if(e?.length)throw Error(t)}var k=()=>globalThis,me=(e=k())=>!!(e.window&&e.screen),he=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=k().setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),ge=typeof k().performance?.now==`function`?()=>k().performance.now():()=>Date.now(),_e=()=>Math.trunc(ge()),ve=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),ye=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},be={};b(be,{set:()=>Ce,remove:()=>Te,isPersistent:()=>xe,has:()=>we,get:()=>Se,clear:()=>Ee});var A,j,M=`vk-videoplayer-dummy-key-${Math.random()}`,N=()=>{if(j!==void 0)return j;try{localStorage.setItem(M,`test`),localStorage.removeItem(M),j=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(M),j=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)j=2;else throw e}else throw e}return j===2&&(A=new Map),j},xe=()=>N()===0,Se=e=>{let t=N();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return A?.get(e);default:C(t)}},Ce=(e,t)=>{let n=N();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:A?.set(e,t);return;default:C(n)}},we=e=>{let t=N();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return A?.has(e)??!1;default:return C(t),!1}},Te=e=>{let t=N();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:A?.delete(e);return;default:C(t)}},Ee=()=>{let e=N();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return A?.clear();default:C(e)}},P=()=>{let e,t=[],n=k();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},F;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(F||={});var I={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},De=(e,t)=>I[e].height>I[t].height,Oe=(e,t)=>I[e].height>=I[t].height,L=(e,t)=>I[e].height<I[t].height,ke=(e,t)=>I[e].height<=I[t].height,Ae=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:L(e,t)?1:-1)[0],je=Object.keys(I).sort((e,t)=>L(e,t)?-1:1),Me=(e,t=.02)=>[...je].find(n=>I[n].height*(1+t)>=e),Ne=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return je.find(e=>{let t=I[e];return t.width>=r&&t.height>=n})},Pe=e=>I[e].height,R=e=>e===`Invariant quality`,Fe=e=>e.every(e=>!R(e));function Ie(e){if(R(e))throw Error(`Expected exact quality`)}var Le=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},Re=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=Re(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},ze=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function Be(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof k().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&k().cancelAnimationFrame(s),k().requestAnimationFrame(e)):setTimeout(e,t)}function g(e){if(p){k().cancelAnimationFrame(e);return}clearTimeout(e)}function ee(e){return l=e,s=h(v,t),u?m(e):o}function te(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function _(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function v(){let e=Date.now();if(_(e))return y(e);s=h(v,te(e))}function y(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function ne(){s!==void 0&&g(s),l=0,r=c=i=s=void 0}function re(){return s===void 0?o:y(Date.now())}function b(){return s!==void 0}function x(...e){let n=Date.now(),a=_(n);if(r=e,i=this,c=n,a){if(s===void 0)return ee(c);if(d)return s=h(v,t),m(c)}return s===void 0&&(s=h(v,t)),o}return x.cancel=ne,x.flush=re,x.pending=b,x}var Ve=(e,t=0,n)=>Be(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),z=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=z(e[r],t):n[r]=e[r]}return n},He=e=>z(e);class Ue extends E{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new S().add(()=>this.subscribers.delete(t))}}class B extends E{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function We(e){return new T(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new S)})}function Ge(...e){return new T(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new S))}var Ke=e=>new T(t=>{let n=k().setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>k().clearTimeout(n)}),qe=e=>new T(t=>{let n=k(),r=n.setInterval(()=>t.next(),e);return()=>{r&&=(n.clearInterval(r),void 0)}});function Je(e){return new T(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var Ye=Je,Xe=(e,t)=>new T(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class Ze extends S{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function Qe(e){return t=>new T(n=>t.subscribe(new $e(n,e)))}class $e{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var et={leading:!1,trailing:!0};function tt(e,t=et){return n=>new T(r=>n.subscribe(new nt(r,e,t)))}class nt{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e;let t=k();D(this.timeout)?t.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=t.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var rt={leading:!0,trailing:!1};function it(e,t=rt){return n=>new T(r=>n.subscribe(new at(r,e,t)))}class at{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,O(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=k().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function ot(e){return t=>new T(n=>t.subscribe(new st(n,e)))}class st{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var ct=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},lt=(e,t)=>e instanceof Object&&t instanceof Object?ct(e,t):e===t;function ut(e=lt){return t=>new T(n=>t.subscribe(new ft(n,e)))}var dt={};class ft{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=dt,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===dt||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function V(e){return t=>new T(n=>t.subscribe(new pt(n,e)))}class pt{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function mt(e){return V(()=>e)}function ht(){return e=>new T(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function gt(){return e=>new T(t=>e.subscribe(new _t(t)))}class _t{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function vt(e){return t=>new T(n=>t.subscribe(new yt(n,e)))}class yt{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function bt(e){return t=>new T(n=>t.subscribe(new xt(n,e)))}class xt{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function St(e=0){return t=>{let n=0,r=new Ue(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new T(e=>(n++,a(r.subscribe(e))))}}var Ct=300,wt=(e,t=Ct)=>new T(n=>{let r=k(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!me(r))return;let o=new r.ResizeObserver(Ve(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),D(r)&&D(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),H=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=H(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},Tt=(e,t=!1)=>{t&&(e.innerHTML=``),e.removeAttribute(`src`),e.load()},Et=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},Dt=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),Ot=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),kt=e=>e!==void 0&&e!==``?e:Ot().toString();function At(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function jt(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var Mt=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Nt=e=>{if(!Mt(e))throw e};function Pt(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class U{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];D(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var Ft=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?H(r):{value:r},n)},W=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class G{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new S,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;D(i)&&i>0&&(this.eventsBuffer=new U(i)),G.dynamicImportStatus===`not_started`&&(G.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=G.dynamicImportPromise.then(r=>{G.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(O(i))return;let{opentelemetryApi:a}=G.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{D(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(G.dynamicImportStatus===`not_started`){G.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);G.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},G.dynamicImportStatus=`completed`}catch{G.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return O(this.span)||G.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){D(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},W(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new G({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes(W(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(D(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}G.dynamicImportStatus=`not_started`,G.dynamicImports=void 0,G.dynamicImportPromise=void 0;var It=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,Lt=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new U(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new U(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>k().setTimeout(e,0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class Rt extends G{constructor(e){super({name:`Root`,options:e}),this.attributes$=new B(null),this.paused$=new B(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=G.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d}=o,f=new(Lt(l))(new s({appToken:It}));this.subscription.add(this.paused$.subscribe(e=>{e?f.pause():f.resume()}));let p=new c({resource:u({[d]:`videoplayer-sdk-web`}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[f]});p.register();let m=p.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:m,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),W(e)))}addSubscription(e){this.subscription.add(e)}}class zt{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new zt({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var Bt=()=>!0,K={level:0,filter:Bt,name:`Noname Tracer`,outputMethod:`log`};class Vt{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=Bt,this.level=K.level,this.outputMethod=K.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??K.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new Vt({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||k().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&k().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class Ht{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new Rt(t);case`debug`:return new Vt;default:return new zt}}}var Ut;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(Ut||={});var Wt;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(Wt||={});var Gt=`vk.ru`,Kt=function(){var e=p(function*(e,t,n){let r=new URL(`https://${Gt}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),qt(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),qt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Jt(n)])),Jt=e=>Array.isArray(e)?e[0]:e,Yt;(e=>{e.RU=`ru`,e.EN=`en`})(Yt||={});var q=`__vk_vp_internals_exposure`;class Xt{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[q])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[q]||(window[q]={}),window[q][e]||(window[q][e]={}),window[q][e][t]||(window[q][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[q]&&window[q][e]&&window[q][e][t]&&(delete window[q][e][t],Object.keys(window[q][e]).length||delete window[q][e],Object.keys(window[q]).length||delete window[q])}}var Zt={};b(Zt,{subscribe:()=>tn,push:()=>en,destroy:()=>$t,create:()=>Qt});var J=new Map,Qt=(e,t)=>J.set(e,t??[]),$t=e=>J.delete(e),en=(e,t)=>{let n=J.get(e);n&&(typeof n==`function`?n(t):n.push(t))},tn=(e,t)=>{let n=J.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);J.set(e,t)}},nn=e=>de({id:e.id,message:e.message,category:e.category,data:rn(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function rn(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var an=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},on=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=k())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class Y{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new S,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=P();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=Y.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=an(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),nn(e)),on()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield Y.loadPromise,Y.tracerErrorMap.has(e.componentName)||O(Y.appTracerModule))return;let{appTracerModule:t}=Y,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});D(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:It,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),Y.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;D(Y.loadPromise)||(Y.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>k().setTimeout(n,e.dynamicImportTimeout));Y.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){Y.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}Y.tracerErrorMap=new Map,Y.appTracerModule=null,Y.loadPromise=null;class sn{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var cn=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}},ln=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},un=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},dn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},fn=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},pn=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},mn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},hn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},gn=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},_n=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},vn=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},yn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),bn=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},xn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},Sn=Object.prototype.hasOwnProperty,Cn=(e,t)=>Sn.call(e,t),wn=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},Tn=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},En=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},Dn=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),On=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},kn=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:An,NativeAbortController:jn}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function Mn(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function Nn(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class Pn{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class X extends Pn{constructor(){super(),this.listeners||Pn.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return`[object AbortSignal]`}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,typeof this.onabort==`function`&&this.onabort.call(this,e)),super.dispatchEvent(e)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(e){let t=Nn(e),n=Mn(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,X.prototype[Symbol.toStringTag]=`AbortSignal`);function Fn(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 In(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!Fn({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&Fn({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),Ln=$?In({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,Rn=$?Ln.fetch:Q.fetch,zn=$?Ln.Request:Q.Request,Bn=$?Z:Q.AbortController,Vn=$?X:Q.AbortSignal,Hn=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*Un(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var Wn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},Gn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},Kn=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},qn=e=>e.replace(/^\s+/,``),Jn=e=>e.replace(/\s+$/,``),Yn=qn,Xn=Jn,Zn=(e,t)=>typeof e==`string`?Hn(e,t):ln(e,t),Qn=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},$n=e=>Q.clearTimeout(e),er=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),tr=!er(Q.requestIdleCallback)||!er(Q.cancelIdleCallback),nr=tr?Qn:Q.requestIdleCallback,rr=tr?$n:Q.cancelIdleCallback,ir=(e,t,n)=>typeof e==`string`?e.includes(t,n):mn(e,t,n),ar=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};
6
+ function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,ee=Object.getOwnPropertyNames,te=Object.getOwnPropertyDescriptor,g=Object.prototype.hasOwnProperty;function _(e){return this[e]}var v=e=>{var t=(y??=new WeakMap).get(e),n;if(t)return t;if(t=h({},`__esModule`,{value:!0}),e&&typeof e==`object`||typeof e==`function`)for(var r of ee(e))g.call(t,r)||h(t,r,{get:_.bind(e,r),enumerable:!(n=te(e,r))||n.enumerable});return y.set(e,t),t},y,ne=e=>e;function re(e,t){this[e]=ne.bind(null,t)}var b=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:re.bind(t,n)})},x={};b(x,{withoutNullable:()=>de,videoSizeToQuality:()=>Fe,videoQualityToHeight:()=>Ie,videoHeightToQuality:()=>Pe,urlCanParsePolyfilled:()=>pr,timeout:()=>Je,timeCodeToString:()=>Ve,throttleFn:()=>Ue,throttle:()=>ot,tap:()=>bt,suppressAbort:()=>Ft,stringTrimStart:()=>tr,stringTrimRight:()=>ir,stringTrimLeft:()=>rr,stringTrimEnd:()=>nr,stringReplaceAll:()=>er,stringPadStart:()=>$n,stringPadEnd:()=>Qn,stringMatchAll:()=>Zn,stringAt:()=>Xn,skip:()=>St,shareReplay:()=>wt,safeStorage:()=>be,requestIdleCallbackPolyfilled:()=>ur,promiseWithResolvers:()=>Ln,promiseTry:()=>In,promiseFinally:()=>Fn,promiseAny:()=>Pn,promiseAllSettled:()=>Nn,pairwise:()=>vt,once:()=>_t,observeElementSize:()=>Et,observableFrom:()=>Ze,objectValues:()=>Mn,objectHasOwn:()=>jn,objectFromEntries:()=>kn,objectEntries:()=>On,nowInt:()=>_e,now:()=>ge,noop:()=>w,merge:()=>qe,mapTo:()=>gt,map:()=>mt,loadVKLangPack:()=>qt,isValidURL:()=>Ot,isNullable:()=>O,isNonNullable:()=>D,isLowerOrEqual:()=>je,isLower:()=>F,isInvariantQuality:()=>I,isIntersecting:()=>kt,isHigherOrEqual:()=>Ae,isHigher:()=>ke,isBrowserWindow:()=>me,isAbortError:()=>Pt,interval:()=>Ye,interpolate:()=>Mt,includesPolyfilled:()=>fr,globalThisPolyfill:()=>Dn,getWindow:()=>k,getVideoQualityLabel:()=>ze,getTraceSubscriptionMethod:()=>Lt,getRangeAroundIndex:()=>Nt,getPlayerId:()=>jt,getMessageFromError:()=>It,getHighestQuality:()=>Me,getExponentialDelay:()=>ye,fromEvent:()=>Qe,flattenObject:()=>B,filterChanged:()=>ft,filter:()=>ct,fillWithDefault:()=>Be,fetchPolyfilled:()=>Kn,devNull:()=>Qt,detectEmbed:()=>De,debounceFn:()=>He,debounce:()=>rt,createDIContainer:()=>ln,combine:()=>Ke,cloneDeepWith:()=>L,cloneDeep:()=>We,clearVideoElement:()=>Dt,checkNever:()=>ae,cancelIdleCallbackPolyfilled:()=>dr,buffer:()=>et,atPolyfilled:()=>ar,assertQualityIsExact:()=>Re,assertNullable:()=>ue,assertNotEmptyArray:()=>fe,assertNonNullable:()=>le,assertNever:()=>C,assertEmptyArray:()=>pe,arrayWith:()=>En,arrayToSpliced:()=>Tn,arrayToSorted:()=>wn,arrayToReversed:()=>Cn,arrayIncludes:()=>Sn,arrayFlatMap:()=>xn,arrayFlat:()=>bn,arrayFindLastIndex:()=>yn,arrayFindLast:()=>vn,arrayAt:()=>_n,areQualitiesExact:()=>Le,addScript:()=>he,abortable:()=>ve,VolumeFaderPlugin:()=>pn,VideoQuality:()=>Oe,ValueSubject:()=>R,VKNumericLanguage:()=>Gt,VERSION:()=>ie,TracerFactory:()=>Ut,SubscriptionRemovable:()=>$e,Subscription:()=>S,Subject:()=>E,RequestPolyfilled:()=>qn,ReplaySubject:()=>Ge,Observable:()=>T,NormalizerPlugin:()=>gn,Logger:()=>ce,InternalsExposure:()=>Zt,InterfaceLanguage:()=>Xt,InjectionToken:()=>cn,INTERNAL_EXPOSE_GLOBAL_KEY:()=>K,ErrorCategory:()=>Wt,EqualizerPlugin:()=>Y,CircularBuffer:()=>V,AudioGraph:()=>fn,AppTracer:()=>J,AbortSignalPolyfilled:()=>Yn,AbortControllerPolyfilled:()=>Jn}),module.exports=v(x);var ie=`1.0.99-dev.0bc518265.0`;class S{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var C=e=>{throw Error(`${e} is value of unexpected type`)},ae=e=>{},w=()=>{},oe=e=>{throw console.error(e),e},se=e=>{console.error(e)};class T{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?se:oe,r;r=t?typeof t==`function`?{next:t,error:w}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:w};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new S().add(()=>{switch(i.next=w,i.error=w,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return C(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class E extends T{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new S().add(()=>this.subscribers.delete(t))}}class ce{constructor(){this.log$=new E,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function le(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function ue(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function D(e){return e!=null}function O(e){return e==null}var de=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>D(t)));function fe(e,t){if(!e?.length)throw Error(t)}function pe(e,t){if(e?.length)throw Error(t)}var k=()=>globalThis,me=(e=k())=>!!(e.window&&e.screen),he=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=k().setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),ge=typeof k().performance?.now==`function`?()=>k().performance.now():()=>Date.now(),_e=()=>Math.trunc(ge()),ve=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),ye=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},be={};b(be,{set:()=>Ce,remove:()=>Te,isPersistent:()=>xe,has:()=>we,get:()=>Se,clear:()=>Ee});var A,j,M=`vk-videoplayer-dummy-key-${Math.random()}`,N=()=>{if(j!==void 0)return j;try{localStorage.setItem(M,`test`),localStorage.removeItem(M),j=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(M),j=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)j=2;else throw e}else throw e}return j===2&&(A=new Map),j},xe=()=>N()===0,Se=e=>{let t=N();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return A?.get(e);default:C(t)}},Ce=(e,t)=>{let n=N();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:A?.set(e,t);return;default:C(n)}},we=e=>{let t=N();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return A?.has(e)??!1;default:return C(t),!1}},Te=e=>{let t=N();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:A?.delete(e);return;default:C(t)}},Ee=()=>{let e=N();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return A?.clear();default:C(e)}},De=()=>{let e,t=[],n=k();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},Oe;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(Oe||={});var P={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},ke=(e,t)=>P[e].height>P[t].height,Ae=(e,t)=>P[e].height>=P[t].height,F=(e,t)=>P[e].height<P[t].height,je=(e,t)=>P[e].height<=P[t].height,Me=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:F(e,t)?1:-1)[0],Ne=Object.keys(P).sort((e,t)=>F(e,t)?-1:1),Pe=(e,t=.02)=>[...Ne].find(n=>P[n].height*(1+t)>=e),Fe=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return Ne.find(e=>{let t=P[e];return t.width>=r&&t.height>=n})},Ie=e=>P[e].height,I=e=>e===`Invariant quality`,Le=e=>e.every(e=>!I(e));function Re(e){if(I(e))throw Error(`Expected exact quality`)}var ze=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},Be=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=Be(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},Ve=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function He(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof k().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&k().cancelAnimationFrame(s),k().requestAnimationFrame(e)):setTimeout(e,t)}function ee(e){if(p){k().cancelAnimationFrame(e);return}clearTimeout(e)}function te(e){return l=e,s=h(v,t),u?m(e):o}function g(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function _(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function v(){let e=Date.now();if(_(e))return y(e);s=h(v,g(e))}function y(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function ne(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function re(){return s===void 0?o:y(Date.now())}function b(){return s!==void 0}function x(...e){let n=Date.now(),a=_(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(v,t),m(c)}return s===void 0&&(s=h(v,t)),o}return x.cancel=ne,x.flush=re,x.pending=b,x}var Ue=(e,t=0,n)=>He(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),L=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=L(e[r],t):n[r]=e[r]}return n},We=e=>L(e);class Ge extends E{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new S().add(()=>this.subscribers.delete(t))}}class R extends E{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function Ke(e){return new T(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new S)})}function qe(...e){return new T(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new S))}var Je=e=>new T(t=>{let n=k().setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>k().clearTimeout(n)}),Ye=e=>new T(t=>{let n=k(),r=n.setInterval(()=>t.next(),e);return()=>{r&&=(n.clearInterval(r),void 0)}});function Xe(e){return new T(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var Ze=Xe,Qe=(e,t)=>new T(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class $e extends S{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function et(e){return t=>new T(n=>t.subscribe(new tt(n,e)))}class tt{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var nt={leading:!1,trailing:!0};function rt(e,t=nt){return n=>new T(r=>n.subscribe(new it(r,e,t)))}class it{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e;let t=k();D(this.timeout)?t.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=t.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var at={leading:!0,trailing:!1};function ot(e,t=at){return n=>new T(r=>n.subscribe(new st(r,e,t)))}class st{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,O(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=k().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function ct(e){return t=>new T(n=>t.subscribe(new lt(n,e)))}class lt{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var ut=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},dt=(e,t)=>e instanceof Object&&t instanceof Object?ut(e,t):e===t;function ft(e=dt){return t=>new T(n=>t.subscribe(new pt(n,e)))}var z={};class pt{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=z,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===z||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function mt(e){return t=>new T(n=>t.subscribe(new ht(n,e)))}class ht{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function gt(e){return mt(()=>e)}function _t(){return e=>new T(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function vt(){return e=>new T(t=>e.subscribe(new yt(t)))}class yt{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function bt(e){return t=>new T(n=>t.subscribe(new xt(n,e)))}class xt{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function St(e){return t=>new T(n=>t.subscribe(new Ct(n,e)))}class Ct{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function wt(e=0){return t=>{let n=0,r=new Ge(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new T(e=>(n++,a(r.subscribe(e))))}}var Tt=300,Et=(e,t=Tt)=>new T(n=>{let r=k(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!me(r))return;let o=new r.ResizeObserver(Ue(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),D(r)&&D(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),B=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=B(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},Dt=(e,t=!1)=>{t&&(e.innerHTML=``),e.removeAttribute(`src`),e.load()},Ot=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},kt=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),At=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),jt=e=>e!==void 0&&e!==``?e:At().toString();function Mt(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function Nt(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var Pt=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Ft=e=>{if(!Pt(e))throw e};function It(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class V{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];D(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var Lt=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?B(r):{value:r},n)},H=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class U{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new S,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;D(i)&&i>0&&(this.eventsBuffer=new V(i)),U.dynamicImportStatus===`not_started`&&(U.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=U.dynamicImportPromise.then(r=>{U.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(O(i))return;let{opentelemetryApi:a}=U.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{D(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(U.dynamicImportStatus===`not_started`){U.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);U.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},U.dynamicImportStatus=`completed`}catch{U.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return O(this.span)||U.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){D(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},H(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new U({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes(H(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(D(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}U.dynamicImportStatus=`not_started`,U.dynamicImports=void 0,U.dynamicImportPromise=void 0;var Rt=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,zt=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new V(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new V(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>k().setTimeout(e,0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class Bt extends U{constructor(e){super({name:`Root`,options:e}),this.attributes$=new R(null),this.paused$=new R(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=U.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d,ATTR_SERVICE_VERSION:f}=o,p=new(zt(l))(new s({appToken:Rt}));this.subscription.add(this.paused$.subscribe(e=>{e?p.pause():p.resume()}));let m=new c({resource:u({[d]:`videoplayer-sdk-web`,[f]:ie}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[p]});m.register();let h=m.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:h,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),H(e)))}addSubscription(e){this.subscription.add(e)}}class W{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new W({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var Vt=()=>!0,G={level:0,filter:Vt,name:`Noname Tracer`,outputMethod:`log`};class Ht{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=Vt,this.level=G.level,this.outputMethod=G.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??G.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new Ht({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||k().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&k().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class Ut{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new Bt(t);case`debug`:return new Ht;default:return new W}}}var Wt;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(Wt||={});var Gt;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(Gt||={});var Kt=`vk.ru`,qt=function(){var e=p(function*(e,t,n){let r=new URL(`https://${Kt}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),Jt(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),Jt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Yt(n)])),Yt=e=>Array.isArray(e)?e[0]:e,Xt;(e=>{e.RU=`ru`,e.EN=`en`})(Xt||={});var K=`__vk_vp_internals_exposure`;class Zt{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[K])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]||(window[K]={}),window[K][e]||(window[K][e]={}),window[K][e][t]||(window[K][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]&&window[K][e]&&window[K][e][t]&&(delete window[K][e][t],Object.keys(window[K][e]).length||delete window[K][e],Object.keys(window[K]).length||delete window[K])}}var Qt={};b(Qt,{subscribe:()=>nn,push:()=>tn,destroy:()=>en,create:()=>$t});var q=new Map,$t=(e,t)=>q.set(e,t??[]),en=e=>q.delete(e),tn=(e,t)=>{let n=q.get(e);n&&(typeof n==`function`?n(t):n.push(t))},nn=(e,t)=>{let n=q.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);q.set(e,t)}},rn=e=>de({id:e.id,message:e.message,category:e.category,data:an(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function an(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var on=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},sn=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=k())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class J{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new S,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=De();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=J.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=on(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),rn(e)),sn()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield J.loadPromise,J.tracerErrorMap.has(e.componentName)||O(J.appTracerModule))return;let{appTracerModule:t}=J,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});D(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:Rt,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),J.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;D(J.loadPromise)||(J.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>k().setTimeout(n,e.dynamicImportTimeout));J.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){J.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}J.tracerErrorMap=new Map,J.appTracerModule=null,J.loadPromise=null;class cn{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var ln=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}};class un{constructor(e){this._inputNode=void 0,this._outputNode=void 0,this._plugins=[],this._destination=null,this._taps=[],this._inputNode=e.createGain(),this._outputNode=e.createGain()}get input(){return this._inputNode}get plugins(){return this._plugins}connectTo(e){this._destination=e,this.rebuild()}addTap(e){this._taps.push(e),this._outputNode.connect(e)}hasPlugin(e){return this._plugins.some(t=>t.id===e)}addPlugin(e){this.hasPlugin(e.id)||(this._plugins.push(e),this.rebuild())}removePlugin(e){let t=this._plugins.findIndex(t=>t.id===e);t!==-1&&(this._plugins.splice(t,1),this.rebuild())}rebuild(){this._inputNode.disconnect();for(let e of this._plugins)e.outputNode.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._plugins)e.connect(t.inputNode),e=t.outputNode;e.connect(this._outputNode),this._destination!==null&&this._outputNode.connect(this._destination);for(let e of this._taps)this._outputNode.connect(e)}}class dn{constructor(e,t,n){this._pluginChain=void 0,this._element=void 0,this._ctx=void 0,this._sourceNode=null,this._isBound=!1,this._element=e,this._ctx=t,this._pluginChain=new un(t),this._pluginChain.connectTo(n)}get isBound(){return this._isBound}get plugins(){return this._pluginChain.plugins}bind(){this._isBound||=(this._sourceNode===null&&(this._sourceNode=this._ctx.createMediaElementSource(this._element)),this._sourceNode.disconnect(),this._sourceNode.connect(this._pluginChain.input),!0)}unbind(){this._isBound&&=(this._sourceNode?.disconnect(),this._sourceNode?.connect(this._ctx.destination),!1)}addPlugin(e){this._pluginChain.addPlugin(e)}removePlugin(e){this._pluginChain.removePlugin(e)}addAnalyser(e){this._pluginChain.addTap(e)}}class fn{constructor(){this._ctx=null,this._masterGain=null,this._connections=new Map,this._contextEnabled=!1,this._boundBeforeDisable=new Set}static isSupported(){let e=k();return D(e.AudioContext??e.webkitAudioContext)}get context(){if(O(this._ctx)){let e=k(),t=e.AudioContext??e.webkitAudioContext;this._ctx=new t}return this._ctx}get contextState(){return this._contextEnabled?this._ctx?.state??`suspended`:`suspended`}enableContext(){var e=this;return p(function*(){e.ensureContext(),yield e._ctx?.resume(),e._contextEnabled=!0;for(let t of e._boundBeforeDisable)e._connections.get(t)?.bind();e._boundBeforeDisable.clear()})()}disableContext(){var e=this;return p(function*(){e._contextEnabled=!1;for(let[t,n]of e._connections)n.isBound&&(e._boundBeforeDisable.add(t),n.unbind())})()}connectSource(e){var t=this;return p(function*(){t.ensureContext(),t._contextEnabled=!0,yield t._ctx?.resume();let n=t._connections.get(e);if(n!==void 0){n.isBound||n.bind();return}let r=new dn(e,t.context,t._masterGain);r.bind(),t._connections.set(e,r)})()}disconnectSource(e){this._connections.get(e)?.unbind()}isSourceConnected(e){return this._connections.get(e)?.isBound??!1}addPlugin(e,t){let n=this._connections.get(e);if(n===void 0)throw Error(`Source is not connected. Call connectSource() first.`);n.addPlugin(t)}removePlugin(e,t){this._connections.get(e)?.removePlugin(t)}getPlugins(e){return this._connections.get(e)?.plugins??[]}createAnalyser(e){let t=this._connections.get(e);if(t===void 0)return null;let n=this.context.createAnalyser();return n.fftSize=256,n.smoothingTimeConstant=.8,t.addAnalyser(n),n}setMasterVolume(e){this._masterGain!==null&&(this._masterGain.gain.value=e)}getMasterVolume(){return this._masterGain?.gain.value??1}dispose(){this._connections.clear(),this._boundBeforeDisable.clear(),this._masterGain=null,this._contextEnabled=!1,this._ctx?.close(),this._ctx=null}ensureContext(){let e=this.context;O(this._masterGain)&&(this._masterGain=e.createGain(),this._masterGain.gain.value=1,this._masterGain.connect(e.destination))}}class pn{constructor(e,t){this.id=`volume-fader`,this._gainNode=void 0,this._duration=void 0,this._curve=void 0,this._fade=null,this._gainNode=e.createGain(),this._gainNode.gain.value=1,this._duration=t.duration,this._curve=t.curve??this._buildEasingCurve(t.duration/1e3)}get inputNode(){return this._gainNode}get outputNode(){return this._gainNode}get faded(){return this._fade!==null}appear(){this._startFade(0,1)}disappear(){this._startFade(1,0)}pause(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime,n=t-this._fade.startTime,r=Math.max(0,this._fade.remaining-n);if(r<=.001){this._finishFade();return}let i=this._sampleIndex(this._fade,t),a=this._fade.curve[i];e.cancelScheduledValues(t),e.setValueAtTime(a,t),this._fade={from:a,target:this._fade.target,startTime:t,remaining:r,curve:this._fade.curve.subarray(i)}}resume(){if(this._fade===null)return;let e=this._gainNode.context.currentTime,{from:t,target:n,remaining:r,curve:i}=this._fade;if(r<=.001||Math.abs(n-t)<.001||i.length<2){this._finishFade();return}this._fade={from:t,target:n,startTime:e,remaining:r,curve:i},this._scheduleCurve(i,t,e,r)}cancel(){this._fade!==null&&this._finishFade()}_finishFade(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime;e.cancelScheduledValues(t),e.setValueAtTime(this._fade.target,t),this._fade=null}_startFade(e,t){let n=this._gainNode.gain,r=this._gainNode.context.currentTime,i=this._duration/1e3;if(i<=0){n.cancelScheduledValues(r),n.setValueAtTime(t,r),this._fade=null;return}let a=new Float32Array(this._curve.length);for(let n=0;n<this._curve.length;n++)a[n]=e+(t-e)*this._curve[n];this._fade={from:a[0],target:t,startTime:r,remaining:i,curve:a},this._scheduleCurve(a,a[0],r,i)}_buildEasingCurve(e){let t=Math.max(2,Math.ceil(e*60)),n=new Float32Array(t);for(let e=0;e<t;e++){let r=e/(t-1);n[e]=(1-Math.cos(Math.PI*r))/2}return n}_scheduleCurve(e,t,n,r){let i=this._gainNode.gain;i.cancelScheduledValues(n),i.setValueAtTime(t,n),i.setValueCurveAtTime(e,n,r)}_sampleIndex(e,t){let n=t-e.startTime,r=Math.max(0,Math.min(1,n/e.remaining));return Math.min(Math.round(r*(e.curve.length-1)),e.curve.length-1)}}class mn{constructor(e,t,n,r){this._filter=void 0,this._source=void 0,this._defaultGain=void 0,this.frequency=void 0,this.frequency=t,this._source=n,this._defaultGain=r,this._filter=e.createBiquadFilter(),this._filter.type=`peaking`,this._filter.frequency.value=t,this._filter.gain.value=0,this._filter.Q.value=1,this._source.connect(this._filter.gain)}get value(){return this._source.offset.value}get node(){return this._filter}set(e){this._source.offset.value=e}reset(){this.set(this._defaultGain)}dispose(){this._source.disconnect(this._filter.gain)}}class Y{constructor(e,t){this.id=`equalizer`,this._inputNode=void 0,this._outputNode=void 0,this._filterMap=new Map,this.equalizer=void 0,this._inputNode=e.createGain(),this._outputNode=e.createGain();let n=Object.entries(t).map(([e,t])=>[Number(e),t]).filter(([e])=>Number.isFinite(e)).sort((e,t)=>e[0]-t[0]),r=Y._sources.get(e);O(r)&&(r=new Map,Y._sources.set(e,r));for(let[t,i]of n)if(!r.has(t)){let n=e.createConstantSource();n.offset.value=i,n.start(),r.set(t,n)}let i={};for(let[t,a]of n){let n=r.get(t);if(!n)continue;let o=new mn(e,t,n,a);this._filterMap.set(t,o),i[t]=o}this.equalizer=i,this.rebuild()}get inputNode(){return this._inputNode}get outputNode(){return this._outputNode}resetAll(){for(let e of this._filterMap.values())e.reset()}dispose(){for(let e of this._filterMap.values())e.dispose()}rebuild(){this._inputNode.disconnect();for(let e of this._filterMap.values())e.node.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._filterMap.values())e.connect(t.node),e=t.node;e.connect(this._outputNode)}}Y._sources=new WeakMap;var hn=-14;class gn{constructor(e,t){this.id=`normalizer`,this._compressor=void 0,this._gainNode=void 0,this._compressor=e.createDynamicsCompressor(),this._gainNode=e.createGain(),this.applyConfig(t),this._compressor.connect(this._gainNode)}get inputNode(){return this._compressor}get outputNode(){return this._gainNode}applyConfig(e){if(!Number.isFinite(e.lufs)||!Number.isFinite(e.peak)){this._gainNode.gain.value=1;return}this._compressor.threshold.value=e.peak,this._compressor.knee.value=0,this._compressor.ratio.value=20,this._compressor.attack.value=.003,this._compressor.release.value=.25;let t=(e.targetLufs??hn)-e.lufs;this._gainNode.gain.value=10**(t/20)}}var _n=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},vn=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},yn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},bn=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},xn=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},Sn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},Cn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},wn=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},Tn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},En=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},Dn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),On=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},kn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},An=Object.prototype.hasOwnProperty,jn=(e,t)=>An.call(e,t),Mn=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},Nn=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},Pn=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},Fn=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),In=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},Ln=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:Rn,NativeAbortController:zn}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function Bn(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function Vn(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class Hn{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class X extends Hn{constructor(){super(),this.listeners||Hn.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return`[object AbortSignal]`}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,typeof this.onabort==`function`&&this.onabort.call(this,e)),super.dispatchEvent(e)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(e){let t=Vn(e),n=Bn(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,X.prototype[Symbol.toStringTag]=`AbortSignal`);function Un(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 Wn(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!Un({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&Un({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),Gn=$?Wn({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,Kn=$?Gn.fetch:Q.fetch,qn=$?Gn.Request:Q.Request,Jn=$?Z:Q.AbortController,Yn=$?X:Q.AbortSignal,Xn=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*Zn(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var Qn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},$n=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},er=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},tr=e=>e.replace(/^\s+/,``),nr=e=>e.replace(/\s+$/,``),rr=tr,ir=nr,ar=(e,t)=>typeof e==`string`?Xn(e,t):_n(e,t),or=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},sr=e=>Q.clearTimeout(e),cr=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),lr=!cr(Q.requestIdleCallback)||!cr(Q.cancelIdleCallback),ur=lr?or:Q.requestIdleCallback,dr=lr?sr:Q.cancelIdleCallback,fr=(e,t,n)=>typeof e==`string`?e.includes(t,n):Sn(e,t,n),pr=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};
package/es2015.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.98-dev.b7ed8d2a3.0
3
- * Fri, 31 Jul 2026 12:23:58 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-98/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.99-dev.0bc518265.0
3
+ * Fri, 14 Aug 2026 11:38:56 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-99/doc/
5
5
  */
6
- var _oxcMod5mn7xw=function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,ee=e=>e;function te(e,t){this[e]=ee.bind(null,t)}var g=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:te.bind(t,n)})},_=`1.0.98-dev.b7ed8d2a3.0`;class v{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var y=e=>{throw Error(`${e} is value of unexpected type`)},ne=e=>{},b=()=>{},re=e=>{throw console.error(e),e},x=e=>{console.error(e)};class S{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?x:re,r;r=t?typeof t==`function`?{next:t,error:b}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:b};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new v().add(()=>{switch(i.next=b,i.error=b,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return y(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class C extends S{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class ie{constructor(){this.log$=new C,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function ae(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function oe(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function w(e){return e!=null}function T(e){return e==null}var E=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>w(t)));function se(e,t){if(!e?.length)throw Error(t)}function ce(e,t){if(e?.length)throw Error(t)}var D=()=>globalThis,le=(e=D())=>!!(e.window&&e.screen),ue=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=D().setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),de=typeof D().performance?.now==`function`?()=>D().performance.now():()=>Date.now(),fe=()=>Math.trunc(de()),pe=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),me=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},he={};g(he,{set:()=>ve,remove:()=>be,isPersistent:()=>ge,has:()=>ye,get:()=>_e,clear:()=>xe});var O,k,A=`vk-videoplayer-dummy-key-${Math.random()}`,j=()=>{if(k!==void 0)return k;try{localStorage.setItem(A,`test`),localStorage.removeItem(A),k=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(A),k=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)k=2;else throw e}else throw e}return k===2&&(O=new Map),k},ge=()=>j()===0,_e=e=>{let t=j();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return O?.get(e);default:y(t)}},ve=(e,t)=>{let n=j();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:O?.set(e,t);return;default:y(n)}},ye=e=>{let t=j();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return O?.has(e)??!1;default:return y(t),!1}},be=e=>{let t=j();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:O?.delete(e);return;default:y(t)}},xe=()=>{let e=j();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return O?.clear();default:y(e)}},Se=()=>{let e,t=[],n=D();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},Ce;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(Ce||={});var M={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},we=(e,t)=>M[e].height>M[t].height,Te=(e,t)=>M[e].height>=M[t].height,N=(e,t)=>M[e].height<M[t].height,Ee=(e,t)=>M[e].height<=M[t].height,De=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:N(e,t)?1:-1)[0],Oe=Object.keys(M).sort((e,t)=>N(e,t)?-1:1),ke=(e,t=.02)=>[...Oe].find(n=>M[n].height*(1+t)>=e),Ae=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return Oe.find(e=>{let t=M[e];return t.width>=r&&t.height>=n})},je=e=>M[e].height,P=e=>e===`Invariant quality`,Me=e=>e.every(e=>!P(e));function Ne(e){if(P(e))throw Error(`Expected exact quality`)}var Pe=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},F=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=F(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},Fe=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function Ie(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof D().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&D().cancelAnimationFrame(s),D().requestAnimationFrame(e)):setTimeout(e,t)}function ee(e){if(p){D().cancelAnimationFrame(e);return}clearTimeout(e)}function te(e){return l=e,s=h(v,t),u?m(e):o}function g(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function _(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function v(){let e=Date.now();if(_(e))return y(e);s=h(v,g(e))}function y(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function ne(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:y(Date.now())}function re(){return s!==void 0}function x(...e){let n=Date.now(),a=_(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(v,t),m(c)}return s===void 0&&(s=h(v,t)),o}return x.cancel=ne,x.flush=b,x.pending=re,x}var Le=(e,t=0,n)=>Ie(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),I=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=I(e[r],t):n[r]=e[r]}return n},Re=e=>I(e);class ze extends C{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class L extends C{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function Be(e){return new S(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new v)})}function Ve(...e){return new S(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new v))}var He=e=>new S(t=>{let n=D().setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>D().clearTimeout(n)}),Ue=e=>new S(t=>{let n=D(),r=n.setInterval(()=>t.next(),e);return()=>{r&&=(n.clearInterval(r),void 0)}});function We(e){return new S(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var Ge=We,Ke=(e,t)=>new S(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class qe extends v{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function Je(e){return t=>new S(n=>t.subscribe(new Ye(n,e)))}class Ye{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var Xe={leading:!1,trailing:!0};function Ze(e,t=Xe){return n=>new S(r=>n.subscribe(new Qe(r,e,t)))}class Qe{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e;let t=D();w(this.timeout)?t.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=t.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var $e={leading:!0,trailing:!1};function et(e,t=$e){return n=>new S(r=>n.subscribe(new tt(r,e,t)))}class tt{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,T(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=D().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function nt(e){return t=>new S(n=>t.subscribe(new rt(n,e)))}class rt{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var it=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},at=(e,t)=>e instanceof Object&&t instanceof Object?it(e,t):e===t;function ot(e=at){return t=>new S(n=>t.subscribe(new st(n,e)))}var R={};class st{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=R,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===R||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function z(e){return t=>new S(n=>t.subscribe(new ct(n,e)))}class ct{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function lt(e){return z(()=>e)}function ut(){return e=>new S(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function dt(){return e=>new S(t=>e.subscribe(new ft(t)))}class ft{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function pt(e){return t=>new S(n=>t.subscribe(new mt(n,e)))}class mt{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function ht(e){return t=>new S(n=>t.subscribe(new gt(n,e)))}class gt{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function _t(e=0){return t=>{let n=0,r=new ze(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new S(e=>(n++,a(r.subscribe(e))))}}var vt=300,yt=(e,t=vt)=>new S(n=>{let r=D(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!le(r))return;let o=new r.ResizeObserver(Le(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),w(r)&&w(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),B=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=B(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},bt=(e,t=!1)=>{t&&(e.innerHTML=``),e.removeAttribute(`src`),e.load()},xt=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},St=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),Ct=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),wt=e=>e!==void 0&&e!==``?e:Ct().toString();function Tt(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function Et(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var V=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Dt=e=>{if(!V(e))throw e};function Ot(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class H{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];w(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var kt=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?B(r):{value:r},n)},U=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class W{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new v,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;w(i)&&i>0&&(this.eventsBuffer=new H(i)),W.dynamicImportStatus===`not_started`&&(W.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=W.dynamicImportPromise.then(r=>{W.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(T(i))return;let{opentelemetryApi:a}=W.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{w(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(W.dynamicImportStatus===`not_started`){W.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);W.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},W.dynamicImportStatus=`completed`}catch{W.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return T(this.span)||W.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){w(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},U(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new W({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes(U(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(w(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}W.dynamicImportStatus=`not_started`,W.dynamicImports=void 0,W.dynamicImportPromise=void 0;var At=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,jt=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new H(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new H(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>D().setTimeout(e,0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class Mt extends W{constructor(e){super({name:`Root`,options:e}),this.attributes$=new L(null),this.paused$=new L(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=W.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d}=o,f=new(jt(l))(new s({appToken:At}));this.subscription.add(this.paused$.subscribe(e=>{e?f.pause():f.resume()}));let p=new c({resource:u({[d]:`videoplayer-sdk-web`}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[f]});p.register();let m=p.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:m,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),U(e)))}addSubscription(e){this.subscription.add(e)}}class G{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new G({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var Nt=()=>!0,K={level:0,filter:Nt,name:`Noname Tracer`,outputMethod:`log`};class Pt{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=Nt,this.level=K.level,this.outputMethod=K.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??K.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new Pt({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||D().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&D().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class Ft{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new Mt(t);case`debug`:return new Pt;default:return new G}}}var It;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(It||={});var Lt;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(Lt||={});var Rt=`vk.ru`,zt=function(){var e=p(function*(e,t,n){let r=new URL(`https://${Rt}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),Bt(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),Bt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Vt(n)])),Vt=e=>Array.isArray(e)?e[0]:e,Ht;(e=>{e.RU=`ru`,e.EN=`en`})(Ht||={});var q=`__vk_vp_internals_exposure`;class Ut{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[q])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[q]||(window[q]={}),window[q][e]||(window[q][e]={}),window[q][e][t]||(window[q][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[q]&&window[q][e]&&window[q][e][t]&&(delete window[q][e][t],Object.keys(window[q][e]).length||delete window[q][e],Object.keys(window[q]).length||delete window[q])}}var Wt={};g(Wt,{subscribe:()=>Jt,push:()=>qt,destroy:()=>Kt,create:()=>Gt});var J=new Map,Gt=(e,t)=>J.set(e,t??[]),Kt=e=>J.delete(e),qt=(e,t)=>{let n=J.get(e);n&&(typeof n==`function`?n(t):n.push(t))},Jt=(e,t)=>{let n=J.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);J.set(e,t)}},Yt=e=>E({id:e.id,message:e.message,category:e.category,data:Xt(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function Xt(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var Zt=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},Qt=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=D())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class Y{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new v,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=Se();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=Y.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=Zt(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),Yt(e)),Qt()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield Y.loadPromise,Y.tracerErrorMap.has(e.componentName)||T(Y.appTracerModule))return;let{appTracerModule:t}=Y,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});w(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:At,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),Y.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;w(Y.loadPromise)||(Y.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>D().setTimeout(n,e.dynamicImportTimeout));Y.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){Y.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}Y.tracerErrorMap=new Map,Y.appTracerModule=null,Y.loadPromise=null;class $t{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var en=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}},tn=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},nn=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},rn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},an=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},on=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},sn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},cn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},ln=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},un=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},dn=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},fn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),pn=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},mn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},hn=Object.prototype.hasOwnProperty,gn=(e,t)=>hn.call(e,t),_n=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},vn=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},yn=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},bn=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),xn=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},Sn=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:Cn,NativeAbortController:wn}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function Tn(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function En(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class Dn{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class X extends Dn{constructor(){super(),this.listeners||Dn.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return`[object AbortSignal]`}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,typeof this.onabort==`function`&&this.onabort.call(this,e)),super.dispatchEvent(e)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(e){let t=En(e),n=Tn(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,X.prototype[Symbol.toStringTag]=`AbortSignal`);function On(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 kn(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!On({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&On({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),An=$?kn({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,jn=$?An.fetch:Q.fetch,Mn=$?An.Request:Q.Request,Nn=$?Z:Q.AbortController,Pn=$?X:Q.AbortSignal,Fn=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*In(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var Ln=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},Rn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},zn=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},Bn=e=>e.replace(/^\s+/,``),Vn=e=>e.replace(/\s+$/,``),Hn=Bn,Un=Vn,Wn=(e,t)=>typeof e==`string`?Fn(e,t):tn(e,t),Gn=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},Kn=e=>Q.clearTimeout(e),qn=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),Jn=!qn(Q.requestIdleCallback)||!qn(Q.cancelIdleCallback),Yn=Jn?Gn:Q.requestIdleCallback,Xn=Jn?Kn:Q.cancelIdleCallback,Zn=(e,t,n)=>typeof e==`string`?e.includes(t,n):sn(e,t,n),Qn=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};;return{E,Ae,je,ke,Qn,He,Fe,Le,et,pt,Dt,Bn,Un,Hn,Vn,zn,Rn,Ln,In,Fn,ht,_t,he,Yn,Sn,xn,bn,yn,vn,dt,ut,yt,Ge,_n,gn,mn,pn,fe,de,b,Ve,lt,z,zt,xt,T,w,Ee,N,P,St,Te,we,le,V,Ue,Tt,Zn,fn,D,Pe,kt,Et,wt,Ot,De,me,Ke,B,ot,nt,F,jn,Wt,Se,Ie,Ze,en,Be,I,Re,bt,ne,Xn,Je,Wn,Ne,oe,se,ae,y,ce,dn,un,ln,cn,sn,on,an,rn,nn,tn,Me,ue,pe,Ce,L,Lt,_,Ft,qe,v,C,Mn,ze,S,ie,Ut,Ht,$t,q,It,H,Y,Pn,Nn};}();var{E:_oxcMod5mn7xw_E,Ae:_oxcMod5mn7xw_Ae,je:_oxcMod5mn7xw_je,ke:_oxcMod5mn7xw_ke,Qn:_oxcMod5mn7xw_Qn,He:_oxcMod5mn7xw_He,Fe:_oxcMod5mn7xw_Fe,Le:_oxcMod5mn7xw_Le,et:_oxcMod5mn7xw_et,pt:_oxcMod5mn7xw_pt,Dt:_oxcMod5mn7xw_Dt,Bn:_oxcMod5mn7xw_Bn,Un:_oxcMod5mn7xw_Un,Hn:_oxcMod5mn7xw_Hn,Vn:_oxcMod5mn7xw_Vn,zn:_oxcMod5mn7xw_zn,Rn:_oxcMod5mn7xw_Rn,Ln:_oxcMod5mn7xw_Ln,In:_oxcMod5mn7xw_In,Fn:_oxcMod5mn7xw_Fn,ht:_oxcMod5mn7xw_ht,_t:_oxcMod5mn7xw__t,he:_oxcMod5mn7xw_he,Yn:_oxcMod5mn7xw_Yn,Sn:_oxcMod5mn7xw_Sn,xn:_oxcMod5mn7xw_xn,bn:_oxcMod5mn7xw_bn,yn:_oxcMod5mn7xw_yn,vn:_oxcMod5mn7xw_vn,dt:_oxcMod5mn7xw_dt,ut:_oxcMod5mn7xw_ut,yt:_oxcMod5mn7xw_yt,Ge:_oxcMod5mn7xw_Ge,_n:_oxcMod5mn7xw__n,gn:_oxcMod5mn7xw_gn,mn:_oxcMod5mn7xw_mn,pn:_oxcMod5mn7xw_pn,fe:_oxcMod5mn7xw_fe,de:_oxcMod5mn7xw_de,b:_oxcMod5mn7xw_b,Ve:_oxcMod5mn7xw_Ve,lt:_oxcMod5mn7xw_lt,z:_oxcMod5mn7xw_z,zt:_oxcMod5mn7xw_zt,xt:_oxcMod5mn7xw_xt,T:_oxcMod5mn7xw_T,w:_oxcMod5mn7xw_w,Ee:_oxcMod5mn7xw_Ee,N:_oxcMod5mn7xw_N,P:_oxcMod5mn7xw_P,St:_oxcMod5mn7xw_St,Te:_oxcMod5mn7xw_Te,we:_oxcMod5mn7xw_we,le:_oxcMod5mn7xw_le,V:_oxcMod5mn7xw_V,Ue:_oxcMod5mn7xw_Ue,Tt:_oxcMod5mn7xw_Tt,Zn:_oxcMod5mn7xw_Zn,fn:_oxcMod5mn7xw_fn,D:_oxcMod5mn7xw_D,Pe:_oxcMod5mn7xw_Pe,kt:_oxcMod5mn7xw_kt,Et:_oxcMod5mn7xw_Et,wt:_oxcMod5mn7xw_wt,Ot:_oxcMod5mn7xw_Ot,De:_oxcMod5mn7xw_De,me:_oxcMod5mn7xw_me,Ke:_oxcMod5mn7xw_Ke,B:_oxcMod5mn7xw_B,ot:_oxcMod5mn7xw_ot,nt:_oxcMod5mn7xw_nt,F:_oxcMod5mn7xw_F,jn:_oxcMod5mn7xw_jn,Wt:_oxcMod5mn7xw_Wt,Se:_oxcMod5mn7xw_Se,Ie:_oxcMod5mn7xw_Ie,Ze:_oxcMod5mn7xw_Ze,en:_oxcMod5mn7xw_en,Be:_oxcMod5mn7xw_Be,I:_oxcMod5mn7xw_I,Re:_oxcMod5mn7xw_Re,bt:_oxcMod5mn7xw_bt,ne:_oxcMod5mn7xw_ne,Xn:_oxcMod5mn7xw_Xn,Je:_oxcMod5mn7xw_Je,Wn:_oxcMod5mn7xw_Wn,Ne:_oxcMod5mn7xw_Ne,oe:_oxcMod5mn7xw_oe,se:_oxcMod5mn7xw_se,ae:_oxcMod5mn7xw_ae,y:_oxcMod5mn7xw_y,ce:_oxcMod5mn7xw_ce,dn:_oxcMod5mn7xw_dn,un:_oxcMod5mn7xw_un,ln:_oxcMod5mn7xw_ln,cn:_oxcMod5mn7xw_cn,sn:_oxcMod5mn7xw_sn,on:_oxcMod5mn7xw_on,an:_oxcMod5mn7xw_an,rn:_oxcMod5mn7xw_rn,nn:_oxcMod5mn7xw_nn,tn:_oxcMod5mn7xw_tn,Me:_oxcMod5mn7xw_Me,ue:_oxcMod5mn7xw_ue,pe:_oxcMod5mn7xw_pe,Ce:_oxcMod5mn7xw_Ce,L:_oxcMod5mn7xw_L,Lt:_oxcMod5mn7xw_Lt,_:_oxcMod5mn7xw__,Ft:_oxcMod5mn7xw_Ft,qe:_oxcMod5mn7xw_qe,v:_oxcMod5mn7xw_v,C:_oxcMod5mn7xw_C,Mn:_oxcMod5mn7xw_Mn,ze:_oxcMod5mn7xw_ze,S:_oxcMod5mn7xw_S,ie:_oxcMod5mn7xw_ie,Ut:_oxcMod5mn7xw_Ut,Ht:_oxcMod5mn7xw_Ht,$t:_oxcMod5mn7xw_$t,q:_oxcMod5mn7xw_q,It:_oxcMod5mn7xw_It,H:_oxcMod5mn7xw_H,Y:_oxcMod5mn7xw_Y,Pn:_oxcMod5mn7xw_Pn,Nn:_oxcMod5mn7xw_Nn}=_oxcMod5mn7xw;export{_oxcMod5mn7xw_E as withoutNullable,_oxcMod5mn7xw_Ae as videoSizeToQuality,_oxcMod5mn7xw_je as videoQualityToHeight,_oxcMod5mn7xw_ke as videoHeightToQuality,_oxcMod5mn7xw_Qn as urlCanParsePolyfilled,_oxcMod5mn7xw_He as timeout,_oxcMod5mn7xw_Fe as timeCodeToString,_oxcMod5mn7xw_Le as throttleFn,_oxcMod5mn7xw_et as throttle,_oxcMod5mn7xw_pt as tap,_oxcMod5mn7xw_Dt as suppressAbort,_oxcMod5mn7xw_Bn as stringTrimStart,_oxcMod5mn7xw_Un as stringTrimRight,_oxcMod5mn7xw_Hn as stringTrimLeft,_oxcMod5mn7xw_Vn as stringTrimEnd,_oxcMod5mn7xw_zn as stringReplaceAll,_oxcMod5mn7xw_Rn as stringPadStart,_oxcMod5mn7xw_Ln as stringPadEnd,_oxcMod5mn7xw_In as stringMatchAll,_oxcMod5mn7xw_Fn as stringAt,_oxcMod5mn7xw_ht as skip,_oxcMod5mn7xw__t as shareReplay,_oxcMod5mn7xw_he as safeStorage,_oxcMod5mn7xw_Yn as requestIdleCallbackPolyfilled,_oxcMod5mn7xw_Sn as promiseWithResolvers,_oxcMod5mn7xw_xn as promiseTry,_oxcMod5mn7xw_bn as promiseFinally,_oxcMod5mn7xw_yn as promiseAny,_oxcMod5mn7xw_vn as promiseAllSettled,_oxcMod5mn7xw_dt as pairwise,_oxcMod5mn7xw_ut as once,_oxcMod5mn7xw_yt as observeElementSize,_oxcMod5mn7xw_Ge as observableFrom,_oxcMod5mn7xw__n as objectValues,_oxcMod5mn7xw_gn as objectHasOwn,_oxcMod5mn7xw_mn as objectFromEntries,_oxcMod5mn7xw_pn as objectEntries,_oxcMod5mn7xw_fe as nowInt,_oxcMod5mn7xw_de as now,_oxcMod5mn7xw_b as noop,_oxcMod5mn7xw_Ve as merge,_oxcMod5mn7xw_lt as mapTo,_oxcMod5mn7xw_z as map,_oxcMod5mn7xw_zt as loadVKLangPack,_oxcMod5mn7xw_xt as isValidURL,_oxcMod5mn7xw_T as isNullable,_oxcMod5mn7xw_w as isNonNullable,_oxcMod5mn7xw_Ee as isLowerOrEqual,_oxcMod5mn7xw_N as isLower,_oxcMod5mn7xw_P as isInvariantQuality,_oxcMod5mn7xw_St as isIntersecting,_oxcMod5mn7xw_Te as isHigherOrEqual,_oxcMod5mn7xw_we as isHigher,_oxcMod5mn7xw_le as isBrowserWindow,_oxcMod5mn7xw_V as isAbortError,_oxcMod5mn7xw_Ue as interval,_oxcMod5mn7xw_Tt as interpolate,_oxcMod5mn7xw_Zn as includesPolyfilled,_oxcMod5mn7xw_fn as globalThisPolyfill,_oxcMod5mn7xw_D as getWindow,_oxcMod5mn7xw_Pe as getVideoQualityLabel,_oxcMod5mn7xw_kt as getTraceSubscriptionMethod,_oxcMod5mn7xw_Et as getRangeAroundIndex,_oxcMod5mn7xw_wt as getPlayerId,_oxcMod5mn7xw_Ot as getMessageFromError,_oxcMod5mn7xw_De as getHighestQuality,_oxcMod5mn7xw_me as getExponentialDelay,_oxcMod5mn7xw_Ke as fromEvent,_oxcMod5mn7xw_B as flattenObject,_oxcMod5mn7xw_ot as filterChanged,_oxcMod5mn7xw_nt as filter,_oxcMod5mn7xw_F as fillWithDefault,_oxcMod5mn7xw_jn as fetchPolyfilled,_oxcMod5mn7xw_Wt as devNull,_oxcMod5mn7xw_Se as detectEmbed,_oxcMod5mn7xw_Ie as debounceFn,_oxcMod5mn7xw_Ze as debounce,_oxcMod5mn7xw_en as createDIContainer,_oxcMod5mn7xw_Be as combine,_oxcMod5mn7xw_I as cloneDeepWith,_oxcMod5mn7xw_Re as cloneDeep,_oxcMod5mn7xw_bt as clearVideoElement,_oxcMod5mn7xw_ne as checkNever,_oxcMod5mn7xw_Xn as cancelIdleCallbackPolyfilled,_oxcMod5mn7xw_Je as buffer,_oxcMod5mn7xw_Wn as atPolyfilled,_oxcMod5mn7xw_Ne as assertQualityIsExact,_oxcMod5mn7xw_oe as assertNullable,_oxcMod5mn7xw_se as assertNotEmptyArray,_oxcMod5mn7xw_ae as assertNonNullable,_oxcMod5mn7xw_y as assertNever,_oxcMod5mn7xw_ce as assertEmptyArray,_oxcMod5mn7xw_dn as arrayWith,_oxcMod5mn7xw_un as arrayToSpliced,_oxcMod5mn7xw_ln as arrayToSorted,_oxcMod5mn7xw_cn as arrayToReversed,_oxcMod5mn7xw_sn as arrayIncludes,_oxcMod5mn7xw_on as arrayFlatMap,_oxcMod5mn7xw_an as arrayFlat,_oxcMod5mn7xw_rn as arrayFindLastIndex,_oxcMod5mn7xw_nn as arrayFindLast,_oxcMod5mn7xw_tn as arrayAt,_oxcMod5mn7xw_Me as areQualitiesExact,_oxcMod5mn7xw_ue as addScript,_oxcMod5mn7xw_pe as abortable,_oxcMod5mn7xw_Ce as VideoQuality,_oxcMod5mn7xw_L as ValueSubject,_oxcMod5mn7xw_Lt as VKNumericLanguage,_oxcMod5mn7xw__ as VERSION,_oxcMod5mn7xw_Ft as TracerFactory,_oxcMod5mn7xw_qe as SubscriptionRemovable,_oxcMod5mn7xw_v as Subscription,_oxcMod5mn7xw_C as Subject,_oxcMod5mn7xw_Mn as RequestPolyfilled,_oxcMod5mn7xw_ze as ReplaySubject,_oxcMod5mn7xw_S as Observable,_oxcMod5mn7xw_ie as Logger,_oxcMod5mn7xw_Ut as InternalsExposure,_oxcMod5mn7xw_Ht as InterfaceLanguage,_oxcMod5mn7xw_$t as InjectionToken,_oxcMod5mn7xw_q as INTERNAL_EXPOSE_GLOBAL_KEY,_oxcMod5mn7xw_It as ErrorCategory,_oxcMod5mn7xw_H as CircularBuffer,_oxcMod5mn7xw_Y as AppTracer,_oxcMod5mn7xw_Pn as AbortSignalPolyfilled,_oxcMod5mn7xw_Nn as AbortControllerPolyfilled};
6
+ var _oxcMod7jlaoe=function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,ee=e=>e;function te(e,t){this[e]=ee.bind(null,t)}var g=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:te.bind(t,n)})},_=`1.0.99-dev.0bc518265.0`;class v{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var y=e=>{throw Error(`${e} is value of unexpected type`)},ne=e=>{},b=()=>{},re=e=>{throw console.error(e),e},x=e=>{console.error(e)};class S{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?x:re,r;r=t?typeof t==`function`?{next:t,error:b}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:b};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new v().add(()=>{switch(i.next=b,i.error=b,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return y(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class C extends S{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class ie{constructor(){this.log$=new C,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function ae(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function oe(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function w(e){return e!=null}function T(e){return e==null}var se=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>w(t)));function ce(e,t){if(!e?.length)throw Error(t)}function le(e,t){if(e?.length)throw Error(t)}var E=()=>globalThis,ue=(e=E())=>!!(e.window&&e.screen),de=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=E().setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),fe=typeof E().performance?.now==`function`?()=>E().performance.now():()=>Date.now(),pe=()=>Math.trunc(fe()),me=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),he=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},D={};g(D,{set:()=>ve,remove:()=>be,isPersistent:()=>ge,has:()=>ye,get:()=>_e,clear:()=>xe});var O,k,A=`vk-videoplayer-dummy-key-${Math.random()}`,j=()=>{if(k!==void 0)return k;try{localStorage.setItem(A,`test`),localStorage.removeItem(A),k=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(A),k=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)k=2;else throw e}else throw e}return k===2&&(O=new Map),k},ge=()=>j()===0,_e=e=>{let t=j();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return O?.get(e);default:y(t)}},ve=(e,t)=>{let n=j();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:O?.set(e,t);return;default:y(n)}},ye=e=>{let t=j();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return O?.has(e)??!1;default:return y(t),!1}},be=e=>{let t=j();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:O?.delete(e);return;default:y(t)}},xe=()=>{let e=j();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return O?.clear();default:y(e)}},Se=()=>{let e,t=[],n=E();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},M;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(M||={});var N={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Ce=(e,t)=>N[e].height>N[t].height,we=(e,t)=>N[e].height>=N[t].height,P=(e,t)=>N[e].height<N[t].height,Te=(e,t)=>N[e].height<=N[t].height,Ee=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:P(e,t)?1:-1)[0],F=Object.keys(N).sort((e,t)=>P(e,t)?-1:1),De=(e,t=.02)=>[...F].find(n=>N[n].height*(1+t)>=e),Oe=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return F.find(e=>{let t=N[e];return t.width>=r&&t.height>=n})},ke=e=>N[e].height,I=e=>e===`Invariant quality`,Ae=e=>e.every(e=>!I(e));function je(e){if(I(e))throw Error(`Expected exact quality`)}var Me=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},Ne=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=Ne(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},Pe=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function Fe(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof E().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&E().cancelAnimationFrame(s),E().requestAnimationFrame(e)):setTimeout(e,t)}function ee(e){if(p){E().cancelAnimationFrame(e);return}clearTimeout(e)}function te(e){return l=e,s=h(v,t),u?m(e):o}function g(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function _(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function v(){let e=Date.now();if(_(e))return y(e);s=h(v,g(e))}function y(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function ne(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:y(Date.now())}function re(){return s!==void 0}function x(...e){let n=Date.now(),a=_(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(v,t),m(c)}return s===void 0&&(s=h(v,t)),o}return x.cancel=ne,x.flush=b,x.pending=re,x}var Ie=(e,t=0,n)=>Fe(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),L=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=L(e[r],t):n[r]=e[r]}return n},Le=e=>L(e);class Re extends C{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class R extends C{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function ze(e){return new S(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new v)})}function Be(...e){return new S(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new v))}var Ve=e=>new S(t=>{let n=E().setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>E().clearTimeout(n)}),He=e=>new S(t=>{let n=E(),r=n.setInterval(()=>t.next(),e);return()=>{r&&=(n.clearInterval(r),void 0)}});function Ue(e){return new S(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var We=Ue,Ge=(e,t)=>new S(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class Ke extends v{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function qe(e){return t=>new S(n=>t.subscribe(new Je(n,e)))}class Je{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var Ye={leading:!1,trailing:!0};function Xe(e,t=Ye){return n=>new S(r=>n.subscribe(new Ze(r,e,t)))}class Ze{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e;let t=E();w(this.timeout)?t.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=t.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var Qe={leading:!0,trailing:!1};function $e(e,t=Qe){return n=>new S(r=>n.subscribe(new et(r,e,t)))}class et{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,T(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=E().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function tt(e){return t=>new S(n=>t.subscribe(new nt(n,e)))}class nt{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var rt=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},it=(e,t)=>e instanceof Object&&t instanceof Object?rt(e,t):e===t;function at(e=it){return t=>new S(n=>t.subscribe(new st(n,e)))}var ot={};class st{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=ot,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===ot||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function z(e){return t=>new S(n=>t.subscribe(new ct(n,e)))}class ct{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function lt(e){return z(()=>e)}function ut(){return e=>new S(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function dt(){return e=>new S(t=>e.subscribe(new ft(t)))}class ft{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function pt(e){return t=>new S(n=>t.subscribe(new mt(n,e)))}class mt{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function ht(e){return t=>new S(n=>t.subscribe(new gt(n,e)))}class gt{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function _t(e=0){return t=>{let n=0,r=new Re(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new S(e=>(n++,a(r.subscribe(e))))}}var vt=300,yt=(e,t=vt)=>new S(n=>{let r=E(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!ue(r))return;let o=new r.ResizeObserver(Ie(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),w(r)&&w(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),B=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=B(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},bt=(e,t=!1)=>{t&&(e.innerHTML=``),e.removeAttribute(`src`),e.load()},xt=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},St=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),Ct=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),wt=e=>e!==void 0&&e!==``?e:Ct().toString();function Tt(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function Et(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var V=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Dt=e=>{if(!V(e))throw e};function Ot(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class H{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];w(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var kt=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?B(r):{value:r},n)},U=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class W{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new v,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;w(i)&&i>0&&(this.eventsBuffer=new H(i)),W.dynamicImportStatus===`not_started`&&(W.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=W.dynamicImportPromise.then(r=>{W.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(T(i))return;let{opentelemetryApi:a}=W.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{w(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(W.dynamicImportStatus===`not_started`){W.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);W.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},W.dynamicImportStatus=`completed`}catch{W.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return T(this.span)||W.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){w(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},U(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new W({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes(U(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(w(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}W.dynamicImportStatus=`not_started`,W.dynamicImports=void 0,W.dynamicImportPromise=void 0;var At=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,jt=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new H(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new H(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>E().setTimeout(e,0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class Mt extends W{constructor(e){super({name:`Root`,options:e}),this.attributes$=new R(null),this.paused$=new R(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=W.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d,ATTR_SERVICE_VERSION:f}=o,p=new(jt(l))(new s({appToken:At}));this.subscription.add(this.paused$.subscribe(e=>{e?p.pause():p.resume()}));let m=new c({resource:u({[d]:`videoplayer-sdk-web`,[f]:_}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[p]});m.register();let h=m.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:h,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),U(e)))}addSubscription(e){this.subscription.add(e)}}class Nt{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new Nt({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var Pt=()=>!0,G={level:0,filter:Pt,name:`Noname Tracer`,outputMethod:`log`};class Ft{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=Pt,this.level=G.level,this.outputMethod=G.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??G.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new Ft({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||E().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&E().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class It{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new Mt(t);case`debug`:return new Ft;default:return new Nt}}}var Lt;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(Lt||={});var Rt;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(Rt||={});var zt=`vk.ru`,Bt=function(){var e=p(function*(e,t,n){let r=new URL(`https://${zt}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),Vt(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),Vt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Ht(n)])),Ht=e=>Array.isArray(e)?e[0]:e,Ut;(e=>{e.RU=`ru`,e.EN=`en`})(Ut||={});var K=`__vk_vp_internals_exposure`;class Wt{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[K])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]||(window[K]={}),window[K][e]||(window[K][e]={}),window[K][e][t]||(window[K][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]&&window[K][e]&&window[K][e][t]&&(delete window[K][e][t],Object.keys(window[K][e]).length||delete window[K][e],Object.keys(window[K]).length||delete window[K])}}var Gt={};g(Gt,{subscribe:()=>Yt,push:()=>Jt,destroy:()=>qt,create:()=>Kt});var q=new Map,Kt=(e,t)=>q.set(e,t??[]),qt=e=>q.delete(e),Jt=(e,t)=>{let n=q.get(e);n&&(typeof n==`function`?n(t):n.push(t))},Yt=(e,t)=>{let n=q.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);q.set(e,t)}},Xt=e=>se({id:e.id,message:e.message,category:e.category,data:Zt(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function Zt(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var Qt=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},$t=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=E())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class J{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new v,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=Se();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=J.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=Qt(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),Xt(e)),$t()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield J.loadPromise,J.tracerErrorMap.has(e.componentName)||T(J.appTracerModule))return;let{appTracerModule:t}=J,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});w(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:At,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),J.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;w(J.loadPromise)||(J.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>E().setTimeout(n,e.dynamicImportTimeout));J.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){J.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}J.tracerErrorMap=new Map,J.appTracerModule=null,J.loadPromise=null;class en{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var tn=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}};class nn{constructor(e){this._inputNode=void 0,this._outputNode=void 0,this._plugins=[],this._destination=null,this._taps=[],this._inputNode=e.createGain(),this._outputNode=e.createGain()}get input(){return this._inputNode}get plugins(){return this._plugins}connectTo(e){this._destination=e,this.rebuild()}addTap(e){this._taps.push(e),this._outputNode.connect(e)}hasPlugin(e){return this._plugins.some(t=>t.id===e)}addPlugin(e){this.hasPlugin(e.id)||(this._plugins.push(e),this.rebuild())}removePlugin(e){let t=this._plugins.findIndex(t=>t.id===e);t!==-1&&(this._plugins.splice(t,1),this.rebuild())}rebuild(){this._inputNode.disconnect();for(let e of this._plugins)e.outputNode.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._plugins)e.connect(t.inputNode),e=t.outputNode;e.connect(this._outputNode),this._destination!==null&&this._outputNode.connect(this._destination);for(let e of this._taps)this._outputNode.connect(e)}}class rn{constructor(e,t,n){this._pluginChain=void 0,this._element=void 0,this._ctx=void 0,this._sourceNode=null,this._isBound=!1,this._element=e,this._ctx=t,this._pluginChain=new nn(t),this._pluginChain.connectTo(n)}get isBound(){return this._isBound}get plugins(){return this._pluginChain.plugins}bind(){this._isBound||=(this._sourceNode===null&&(this._sourceNode=this._ctx.createMediaElementSource(this._element)),this._sourceNode.disconnect(),this._sourceNode.connect(this._pluginChain.input),!0)}unbind(){this._isBound&&=(this._sourceNode?.disconnect(),this._sourceNode?.connect(this._ctx.destination),!1)}addPlugin(e){this._pluginChain.addPlugin(e)}removePlugin(e){this._pluginChain.removePlugin(e)}addAnalyser(e){this._pluginChain.addTap(e)}}class an{constructor(){this._ctx=null,this._masterGain=null,this._connections=new Map,this._contextEnabled=!1,this._boundBeforeDisable=new Set}static isSupported(){let e=E();return w(e.AudioContext??e.webkitAudioContext)}get context(){if(T(this._ctx)){let e=E(),t=e.AudioContext??e.webkitAudioContext;this._ctx=new t}return this._ctx}get contextState(){return this._contextEnabled?this._ctx?.state??`suspended`:`suspended`}enableContext(){var e=this;return p(function*(){e.ensureContext(),yield e._ctx?.resume(),e._contextEnabled=!0;for(let t of e._boundBeforeDisable)e._connections.get(t)?.bind();e._boundBeforeDisable.clear()})()}disableContext(){var e=this;return p(function*(){e._contextEnabled=!1;for(let[t,n]of e._connections)n.isBound&&(e._boundBeforeDisable.add(t),n.unbind())})()}connectSource(e){var t=this;return p(function*(){t.ensureContext(),t._contextEnabled=!0,yield t._ctx?.resume();let n=t._connections.get(e);if(n!==void 0){n.isBound||n.bind();return}let r=new rn(e,t.context,t._masterGain);r.bind(),t._connections.set(e,r)})()}disconnectSource(e){this._connections.get(e)?.unbind()}isSourceConnected(e){return this._connections.get(e)?.isBound??!1}addPlugin(e,t){let n=this._connections.get(e);if(n===void 0)throw Error(`Source is not connected. Call connectSource() first.`);n.addPlugin(t)}removePlugin(e,t){this._connections.get(e)?.removePlugin(t)}getPlugins(e){return this._connections.get(e)?.plugins??[]}createAnalyser(e){let t=this._connections.get(e);if(t===void 0)return null;let n=this.context.createAnalyser();return n.fftSize=256,n.smoothingTimeConstant=.8,t.addAnalyser(n),n}setMasterVolume(e){this._masterGain!==null&&(this._masterGain.gain.value=e)}getMasterVolume(){return this._masterGain?.gain.value??1}dispose(){this._connections.clear(),this._boundBeforeDisable.clear(),this._masterGain=null,this._contextEnabled=!1,this._ctx?.close(),this._ctx=null}ensureContext(){let e=this.context;T(this._masterGain)&&(this._masterGain=e.createGain(),this._masterGain.gain.value=1,this._masterGain.connect(e.destination))}}class on{constructor(e,t){this.id=`volume-fader`,this._gainNode=void 0,this._duration=void 0,this._curve=void 0,this._fade=null,this._gainNode=e.createGain(),this._gainNode.gain.value=1,this._duration=t.duration,this._curve=t.curve??this._buildEasingCurve(t.duration/1e3)}get inputNode(){return this._gainNode}get outputNode(){return this._gainNode}get faded(){return this._fade!==null}appear(){this._startFade(0,1)}disappear(){this._startFade(1,0)}pause(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime,n=t-this._fade.startTime,r=Math.max(0,this._fade.remaining-n);if(r<=.001){this._finishFade();return}let i=this._sampleIndex(this._fade,t),a=this._fade.curve[i];e.cancelScheduledValues(t),e.setValueAtTime(a,t),this._fade={from:a,target:this._fade.target,startTime:t,remaining:r,curve:this._fade.curve.subarray(i)}}resume(){if(this._fade===null)return;let e=this._gainNode.context.currentTime,{from:t,target:n,remaining:r,curve:i}=this._fade;if(r<=.001||Math.abs(n-t)<.001||i.length<2){this._finishFade();return}this._fade={from:t,target:n,startTime:e,remaining:r,curve:i},this._scheduleCurve(i,t,e,r)}cancel(){this._fade!==null&&this._finishFade()}_finishFade(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime;e.cancelScheduledValues(t),e.setValueAtTime(this._fade.target,t),this._fade=null}_startFade(e,t){let n=this._gainNode.gain,r=this._gainNode.context.currentTime,i=this._duration/1e3;if(i<=0){n.cancelScheduledValues(r),n.setValueAtTime(t,r),this._fade=null;return}let a=new Float32Array(this._curve.length);for(let n=0;n<this._curve.length;n++)a[n]=e+(t-e)*this._curve[n];this._fade={from:a[0],target:t,startTime:r,remaining:i,curve:a},this._scheduleCurve(a,a[0],r,i)}_buildEasingCurve(e){let t=Math.max(2,Math.ceil(e*60)),n=new Float32Array(t);for(let e=0;e<t;e++){let r=e/(t-1);n[e]=(1-Math.cos(Math.PI*r))/2}return n}_scheduleCurve(e,t,n,r){let i=this._gainNode.gain;i.cancelScheduledValues(n),i.setValueAtTime(t,n),i.setValueCurveAtTime(e,n,r)}_sampleIndex(e,t){let n=t-e.startTime,r=Math.max(0,Math.min(1,n/e.remaining));return Math.min(Math.round(r*(e.curve.length-1)),e.curve.length-1)}}class sn{constructor(e,t,n,r){this._filter=void 0,this._source=void 0,this._defaultGain=void 0,this.frequency=void 0,this.frequency=t,this._source=n,this._defaultGain=r,this._filter=e.createBiquadFilter(),this._filter.type=`peaking`,this._filter.frequency.value=t,this._filter.gain.value=0,this._filter.Q.value=1,this._source.connect(this._filter.gain)}get value(){return this._source.offset.value}get node(){return this._filter}set(e){this._source.offset.value=e}reset(){this.set(this._defaultGain)}dispose(){this._source.disconnect(this._filter.gain)}}class Y{constructor(e,t){this.id=`equalizer`,this._inputNode=void 0,this._outputNode=void 0,this._filterMap=new Map,this.equalizer=void 0,this._inputNode=e.createGain(),this._outputNode=e.createGain();let n=Object.entries(t).map(([e,t])=>[Number(e),t]).filter(([e])=>Number.isFinite(e)).sort((e,t)=>e[0]-t[0]),r=Y._sources.get(e);T(r)&&(r=new Map,Y._sources.set(e,r));for(let[t,i]of n)if(!r.has(t)){let n=e.createConstantSource();n.offset.value=i,n.start(),r.set(t,n)}let i={};for(let[t,a]of n){let n=r.get(t);if(!n)continue;let o=new sn(e,t,n,a);this._filterMap.set(t,o),i[t]=o}this.equalizer=i,this.rebuild()}get inputNode(){return this._inputNode}get outputNode(){return this._outputNode}resetAll(){for(let e of this._filterMap.values())e.reset()}dispose(){for(let e of this._filterMap.values())e.dispose()}rebuild(){this._inputNode.disconnect();for(let e of this._filterMap.values())e.node.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._filterMap.values())e.connect(t.node),e=t.node;e.connect(this._outputNode)}}Y._sources=new WeakMap;var cn=-14;class ln{constructor(e,t){this.id=`normalizer`,this._compressor=void 0,this._gainNode=void 0,this._compressor=e.createDynamicsCompressor(),this._gainNode=e.createGain(),this.applyConfig(t),this._compressor.connect(this._gainNode)}get inputNode(){return this._compressor}get outputNode(){return this._gainNode}applyConfig(e){if(!Number.isFinite(e.lufs)||!Number.isFinite(e.peak)){this._gainNode.gain.value=1;return}this._compressor.threshold.value=e.peak,this._compressor.knee.value=0,this._compressor.ratio.value=20,this._compressor.attack.value=.003,this._compressor.release.value=.25;let t=(e.targetLufs??cn)-e.lufs;this._gainNode.gain.value=10**(t/20)}}var un=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},dn=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},fn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},pn=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},mn=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},hn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},gn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},_n=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},vn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},yn=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},bn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),xn=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},Sn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},Cn=Object.prototype.hasOwnProperty,wn=(e,t)=>Cn.call(e,t),Tn=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},En=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},Dn=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},On=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),kn=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},An=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:jn,NativeAbortController:Mn}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function Nn(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function Pn(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class Fn{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class X extends Fn{constructor(){super(),this.listeners||Fn.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return`[object AbortSignal]`}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,typeof this.onabort==`function`&&this.onabort.call(this,e)),super.dispatchEvent(e)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(e){let t=Pn(e),n=Nn(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,X.prototype[Symbol.toStringTag]=`AbortSignal`);function In(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 Ln(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!In({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&In({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),Rn=$?Ln({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,zn=$?Rn.fetch:Q.fetch,Bn=$?Rn.Request:Q.Request,Vn=$?Z:Q.AbortController,Hn=$?X:Q.AbortSignal,Un=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*Wn(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var Gn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},Kn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},qn=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},Jn=e=>e.replace(/^\s+/,``),Yn=e=>e.replace(/\s+$/,``),Xn=Jn,Zn=Yn,Qn=(e,t)=>typeof e==`string`?Un(e,t):un(e,t),$n=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},er=e=>Q.clearTimeout(e),tr=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),nr=!tr(Q.requestIdleCallback)||!tr(Q.cancelIdleCallback),rr=nr?$n:Q.requestIdleCallback,ir=nr?er:Q.cancelIdleCallback,ar=(e,t,n)=>typeof e==`string`?e.includes(t,n):hn(e,t,n),or=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};;return{se,Oe,ke,De,or,Ve,Pe,Ie,$e,pt,Dt,Jn,Zn,Xn,Yn,qn,Kn,Gn,Wn,Un,ht,_t,D,rr,An,kn,On,Dn,En,dt,ut,yt,We,Tn,wn,Sn,xn,pe,fe,b,Be,lt,z,Bt,xt,T,w,Te,P,I,St,we,Ce,ue,V,He,Tt,ar,bn,E,Me,kt,Et,wt,Ot,Ee,he,Ge,B,at,tt,Ne,zn,Gt,Se,Fe,Xe,tn,ze,L,Le,bt,ne,ir,qe,Qn,je,oe,ce,ae,y,le,yn,vn,_n,gn,hn,mn,pn,fn,dn,un,Ae,de,me,on,M,R,Rt,_,It,Ke,v,C,Bn,Re,S,ln,ie,Wt,Ut,en,K,Lt,Y,H,an,J,Hn,Vn};}();var{se:_oxcMod7jlaoe_se,Oe:_oxcMod7jlaoe_Oe,ke:_oxcMod7jlaoe_ke,De:_oxcMod7jlaoe_De,or:_oxcMod7jlaoe_or,Ve:_oxcMod7jlaoe_Ve,Pe:_oxcMod7jlaoe_Pe,Ie:_oxcMod7jlaoe_Ie,$e:_oxcMod7jlaoe_$e,pt:_oxcMod7jlaoe_pt,Dt:_oxcMod7jlaoe_Dt,Jn:_oxcMod7jlaoe_Jn,Zn:_oxcMod7jlaoe_Zn,Xn:_oxcMod7jlaoe_Xn,Yn:_oxcMod7jlaoe_Yn,qn:_oxcMod7jlaoe_qn,Kn:_oxcMod7jlaoe_Kn,Gn:_oxcMod7jlaoe_Gn,Wn:_oxcMod7jlaoe_Wn,Un:_oxcMod7jlaoe_Un,ht:_oxcMod7jlaoe_ht,_t:_oxcMod7jlaoe__t,D:_oxcMod7jlaoe_D,rr:_oxcMod7jlaoe_rr,An:_oxcMod7jlaoe_An,kn:_oxcMod7jlaoe_kn,On:_oxcMod7jlaoe_On,Dn:_oxcMod7jlaoe_Dn,En:_oxcMod7jlaoe_En,dt:_oxcMod7jlaoe_dt,ut:_oxcMod7jlaoe_ut,yt:_oxcMod7jlaoe_yt,We:_oxcMod7jlaoe_We,Tn:_oxcMod7jlaoe_Tn,wn:_oxcMod7jlaoe_wn,Sn:_oxcMod7jlaoe_Sn,xn:_oxcMod7jlaoe_xn,pe:_oxcMod7jlaoe_pe,fe:_oxcMod7jlaoe_fe,b:_oxcMod7jlaoe_b,Be:_oxcMod7jlaoe_Be,lt:_oxcMod7jlaoe_lt,z:_oxcMod7jlaoe_z,Bt:_oxcMod7jlaoe_Bt,xt:_oxcMod7jlaoe_xt,T:_oxcMod7jlaoe_T,w:_oxcMod7jlaoe_w,Te:_oxcMod7jlaoe_Te,P:_oxcMod7jlaoe_P,I:_oxcMod7jlaoe_I,St:_oxcMod7jlaoe_St,we:_oxcMod7jlaoe_we,Ce:_oxcMod7jlaoe_Ce,ue:_oxcMod7jlaoe_ue,V:_oxcMod7jlaoe_V,He:_oxcMod7jlaoe_He,Tt:_oxcMod7jlaoe_Tt,ar:_oxcMod7jlaoe_ar,bn:_oxcMod7jlaoe_bn,E:_oxcMod7jlaoe_E,Me:_oxcMod7jlaoe_Me,kt:_oxcMod7jlaoe_kt,Et:_oxcMod7jlaoe_Et,wt:_oxcMod7jlaoe_wt,Ot:_oxcMod7jlaoe_Ot,Ee:_oxcMod7jlaoe_Ee,he:_oxcMod7jlaoe_he,Ge:_oxcMod7jlaoe_Ge,B:_oxcMod7jlaoe_B,at:_oxcMod7jlaoe_at,tt:_oxcMod7jlaoe_tt,Ne:_oxcMod7jlaoe_Ne,zn:_oxcMod7jlaoe_zn,Gt:_oxcMod7jlaoe_Gt,Se:_oxcMod7jlaoe_Se,Fe:_oxcMod7jlaoe_Fe,Xe:_oxcMod7jlaoe_Xe,tn:_oxcMod7jlaoe_tn,ze:_oxcMod7jlaoe_ze,L:_oxcMod7jlaoe_L,Le:_oxcMod7jlaoe_Le,bt:_oxcMod7jlaoe_bt,ne:_oxcMod7jlaoe_ne,ir:_oxcMod7jlaoe_ir,qe:_oxcMod7jlaoe_qe,Qn:_oxcMod7jlaoe_Qn,je:_oxcMod7jlaoe_je,oe:_oxcMod7jlaoe_oe,ce:_oxcMod7jlaoe_ce,ae:_oxcMod7jlaoe_ae,y:_oxcMod7jlaoe_y,le:_oxcMod7jlaoe_le,yn:_oxcMod7jlaoe_yn,vn:_oxcMod7jlaoe_vn,_n:_oxcMod7jlaoe__n,gn:_oxcMod7jlaoe_gn,hn:_oxcMod7jlaoe_hn,mn:_oxcMod7jlaoe_mn,pn:_oxcMod7jlaoe_pn,fn:_oxcMod7jlaoe_fn,dn:_oxcMod7jlaoe_dn,un:_oxcMod7jlaoe_un,Ae:_oxcMod7jlaoe_Ae,de:_oxcMod7jlaoe_de,me:_oxcMod7jlaoe_me,on:_oxcMod7jlaoe_on,M:_oxcMod7jlaoe_M,R:_oxcMod7jlaoe_R,Rt:_oxcMod7jlaoe_Rt,_:_oxcMod7jlaoe__,It:_oxcMod7jlaoe_It,Ke:_oxcMod7jlaoe_Ke,v:_oxcMod7jlaoe_v,C:_oxcMod7jlaoe_C,Bn:_oxcMod7jlaoe_Bn,Re:_oxcMod7jlaoe_Re,S:_oxcMod7jlaoe_S,ln:_oxcMod7jlaoe_ln,ie:_oxcMod7jlaoe_ie,Wt:_oxcMod7jlaoe_Wt,Ut:_oxcMod7jlaoe_Ut,en:_oxcMod7jlaoe_en,K:_oxcMod7jlaoe_K,Lt:_oxcMod7jlaoe_Lt,Y:_oxcMod7jlaoe_Y,H:_oxcMod7jlaoe_H,an:_oxcMod7jlaoe_an,J:_oxcMod7jlaoe_J,Hn:_oxcMod7jlaoe_Hn,Vn:_oxcMod7jlaoe_Vn}=_oxcMod7jlaoe;export{_oxcMod7jlaoe_se as withoutNullable,_oxcMod7jlaoe_Oe as videoSizeToQuality,_oxcMod7jlaoe_ke as videoQualityToHeight,_oxcMod7jlaoe_De as videoHeightToQuality,_oxcMod7jlaoe_or as urlCanParsePolyfilled,_oxcMod7jlaoe_Ve as timeout,_oxcMod7jlaoe_Pe as timeCodeToString,_oxcMod7jlaoe_Ie as throttleFn,_oxcMod7jlaoe_$e as throttle,_oxcMod7jlaoe_pt as tap,_oxcMod7jlaoe_Dt as suppressAbort,_oxcMod7jlaoe_Jn as stringTrimStart,_oxcMod7jlaoe_Zn as stringTrimRight,_oxcMod7jlaoe_Xn as stringTrimLeft,_oxcMod7jlaoe_Yn as stringTrimEnd,_oxcMod7jlaoe_qn as stringReplaceAll,_oxcMod7jlaoe_Kn as stringPadStart,_oxcMod7jlaoe_Gn as stringPadEnd,_oxcMod7jlaoe_Wn as stringMatchAll,_oxcMod7jlaoe_Un as stringAt,_oxcMod7jlaoe_ht as skip,_oxcMod7jlaoe__t as shareReplay,_oxcMod7jlaoe_D as safeStorage,_oxcMod7jlaoe_rr as requestIdleCallbackPolyfilled,_oxcMod7jlaoe_An as promiseWithResolvers,_oxcMod7jlaoe_kn as promiseTry,_oxcMod7jlaoe_On as promiseFinally,_oxcMod7jlaoe_Dn as promiseAny,_oxcMod7jlaoe_En as promiseAllSettled,_oxcMod7jlaoe_dt as pairwise,_oxcMod7jlaoe_ut as once,_oxcMod7jlaoe_yt as observeElementSize,_oxcMod7jlaoe_We as observableFrom,_oxcMod7jlaoe_Tn as objectValues,_oxcMod7jlaoe_wn as objectHasOwn,_oxcMod7jlaoe_Sn as objectFromEntries,_oxcMod7jlaoe_xn as objectEntries,_oxcMod7jlaoe_pe as nowInt,_oxcMod7jlaoe_fe as now,_oxcMod7jlaoe_b as noop,_oxcMod7jlaoe_Be as merge,_oxcMod7jlaoe_lt as mapTo,_oxcMod7jlaoe_z as map,_oxcMod7jlaoe_Bt as loadVKLangPack,_oxcMod7jlaoe_xt as isValidURL,_oxcMod7jlaoe_T as isNullable,_oxcMod7jlaoe_w as isNonNullable,_oxcMod7jlaoe_Te as isLowerOrEqual,_oxcMod7jlaoe_P as isLower,_oxcMod7jlaoe_I as isInvariantQuality,_oxcMod7jlaoe_St as isIntersecting,_oxcMod7jlaoe_we as isHigherOrEqual,_oxcMod7jlaoe_Ce as isHigher,_oxcMod7jlaoe_ue as isBrowserWindow,_oxcMod7jlaoe_V as isAbortError,_oxcMod7jlaoe_He as interval,_oxcMod7jlaoe_Tt as interpolate,_oxcMod7jlaoe_ar as includesPolyfilled,_oxcMod7jlaoe_bn as globalThisPolyfill,_oxcMod7jlaoe_E as getWindow,_oxcMod7jlaoe_Me as getVideoQualityLabel,_oxcMod7jlaoe_kt as getTraceSubscriptionMethod,_oxcMod7jlaoe_Et as getRangeAroundIndex,_oxcMod7jlaoe_wt as getPlayerId,_oxcMod7jlaoe_Ot as getMessageFromError,_oxcMod7jlaoe_Ee as getHighestQuality,_oxcMod7jlaoe_he as getExponentialDelay,_oxcMod7jlaoe_Ge as fromEvent,_oxcMod7jlaoe_B as flattenObject,_oxcMod7jlaoe_at as filterChanged,_oxcMod7jlaoe_tt as filter,_oxcMod7jlaoe_Ne as fillWithDefault,_oxcMod7jlaoe_zn as fetchPolyfilled,_oxcMod7jlaoe_Gt as devNull,_oxcMod7jlaoe_Se as detectEmbed,_oxcMod7jlaoe_Fe as debounceFn,_oxcMod7jlaoe_Xe as debounce,_oxcMod7jlaoe_tn as createDIContainer,_oxcMod7jlaoe_ze as combine,_oxcMod7jlaoe_L as cloneDeepWith,_oxcMod7jlaoe_Le as cloneDeep,_oxcMod7jlaoe_bt as clearVideoElement,_oxcMod7jlaoe_ne as checkNever,_oxcMod7jlaoe_ir as cancelIdleCallbackPolyfilled,_oxcMod7jlaoe_qe as buffer,_oxcMod7jlaoe_Qn as atPolyfilled,_oxcMod7jlaoe_je as assertQualityIsExact,_oxcMod7jlaoe_oe as assertNullable,_oxcMod7jlaoe_ce as assertNotEmptyArray,_oxcMod7jlaoe_ae as assertNonNullable,_oxcMod7jlaoe_y as assertNever,_oxcMod7jlaoe_le as assertEmptyArray,_oxcMod7jlaoe_yn as arrayWith,_oxcMod7jlaoe_vn as arrayToSpliced,_oxcMod7jlaoe__n as arrayToSorted,_oxcMod7jlaoe_gn as arrayToReversed,_oxcMod7jlaoe_hn as arrayIncludes,_oxcMod7jlaoe_mn as arrayFlatMap,_oxcMod7jlaoe_pn as arrayFlat,_oxcMod7jlaoe_fn as arrayFindLastIndex,_oxcMod7jlaoe_dn as arrayFindLast,_oxcMod7jlaoe_un as arrayAt,_oxcMod7jlaoe_Ae as areQualitiesExact,_oxcMod7jlaoe_de as addScript,_oxcMod7jlaoe_me as abortable,_oxcMod7jlaoe_on as VolumeFaderPlugin,_oxcMod7jlaoe_M as VideoQuality,_oxcMod7jlaoe_R as ValueSubject,_oxcMod7jlaoe_Rt as VKNumericLanguage,_oxcMod7jlaoe__ as VERSION,_oxcMod7jlaoe_It as TracerFactory,_oxcMod7jlaoe_Ke as SubscriptionRemovable,_oxcMod7jlaoe_v as Subscription,_oxcMod7jlaoe_C as Subject,_oxcMod7jlaoe_Bn as RequestPolyfilled,_oxcMod7jlaoe_Re as ReplaySubject,_oxcMod7jlaoe_S as Observable,_oxcMod7jlaoe_ln as NormalizerPlugin,_oxcMod7jlaoe_ie as Logger,_oxcMod7jlaoe_Wt as InternalsExposure,_oxcMod7jlaoe_Ut as InterfaceLanguage,_oxcMod7jlaoe_en as InjectionToken,_oxcMod7jlaoe_K as INTERNAL_EXPOSE_GLOBAL_KEY,_oxcMod7jlaoe_Lt as ErrorCategory,_oxcMod7jlaoe_Y as EqualizerPlugin,_oxcMod7jlaoe_H as CircularBuffer,_oxcMod7jlaoe_an as AudioGraph,_oxcMod7jlaoe_J as AppTracer,_oxcMod7jlaoe_Hn as AbortSignalPolyfilled,_oxcMod7jlaoe_Vn as AbortControllerPolyfilled};