@vkontakte/videoplayer-shared 1.0.100-dev.065b3da4a.0 → 1.0.100-dev.3748d91d5.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 +3 -3
- package/es2015.esm.js +3 -3
- package/esnext.cjs +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +1 -1
- package/types/types/index.d.ts +7 -1
- package/types/utils/browser.d.ts +5 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/timers/WorkerTimersBackend.d.ts +28 -0
- package/types/utils/timers/index.d.ts +3 -0
- package/types/utils/timers/sharedTimers.d.ts +1 -0
- package/types/utils/timers/timers.d.ts +6 -0
- package/types/utils/timers/types.d.ts +30 -0
- package/types/utils/timers/worker.d.ts +28 -0
package/es2015.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.100-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.100-dev.3748d91d5.0
|
|
3
|
+
* Mon, 24 Aug 2026 11:14:18 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-100/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,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.100-dev.065b3da4a.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=>{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}};
|
|
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,ne=Object.prototype.hasOwnProperty;function g(e){return this[e]}var _=e=>{var t=(v??=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))ne.call(t,r)||h(t,r,{get:g.bind(e,r),enumerable:!(n=te(e,r))||n.enumerable});return v.set(e,t),t},v,re=e=>e;function ie(e,t){this[e]=re.bind(null,t)}var y=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:ie.bind(t,n)})},b={};y(b,{withoutNullable:()=>fe,videoSizeToQuality:()=>tt,videoQualityToHeight:()=>nt,videoHeightToQuality:()=>et,urlCanParsePolyfilled:()=>Br,timeout:()=>ht,timeCodeToString:()=>st,throttleFn:()=>lt,throttle:()=>Dt,tap:()=>Ht,suppressAbort:()=>an,stringTrimStart:()=>Or,stringTrimRight:()=>jr,stringTrimLeft:()=>Ar,stringTrimEnd:()=>kr,stringReplaceAll:()=>Dr,stringPadStart:()=>Er,stringPadEnd:()=>Tr,stringMatchAll:()=>wr,stringAt:()=>Cr,skip:()=>Wt,shareReplay:()=>Kt,safeStorage:()=>Be,retainTimers:()=>Pe,requestIdleCallbackPolyfilled:()=>Lr,releaseTimers:()=>Fe,promiseWithResolvers:()=>ur,promiseTry:()=>lr,promiseFinally:()=>cr,promiseAny:()=>sr,promiseAllSettled:()=>or,pairwise:()=>Bt,once:()=>zt,observeElementSize:()=>Jt,observableFrom:()=>vt,objectValues:()=>ar,objectHasOwn:()=>ir,objectFromEntries:()=>nr,objectEntries:()=>tr,nowInt:()=>_e,now:()=>k,noop:()=>C,merge:()=>mt,mapTo:()=>Rt,map:()=>It,loadVKLangPack:()=>xn,isValidURL:()=>Zt,isNullable:()=>D,isNonNullable:()=>E,isLowerOrEqual:()=>Ze,isLower:()=>V,isInvariantQuality:()=>H,isIntersecting:()=>Qt,isHigherOrEqual:()=>Xe,isHigher:()=>Ye,isBrowserWindow:()=>ge,isAbortError:()=>rn,interval:()=>gt,interpolate:()=>tn,includesPolyfilled:()=>zr,globalThisPolyfill:()=>er,getWindow:()=>O,getVideoQualityLabel:()=>at,getTraceSubscriptionMethod:()=>sn,getTimersDiagnostics:()=>Ie,getTimerWindow:()=>he,getRangeAroundIndex:()=>nn,getPlayerId:()=>en,getMessageFromError:()=>on,getHighestQuality:()=>Qe,getExponentialDelay:()=>ze,fromEvent:()=>yt,flattenObject:()=>Yt,filterChanged:()=>Nt,filter:()=>kt,fillWithDefault:()=>ot,fetchPolyfilled:()=>yr,devNull:()=>En,detectEmbed:()=>qe,debounceFn:()=>ct,debounce:()=>wt,createTimers:()=>Me,createDIContainer:()=>In,combine:()=>pt,cloneDeepWith:()=>U,cloneDeep:()=>ut,clearVideoElement:()=>Xt,checkNever:()=>oe,cancelIdleCallbackPolyfilled:()=>Rr,buffer:()=>xt,atPolyfilled:()=>Mr,assertQualityIsExact:()=>it,assertNullable:()=>de,assertNotEmptyArray:()=>pe,assertNonNullable:()=>ue,assertNever:()=>S,assertEmptyArray:()=>me,arrayWith:()=>$n,arrayToSpliced:()=>Qn,arrayToSorted:()=>Zn,arrayToReversed:()=>Xn,arrayIncludes:()=>Yn,arrayFlatMap:()=>Jn,arrayFlat:()=>qn,arrayFindLastIndex:()=>Kn,arrayFindLast:()=>Gn,arrayAt:()=>Wn,areQualitiesExact:()=>rt,addScript:()=>Le,abortable:()=>Re,WorkerState:()=>Se,VolumeFaderPlugin:()=>Bn,VideoQuality:()=>Je,ValueSubject:()=>ft,VKNumericLanguage:()=>yn,VERSION:()=>ae,TracerFactory:()=>gn,TimerModule:()=>xe,SubscriptionRemovable:()=>bt,Subscription:()=>x,Subject:()=>T,RequestPolyfilled:()=>br,ReplaySubject:()=>dt,Observable:()=>w,NormalizerPlugin:()=>Un,Logger:()=>le,InternalsExposure:()=>Tn,InterfaceLanguage:()=>wn,InjectionToken:()=>Fn,INTERNAL_EXPOSE_GLOBAL_KEY:()=>K,ErrorOrigin:()=>_n,ErrorCategory:()=>vn,EqualizerPlugin:()=>Y,CircularBuffer:()=>W,AudioGraph:()=>zn,AppTracer:()=>J,AbortSignalPolyfilled:()=>Sr,AbortControllerPolyfilled:()=>xr}),module.exports=_(b);var ae=`1.0.100-dev.3748d91d5.0`;class x{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 S=e=>{throw Error(`${e} is value of unexpected type`)},oe=e=>{},C=()=>{},se=e=>{throw console.error(e),e},ce=e=>{console.error(e)};class w{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?ce:se,r;r=t?typeof t==`function`?{next:t,error:C}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:C};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 x().add(()=>{switch(i.next=C,i.error=C,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return S(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class T extends w{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 x().add(()=>this.subscribers.delete(t))}}class le{constructor(){this.log$=new T,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 ue(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function de(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function E(e){return e!=null}function D(e){return e==null}var fe=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>E(t)));function pe(e,t){if(!e?.length)throw Error(t)}function me(e,t){if(e?.length)throw Error(t)}var O=()=>globalThis,he=()=>globalThis,ge=(e=O())=>!!(e.window&&e.screen),k=typeof O().performance?.now==`function`?()=>O().performance.now():()=>Date.now(),_e=()=>Math.trunc(k());function ve(){var e=self,t=new Map;e.onmessage=function(n){var r=n.data;if(r.type===`ping`){e.postMessage({type:`ready`});return}if(r.type===`set`){var i=r.id;r.repeat?t.set(i,{repeat:!0,handle:e.setInterval(function(){e.postMessage({type:`tick`,id:i})},r.delay)}):t.set(i,{repeat:!1,handle:e.setTimeout(function(){t.delete(i),e.postMessage({type:`tick`,id:i})},r.delay)});return}var a=t.get(r.id);a&&(a.repeat?e.clearInterval(a.handle):e.clearTimeout(a.handle),t.delete(r.id))}}var ye=()=>`'use strict';(${ve.toString()})();`;class be{constructor(e,t){this.worker=void 0,this.handlers=void 0,this.records=new Map,this.ticks=0,this.handleMessage=e=>{if(e.data.type===`ready`){this.handlers.onReady();return}let{id:t}=e.data,n=this.records.get(t);D(n)||(this.ticks++,n.repeat||this.records.delete(t),n.callback())},this.handleError=()=>{this.handlers.onFatalError(this.destroy())},this.worker=e,this.handlers=t,this.worker.onmessage=this.handleMessage,this.worker.onerror=this.handleError,this.worker.onmessageerror=this.handleError,this.postCommand({type:`ping`})}static create(e){let t=O();if(typeof t.Worker!=`function`||typeof t.Blob!=`function`||D(t.URL?.createObjectURL))return null;let n=t.URL.createObjectURL(new t.Blob([ye()],{type:`text/javascript`}));try{return new be(new t.Worker(n),e)}catch{return null}finally{t.URL.revokeObjectURL(n)}}get activeCount(){return this.records.size}get deliveredTicks(){return this.ticks}set(e,t,n,r){this.records.set(e,{callback:t,repeat:r,delay:n,startedAt:k()}),this.postCommand({type:`set`,id:e,delay:n,repeat:r})}clear(e){this.records.delete(e)&&this.postCommand({type:`clear`,id:e})}destroy(){let e=new Map(this.records);return this.records.clear(),this.worker.onmessage=null,this.worker.onerror=null,this.worker.onmessageerror=null,this.worker.terminate(),e}postCommand(e){this.worker.postMessage(e)}}var xe;(e=>{e.SHARED=`shared`,e.CORE=`core`,e.STATISTICS=`statistics`,e.INTERACTIVE=`interactive`,e.UI=`ui`,e.UI_TV=`ui-tv`})(xe||={});var Se;(e=>{e.IDLE=`idle`,e.STARTING=`starting`,e.READY=`ready`,e.FAILED=`failed`})(Se||={});var Ce=1,A=0,j=`idle`,M=null,N=new Map,P=new Set,we=e=>{let t=k();for(let[n,r]of e){let e=r.repeat?r.delay:Math.max(0,r.delay-(t-r.startedAt));ke(n,r.callback,e,r.repeat)}},Te=e=>{j=`failed`,M=null,we(e)},Ee=()=>{D(M)||(we(M.destroy()),M=null),j=`idle`},De=()=>{j===`idle`&&(j=`starting`,M=be.create({onReady:()=>{j=`ready`},onFatalError:Te}))},Oe=e=>P.has(e)?(De(),j===`ready`?M:null):null,ke=(e,t,n,r)=>{let i=he();r?N.set(e,{repeat:!0,nativeId:i.setInterval(t,n)}):N.set(e,{repeat:!1,nativeId:i.setTimeout(()=>{N.delete(e),t()},n)})},Ae=(e,t,n,r)=>{let i=Ce++,a=Oe(e);return D(a)?ke(i,t,n,r):a.set(i,t,n,r),i},je=e=>{if(D(e))return;let t=N.get(e);if(D(t)){M?.clear(e);return}N.delete(e);let n=he();t.repeat?n.clearInterval(t.nativeId):n.clearTimeout(t.nativeId)},Me=e=>({setTimeout:(t,n=0)=>Ae(e,t,n,!1),setInterval:(t,n=0)=>Ae(e,t,n,!0),clearTimeout:je,clearInterval:je}),Ne=e=>{P.clear(),e.forEach(e=>P.add(e)),P.size===0&&Ee()},Pe=e=>{A++,Ne(e)},Fe=()=>{A!==0&&(A--,A===0&&Ne([]))},Ie=()=>({workerModules:[...P],workerState:j,liveConsumers:A,activeWindowTimers:N.size,activeWorkerTimers:M?.activeCount??0,workerTicks:M?.deliveredTicks??0}),F=Me(`shared`),Le=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&F.clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=F.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)}),Re=(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}),ze=(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={};y(Be,{set:()=>Ue,remove:()=>Ge,isPersistent:()=>Ve,has:()=>We,get:()=>He,clear:()=>Ke});var I,L,R=`vk-videoplayer-dummy-key-${Math.random()}`,z=()=>{if(L!==void 0)return L;try{localStorage.setItem(R,`test`),localStorage.removeItem(R),L=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(R),L=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)L=2;else throw e}else throw e}return L===2&&(I=new Map),L},Ve=()=>z()===0,He=e=>{let t=z();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return I?.get(e);default:S(t)}},Ue=(e,t)=>{let n=z();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:I?.set(e,t);return;default:S(n)}},We=e=>{let t=z();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return I?.has(e)??!1;default:return S(t),!1}},Ge=e=>{let t=z();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:I?.delete(e);return;default:S(t)}},Ke=()=>{let e=z();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return I?.clear();default:S(e)}},qe=()=>{let e,t=[],n=O();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)}},Je;(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`})(Je||={});var B={"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}},Ye=(e,t)=>B[e].height>B[t].height,Xe=(e,t)=>B[e].height>=B[t].height,V=(e,t)=>B[e].height<B[t].height,Ze=(e,t)=>B[e].height<=B[t].height,Qe=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:V(e,t)?1:-1)[0],$e=Object.keys(B).sort((e,t)=>V(e,t)?-1:1),et=(e,t=.02)=>[...$e].find(n=>B[n].height*(1+t)>=e),tt=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return $e.find(e=>{let t=B[e];return t.width>=r&&t.height>=n})},nt=e=>B[e].height,H=e=>e===`Invariant quality`,rt=e=>e.every(e=>!H(e));function it(e){if(H(e))throw Error(`Expected exact quality`)}var at=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``}},ot=(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]=ot(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},st=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 ct(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof O().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&&O().cancelAnimationFrame(s),O().requestAnimationFrame(e)):F.setTimeout(e,t)}function ee(e){if(p){O().cancelAnimationFrame(e);return}F.clearTimeout(e)}function te(e){return l=e,s=h(_,t),u?m(e):o}function ne(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function g(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){let e=Date.now();if(g(e))return v(e);s=h(_,ne(e))}function v(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function re(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function ie(){return s===void 0?o:v(Date.now())}function y(){return s!==void 0}function b(...e){let n=Date.now(),a=g(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(_,t),m(c)}return s===void 0&&(s=h(_,t)),o}return b.cancel=re,b.flush=ie,b.pending=y,b}var lt=(e,t=0,n)=>ct(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),U=(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]=U(e[r],t):n[r]=e[r]}return n},ut=e=>U(e);class dt extends T{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 x().add(()=>this.subscribers.delete(t))}}class ft extends T{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 pt(e){return new w(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 x)})}function mt(...e){return new w(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new x))}var ht=e=>new w(t=>{let n=F.setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>F.clearTimeout(n)}),gt=e=>new w(t=>{let n=F.setInterval(()=>t.next(),e);return()=>{n&&=(F.clearInterval(n),void 0)}});function _t(e){return new w(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 vt=_t,yt=(e,t)=>new w(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class bt extends x{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function xt(e){return t=>new w(n=>t.subscribe(new St(n,e)))}class St{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 Ct={leading:!1,trailing:!0};function wt(e,t=Ct){return n=>new w(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,E(this.timeout)?F.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=F.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 Et={leading:!0,trailing:!1};function Dt(e,t=Et){return n=>new w(r=>n.subscribe(new Ot(r,e,t)))}class Ot{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,D(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=F.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 kt(e){return t=>new w(n=>t.subscribe(new At(n,e)))}class At{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 jt=(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)},Mt=(e,t)=>e instanceof Object&&t instanceof Object?jt(e,t):e===t;function Nt(e=Mt){return t=>new w(n=>t.subscribe(new Ft(n,e)))}var Pt={};class Ft{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=Pt,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===Pt||!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 It(e){return t=>new w(n=>t.subscribe(new Lt(n,e)))}class Lt{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 Rt(e){return It(()=>e)}function zt(){return e=>new w(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 Bt(){return e=>new w(t=>e.subscribe(new Vt(t)))}class Vt{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 Ht(e){return t=>new w(n=>t.subscribe(new Ut(n,e)))}class Ut{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 Wt(e){return t=>new w(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 Kt(e=0){return t=>{let n=0,r=new dt(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new w(e=>(n++,a(r.subscribe(e))))}}var qt=300,Jt=(e,t=qt)=>new w(n=>{let r=O(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!ge(r))return;let o=new r.ResizeObserver(lt(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),E(r)&&E(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),Yt=(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=Yt(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},Xt=e=>{e.innerHTML=``,e.removeAttribute(`src`),e.load()},Zt=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},Qt=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),$t=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),en=e=>e!==void 0&&e!==``?e:$t().toString();function tn(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 nn(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 rn=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),an=e=>{if(!rn(e))throw e};function on(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 W{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];E(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 sn=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?Yt(r):{value:r},n)},cn=(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 x,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;E(i)&&i>0&&(this.eventsBuffer=new W(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(D(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=>{E(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)=>F.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 D(this.span)||G.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){E(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},cn(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(cn(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(E(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 ln=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,un=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 W(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 W(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>F.setTimeout(()=>e(void 0),0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class dn extends G{constructor(e){super({name:`Root`,options:e}),this.attributes$=new ft(null),this.paused$=new ft(!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,ATTR_SERVICE_VERSION:f}=o,p=new(un(l))(new s({appToken:ln}));this.subscription.add(this.paused$.subscribe(e=>{e?p.pause():p.resume()}));let m=new c({resource:u({[d]:`videoplayer-sdk-web`,[f]:ae}),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()),cn(e)))}addSubscription(e){this.subscription.add(e)}}class fn{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new fn({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var pn=()=>!0,mn={level:0,filter:pn,name:`Noname Tracer`,outputMethod:`log`};class hn{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=pn,this.level=mn.level,this.outputMethod=mn.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??mn.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 hn({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)||O().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&O().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class gn{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new dn(t);case`debug`:return new hn;default:return new fn}}}var _n;(e=>{e.MediaError=`mediaError`,e.SegmentFetcher=`segment_fetcher`,e.SegmentAppend=`segment_append`,e.Hangup=`hangup`,e.Stall=`stall`})(_n||={});var vn;(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`})(vn||={});var yn;(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`})(yn||={});var bn=`vk.ru`,xn=function(){var e=p(function*(e,t,n){let r=new URL(`https://${bn}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),Sn(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),Sn=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Cn(n)])),Cn=e=>Array.isArray(e)?e[0]:e,wn;(e=>{e.RU=`ru`,e.EN=`en`})(wn||={});var K=`__vk_vp_internals_exposure`;class Tn{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 En={};y(En,{subscribe:()=>An,push:()=>kn,destroy:()=>On,create:()=>Dn});var q=new Map,Dn=(e,t)=>q.set(e,t??[]),On=e=>q.delete(e),kn=(e,t)=>{let n=q.get(e);n&&(typeof n==`function`?n(t):n.push(t))},An=(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)}},jn=e=>fe({id:e.id,message:e.message,category:e.category,data:Mn(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function Mn(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var Nn=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},Pn=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=O())==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 x,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}=qe();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=Nn(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),jn(e)),Pn()),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)||D(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});E(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:ln,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;E(J.loadPromise)||(J.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>F.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 Fn{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var In=()=>{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 Ln{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 Ln(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 zn{constructor(){this._ctx=null,this._masterGain=null,this._connections=new Map,this._contextEnabled=!1,this._boundBeforeDisable=new Set}static isSupported(){let e=O();return E(e.AudioContext??e.webkitAudioContext)}get context(){if(D(this._ctx)){let e=O(),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;D(this._masterGain)&&(this._masterGain=e.createGain(),this._masterGain.gain.value=1,this._masterGain.connect(e.destination))}}class Bn{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 Vn{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);D(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 Vn(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 Un{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 Wn=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},Gn=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},Kn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},qn=(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},Jn=(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},Yn=(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},Xn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},Zn=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},Qn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},$n=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},er=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),tr=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},nr=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},rr=Object.prototype.hasOwnProperty,ir=(e,t)=>rr.call(e,t),ar=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},or=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}))))},sr=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`))})})})},cr=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),lr=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},ur=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:dr,NativeAbortController:fr}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function pr(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 mr(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 hr{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 hr{constructor(){super(),this.listeners||hr.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=mr(e),n=pr(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 gr(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 _r(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!gr({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&&gr({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),vr=$?_r({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,yr=$?vr.fetch:Q.fetch,br=$?vr.Request:Q.Request,xr=$?Z:Q.AbortController,Sr=$?X:Q.AbortSignal,Cr=(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*wr(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 Tr=(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)},Er=(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},Dr=(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)},Or=e=>e.replace(/^\s+/,``),kr=e=>e.replace(/\s+$/,``),Ar=Or,jr=kr,Mr=(e,t)=>typeof e==`string`?Cr(e,t):Wn(e,t),Nr=(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)},Pr=e=>Q.clearTimeout(e),Fr=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),Ir=!Fr(Q.requestIdleCallback)||!Fr(Q.cancelIdleCallback),Lr=Ir?Nr:Q.requestIdleCallback,Rr=Ir?Pr:Q.cancelIdleCallback,zr=(e,t,n)=>typeof e==`string`?e.includes(t,n):Yn(e,t,n),Br=(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.100-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.100-dev.3748d91d5.0
|
|
3
|
+
* Mon, 24 Aug 2026 11:14:18 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-100/doc/
|
|
5
5
|
*/
|
|
6
|
-
var _oxcModbs06xn=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.100-dev.065b3da4a.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=>{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:_oxcModbs06xn_se,Oe:_oxcModbs06xn_Oe,ke:_oxcModbs06xn_ke,De:_oxcModbs06xn_De,or:_oxcModbs06xn_or,Ve:_oxcModbs06xn_Ve,Pe:_oxcModbs06xn_Pe,Ie:_oxcModbs06xn_Ie,$e:_oxcModbs06xn_$e,pt:_oxcModbs06xn_pt,Dt:_oxcModbs06xn_Dt,Jn:_oxcModbs06xn_Jn,Zn:_oxcModbs06xn_Zn,Xn:_oxcModbs06xn_Xn,Yn:_oxcModbs06xn_Yn,qn:_oxcModbs06xn_qn,Kn:_oxcModbs06xn_Kn,Gn:_oxcModbs06xn_Gn,Wn:_oxcModbs06xn_Wn,Un:_oxcModbs06xn_Un,ht:_oxcModbs06xn_ht,_t:_oxcModbs06xn__t,D:_oxcModbs06xn_D,rr:_oxcModbs06xn_rr,An:_oxcModbs06xn_An,kn:_oxcModbs06xn_kn,On:_oxcModbs06xn_On,Dn:_oxcModbs06xn_Dn,En:_oxcModbs06xn_En,dt:_oxcModbs06xn_dt,ut:_oxcModbs06xn_ut,yt:_oxcModbs06xn_yt,We:_oxcModbs06xn_We,Tn:_oxcModbs06xn_Tn,wn:_oxcModbs06xn_wn,Sn:_oxcModbs06xn_Sn,xn:_oxcModbs06xn_xn,pe:_oxcModbs06xn_pe,fe:_oxcModbs06xn_fe,b:_oxcModbs06xn_b,Be:_oxcModbs06xn_Be,lt:_oxcModbs06xn_lt,z:_oxcModbs06xn_z,Bt:_oxcModbs06xn_Bt,xt:_oxcModbs06xn_xt,T:_oxcModbs06xn_T,w:_oxcModbs06xn_w,Te:_oxcModbs06xn_Te,P:_oxcModbs06xn_P,I:_oxcModbs06xn_I,St:_oxcModbs06xn_St,we:_oxcModbs06xn_we,Ce:_oxcModbs06xn_Ce,ue:_oxcModbs06xn_ue,V:_oxcModbs06xn_V,He:_oxcModbs06xn_He,Tt:_oxcModbs06xn_Tt,ar:_oxcModbs06xn_ar,bn:_oxcModbs06xn_bn,E:_oxcModbs06xn_E,Me:_oxcModbs06xn_Me,kt:_oxcModbs06xn_kt,Et:_oxcModbs06xn_Et,wt:_oxcModbs06xn_wt,Ot:_oxcModbs06xn_Ot,Ee:_oxcModbs06xn_Ee,he:_oxcModbs06xn_he,Ge:_oxcModbs06xn_Ge,B:_oxcModbs06xn_B,at:_oxcModbs06xn_at,tt:_oxcModbs06xn_tt,Ne:_oxcModbs06xn_Ne,zn:_oxcModbs06xn_zn,Gt:_oxcModbs06xn_Gt,Se:_oxcModbs06xn_Se,Fe:_oxcModbs06xn_Fe,Xe:_oxcModbs06xn_Xe,tn:_oxcModbs06xn_tn,ze:_oxcModbs06xn_ze,L:_oxcModbs06xn_L,Le:_oxcModbs06xn_Le,bt:_oxcModbs06xn_bt,ne:_oxcModbs06xn_ne,ir:_oxcModbs06xn_ir,qe:_oxcModbs06xn_qe,Qn:_oxcModbs06xn_Qn,je:_oxcModbs06xn_je,oe:_oxcModbs06xn_oe,ce:_oxcModbs06xn_ce,ae:_oxcModbs06xn_ae,y:_oxcModbs06xn_y,le:_oxcModbs06xn_le,yn:_oxcModbs06xn_yn,vn:_oxcModbs06xn_vn,_n:_oxcModbs06xn__n,gn:_oxcModbs06xn_gn,hn:_oxcModbs06xn_hn,mn:_oxcModbs06xn_mn,pn:_oxcModbs06xn_pn,fn:_oxcModbs06xn_fn,dn:_oxcModbs06xn_dn,un:_oxcModbs06xn_un,Ae:_oxcModbs06xn_Ae,de:_oxcModbs06xn_de,me:_oxcModbs06xn_me,on:_oxcModbs06xn_on,M:_oxcModbs06xn_M,R:_oxcModbs06xn_R,Rt:_oxcModbs06xn_Rt,_:_oxcModbs06xn__,It:_oxcModbs06xn_It,Ke:_oxcModbs06xn_Ke,v:_oxcModbs06xn_v,C:_oxcModbs06xn_C,Bn:_oxcModbs06xn_Bn,Re:_oxcModbs06xn_Re,S:_oxcModbs06xn_S,ln:_oxcModbs06xn_ln,ie:_oxcModbs06xn_ie,Wt:_oxcModbs06xn_Wt,Ut:_oxcModbs06xn_Ut,en:_oxcModbs06xn_en,K:_oxcModbs06xn_K,Lt:_oxcModbs06xn_Lt,Y:_oxcModbs06xn_Y,H:_oxcModbs06xn_H,an:_oxcModbs06xn_an,J:_oxcModbs06xn_J,Hn:_oxcModbs06xn_Hn,Vn:_oxcModbs06xn_Vn}=_oxcModbs06xn;export{_oxcModbs06xn_se as withoutNullable,_oxcModbs06xn_Oe as videoSizeToQuality,_oxcModbs06xn_ke as videoQualityToHeight,_oxcModbs06xn_De as videoHeightToQuality,_oxcModbs06xn_or as urlCanParsePolyfilled,_oxcModbs06xn_Ve as timeout,_oxcModbs06xn_Pe as timeCodeToString,_oxcModbs06xn_Ie as throttleFn,_oxcModbs06xn_$e as throttle,_oxcModbs06xn_pt as tap,_oxcModbs06xn_Dt as suppressAbort,_oxcModbs06xn_Jn as stringTrimStart,_oxcModbs06xn_Zn as stringTrimRight,_oxcModbs06xn_Xn as stringTrimLeft,_oxcModbs06xn_Yn as stringTrimEnd,_oxcModbs06xn_qn as stringReplaceAll,_oxcModbs06xn_Kn as stringPadStart,_oxcModbs06xn_Gn as stringPadEnd,_oxcModbs06xn_Wn as stringMatchAll,_oxcModbs06xn_Un as stringAt,_oxcModbs06xn_ht as skip,_oxcModbs06xn__t as shareReplay,_oxcModbs06xn_D as safeStorage,_oxcModbs06xn_rr as requestIdleCallbackPolyfilled,_oxcModbs06xn_An as promiseWithResolvers,_oxcModbs06xn_kn as promiseTry,_oxcModbs06xn_On as promiseFinally,_oxcModbs06xn_Dn as promiseAny,_oxcModbs06xn_En as promiseAllSettled,_oxcModbs06xn_dt as pairwise,_oxcModbs06xn_ut as once,_oxcModbs06xn_yt as observeElementSize,_oxcModbs06xn_We as observableFrom,_oxcModbs06xn_Tn as objectValues,_oxcModbs06xn_wn as objectHasOwn,_oxcModbs06xn_Sn as objectFromEntries,_oxcModbs06xn_xn as objectEntries,_oxcModbs06xn_pe as nowInt,_oxcModbs06xn_fe as now,_oxcModbs06xn_b as noop,_oxcModbs06xn_Be as merge,_oxcModbs06xn_lt as mapTo,_oxcModbs06xn_z as map,_oxcModbs06xn_Bt as loadVKLangPack,_oxcModbs06xn_xt as isValidURL,_oxcModbs06xn_T as isNullable,_oxcModbs06xn_w as isNonNullable,_oxcModbs06xn_Te as isLowerOrEqual,_oxcModbs06xn_P as isLower,_oxcModbs06xn_I as isInvariantQuality,_oxcModbs06xn_St as isIntersecting,_oxcModbs06xn_we as isHigherOrEqual,_oxcModbs06xn_Ce as isHigher,_oxcModbs06xn_ue as isBrowserWindow,_oxcModbs06xn_V as isAbortError,_oxcModbs06xn_He as interval,_oxcModbs06xn_Tt as interpolate,_oxcModbs06xn_ar as includesPolyfilled,_oxcModbs06xn_bn as globalThisPolyfill,_oxcModbs06xn_E as getWindow,_oxcModbs06xn_Me as getVideoQualityLabel,_oxcModbs06xn_kt as getTraceSubscriptionMethod,_oxcModbs06xn_Et as getRangeAroundIndex,_oxcModbs06xn_wt as getPlayerId,_oxcModbs06xn_Ot as getMessageFromError,_oxcModbs06xn_Ee as getHighestQuality,_oxcModbs06xn_he as getExponentialDelay,_oxcModbs06xn_Ge as fromEvent,_oxcModbs06xn_B as flattenObject,_oxcModbs06xn_at as filterChanged,_oxcModbs06xn_tt as filter,_oxcModbs06xn_Ne as fillWithDefault,_oxcModbs06xn_zn as fetchPolyfilled,_oxcModbs06xn_Gt as devNull,_oxcModbs06xn_Se as detectEmbed,_oxcModbs06xn_Fe as debounceFn,_oxcModbs06xn_Xe as debounce,_oxcModbs06xn_tn as createDIContainer,_oxcModbs06xn_ze as combine,_oxcModbs06xn_L as cloneDeepWith,_oxcModbs06xn_Le as cloneDeep,_oxcModbs06xn_bt as clearVideoElement,_oxcModbs06xn_ne as checkNever,_oxcModbs06xn_ir as cancelIdleCallbackPolyfilled,_oxcModbs06xn_qe as buffer,_oxcModbs06xn_Qn as atPolyfilled,_oxcModbs06xn_je as assertQualityIsExact,_oxcModbs06xn_oe as assertNullable,_oxcModbs06xn_ce as assertNotEmptyArray,_oxcModbs06xn_ae as assertNonNullable,_oxcModbs06xn_y as assertNever,_oxcModbs06xn_le as assertEmptyArray,_oxcModbs06xn_yn as arrayWith,_oxcModbs06xn_vn as arrayToSpliced,_oxcModbs06xn__n as arrayToSorted,_oxcModbs06xn_gn as arrayToReversed,_oxcModbs06xn_hn as arrayIncludes,_oxcModbs06xn_mn as arrayFlatMap,_oxcModbs06xn_pn as arrayFlat,_oxcModbs06xn_fn as arrayFindLastIndex,_oxcModbs06xn_dn as arrayFindLast,_oxcModbs06xn_un as arrayAt,_oxcModbs06xn_Ae as areQualitiesExact,_oxcModbs06xn_de as addScript,_oxcModbs06xn_me as abortable,_oxcModbs06xn_on as VolumeFaderPlugin,_oxcModbs06xn_M as VideoQuality,_oxcModbs06xn_R as ValueSubject,_oxcModbs06xn_Rt as VKNumericLanguage,_oxcModbs06xn__ as VERSION,_oxcModbs06xn_It as TracerFactory,_oxcModbs06xn_Ke as SubscriptionRemovable,_oxcModbs06xn_v as Subscription,_oxcModbs06xn_C as Subject,_oxcModbs06xn_Bn as RequestPolyfilled,_oxcModbs06xn_Re as ReplaySubject,_oxcModbs06xn_S as Observable,_oxcModbs06xn_ln as NormalizerPlugin,_oxcModbs06xn_ie as Logger,_oxcModbs06xn_Wt as InternalsExposure,_oxcModbs06xn_Ut as InterfaceLanguage,_oxcModbs06xn_en as InjectionToken,_oxcModbs06xn_K as INTERNAL_EXPOSE_GLOBAL_KEY,_oxcModbs06xn_Lt as ErrorCategory,_oxcModbs06xn_Y as EqualizerPlugin,_oxcModbs06xn_H as CircularBuffer,_oxcModbs06xn_an as AudioGraph,_oxcModbs06xn_J as AppTracer,_oxcModbs06xn_Hn as AbortSignalPolyfilled,_oxcModbs06xn_Vn as AbortControllerPolyfilled};
|
|
6
|
+
var _oxcModgv06di=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.100-dev.3748d91d5.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,D=()=>globalThis,ue=(e=E())=>!!(e.window&&e.screen),O=typeof E().performance?.now==`function`?()=>E().performance.now():()=>Date.now(),de=()=>Math.trunc(O());function fe(){var e=self,t=new Map;e.onmessage=function(n){var r=n.data;if(r.type===`ping`){e.postMessage({type:`ready`});return}if(r.type===`set`){var i=r.id;r.repeat?t.set(i,{repeat:!0,handle:e.setInterval(function(){e.postMessage({type:`tick`,id:i})},r.delay)}):t.set(i,{repeat:!1,handle:e.setTimeout(function(){t.delete(i),e.postMessage({type:`tick`,id:i})},r.delay)});return}var a=t.get(r.id);a&&(a.repeat?e.clearInterval(a.handle):e.clearTimeout(a.handle),t.delete(r.id))}}var pe=()=>`'use strict';(${fe.toString()})();`;class me{constructor(e,t){this.worker=void 0,this.handlers=void 0,this.records=new Map,this.ticks=0,this.handleMessage=e=>{if(e.data.type===`ready`){this.handlers.onReady();return}let{id:t}=e.data,n=this.records.get(t);T(n)||(this.ticks++,n.repeat||this.records.delete(t),n.callback())},this.handleError=()=>{this.handlers.onFatalError(this.destroy())},this.worker=e,this.handlers=t,this.worker.onmessage=this.handleMessage,this.worker.onerror=this.handleError,this.worker.onmessageerror=this.handleError,this.postCommand({type:`ping`})}static create(e){let t=E();if(typeof t.Worker!=`function`||typeof t.Blob!=`function`||T(t.URL?.createObjectURL))return null;let n=t.URL.createObjectURL(new t.Blob([pe()],{type:`text/javascript`}));try{return new me(new t.Worker(n),e)}catch{return null}finally{t.URL.revokeObjectURL(n)}}get activeCount(){return this.records.size}get deliveredTicks(){return this.ticks}set(e,t,n,r){this.records.set(e,{callback:t,repeat:r,delay:n,startedAt:O()}),this.postCommand({type:`set`,id:e,delay:n,repeat:r})}clear(e){this.records.delete(e)&&this.postCommand({type:`clear`,id:e})}destroy(){let e=new Map(this.records);return this.records.clear(),this.worker.onmessage=null,this.worker.onerror=null,this.worker.onmessageerror=null,this.worker.terminate(),e}postCommand(e){this.worker.postMessage(e)}}var he;(e=>{e.SHARED=`shared`,e.CORE=`core`,e.STATISTICS=`statistics`,e.INTERACTIVE=`interactive`,e.UI=`ui`,e.UI_TV=`ui-tv`})(he||={});var ge;(e=>{e.IDLE=`idle`,e.STARTING=`starting`,e.READY=`ready`,e.FAILED=`failed`})(ge||={});var _e=1,k=0,A=`idle`,j=null,M=new Map,N=new Set,ve=e=>{let t=O();for(let[n,r]of e){let e=r.repeat?r.delay:Math.max(0,r.delay-(t-r.startedAt));Ce(n,r.callback,e,r.repeat)}},ye=e=>{A=`failed`,j=null,ve(e)},be=()=>{T(j)||(ve(j.destroy()),j=null),A=`idle`},xe=()=>{A===`idle`&&(A=`starting`,j=me.create({onReady:()=>{A=`ready`},onFatalError:ye}))},Se=e=>N.has(e)?(xe(),A===`ready`?j:null):null,Ce=(e,t,n,r)=>{let i=D();r?M.set(e,{repeat:!0,nativeId:i.setInterval(t,n)}):M.set(e,{repeat:!1,nativeId:i.setTimeout(()=>{M.delete(e),t()},n)})},we=(e,t,n,r)=>{let i=_e++,a=Se(e);return T(a)?Ce(i,t,n,r):a.set(i,t,n,r),i},Te=e=>{if(T(e))return;let t=M.get(e);if(T(t)){j?.clear(e);return}M.delete(e);let n=D();t.repeat?n.clearInterval(t.nativeId):n.clearTimeout(t.nativeId)},Ee=e=>({setTimeout:(t,n=0)=>we(e,t,n,!1),setInterval:(t,n=0)=>we(e,t,n,!0),clearTimeout:Te,clearInterval:Te}),De=e=>{N.clear(),e.forEach(e=>N.add(e)),N.size===0&&be()},Oe=e=>{k++,De(e)},ke=()=>{k!==0&&(k--,k===0&&De([]))},Ae=()=>({workerModules:[...N],workerState:A,liveConsumers:k,activeWindowTimers:M.size,activeWorkerTimers:j?.activeCount??0,workerTicks:j?.deliveredTicks??0}),P=Ee(`shared`),je=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&P.clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=P.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)}),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}),Ne=(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},Pe={};g(Pe,{set:()=>Le,remove:()=>ze,isPersistent:()=>Fe,has:()=>Re,get:()=>Ie,clear:()=>Be});var F,I,L=`vk-videoplayer-dummy-key-${Math.random()}`,R=()=>{if(I!==void 0)return I;try{localStorage.setItem(L,`test`),localStorage.removeItem(L),I=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(L),I=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)I=2;else throw e}else throw e}return I===2&&(F=new Map),I},Fe=()=>R()===0,Ie=e=>{let t=R();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return F?.get(e);default:y(t)}},Le=(e,t)=>{let n=R();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:F?.set(e,t);return;default:y(n)}},Re=e=>{let t=R();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return F?.has(e)??!1;default:return y(t),!1}},ze=e=>{let t=R();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:F?.delete(e);return;default:y(t)}},Be=()=>{let e=R();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return F?.clear();default:y(e)}},Ve=()=>{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)}},He;(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`})(He||={});var z={"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}},Ue=(e,t)=>z[e].height>z[t].height,We=(e,t)=>z[e].height>=z[t].height,B=(e,t)=>z[e].height<z[t].height,Ge=(e,t)=>z[e].height<=z[t].height,Ke=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:B(e,t)?1:-1)[0],qe=Object.keys(z).sort((e,t)=>B(e,t)?-1:1),Je=(e,t=.02)=>[...qe].find(n=>z[n].height*(1+t)>=e),Ye=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return qe.find(e=>{let t=z[e];return t.width>=r&&t.height>=n})},Xe=e=>z[e].height,V=e=>e===`Invariant quality`,Ze=e=>e.every(e=>!V(e));function Qe(e){if(V(e))throw Error(`Expected exact quality`)}var $e=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``}},et=(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]=et(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},tt=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 nt(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)):P.setTimeout(e,t)}function ee(e){if(p){E().cancelAnimationFrame(e);return}P.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 rt=(e,t=0,n)=>nt(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),H=(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]=H(e[r],t):n[r]=e[r]}return n},it=e=>H(e);class at 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 U 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 ot(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 st(...e){return new S(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new v))}var ct=e=>new S(t=>{let n=P.setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>P.clearTimeout(n)}),lt=e=>new S(t=>{let n=P.setInterval(()=>t.next(),e);return()=>{n&&=(P.clearInterval(n),void 0)}});function ut(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 dt=ut,ft=(e,t)=>new S(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class pt extends v{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function mt(e){return t=>new S(n=>t.subscribe(new ht(n,e)))}class ht{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 gt={leading:!1,trailing:!0};function _t(e,t=gt){return n=>new S(r=>n.subscribe(new vt(r,e,t)))}class vt{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,w(this.timeout)?P.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=P.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 yt={leading:!0,trailing:!1};function bt(e,t=yt){return n=>new S(r=>n.subscribe(new xt(r,e,t)))}class xt{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=P.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 St(e){return t=>new S(n=>t.subscribe(new Ct(n,e)))}class Ct{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 wt=(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)},Tt=(e,t)=>e instanceof Object&&t instanceof Object?wt(e,t):e===t;function Et(e=Tt){return t=>new S(n=>t.subscribe(new Ot(n,e)))}var Dt={};class Ot{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 kt(e){return t=>new S(n=>t.subscribe(new At(n,e)))}class At{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 jt(e){return kt(()=>e)}function Mt(){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 Nt(){return e=>new S(t=>e.subscribe(new Pt(t)))}class Pt{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 Ft(e){return t=>new S(n=>t.subscribe(new It(n,e)))}class It{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 Lt(e){return t=>new S(n=>t.subscribe(new Rt(n,e)))}class Rt{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 zt(e=0){return t=>{let n=0,r=new at(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new S(e=>(n++,a(r.subscribe(e))))}}var Bt=300,Vt=(e,t=Bt)=>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(rt(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()}),W=(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=W(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},Ht=e=>{e.innerHTML=``,e.removeAttribute(`src`),e.load()},Ut=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},Wt=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),Gt=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),Kt=e=>e!==void 0&&e!==``?e:Gt().toString();function qt(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 Yt=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Xt=e=>{if(!Yt(e))throw e};function Zt(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 G{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 Qt=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?W(r):{value:r},n)},$t=(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 K{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 G(i)),K.dynamicImportStatus===`not_started`&&(K.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=K.dynamicImportPromise.then(r=>{K.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}=K.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(K.dynamicImportStatus===`not_started`){K.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>P.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]);K.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},K.dynamicImportStatus=`completed`}catch{K.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return T(this.span)||K.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({},$t(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 K({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes($t(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)}}K.dynamicImportStatus=`not_started`,K.dynamicImports=void 0,K.dynamicImportPromise=void 0;var en=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,tn=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 G(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 G(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>P.setTimeout(()=>e(void 0),0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class nn extends K{constructor(e){super({name:`Root`,options:e}),this.attributes$=new U(null),this.paused$=new U(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=K.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d,ATTR_SERVICE_VERSION:f}=o,p=new(tn(l))(new s({appToken:en}));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()),$t(e)))}addSubscription(e){this.subscription.add(e)}}class rn{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new rn({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var an=()=>!0,on={level:0,filter:an,name:`Noname Tracer`,outputMethod:`log`};class sn{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=an,this.level=on.level,this.outputMethod=on.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??on.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 sn({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 cn{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new nn(t);case`debug`:return new sn;default:return new rn}}}var ln;(e=>{e.MediaError=`mediaError`,e.SegmentFetcher=`segment_fetcher`,e.SegmentAppend=`segment_append`,e.Hangup=`hangup`,e.Stall=`stall`})(ln||={});var un;(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`})(un||={});var dn;(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`})(dn||={});var fn=`vk.ru`,pn=function(){var e=p(function*(e,t,n){let r=new URL(`https://${fn}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),mn(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),mn=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),hn(n)])),hn=e=>Array.isArray(e)?e[0]:e,gn;(e=>{e.RU=`ru`,e.EN=`en`})(gn||={});var q=`__vk_vp_internals_exposure`;class _n{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 vn={};g(vn,{subscribe:()=>Sn,push:()=>xn,destroy:()=>bn,create:()=>yn});var J=new Map,yn=(e,t)=>J.set(e,t??[]),bn=e=>J.delete(e),xn=(e,t)=>{let n=J.get(e);n&&(typeof n==`function`?n(t):n.push(t))},Sn=(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)}},Cn=e=>se({id:e.id,message:e.message,category:e.category,data:wn(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function wn(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var Tn=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},En=()=>{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 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}=Ve();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=Tn(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),Cn(e)),En()),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:en,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)=>P.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 Dn{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var On=()=>{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 kn{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 An{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 kn(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 jn{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 An(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 Mn{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 Nn{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 X{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=X._sources.get(e);T(r)&&(r=new Map,X._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 Nn(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)}}X._sources=new WeakMap;var Pn=-14;class Fn{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??Pn)-e.lufs;this._gainNode.gain.value=10**(t/20)}}var In=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},Ln=(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},zn=(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},Bn=(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},Vn=(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},Un=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},Wn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},Gn=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},Kn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),qn=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},Jn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},Yn=Object.prototype.hasOwnProperty,Xn=(e,t)=>Yn.call(e,t),Zn=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},Qn=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}))))},$n=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`))})})})},er=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),tr=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},nr=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:rr,NativeAbortController:ir}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function ar(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 or(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 sr{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 cr extends sr{constructor(){super(),this.listeners||sr.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 cr,writable:!0,configurable:!0})}abort(e){let t=or(e),n=ar(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,cr.prototype[Symbol.toStringTag]=`AbortSignal`);function lr(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 ur(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!lr({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&&lr({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),dr=$?ur({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,fr=$?dr.fetch:Q.fetch,pr=$?dr.Request:Q.Request,mr=$?Z:Q.AbortController,hr=$?cr:Q.AbortSignal,gr=(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*_r(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 vr=(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)},yr=(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},br=(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)},xr=e=>e.replace(/^\s+/,``),Sr=e=>e.replace(/\s+$/,``),Cr=xr,wr=Sr,Tr=(e,t)=>typeof e==`string`?gr(e,t):In(e,t),Er=(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)},Dr=e=>Q.clearTimeout(e),Or=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),kr=!Or(Q.requestIdleCallback)||!Or(Q.cancelIdleCallback),Ar=kr?Er:Q.requestIdleCallback,jr=kr?Dr:Q.cancelIdleCallback,Mr=(e,t,n)=>typeof e==`string`?e.includes(t,n):Vn(e,t,n),Nr=(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,Ye,Xe,Je,Nr,ct,tt,rt,bt,Ft,Xt,xr,wr,Cr,Sr,br,yr,vr,_r,gr,Lt,zt,Pe,Oe,Ar,ke,nr,tr,er,$n,Qn,Nt,Mt,Vt,dt,Zn,Xn,Jn,qn,de,O,b,st,jt,kt,pn,Ut,T,w,Ge,B,V,Wt,We,Ue,ue,Yt,lt,qt,Mr,Kn,E,$e,Qt,Ae,D,Jt,Kt,Zt,Ke,Ne,ft,W,Et,St,et,fr,vn,Ve,nt,_t,Ee,On,ot,H,it,Ht,ne,jr,mt,Tr,Qe,oe,ce,ae,y,le,Gn,Wn,Un,Hn,Vn,Bn,zn,Rn,Ln,In,Ze,je,Me,ge,Mn,He,U,dn,_,cn,he,pt,v,C,pr,at,S,Fn,ie,_n,gn,Dn,q,ln,un,X,G,jn,Y,hr,mr};}();var{se:_oxcModgv06di_se,Ye:_oxcModgv06di_Ye,Xe:_oxcModgv06di_Xe,Je:_oxcModgv06di_Je,Nr:_oxcModgv06di_Nr,ct:_oxcModgv06di_ct,tt:_oxcModgv06di_tt,rt:_oxcModgv06di_rt,bt:_oxcModgv06di_bt,Ft:_oxcModgv06di_Ft,Xt:_oxcModgv06di_Xt,xr:_oxcModgv06di_xr,wr:_oxcModgv06di_wr,Cr:_oxcModgv06di_Cr,Sr:_oxcModgv06di_Sr,br:_oxcModgv06di_br,yr:_oxcModgv06di_yr,vr:_oxcModgv06di_vr,_r:_oxcModgv06di__r,gr:_oxcModgv06di_gr,Lt:_oxcModgv06di_Lt,zt:_oxcModgv06di_zt,Pe:_oxcModgv06di_Pe,Oe:_oxcModgv06di_Oe,Ar:_oxcModgv06di_Ar,ke:_oxcModgv06di_ke,nr:_oxcModgv06di_nr,tr:_oxcModgv06di_tr,er:_oxcModgv06di_er,$n:_oxcModgv06di_$n,Qn:_oxcModgv06di_Qn,Nt:_oxcModgv06di_Nt,Mt:_oxcModgv06di_Mt,Vt:_oxcModgv06di_Vt,dt:_oxcModgv06di_dt,Zn:_oxcModgv06di_Zn,Xn:_oxcModgv06di_Xn,Jn:_oxcModgv06di_Jn,qn:_oxcModgv06di_qn,de:_oxcModgv06di_de,O:_oxcModgv06di_O,b:_oxcModgv06di_b,st:_oxcModgv06di_st,jt:_oxcModgv06di_jt,kt:_oxcModgv06di_kt,pn:_oxcModgv06di_pn,Ut:_oxcModgv06di_Ut,T:_oxcModgv06di_T,w:_oxcModgv06di_w,Ge:_oxcModgv06di_Ge,B:_oxcModgv06di_B,V:_oxcModgv06di_V,Wt:_oxcModgv06di_Wt,We:_oxcModgv06di_We,Ue:_oxcModgv06di_Ue,ue:_oxcModgv06di_ue,Yt:_oxcModgv06di_Yt,lt:_oxcModgv06di_lt,qt:_oxcModgv06di_qt,Mr:_oxcModgv06di_Mr,Kn:_oxcModgv06di_Kn,E:_oxcModgv06di_E,$e:_oxcModgv06di_$e,Qt:_oxcModgv06di_Qt,Ae:_oxcModgv06di_Ae,D:_oxcModgv06di_D,Jt:_oxcModgv06di_Jt,Kt:_oxcModgv06di_Kt,Zt:_oxcModgv06di_Zt,Ke:_oxcModgv06di_Ke,Ne:_oxcModgv06di_Ne,ft:_oxcModgv06di_ft,W:_oxcModgv06di_W,Et:_oxcModgv06di_Et,St:_oxcModgv06di_St,et:_oxcModgv06di_et,fr:_oxcModgv06di_fr,vn:_oxcModgv06di_vn,Ve:_oxcModgv06di_Ve,nt:_oxcModgv06di_nt,_t:_oxcModgv06di__t,Ee:_oxcModgv06di_Ee,On:_oxcModgv06di_On,ot:_oxcModgv06di_ot,H:_oxcModgv06di_H,it:_oxcModgv06di_it,Ht:_oxcModgv06di_Ht,ne:_oxcModgv06di_ne,jr:_oxcModgv06di_jr,mt:_oxcModgv06di_mt,Tr:_oxcModgv06di_Tr,Qe:_oxcModgv06di_Qe,oe:_oxcModgv06di_oe,ce:_oxcModgv06di_ce,ae:_oxcModgv06di_ae,y:_oxcModgv06di_y,le:_oxcModgv06di_le,Gn:_oxcModgv06di_Gn,Wn:_oxcModgv06di_Wn,Un:_oxcModgv06di_Un,Hn:_oxcModgv06di_Hn,Vn:_oxcModgv06di_Vn,Bn:_oxcModgv06di_Bn,zn:_oxcModgv06di_zn,Rn:_oxcModgv06di_Rn,Ln:_oxcModgv06di_Ln,In:_oxcModgv06di_In,Ze:_oxcModgv06di_Ze,je:_oxcModgv06di_je,Me:_oxcModgv06di_Me,ge:_oxcModgv06di_ge,Mn:_oxcModgv06di_Mn,He:_oxcModgv06di_He,U:_oxcModgv06di_U,dn:_oxcModgv06di_dn,_:_oxcModgv06di__,cn:_oxcModgv06di_cn,he:_oxcModgv06di_he,pt:_oxcModgv06di_pt,v:_oxcModgv06di_v,C:_oxcModgv06di_C,pr:_oxcModgv06di_pr,at:_oxcModgv06di_at,S:_oxcModgv06di_S,Fn:_oxcModgv06di_Fn,ie:_oxcModgv06di_ie,_n:_oxcModgv06di__n,gn:_oxcModgv06di_gn,Dn:_oxcModgv06di_Dn,q:_oxcModgv06di_q,ln:_oxcModgv06di_ln,un:_oxcModgv06di_un,X:_oxcModgv06di_X,G:_oxcModgv06di_G,jn:_oxcModgv06di_jn,Y:_oxcModgv06di_Y,hr:_oxcModgv06di_hr,mr:_oxcModgv06di_mr}=_oxcModgv06di;export{_oxcModgv06di_se as withoutNullable,_oxcModgv06di_Ye as videoSizeToQuality,_oxcModgv06di_Xe as videoQualityToHeight,_oxcModgv06di_Je as videoHeightToQuality,_oxcModgv06di_Nr as urlCanParsePolyfilled,_oxcModgv06di_ct as timeout,_oxcModgv06di_tt as timeCodeToString,_oxcModgv06di_rt as throttleFn,_oxcModgv06di_bt as throttle,_oxcModgv06di_Ft as tap,_oxcModgv06di_Xt as suppressAbort,_oxcModgv06di_xr as stringTrimStart,_oxcModgv06di_wr as stringTrimRight,_oxcModgv06di_Cr as stringTrimLeft,_oxcModgv06di_Sr as stringTrimEnd,_oxcModgv06di_br as stringReplaceAll,_oxcModgv06di_yr as stringPadStart,_oxcModgv06di_vr as stringPadEnd,_oxcModgv06di__r as stringMatchAll,_oxcModgv06di_gr as stringAt,_oxcModgv06di_Lt as skip,_oxcModgv06di_zt as shareReplay,_oxcModgv06di_Pe as safeStorage,_oxcModgv06di_Oe as retainTimers,_oxcModgv06di_Ar as requestIdleCallbackPolyfilled,_oxcModgv06di_ke as releaseTimers,_oxcModgv06di_nr as promiseWithResolvers,_oxcModgv06di_tr as promiseTry,_oxcModgv06di_er as promiseFinally,_oxcModgv06di_$n as promiseAny,_oxcModgv06di_Qn as promiseAllSettled,_oxcModgv06di_Nt as pairwise,_oxcModgv06di_Mt as once,_oxcModgv06di_Vt as observeElementSize,_oxcModgv06di_dt as observableFrom,_oxcModgv06di_Zn as objectValues,_oxcModgv06di_Xn as objectHasOwn,_oxcModgv06di_Jn as objectFromEntries,_oxcModgv06di_qn as objectEntries,_oxcModgv06di_de as nowInt,_oxcModgv06di_O as now,_oxcModgv06di_b as noop,_oxcModgv06di_st as merge,_oxcModgv06di_jt as mapTo,_oxcModgv06di_kt as map,_oxcModgv06di_pn as loadVKLangPack,_oxcModgv06di_Ut as isValidURL,_oxcModgv06di_T as isNullable,_oxcModgv06di_w as isNonNullable,_oxcModgv06di_Ge as isLowerOrEqual,_oxcModgv06di_B as isLower,_oxcModgv06di_V as isInvariantQuality,_oxcModgv06di_Wt as isIntersecting,_oxcModgv06di_We as isHigherOrEqual,_oxcModgv06di_Ue as isHigher,_oxcModgv06di_ue as isBrowserWindow,_oxcModgv06di_Yt as isAbortError,_oxcModgv06di_lt as interval,_oxcModgv06di_qt as interpolate,_oxcModgv06di_Mr as includesPolyfilled,_oxcModgv06di_Kn as globalThisPolyfill,_oxcModgv06di_E as getWindow,_oxcModgv06di_$e as getVideoQualityLabel,_oxcModgv06di_Qt as getTraceSubscriptionMethod,_oxcModgv06di_Ae as getTimersDiagnostics,_oxcModgv06di_D as getTimerWindow,_oxcModgv06di_Jt as getRangeAroundIndex,_oxcModgv06di_Kt as getPlayerId,_oxcModgv06di_Zt as getMessageFromError,_oxcModgv06di_Ke as getHighestQuality,_oxcModgv06di_Ne as getExponentialDelay,_oxcModgv06di_ft as fromEvent,_oxcModgv06di_W as flattenObject,_oxcModgv06di_Et as filterChanged,_oxcModgv06di_St as filter,_oxcModgv06di_et as fillWithDefault,_oxcModgv06di_fr as fetchPolyfilled,_oxcModgv06di_vn as devNull,_oxcModgv06di_Ve as detectEmbed,_oxcModgv06di_nt as debounceFn,_oxcModgv06di__t as debounce,_oxcModgv06di_Ee as createTimers,_oxcModgv06di_On as createDIContainer,_oxcModgv06di_ot as combine,_oxcModgv06di_H as cloneDeepWith,_oxcModgv06di_it as cloneDeep,_oxcModgv06di_Ht as clearVideoElement,_oxcModgv06di_ne as checkNever,_oxcModgv06di_jr as cancelIdleCallbackPolyfilled,_oxcModgv06di_mt as buffer,_oxcModgv06di_Tr as atPolyfilled,_oxcModgv06di_Qe as assertQualityIsExact,_oxcModgv06di_oe as assertNullable,_oxcModgv06di_ce as assertNotEmptyArray,_oxcModgv06di_ae as assertNonNullable,_oxcModgv06di_y as assertNever,_oxcModgv06di_le as assertEmptyArray,_oxcModgv06di_Gn as arrayWith,_oxcModgv06di_Wn as arrayToSpliced,_oxcModgv06di_Un as arrayToSorted,_oxcModgv06di_Hn as arrayToReversed,_oxcModgv06di_Vn as arrayIncludes,_oxcModgv06di_Bn as arrayFlatMap,_oxcModgv06di_zn as arrayFlat,_oxcModgv06di_Rn as arrayFindLastIndex,_oxcModgv06di_Ln as arrayFindLast,_oxcModgv06di_In as arrayAt,_oxcModgv06di_Ze as areQualitiesExact,_oxcModgv06di_je as addScript,_oxcModgv06di_Me as abortable,_oxcModgv06di_ge as WorkerState,_oxcModgv06di_Mn as VolumeFaderPlugin,_oxcModgv06di_He as VideoQuality,_oxcModgv06di_U as ValueSubject,_oxcModgv06di_dn as VKNumericLanguage,_oxcModgv06di__ as VERSION,_oxcModgv06di_cn as TracerFactory,_oxcModgv06di_he as TimerModule,_oxcModgv06di_pt as SubscriptionRemovable,_oxcModgv06di_v as Subscription,_oxcModgv06di_C as Subject,_oxcModgv06di_pr as RequestPolyfilled,_oxcModgv06di_at as ReplaySubject,_oxcModgv06di_S as Observable,_oxcModgv06di_Fn as NormalizerPlugin,_oxcModgv06di_ie as Logger,_oxcModgv06di__n as InternalsExposure,_oxcModgv06di_gn as InterfaceLanguage,_oxcModgv06di_Dn as InjectionToken,_oxcModgv06di_q as INTERNAL_EXPOSE_GLOBAL_KEY,_oxcModgv06di_ln as ErrorOrigin,_oxcModgv06di_un as ErrorCategory,_oxcModgv06di_X as EqualizerPlugin,_oxcModgv06di_G as CircularBuffer,_oxcModgv06di_jn as AudioGraph,_oxcModgv06di_Y as AppTracer,_oxcModgv06di_hr as AbortSignalPolyfilled,_oxcModgv06di_mr as AbortControllerPolyfilled};
|