@vkontakte/videoplayer-shared 1.0.36-dev.2da9ea99.0 → 1.0.36-dev.a84e6475.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +3 -3
- package/es2015.esm.js +3 -3
- package/es2018.cjs.js +3 -3
- package/es2018.esm.js +3 -3
- package/esnext.cjs.js +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +7 -7
- package/types/Logger/Logger.d.ts +10 -0
- package/types/Logger/index.d.ts +2 -0
- package/types/Logger/types.d.ts +30 -0
- package/types/env.d.ts +1 -0
- package/types/index.d.ts +6 -0
- package/types/reactive/Observable.d.ts +7 -0
- package/types/reactive/Subject.d.ts +10 -0
- package/types/reactive/Subscription.d.ts +6 -0
- package/types/reactive/ValueSubject.d.ts +10 -0
- package/types/reactive/combine.d.ts +10 -0
- package/types/reactive/fromEvent.d.ts +7 -0
- package/types/reactive/index.d.ts +21 -0
- package/types/reactive/interval.d.ts +4 -0
- package/types/reactive/merge.d.ts +12 -0
- package/types/reactive/observableFrom.d.ts +3 -0
- package/types/reactive/operators/buffer.d.ts +2 -0
- package/types/reactive/operators/debounce.d.ts +6 -0
- package/types/reactive/operators/filter.d.ts +3 -0
- package/types/reactive/operators/filterChanged.d.ts +5 -0
- package/types/reactive/operators/map.d.ts +2 -0
- package/types/reactive/operators/mapTo.d.ts +2 -0
- package/types/reactive/operators/once.d.ts +5 -0
- package/types/reactive/operators/pairwise.d.ts +4 -0
- package/types/reactive/operators/tap.d.ts +2 -0
- package/types/reactive/operators/throttle.d.ts +5 -0
- package/types/reactive/timeout.d.ts +4 -0
- package/types/reactive/types.d.ts +29 -0
- package/types/translation/index.d.ts +2 -0
- package/types/translation/loadVKLangPack.d.ts +16 -0
- package/types/translation/types.d.ts +5 -0
- package/types/types/index.d.ts +53 -0
- package/types/utils/abortable.d.ts +3 -0
- package/types/utils/addScript.d.ts +1 -0
- package/types/utils/cloneDeep.d.ts +1 -0
- package/types/utils/cloneDeepWith.d.ts +3 -0
- package/types/utils/config.d.ts +2 -0
- package/types/utils/debounceFn.d.ts +13 -0
- package/types/utils/detectBrowser.d.ts +30 -0
- package/types/utils/detectEmbed.d.ts +4 -0
- package/types/utils/empty.d.ts +2 -0
- package/types/utils/exponentialBackoff.d.ts +9 -0
- package/types/utils/iframeSafeStorage.d.ts +6 -0
- package/types/utils/index.d.ts +22 -0
- package/types/utils/never.d.ts +2 -0
- package/types/utils/noop.d.ts +1 -0
- package/types/utils/now.d.ts +2 -0
- package/types/utils/nullable.d.ts +7 -0
- package/types/utils/observeElementSize.d.ts +3 -0
- package/types/utils/quality/index.d.ts +20 -0
- package/types/utils/quality/types.d.ts +21 -0
- package/types/utils/semanticTypes.d.ts +7 -0
- package/types/utils/throttleFn.d.ts +5 -0
- package/types/utils/timecode.d.ts +1 -0
- package/index.d.ts +0 -415
package/esnext.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.36-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.36-dev.a84e6475.0
|
|
3
|
+
* Mon, 17 Jun 2024 13:25:55 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const ie="1.0.36-dev.2da9ea99.0";class R{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const y=e=>{throw new Error(`${e} is value of unexpected type`)},se=e=>{},S=()=>{};class f{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:S}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:S,error:S};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new R().add(()=>{switch(s.next=S,s.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return y(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class I extends f{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new R().add(()=>this.subscribers.delete(n))}}class oe{log$=new I;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function ae(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ce(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function _(e){return typeof e<"u"&&e!==null}function z(e){return e==null}function le(e,t){if(!e?.length)throw new Error(t)}function ue(e,t){if(e?.length)throw new Error(t)}const de=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{l&&clearTimeout(l),c.removeEventListener("load",o),c.removeEventListener("error",i)};let l;n&&(l=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),fe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),he=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const N=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,n=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,r=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,s=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,o=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,a=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,l=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,b=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,h=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,m=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,v=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||exports.CurrentClientBrowser.Rest,device:l||c||b||h||v||m||exports.CurrentClientDevice.Desktop}},be=(e=!1)=>{const n=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(N().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},ge=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},we=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(N().device),me=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,pe=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var d;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(d||(d={}));let O,E;const P=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(E!==void 0)return E;try{localStorage.setItem(P,"test"),localStorage.removeItem(P),E=d.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(P),E=d.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=d.RUNTIME;else throw t}else throw e}return E===d.RUNTIME&&(O=new Map),E},Ee=()=>A()===d.LOCAL_STORAGE,ye=e=>{const t=A();switch(t){case d.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case d.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case d.RUNTIME:return O?.get(e);default:y(t)}},ve=(e,t)=>{const n=A();switch(n){case d.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.RUNTIME:return void O?.set(e,t);default:y(n)}},Se=e=>{const t=A();switch(t){case d.LOCAL_STORAGE:return e in localStorage;case d.SESSION_STORAGE:return e in sessionStorage;case d.RUNTIME:return O?.has(e)??!1;default:return y(t),!1}},Oe=e=>{const t=A();switch(t){case d.LOCAL_STORAGE:return localStorage.removeItem(e);case d.SESSION_STORAGE:return sessionStorage.removeItem(e);case d.RUNTIME:return void O?.delete(e);default:y(t)}},Ae=()=>{const e=A();switch(e){case d.LOCAL_STORAGE:return localStorage.clear();case d.SESSION_STORAGE:return sessionStorage.clear();case d.RUNTIME:return O?.clear();default:y(e)}};var xe=Object.freeze({__proto__:null,clear:Ae,get:ye,has:Se,isPersistent:Ee,remove:Oe,set:ve});const Re=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const g={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Le=(e,t)=>g[e].height>g[t].height,Ce=(e,t)=>g[e].height>=g[t].height,M=(e,t)=>g[e].height<g[t].height,Te=(e,t)=>g[e].height<=g[t].height,_e=e=>e.sort((t,n)=>t===n?0:t===exports.VideoQuality.INVARIANT?1:n===exports.VideoQuality.INVARIANT?-1:M(t,n)?1:-1)[0],B=Object.keys(g).sort((e,t)=>M(e,t)?-1:1),Pe=(e,t=.02)=>[...B].find(r=>g[r].height*(1+t)>=e),Ie=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return B.find(s=>{const i=g[s];return i.width>=r&&i.height>=n})},Ne=e=>g[e].height,D=e=>e===exports.VideoQuality.INVARIANT,Me=e=>e.every(t=>!D(t));function De(e){if(D(e))throw new Error("Expected exact quality")}const G=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=G(i,s):n[r]=r in e?i:s}return n},Qe=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function W(e,t=0,n){let r,s,i,o,a,l,c=0,b=!1,h=!1,m=!0;const v=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(b=!!n.leading,h="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,m="trailing"in n?!!n.trailing:m);function x(u){const w=r,p=s;return r=s=void 0,c=u,o=e.apply(p,w),o}function L(u,w){return v?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,w)}function J(u){if(v){window.cancelAnimationFrame(u);return}clearTimeout(u)}function Z(u){return c=u,a=L(C,t),b?x(u):o}function ee(u){const w=u-l,p=u-c,q=t-w;return h?Math.min(q,i-p):q}function k(u){const w=u-l,p=u-c;return l===void 0||w>=t||w<0||h&&p>=i}function C(){const u=Date.now();if(k(u))return F(u);a=L(C,ee(u))}function F(u){return a=void 0,m&&r?x(u):(r=s=void 0,o)}function te(){a!==void 0&&J(a),c=0,r=l=s=a=void 0}function ne(){return a===void 0?o:F(Date.now())}function re(){return a!==void 0}function T(...u){const w=Date.now(),p=k(w);if(r=u,s=this,l=w,p){if(a===void 0)return Z(l);if(h)return a=L(C,t),x(l)}return a===void 0&&(a=L(C,t)),o}return T.cancel=te,T.flush=ne,T.pending=re,T}const H=(e,t=0,n)=>W(e,t,{...{leading:!0,trailing:!0},...n,maxWait:t}),Q=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=Q(e[r],t):n[r]=e[r]}return n},Ve=e=>Q(e),ke=300,Fe=(e,t=ke)=>new f(n=>{const{width:r,height:s}=e.getBoundingClientRect();if(n.next({width:r,height:s}),!window.ResizeObserver)return;const i=new ResizeObserver(H(o=>{const a=o[0];if(!a)return;let l,c;a.contentBoxSize&&a.contentBoxSize[0]?(c=a.contentBoxSize[0].blockSize,l=a.contentBoxSize[0].inlineSize):a.contentRect&&(l=a.contentRect.width,c=a.contentRect.height),_(l)&&_(c)&&n.next({width:l,height:c})},t));return i.observe(e),()=>i.disconnect()});class qe extends I{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function je(e){return new f(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new R)})}function Ue(...e){return new f(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new R))}var ze=e=>new f(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),Be=e=>new f(t=>{let n=window.setInterval(()=>t.next(),e);return()=>{n&&(window.clearInterval(n),n=void 0)}}),Ge=e=>new f(t=>{e.forEach(n=>t.next(n))}),We=(e,t)=>new f(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function He(e){return t=>new f(n=>t.subscribe(new $e(n,e)))}class $e{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Ye={leading:!1,trailing:!0};function Ke(e,t=Ye){return n=>new f(r=>n.subscribe(new Xe(r,e,t)))}class Xe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,_(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Je={leading:!0,trailing:!1};function Ze(e,t=Je){return n=>new f(r=>n.subscribe(new et(r,e,t)))}class et{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,z(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function tt(e){return t=>new f(n=>t.subscribe(new nt(n,e)))}class nt{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function rt(e=(t,n)=>t===n){return t=>new f(n=>t.subscribe(new it(n,e)))}const j={};class it{destination;predicate;lastValue=j;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===j||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function $(e){return t=>new f(n=>t.subscribe(new st(n,e)))}let st=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function ot(e){return $(()=>e)}function at(){return e=>new f(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function ct(){return e=>new f(t=>e.subscribe(new lt(t)))}class lt{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function ut(e){return t=>new f(n=>t.subscribe(new dt(n,e)))}class dt{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf",e.FATAL="fatal"})(exports.ErrorCategory||(exports.ErrorCategory={}));class U{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class Y extends U{constructor(){super(),this.listeners||U.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ft{constructor(){Object.defineProperty(this,"signal",{value:new Y,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ft.prototype[Symbol.toStringTag]="AbortController",Y.prototype[Symbol.toStringTag]="AbortSignal");function K(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 ht(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!K({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,b){let h;b&&b.signal&&(h=b.signal,delete b.signal);const m=new n(c,b);return h&&Object.defineProperty(m,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),m},i.prototype=n.prototype);const o=t;return{fetch:(l,c)=>{const b=i&&i.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(b){let h;try{h=new DOMException("Aborted","AbortError")}catch{h=new Error("Aborted"),h.name="AbortError"}if(b.aborted)return Promise.reject(h);const m=new Promise((v,x)=>{b.addEventListener("abort",()=>x(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([m,o(l,c)])}return o(l,c)},Request:i}}const V=K({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),X=V?ht({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,bt=V?X.fetch:window.fetch;V?X.Request:window.Request;exports.VKNumericLanguage=void 0;(function(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"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const gt="vk.com",wt=async(e,t,n)=>{const r=new URL(`https://${gt}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await bt(r.toString())).json();return mt(i,n)},mt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),pt(r)])),pt=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=oe;exports.Observable=f;exports.Subject=I;exports.Subscription=R;exports.VERSION=ie;exports.ValueSubject=qe;exports.abortable=he;exports.addScript=de;exports.areQualitiesExact=Me;exports.assertEmptyArray=ue;exports.assertNever=y;exports.assertNonNullable=ae;exports.assertNotEmptyArray=le;exports.assertNullable=ce;exports.assertQualityIsExact=De;exports.buffer=He;exports.checkNever=se;exports.cloneDeep=Ve;exports.cloneDeepWith=Q;exports.combine=je;exports.debounce=Ke;exports.debounceFn=W;exports.detectEmbed=Re;exports.fillWithDefault=G;exports.filter=tt;exports.filterChanged=rt;exports.fromEvent=We;exports.getCurrentBrowser=N;exports.getExponentialDelay=pe;exports.getHighestQuality=_e;exports.getIOSVersion=ge;exports.interval=Be;exports.isHigher=Le;exports.isHigherOrEqual=Ce;exports.isIOS=be;exports.isInvariantQuality=D;exports.isLower=M;exports.isLowerOrEqual=Te;exports.isMacLike=we;exports.isMobile=me;exports.isNonNullable=_;exports.isNullable=z;exports.loadVKLangPack=wt;exports.map=$;exports.mapTo=ot;exports.merge=Ue;exports.noop=S;exports.now=fe;exports.observableFrom=Ge;exports.observeElementSize=Fe;exports.once=at;exports.pairwise=ct;exports.safeStorage=xe;exports.tap=ut;exports.throttle=Ze;exports.throttleFn=H;exports.timeCodeToString=Qe;exports.timeout=ze;exports.videoHeightToQuality=Pe;exports.videoQualityToHeight=Ne;exports.videoSizeToQuality=Ie;
|
|
6
|
+
"use strict";var ls=Object.create;var me=Object.defineProperty;var cs=Object.getOwnPropertyDescriptor;var fs=Object.getOwnPropertyNames;var ps=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var i=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),At=(e,r)=>{for(var t in r)me(e,t,{get:r[t],enumerable:!0})},_t=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of fs(r))!vs.call(e,o)&&o!==t&&me(e,o,{get:()=>r[o],enumerable:!(n=cs(r,o))||n.enumerable});return e};var bs=(e,r,t)=>(t=e!=null?ls(ps(e)):{},_t(r||!e||!e.__esModule?me(t,"default",{value:e,enumerable:!0}):t,e)),ds=e=>_t(me({},"__esModule",{value:!0}),e);var A=i((Hb,dn)=>{"use strict";dn.exports=function(e){try{return!!e()}catch{return!0}}});var ae=i((Xb,mn)=>{"use strict";var ws=A();mn.exports=!ws(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var C=i((Jb,hn)=>{"use strict";var Tn=ae(),yn=Function.prototype,xr=yn.call,qs=Tn&&yn.bind.bind(xr,xr);hn.exports=Tn?qs:function(e){return function(){return xr.apply(e,arguments)}}});var qe=i((Zb,In)=>{"use strict";var gn=C(),Rs=gn({}.toString),Ps=gn("".slice);In.exports=function(e){return Ps(Rs(e),8,-1)}});var xn=i((ed,On)=>{"use strict";var As=C(),_s=A(),Ls=qe(),Er=Object,Cs=As("".split);On.exports=_s(function(){return!Er("z").propertyIsEnumerable(0)})?function(e){return Ls(e)=="String"?Cs(e,""):Er(e)}:Er});var Re=i((rd,En)=>{"use strict";En.exports=function(e){return e==null}});var Sr=i((td,Sn)=>{"use strict";var Ns=Re(),js=TypeError;Sn.exports=function(e){if(Ns(e))throw js("Can't call method on "+e);return e}});var H=i((nd,wn)=>{"use strict";var Ms=xn(),ks=Sr();wn.exports=function(e){return Ms(ks(e))}});var Rn=i((od,qn)=>{"use strict";qn.exports=function(){}});var Q=i((id,Pn)=>{"use strict";Pn.exports={}});var S=i((An,_n)=>{"use strict";var Pe=function(e){return e&&e.Math==Math&&e};_n.exports=Pe(typeof globalThis=="object"&&globalThis)||Pe(typeof window=="object"&&window)||Pe(typeof self=="object"&&self)||Pe(typeof global=="object"&&global)||function(){return this}()||An||Function("return this")()});var qr=i((ad,Ln)=>{"use strict";var wr=typeof document=="object"&&document.all,Ds=typeof wr>"u"&&wr!==void 0;Ln.exports={all:wr,IS_HTMLDDA:Ds}});var O=i((sd,Nn)=>{"use strict";var Cn=qr(),Vs=Cn.all;Nn.exports=Cn.IS_HTMLDDA?function(e){return typeof e=="function"||e===Vs}:function(e){return typeof e=="function"}});var kn=i((ud,Mn)=>{"use strict";var Fs=S(),Us=O(),jn=Fs.WeakMap;Mn.exports=Us(jn)&&/native code/.test(String(jn))});var B=i((ld,Fn)=>{"use strict";var Dn=O(),Vn=qr(),Gs=Vn.all;Fn.exports=Vn.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Dn(e)||e===Gs}:function(e){return typeof e=="object"?e!==null:Dn(e)}});var N=i((cd,Un)=>{"use strict";var Qs=A();Un.exports=!Qs(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Pr=i((fd,Qn)=>{"use strict";var Bs=S(),Gn=B(),Rr=Bs.document,$s=Gn(Rr)&&Gn(Rr.createElement);Qn.exports=function(e){return $s?Rr.createElement(e):{}}});var Ar=i((pd,Bn)=>{"use strict";var Ws=N(),zs=A(),Ks=Pr();Bn.exports=!Ws&&!zs(function(){return Object.defineProperty(Ks("div"),"a",{get:function(){return 7}}).a!=7})});var _r=i((vd,$n)=>{"use strict";var Ys=N(),Hs=A();$n.exports=Ys&&Hs(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var D=i((bd,Wn)=>{"use strict";var Xs=B(),Js=String,Zs=TypeError;Wn.exports=function(e){if(Xs(e))return e;throw Zs(Js(e)+" is not an object")}});var V=i((dd,zn)=>{"use strict";var eu=ae(),Ae=Function.prototype.call;zn.exports=eu?Ae.bind(Ae):function(){return Ae.apply(Ae,arguments)}});var _e=i((md,Kn)=>{"use strict";Kn.exports={}});var Nr=i((Td,Hn)=>{"use strict";var Lr=_e(),Cr=S(),ru=O(),Yn=function(e){return ru(e)?e:void 0};Hn.exports=function(e,r){return arguments.length<2?Yn(Lr[e])||Yn(Cr[e]):Lr[e]&&Lr[e][r]||Cr[e]&&Cr[e][r]}});var jr=i((yd,Xn)=>{"use strict";var tu=C();Xn.exports=tu({}.isPrototypeOf)});var Zn=i((hd,Jn)=>{"use strict";Jn.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var ao=i((gd,io)=>{"use strict";var oo=S(),Mr=Zn(),eo=oo.process,ro=oo.Deno,to=eo&&eo.versions||ro&&ro.version,no=to&&to.v8,q,Le;no&&(q=no.split("."),Le=q[0]>0&&q[0]<4?1:+(q[0]+q[1]));!Le&&Mr&&(q=Mr.match(/Edge\/(\d+)/),(!q||q[1]>=74)&&(q=Mr.match(/Chrome\/(\d+)/),q&&(Le=+q[1])));io.exports=Le});var kr=i((Id,uo)=>{"use strict";var so=ao(),nu=A(),ou=S(),iu=ou.String;uo.exports=!!Object.getOwnPropertySymbols&&!nu(function(){var e=Symbol();return!iu(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&so&&so<41})});var Dr=i((Od,lo)=>{"use strict";var au=kr();lo.exports=au&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Vr=i((xd,co)=>{"use strict";var su=Nr(),uu=O(),lu=jr(),cu=Dr(),fu=Object;co.exports=cu?function(e){return typeof e=="symbol"}:function(e){var r=su("Symbol");return uu(r)&&lu(r.prototype,fu(e))}});var Ce=i((Ed,fo)=>{"use strict";var pu=String;fo.exports=function(e){try{return pu(e)}catch{return"Object"}}});var se=i((Sd,po)=>{"use strict";var vu=O(),bu=Ce(),du=TypeError;po.exports=function(e){if(vu(e))return e;throw du(bu(e)+" is not a function")}});var Ne=i((wd,vo)=>{"use strict";var mu=se(),Tu=Re();vo.exports=function(e,r){var t=e[r];return Tu(t)?void 0:mu(t)}});var mo=i((qd,bo)=>{"use strict";var Fr=V(),Ur=O(),Gr=B(),yu=TypeError;bo.exports=function(e,r){var t,n;if(r==="string"&&Ur(t=e.toString)&&!Gr(n=Fr(t,e))||Ur(t=e.valueOf)&&!Gr(n=Fr(t,e))||r!=="string"&&Ur(t=e.toString)&&!Gr(n=Fr(t,e)))return n;throw yu("Can't convert object to primitive value")}});var ue=i((Rd,To)=>{"use strict";To.exports=!0});var go=i((Pd,ho)=>{"use strict";var yo=S(),hu=Object.defineProperty;ho.exports=function(e,r){try{hu(yo,e,{value:r,configurable:!0,writable:!0})}catch{yo[e]=r}return r}});var Qr=i((Ad,Oo)=>{"use strict";var gu=S(),Iu=go(),Io="__core-js_shared__",Ou=gu[Io]||Iu(Io,{});Oo.exports=Ou});var Br=i((_d,Eo)=>{"use strict";var xu=ue(),xo=Qr();(Eo.exports=function(e,r){return xo[e]||(xo[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:xu?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var $r=i((Ld,So)=>{"use strict";var Eu=Sr(),Su=Object;So.exports=function(e){return Su(Eu(e))}});var j=i((Cd,wo)=>{"use strict";var wu=C(),qu=$r(),Ru=wu({}.hasOwnProperty);wo.exports=Object.hasOwn||function(r,t){return Ru(qu(r),t)}});var Wr=i((Nd,qo)=>{"use strict";var Pu=C(),Au=0,_u=Math.random(),Lu=Pu(1 .toString);qo.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Lu(++Au+_u,36)}});var _=i((jd,Po)=>{"use strict";var Cu=S(),Nu=Br(),Ro=j(),ju=Wr(),Mu=kr(),ku=Dr(),X=Cu.Symbol,zr=Nu("wks"),Du=ku?X.for||X:X&&X.withoutSetter||ju;Po.exports=function(e){return Ro(zr,e)||(zr[e]=Mu&&Ro(X,e)?X[e]:Du("Symbol."+e)),zr[e]}});var Co=i((Md,Lo)=>{"use strict";var Vu=V(),Ao=B(),_o=Vr(),Fu=Ne(),Uu=mo(),Gu=_(),Qu=TypeError,Bu=Gu("toPrimitive");Lo.exports=function(e,r){if(!Ao(e)||_o(e))return e;var t=Fu(e,Bu),n;if(t){if(r===void 0&&(r="default"),n=Vu(t,e,r),!Ao(n)||_o(n))return n;throw Qu("Can't convert object to primitive value")}return r===void 0&&(r="number"),Uu(e,r)}});var je=i((kd,No)=>{"use strict";var $u=Co(),Wu=Vr();No.exports=function(e){var r=$u(e,"string");return Wu(r)?r:r+""}});var J=i(Mo=>{"use strict";var zu=N(),Ku=Ar(),Yu=_r(),Me=D(),jo=je(),Hu=TypeError,Kr=Object.defineProperty,Xu=Object.getOwnPropertyDescriptor,Yr="enumerable",Hr="configurable",Xr="writable";Mo.f=zu?Yu?function(r,t,n){if(Me(r),t=jo(t),Me(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Xr in n&&!n[Xr]){var o=Xu(r,t);o&&o[Xr]&&(r[t]=n.value,n={configurable:Hr in n?n[Hr]:o[Hr],enumerable:Yr in n?n[Yr]:o[Yr],writable:!1})}return Kr(r,t,n)}:Kr:function(r,t,n){if(Me(r),t=jo(t),Me(n),Ku)try{return Kr(r,t,n)}catch{}if("get"in n||"set"in n)throw Hu("Accessors not supported");return"value"in n&&(r[t]=n.value),r}});var le=i((Vd,ko)=>{"use strict";ko.exports=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}});var $=i((Fd,Do)=>{"use strict";var Ju=N(),Zu=J(),el=le();Do.exports=Ju?function(e,r,t){return Zu.f(e,r,el(1,t))}:function(e,r,t){return e[r]=t,e}});var ke=i((Ud,Fo)=>{"use strict";var rl=Br(),tl=Wr(),Vo=rl("keys");Fo.exports=function(e){return Vo[e]||(Vo[e]=tl(e))}});var De=i((Gd,Uo)=>{"use strict";Uo.exports={}});var $o=i((Qd,Bo)=>{"use strict";var nl=kn(),Qo=S(),ol=B(),il=$(),Jr=j(),Zr=Qr(),al=ke(),sl=De(),Go="Object already initialized",et=Qo.TypeError,ul=Qo.WeakMap,Ve,ce,Fe,ll=function(e){return Fe(e)?ce(e):Ve(e,{})},cl=function(e){return function(r){var t;if(!ol(r)||(t=ce(r)).type!==e)throw et("Incompatible receiver, "+e+" required");return t}};nl||Zr.state?(R=Zr.state||(Zr.state=new ul),R.get=R.get,R.has=R.has,R.set=R.set,Ve=function(e,r){if(R.has(e))throw et(Go);return r.facade=e,R.set(e,r),r},ce=function(e){return R.get(e)||{}},Fe=function(e){return R.has(e)}):(W=al("state"),sl[W]=!0,Ve=function(e,r){if(Jr(e,W))throw et(Go);return r.facade=e,il(e,W,r),r},ce=function(e){return Jr(e,W)?e[W]:{}},Fe=function(e){return Jr(e,W)});var R,W;Bo.exports={set:Ve,get:ce,has:Fe,enforce:ll,getterFor:cl}});var Ho=i((Bd,Yo)=>{"use strict";var fl=ae(),Ko=Function.prototype,Wo=Ko.apply,zo=Ko.call;Yo.exports=typeof Reflect=="object"&&Reflect.apply||(fl?zo.bind(Wo):function(){return zo.apply(Wo,arguments)})});var rt=i(($d,Xo)=>{"use strict";var pl=qe(),vl=C();Xo.exports=function(e){if(pl(e)==="Function")return vl(e)}});var ri=i(ei=>{"use strict";var Jo={}.propertyIsEnumerable,Zo=Object.getOwnPropertyDescriptor,bl=Zo&&!Jo.call({1:2},1);ei.f=bl?function(r){var t=Zo(this,r);return!!t&&t.enumerable}:Jo});var oi=i(ni=>{"use strict";var dl=N(),ml=V(),Tl=ri(),yl=le(),hl=H(),gl=je(),Il=j(),Ol=Ar(),ti=Object.getOwnPropertyDescriptor;ni.f=dl?ti:function(r,t){if(r=hl(r),t=gl(t),Ol)try{return ti(r,t)}catch{}if(Il(r,t))return yl(!ml(Tl.f,r,t),r[t])}});var ai=i((Kd,ii)=>{"use strict";var xl=A(),El=O(),Sl=/#|\.prototype\./,fe=function(e,r){var t=ql[wl(e)];return t==Pl?!0:t==Rl?!1:El(r)?xl(r):!!r},wl=fe.normalize=function(e){return String(e).replace(Sl,".").toLowerCase()},ql=fe.data={},Rl=fe.NATIVE="N",Pl=fe.POLYFILL="P";ii.exports=fe});var tt=i((Yd,ui)=>{"use strict";var si=rt(),Al=se(),_l=ae(),Ll=si(si.bind);ui.exports=function(e,r){return Al(e),r===void 0?e:_l?Ll(e,r):function(){return e.apply(r,arguments)}}});var nt=i((Hd,ci)=>{"use strict";var Ue=S(),Cl=Ho(),Nl=rt(),jl=O(),Ml=oi().f,kl=ai(),Z=_e(),Dl=tt(),ee=$(),li=j(),Vl=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Cl(e,this,arguments)};return r.prototype=e.prototype,r};ci.exports=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,s=n?Ue:o?Ue[t]:(Ue[t]||{}).prototype,u=n?Z:Z[t]||ee(Z,t,{})[t],f=u.prototype,l,c,p,b,d,T,y,I,h;for(b in r)l=kl(n?b:t+(o?".":"#")+b,e.forced),c=!l&&s&&li(s,b),T=u[b],c&&(e.dontCallGetSet?(h=Ml(s,b),y=h&&h.value):y=s[b]),d=c&&y?y:r[b],!(c&&typeof T==typeof d)&&(e.bind&&c?I=Dl(d,Ue):e.wrap&&c?I=Vl(d):a&&jl(d)?I=Nl(d):I=d,(e.sham||d&&d.sham||T&&T.sham)&&ee(I,"sham",!0),ee(u,b,I),a&&(p=t+"Prototype",li(Z,p)||ee(Z,p,{}),ee(Z[p],b,d),e.real&&f&&(l||!f[b])&&ee(f,b,d)))}});var vi=i((Xd,pi)=>{"use strict";var ot=N(),Fl=j(),fi=Function.prototype,Ul=ot&&Object.getOwnPropertyDescriptor,it=Fl(fi,"name"),Gl=it&&function(){}.name==="something",Ql=it&&(!ot||ot&&Ul(fi,"name").configurable);pi.exports={EXISTS:it,PROPER:Gl,CONFIGURABLE:Ql}});var di=i((Jd,bi)=>{"use strict";var Bl=Math.ceil,$l=Math.floor;bi.exports=Math.trunc||function(r){var t=+r;return(t>0?$l:Bl)(t)}});var at=i((Zd,mi)=>{"use strict";var Wl=di();mi.exports=function(e){var r=+e;return r!==r||r===0?0:Wl(r)}});var yi=i((em,Ti)=>{"use strict";var zl=at(),Kl=Math.max,Yl=Math.min;Ti.exports=function(e,r){var t=zl(e);return t<0?Kl(t+r,0):Yl(t,r)}});var gi=i((rm,hi)=>{"use strict";var Hl=at(),Xl=Math.min;hi.exports=function(e){return e>0?Xl(Hl(e),9007199254740991):0}});var st=i((tm,Ii)=>{"use strict";var Jl=gi();Ii.exports=function(e){return Jl(e.length)}});var Ei=i((nm,xi)=>{"use strict";var Zl=H(),ec=yi(),rc=st(),Oi=function(e){return function(r,t,n){var o=Zl(r),a=rc(o),s=ec(n,a),u;if(e&&t!=t){for(;a>s;)if(u=o[s++],u!=u)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===t)return e||s||0;return!e&&-1}};xi.exports={includes:Oi(!0),indexOf:Oi(!1)}});var qi=i((om,wi)=>{"use strict";var tc=C(),ut=j(),nc=H(),oc=Ei().indexOf,ic=De(),Si=tc([].push);wi.exports=function(e,r){var t=nc(e),n=0,o=[],a;for(a in t)!ut(ic,a)&&ut(t,a)&&Si(o,a);for(;r.length>n;)ut(t,a=r[n++])&&(~oc(o,a)||Si(o,a));return o}});var lt=i((im,Ri)=>{"use strict";Ri.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Ai=i((am,Pi)=>{"use strict";var ac=qi(),sc=lt();Pi.exports=Object.keys||function(r){return ac(r,sc)}});var Li=i(_i=>{"use strict";var uc=N(),lc=_r(),cc=J(),fc=D(),pc=H(),vc=Ai();_i.f=uc&&!lc?Object.defineProperties:function(r,t){fc(r);for(var n=pc(t),o=vc(t),a=o.length,s=0,u;a>s;)cc.f(r,u=o[s++],n[u]);return r}});var Ni=i((um,Ci)=>{"use strict";var bc=Nr();Ci.exports=bc("document","documentElement")});var vt=i((lm,Ui)=>{"use strict";var dc=D(),mc=Li(),ji=lt(),Tc=De(),yc=Ni(),hc=Pr(),gc=ke(),Mi=">",ki="<",ft="prototype",pt="script",Vi=gc("IE_PROTO"),ct=function(){},Fi=function(e){return ki+pt+Mi+e+ki+"/"+pt+Mi},Di=function(e){e.write(Fi("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ic=function(){var e=hc("iframe"),r="java"+pt+":",t;return e.style.display="none",yc.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Fi("document.F=Object")),t.close(),t.F},Ge,Qe=function(){try{Ge=new ActiveXObject("htmlfile")}catch{}Qe=typeof document<"u"?document.domain&&Ge?Di(Ge):Ic():Di(Ge);for(var e=ji.length;e--;)delete Qe[ft][ji[e]];return Qe()};Tc[Vi]=!0;Ui.exports=Object.create||function(r,t){var n;return r!==null?(ct[ft]=dc(r),n=new ct,ct[ft]=null,n[Vi]=r):n=Qe(),t===void 0?n:mc.f(n,t)}});var Qi=i((cm,Gi)=>{"use strict";var Oc=A();Gi.exports=!Oc(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var dt=i((fm,$i)=>{"use strict";var xc=j(),Ec=O(),Sc=$r(),wc=ke(),qc=Qi(),Bi=wc("IE_PROTO"),bt=Object,Rc=bt.prototype;$i.exports=qc?bt.getPrototypeOf:function(e){var r=Sc(e);if(xc(r,Bi))return r[Bi];var t=r.constructor;return Ec(t)&&r instanceof t?t.prototype:r instanceof bt?Rc:null}});var mt=i((pm,Wi)=>{"use strict";var Pc=$();Wi.exports=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Pc(e,r,t),e}});var gt=i((vm,Yi)=>{"use strict";var Ac=A(),_c=O(),Lc=B(),Cc=vt(),zi=dt(),Nc=mt(),jc=_(),Mc=ue(),ht=jc("iterator"),Ki=!1,M,Tt,yt;[].keys&&(yt=[].keys(),"next"in yt?(Tt=zi(zi(yt)),Tt!==Object.prototype&&(M=Tt)):Ki=!0);var kc=!Lc(M)||Ac(function(){var e={};return M[ht].call(e)!==e});kc?M={}:Mc&&(M=Cc(M));_c(M[ht])||Nc(M,ht,function(){return this});Yi.exports={IteratorPrototype:M,BUGGY_SAFARI_ITERATORS:Ki}});var Be=i((bm,Xi)=>{"use strict";var Dc=_(),Vc=Dc("toStringTag"),Hi={};Hi[Vc]="z";Xi.exports=String(Hi)==="[object z]"});var We=i((dm,Ji)=>{"use strict";var Fc=Be(),Uc=O(),$e=qe(),Gc=_(),Qc=Gc("toStringTag"),Bc=Object,$c=$e(function(){return arguments}())=="Arguments",Wc=function(e,r){try{return e[r]}catch{}};Ji.exports=Fc?$e:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Wc(r=Bc(e),Qc))=="string"?t:$c?$e(r):(n=$e(r))=="Object"&&Uc(r.callee)?"Arguments":n}});var ea=i((mm,Zi)=>{"use strict";var zc=Be(),Kc=We();Zi.exports=zc?{}.toString:function(){return"[object "+Kc(this)+"]"}});var It=i((Tm,ta)=>{"use strict";var Yc=Be(),Hc=J().f,Xc=$(),Jc=j(),Zc=ea(),ef=_(),ra=ef("toStringTag");ta.exports=function(e,r,t,n){if(e){var o=t?e:e.prototype;Jc(o,ra)||Hc(o,ra,{configurable:!0,value:r}),n&&!Yc&&Xc(o,"toString",Zc)}}});var oa=i((ym,na)=>{"use strict";var rf=gt().IteratorPrototype,tf=vt(),nf=le(),of=It(),af=Q(),sf=function(){return this};na.exports=function(e,r,t,n){var o=r+" Iterator";return e.prototype=tf(rf,{next:nf(+!n,t)}),of(e,o,!1,!0),af[o]=sf,e}});var aa=i((hm,ia)=>{"use strict";var uf=C(),lf=se();ia.exports=function(e,r,t){try{return uf(lf(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}}});var ua=i((gm,sa)=>{"use strict";var cf=O(),ff=String,pf=TypeError;sa.exports=function(e){if(typeof e=="object"||cf(e))return e;throw pf("Can't set "+ff(e)+" as a prototype")}});var ca=i((Im,la)=>{"use strict";var vf=aa(),bf=D(),df=ua();la.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=vf(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(o,a){return bf(o),df(a),e?t(o,a):o.__proto__=a,o}}():void 0)});var Ia=i((Om,ga)=>{"use strict";var mf=nt(),Tf=V(),ze=ue(),ya=vi(),yf=O(),hf=oa(),fa=dt(),pa=ca(),gf=It(),If=$(),Ot=mt(),Of=_(),va=Q(),ha=gt(),xf=ya.PROPER,Ef=ya.CONFIGURABLE,ba=ha.IteratorPrototype,Ke=ha.BUGGY_SAFARI_ITERATORS,pe=Of("iterator"),da="keys",ve="values",ma="entries",Ta=function(){return this};ga.exports=function(e,r,t,n,o,a,s){hf(t,r,n);var u=function(h){if(h===o&&b)return b;if(!Ke&&h in c)return c[h];switch(h){case da:return function(){return new t(this,h)};case ve:return function(){return new t(this,h)};case ma:return function(){return new t(this,h)}}return function(){return new t(this)}},f=r+" Iterator",l=!1,c=e.prototype,p=c[pe]||c["@@iterator"]||o&&c[o],b=!Ke&&p||u(o),d=r=="Array"&&c.entries||p,T,y,I;if(d&&(T=fa(d.call(new e)),T!==Object.prototype&&T.next&&(!ze&&fa(T)!==ba&&(pa?pa(T,ba):yf(T[pe])||Ot(T,pe,Ta)),gf(T,f,!0,!0),ze&&(va[f]=Ta))),xf&&o==ve&&p&&p.name!==ve&&(!ze&&Ef?If(c,"name",ve):(l=!0,b=function(){return Tf(p,this)})),o)if(y={values:u(ve),keys:a?b:u(da),entries:u(ma)},s)for(I in y)(Ke||l||!(I in c))&&Ot(c,I,y[I]);else mf({target:r,proto:!0,forced:Ke||l},y);return(!ze||s)&&c[pe]!==b&&Ot(c,pe,b,{name:o}),va[r]=b,y}});var xa=i((xm,Oa)=>{"use strict";Oa.exports=function(e,r){return{value:e,done:r}}});var Et=i((Em,Ra)=>{"use strict";var Sf=H(),xt=Rn(),Ea=Q(),wa=$o(),wf=J().f,qf=Ia(),Ye=xa(),Rf=ue(),Pf=N(),qa="Array Iterator",Af=wa.set,_f=wa.getterFor(qa);Ra.exports=qf(Array,"Array",function(e,r){Af(this,{type:qa,target:Sf(e),index:0,kind:r})},function(){var e=_f(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,Ye(void 0,!0)):t=="keys"?Ye(n,!1):t=="values"?Ye(r[n],!1):Ye([n,r[n]],!1)},"values");var Sa=Ea.Arguments=Ea.Array;xt("keys");xt("values");xt("entries");if(!Rf&&Pf&&Sa.name!=="values")try{wf(Sa,"name",{value:"values"})}catch{}});var Aa=i((Sm,Pa)=>{"use strict";var Lf=_(),Cf=Q(),Nf=Lf("iterator"),jf=Array.prototype;Pa.exports=function(e){return e!==void 0&&(Cf.Array===e||jf[Nf]===e)}});var St=i((wm,La)=>{"use strict";var Mf=We(),_a=Ne(),kf=Re(),Df=Q(),Vf=_(),Ff=Vf("iterator");La.exports=function(e){if(!kf(e))return _a(e,Ff)||_a(e,"@@iterator")||Df[Mf(e)]}});var Na=i((qm,Ca)=>{"use strict";var Uf=V(),Gf=se(),Qf=D(),Bf=Ce(),$f=St(),Wf=TypeError;Ca.exports=function(e,r){var t=arguments.length<2?$f(e):r;if(Gf(t))return Qf(Uf(t,e));throw Wf(Bf(e)+" is not iterable")}});var ka=i((Rm,Ma)=>{"use strict";var zf=V(),ja=D(),Kf=Ne();Ma.exports=function(e,r,t){var n,o;ja(e);try{if(n=Kf(e,"return"),!n){if(r==="throw")throw t;return t}n=zf(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ja(n),t}});var Ga=i((Pm,Ua)=>{"use strict";var Yf=tt(),Hf=V(),Xf=D(),Jf=Ce(),Zf=Aa(),ep=st(),Da=jr(),rp=Na(),tp=St(),Va=ka(),np=TypeError,He=function(e,r){this.stopped=e,this.result=r},Fa=He.prototype;Ua.exports=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),u=!!(t&&t.INTERRUPTED),f=Yf(r,n),l,c,p,b,d,T,y,I=function(g){return l&&Va(l,"normal",g),new He(!0,g)},h=function(g){return o?(Xf(g),u?f(g[0],g[1],I):f(g[0],g[1])):u?f(g,I):f(g)};if(a)l=e.iterator;else if(s)l=e;else{if(c=tp(e),!c)throw np(Jf(e)+" is not iterable");if(Zf(c)){for(p=0,b=ep(e);b>p;p++)if(d=h(e[p]),d&&Da(Fa,d))return d;return new He(!1)}l=rp(e,c)}for(T=a?e.next:l.next;!(y=Hf(T,l)).done;){try{d=h(y.value)}catch(g){Va(l,"throw",g)}if(typeof d=="object"&&d&&Da(Fa,d))return d}return new He(!1)}});var Ba=i((Am,Qa)=>{"use strict";var op=je(),ip=J(),ap=le();Qa.exports=function(e,r,t){var n=op(r);n in e?ip.f(e,n,ap(0,t)):e[n]=t}});var $a=i(()=>{"use strict";var sp=nt(),up=Ga(),lp=Ba();sp({target:"Object",stat:!0},{fromEntries:function(r){var t={};return up(r,function(n,o){lp(t,n,o)},{AS_ENTRIES:!0}),t}})});var za=i((Cm,Wa)=>{"use strict";Et();$a();var cp=_e();Wa.exports=cp.Object.fromEntries});var Ya=i((Nm,Ka)=>{"use strict";Ka.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var Ja=i(()=>{"use strict";Et();var fp=Ya(),pp=S(),vp=We(),bp=$(),Ha=Q(),dp=_(),Xa=dp("toStringTag");for(Xe in fp)wt=pp[Xe],Je=wt&&wt.prototype,Je&&vp(Je)!==Xa&&bp(Je,Xa,Xe),Ha[Xe]=Ha.Array;var wt,Je,Xe});var es=i((km,Za)=>{"use strict";var mp=za();Ja();Za.exports=mp});var ts=i((Dm,rs)=>{"use strict";var Tp=es();rs.exports=Tp});var Op={};At(Op,{CurrentClientBrowser:()=>Ze,CurrentClientDevice:()=>er,ErrorCategory:()=>pn,InterfaceLanguage:()=>is,Logger:()=>Te,Observable:()=>v,Subject:()=>L,Subscription:()=>x,VERSION:()=>Lt,VKNumericLanguage:()=>os,ValueSubject:()=>te,VideoQuality:()=>ge,abortable:()=>Ft,addScript:()=>Dt,areQualitiesExact:()=>rn,assertEmptyArray:()=>kt,assertNever:()=>P,assertNonNullable:()=>Nt,assertNotEmptyArray:()=>Mt,assertNullable:()=>jt,assertQualityIsExact:()=>tn,buffer:()=>ar,checkNever:()=>Ct,cloneDeep:()=>on,cloneDeepWith:()=>re,combine:()=>nr,debounce:()=>ur,debounceFn:()=>xe,detectEmbed:()=>Wt,fillWithDefault:()=>nn,filter:()=>pr,filterChanged:()=>br,fromEvent:()=>cn,getCurrentBrowser:()=>he,getExponentialDelay:()=>$t,getHighestQuality:()=>Ht,getIOSVersion:()=>Gt,interval:()=>un,isHigher:()=>zt,isHigherOrEqual:()=>Kt,isIOS:()=>Ut,isInvariantQuality:()=>Oe,isLower:()=>Ie,isLowerOrEqual:()=>Yt,isMacLike:()=>Qt,isMobile:()=>Bt,isNonNullable:()=>U,isNullable:()=>ye,loadVKLangPack:()=>hp,map:()=>ne,mapTo:()=>mr,merge:()=>or,noop:()=>k,now:()=>Vt,observableFrom:()=>ln,observeElementSize:()=>an,once:()=>Tr,pairwise:()=>hr,safeStorage:()=>tr,tap:()=>Ir,throttle:()=>cr,throttleFn:()=>Ee,timeCodeToString:()=>Os,timeout:()=>sn,videoHeightToQuality:()=>Jt,videoQualityToHeight:()=>en,videoSizeToQuality:()=>Zt});module.exports=ds(Op);var Lt="__VERSION__";var x=class{constructor(){this.subscriptions=[]}unsubscribe(){let r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}};var P=e=>{throw new Error(`${e} is value of unexpected type`)},Ct=e=>{};var k=()=>{};var v=class{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){let n;t?typeof t=="function"?n={next:t,error:k}:n={next:s=>t.next(s),error:s=>t.error?.(s)}:n={next:k,error:k};let o=typeof r=="function"?{next:s=>{try{r(s)}catch(u){n.next(u)}},error:s=>n.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):n.next(s)},a;try{a=this._subscribe(o)}catch(s){o.error?.(s)}return new x().add(()=>{switch(o.next=k,o.error=k,typeof a){case"function":a();return;case"object":a.unsubscribe();return;case"undefined":return;default:return P(a)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}};var L=class extends v{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){let n=this.keyCounter++;return this.subscribers.set(n,t),new x().add(()=>this.subscribers.delete(n))}};var Te=class{constructor(){this.log$=new L;this.logs=[];this.log=r=>{let t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)};this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}};function Nt(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function jt(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function U(e){return typeof e<"u"&&e!==null}function ye(e){return e==null}function Mt(e,r){if(!e?.length)throw new Error(r)}function kt(e,r){if(e?.length)throw new Error(r)}var Dt=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{u(),l.remove()});let a=()=>{u(),o()},s=()=>{u(),n()},u=()=>{f&&clearTimeout(f),l.removeEventListener("load",s),l.removeEventListener("error",a)},f;t&&(f=window.setTimeout(a,t));let l=document.createElement("script");l.addEventListener("load",s),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var Vt=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Ft=(e,r)=>async(...t)=>{let n=r(...t),o=e.aborted,a;for(;!o&&!e.aborted;)try{let s=await n.next(a);o=s.done??!1,a=s.value}catch(s){await n.throw(s)}return a};var Ze=(l=>(l.Unknown="Unknown",l.Yandex="Yandex",l.Chrome="Chrome",l.Chromium="Chromium",l.Firefox="Firefox",l.Safari="Safari",l.Opera="Opera",l.Edge="Edge",l.Rest="Rest",l))(Ze||{}),er=(f=>(f.Unknown="Unknown",f.Android="Android",f.iPhone="iPhone",f.iPad="iPad",f.iPod="iPod",f.RestMobile="RestMobile",f.Mac="Mac",f.Desktop="Desktop",f))(er||{}),he=()=>{let{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?"Yandex":void 0,t=/chrome|crios/i.test(e)?"Chrome":void 0,n=/chromium/i.test(e)?"Chromium":void 0,o=/firefox|fxios/i.test(e)?"Firefox":void 0,a=/webkit|safari|khtml/i.test(e)?"Safari":void 0,s=/opr\//i.test(e)?"Opera":void 0,u=/edg/i.test(e)?"Edge":void 0,f=/android/i.test(e)?"Android":void 0,l=/iphone/i.test(e)?"iPhone":void 0,c=/ipad/i.test(e)?"iPad":void 0,p=/ipod/i.test(e)?"iPod":void 0,b=/mac/i.test(e)?"Mac":void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?"RestMobile":void 0;return{browser:r||o||s||u||t||n||a||"Rest",device:f||l||c||p||d||b||"Desktop"}},Ut=(e=!1)=>{let t=["iPhone","iPad","iPod"].includes(he().device);if(!e)return t;let{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},Gt=()=>{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;let t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Qt=()=>["Mac","iPhone","iPad","iPod"].includes(he().device),Bt=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile;var $t=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let s=r;return s*=t**e,s*=1+(Math.random()*a*2-a),s=Math.round(s),s=Math.min(s,n),s=Math.max(s,o),s};var tr={};At(tr,{clear:()=>Is,get:()=>Ts,has:()=>hs,isPersistent:()=>ms,remove:()=>gs,set:()=>ys});var z,G,rr=`vk-videoplayer-dummy-key-${Math.random()}`,K=()=>{if(G!==void 0)return G;try{localStorage.setItem(rr,"test"),localStorage.removeItem(rr),G=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(rr),G=1}catch(r){if(r instanceof DOMException||r instanceof TypeError)G=2;else throw r}else throw e}return G===2&&(z=new Map),G},ms=()=>K()===0,Ts=e=>{let r=K();switch(r){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return z?.get(e);default:P(r)}},ys=(e,r)=>{let t=K();switch(t){case 0:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void z?.set(e,r);default:P(t)}},hs=e=>{let r=K();switch(r){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return z?.has(e)??!1;default:return P(r),!1}},gs=e=>{let r=K();switch(r){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:return void z?.delete(e);default:P(r)}},Is=()=>{let e=K();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return z?.clear();default:P(e)}};var Wt=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}let t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var ge=(c=>(c.INVARIANT="Invariant quality",c.Q_144P="144p",c.Q_240P="240p",c.Q_360P="360p",c.Q_480P="480p",c.Q_720P="720p",c.Q_1080P="1080p",c.Q_1440P="1440p",c.Q_2160P="2160p",c.Q_4320P="4320p",c))(ge||{});var E={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"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}},zt=(e,r)=>E[e].height>E[r].height,Kt=(e,r)=>E[e].height>=E[r].height,Ie=(e,r)=>E[e].height<E[r].height,Yt=(e,r)=>E[e].height<=E[r].height,Ht=e=>e.sort((r,t)=>r===t?0:r==="Invariant quality"?1:t==="Invariant quality"?-1:Ie(r,t)?1:-1)[0],Xt=Object.keys(E).sort((e,r)=>Ie(e,r)?-1:1),Jt=(e,r=.02)=>[...Xt].find(n=>E[n].height*(1+r)>=e),Zt=({width:e,height:r})=>{let t=Math.min(e,r),n=Math.max(e,r);return Xt.find(o=>{let a=E[o];return a.width>=n&&a.height>=t})},en=e=>E[e].height,Oe=e=>e==="Invariant quality",rn=e=>e.every(r=>!Oe(r));function tn(e){if(Oe(e))throw new Error("Expected exact quality")}var nn=(e,r)=>{let t={};for(let n of Object.keys(r)){let o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=nn(a,o):t[n]=n in e?a:o}return t};var Os=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function xe(e,r=0,t){let n,o,a,s,u,f,l=0,c=!1,p=!1,b=!0,d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(c=!!t.leading,p="maxWait"in t,a=t?.maxWait?Math.max(+t?.maxWait||0,r):a,b="trailing"in t?!!t.trailing:b);function T(m){let w=n,F=o;return n=o=void 0,l=m,s=e.apply(F,w),s}function y(m,w){return d?(u&&window.cancelAnimationFrame(u),window.requestAnimationFrame(m)):setTimeout(m,w)}function I(m){if(d){window.cancelAnimationFrame(m);return}clearTimeout(m)}function h(m){return l=m,u=y(be,r),c?T(m):s}function g(m){let w=m-f,F=m-l,Pt=r-w;return p?Math.min(Pt,a-F):Pt}function qt(m){let w=m-f,F=m-l;return f===void 0||w>=r||w<0||p&&F>=a}function be(){let m=Date.now();if(qt(m))return Rt(m);u=y(be,g(m))}function Rt(m){return u=void 0,b&&n?T(m):(n=o=void 0,s)}function as(){u!==void 0&&I(u),l=0,n=f=o=u=void 0}function ss(){return u===void 0?s:Rt(Date.now())}function us(){return u!==void 0}function de(...m){let w=Date.now(),F=qt(w);if(n=m,o=this,f=w,F){if(u===void 0)return h(f);if(p)return u=y(be,r),T(f)}return u===void 0&&(u=y(be,r)),s}return de.cancel=as,de.flush=ss,de.pending=us,de}var Ee=(e,r=0,t)=>xe(e,r,{...{leading:!0,trailing:!0},...t,maxWait:r});var re=(e,r)=>{if(e===null||typeof e!="object")return e;let t=Array.isArray(e)?[]:{};for(let n in e){if(typeof r=="function"){let o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=re(e[n],r):t[n]=e[n]}return t};var on=e=>re(e);var xs=300,an=(e,r=xs)=>new v(t=>{let{width:n,height:o}=e.getBoundingClientRect();if(t.next({width:n,height:o}),!window.ResizeObserver)return;let a=new ResizeObserver(Ee(s=>{let u=s[0];if(!u)return;let f,l;u.contentBoxSize&&u.contentBoxSize[0]?(l=u.contentBoxSize[0].blockSize,f=u.contentBoxSize[0].inlineSize):u.contentRect&&(f=u.contentRect.width,l=u.contentRect.height),U(f)&&U(l)&&t.next({width:f,height:l})},r));return a.observe(e),()=>a.disconnect()});var te=class extends L{constructor(t){super();this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){let n=super._subscribe(t);return t.next(this.value),n}};function nr(e){return new v(r=>{let t={},n=Object.keys(e).length,o=a=>s=>{a in t||n--,t[a]=s,n===0&&r.next(t)};return Object.entries(e).reduce((a,[s,u])=>a.add(u.subscribe(o(s))),new x)})}function or(...e){return new v(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new x))}var sn=e=>new v(r=>{let t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)});var un=e=>new v(r=>{let t=window.setInterval(()=>r.next(),e);return()=>{t&&(window.clearInterval(t),t=void 0)}});var ln=e=>new v(r=>{e.forEach(t=>r.next(t))});var cn=(e,r)=>new v(t=>{let n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ar(e){return r=>new v(t=>r.subscribe(new ir(t,e)))}var ir=class{constructor(r,t){this.destination=r;this.size=t;this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){this.destination.error?.(r)}};var Es={leading:!1,trailing:!0};function ur(e,r=Es){return t=>new v(n=>t.subscribe(new sr(n,e,r)))}var sr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,U(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){this.destination.error?.(r)}};var Ss={leading:!0,trailing:!1};function cr(e,r=Ss){return t=>new v(n=>t.subscribe(new lr(n,e,r)))}var lr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,ye(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){this.destination.error?.(r)}};function pr(e){return r=>new v(t=>r.subscribe(new fr(t,e)))}var fr=class{constructor(r,t){this.destination=r;this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){this.destination.error?.(r)}};function br(e=(r,t)=>r===t){return r=>new v(t=>r.subscribe(new vr(t,e)))}var fn={},vr=class{constructor(r,t){this.destination=r;this.predicate=t;this.lastValue=fn}next(r){let t;try{t=this.lastValue===fn||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){this.destination.error?.(r)}};function ne(e){return r=>new v(t=>r.subscribe(new dr(t,e)))}var dr=class{constructor(r,t){this.destination=r;this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){this.destination.error?.(r)}};function mr(e){return ne(()=>e)}function Tr(){return e=>new v(r=>{let t=!1,n=!1,o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{t=!0,r.error?.(a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function hr(){return e=>new v(r=>e.subscribe(new yr(r)))}var yr=class{constructor(r){this.destination=r;this.hasLast=!1}next(r){let t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){this.destination.error?.(r)}};function Ir(e){return r=>new v(t=>r.subscribe(new gr(t,e)))}var gr=class{constructor(r,t){this.destination=r;this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){this.destination.error?.(r)}};var pn=(u=>(u.NETWORK="network",u.VIDEO_PIPELINE="video_pipeline",u.EXTERNAL_API="external_api",u.PARSER="parser",u.DOM="dom",u.WTF="wtf",u.FATAL="fatal",u))(pn||{});var Se=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;let n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;let n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){let s=n[o];try{s.callback.call(this,r)}catch(u){Promise.resolve().then(()=>{throw u})}s.options&&s.options.once&&this.removeEventListener(r.type,s.callback)}return!r.defaultPrevented}},Y=class extends Se{constructor(){super(),this.listeners||Se.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(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}},oe=class{constructor(){Object.defineProperty(this,"signal",{value:new Y,writable:!0,configurable:!0})}abort(r){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}}let n=r;if(n===void 0)if(typeof document>"u")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch{n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol<"u"&&Symbol.toStringTag&&(oe.prototype[Symbol.toStringTag]="AbortController",Y.prototype[Symbol.toStringTag]="AbortSignal");function we(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 Or(e){typeof e=="function"&&(e={fetch:e});let{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!we({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(l,c){let p;c&&c.signal&&(p=c.signal,delete c.signal);let b=new t(l,c);return p&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),b},a.prototype=t.prototype);let s=r;return{fetch:(f,l)=>{let c=a&&a.prototype.isPrototypeOf(f)?f.signal:l?l.signal:void 0;if(c){let p;try{p=new DOMException("Aborted","AbortError")}catch{p=new Error("Aborted"),p.name="AbortError"}if(c.aborted)return Promise.reject(p);let b=new Promise((d,T)=>{c.addEventListener("abort",()=>T(p),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([b,s(f,l)])}return s(f,l)},Request:a}}var ie=we({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),vn=ie?Or({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,bn=ie?vn.fetch:window.fetch,Wb=ie?vn.Request:window.Request,zb=ie?oe:window.AbortController,Kb=ie?Y:window.AbortSignal;var ns=bs(ts(),1),os=(p=>(p.Armenian="58",p.Azerbaijani="57",p.Belarusian="114",p.English="3",p.Kazakh="97",p.Portuguese="73",p.Russian="0",p.Spanish="4",p.Ukrainian="1",p.Uzbek="65",p.Vietnamese="75",p))(os||{}),yp="vk.com",hp=async(e,r,t)=>{let n=new URL(`https://${yp}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);let a=await(await bn(n.toString())).json();return gp(a,t)},gp=(e,r)=>(0,ns.default)(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Ip(n)])),Ip=e=>Array.isArray(e)?e[0]:e;var is=(t=>(t.RU="ru",t.EN="en",t))(is||{});
|
package/esnext.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.36-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.36-dev.a84e6475.0
|
|
3
|
+
* Mon, 17 Jun 2024 13:25:55 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
|
|
5
5
|
*/
|
|
6
|
-
const Ne="1.0.36-dev.2da9ea99.0";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},ke=e=>{},L=()=>{};class f{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:L}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:L,error:L};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new M().add(()=>{switch(s.next=L,s.error=L,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return x(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class G extends f{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class Fe{log$=new G;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function qe(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function Ce(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function k(e){return typeof e<"u"&&e!==null}function se(e){return e==null}function De(e,t){if(!e?.length)throw new Error(t)}function je(e,t){if(e?.length)throw new Error(t)}const Ue=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{l&&clearTimeout(l),c.removeEventListener("load",o),c.removeEventListener("error",i)};let l;n&&(l=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),Qe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Ve=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};var S;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(S||(S={}));var b;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(b||(b={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?S.Yandex:void 0,n=/chrome|crios/i.test(e)?S.Chrome:void 0,r=/chromium/i.test(e)?S.Chromium:void 0,s=/firefox|fxios/i.test(e)?S.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?S.Safari:void 0,o=/opr\//i.test(e)?S.Opera:void 0,a=/edg/i.test(e)?S.Edge:void 0,l=/android/i.test(e)?b.Android:void 0,c=/iphone/i.test(e)?b.iPhone:void 0,w=/ipad/i.test(e)?b.iPad:void 0,h=/ipod/i.test(e)?b.iPod:void 0,E=/mac/i.test(e)?b.Mac:void 0,y=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?b.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||S.Rest,device:l||c||w||h||y||E||b.Desktop}},ze=(e=!1)=>{const n=[b.iPhone,b.iPad,b.iPod].includes(W().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},Ge=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},We=()=>[b.Mac,b.iPhone,b.iPad,b.iPod].includes(W().device),$e=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,Be=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var d;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(d||(d={}));let v,O;const N=`vk-videoplayer-dummy-key-${Math.random()}`,R=()=>{if(O!==void 0)return O;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),O=d.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),O=d.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)O=d.RUNTIME;else throw t}else throw e}return O===d.RUNTIME&&(v=new Map),O},oe=()=>R()===d.LOCAL_STORAGE,ae=e=>{const t=R();switch(t){case d.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case d.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case d.RUNTIME:return v?.get(e);default:x(t)}},ce=(e,t)=>{const n=R();switch(n){case d.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.RUNTIME:return void v?.set(e,t);default:x(n)}},le=e=>{const t=R();switch(t){case d.LOCAL_STORAGE:return e in localStorage;case d.SESSION_STORAGE:return e in sessionStorage;case d.RUNTIME:return v?.has(e)??!1;default:return x(t),!1}},ue=e=>{const t=R();switch(t){case d.LOCAL_STORAGE:return localStorage.removeItem(e);case d.SESSION_STORAGE:return sessionStorage.removeItem(e);case d.RUNTIME:return void v?.delete(e);default:x(t)}},de=()=>{const e=R();switch(e){case d.LOCAL_STORAGE:return localStorage.clear();case d.SESSION_STORAGE:return sessionStorage.clear();case d.RUNTIME:return v?.clear();default:x(e)}};var Ye=Object.freeze({__proto__:null,clear:de,get:ae,has:le,isPersistent:oe,remove:ue,set:ce});const He=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var m;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(m||(m={}));const g={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},Xe=(e,t)=>g[e].height>g[t].height,Je=(e,t)=>g[e].height>=g[t].height,$=(e,t)=>g[e].height<g[t].height,Ze=(e,t)=>g[e].height<=g[t].height,Ke=e=>e.sort((t,n)=>t===n?0:t===m.INVARIANT?1:n===m.INVARIANT?-1:$(t,n)?1:-1)[0],B=Object.keys(g).sort((e,t)=>$(e,t)?-1:1),et=(e,t=.02)=>[...B].find(r=>g[r].height*(1+t)>=e),tt=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return B.find(s=>{const i=g[s];return i.width>=r&&i.height>=n})},nt=e=>g[e].height,Y=e=>e===m.INVARIANT,rt=e=>e.every(t=>!Y(t));function it(e){if(Y(e))throw new Error("Expected exact quality")}const fe=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=fe(i,s):n[r]=r in e?i:s}return n},st=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function he(e,t=0,n){let r,s,i,o,a,l,c=0,w=!1,h=!1,E=!0;const y=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(w=!!n.leading,h="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,E="trailing"in n?!!n.trailing:E);function T(u){const p=r,A=s;return r=s=void 0,c=u,o=e.apply(A,p),o}function _(u,p){return y?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,p)}function K(u){if(y){window.cancelAnimationFrame(u);return}clearTimeout(u)}function ee(u){return c=u,a=_(P,t),w?T(u):o}function te(u){const p=u-l,A=u-c,D=t-p;return h?Math.min(D,i-A):D}function q(u){const p=u-l,A=u-c;return l===void 0||p>=t||p<0||h&&A>=i}function P(){const u=Date.now();if(q(u))return C(u);a=_(P,te(u))}function C(u){return a=void 0,E&&r?T(u):(r=s=void 0,o)}function ne(){a!==void 0&&K(a),c=0,r=l=s=a=void 0}function re(){return a===void 0?o:C(Date.now())}function ie(){return a!==void 0}function I(...u){const p=Date.now(),A=q(p);if(r=u,s=this,l=p,A){if(a===void 0)return ee(l);if(h)return a=_(P,t),T(l)}return a===void 0&&(a=_(P,t)),o}return I.cancel=ne,I.flush=re,I.pending=ie,I}const be=(e,t=0,n)=>he(e,t,{...{leading:!0,trailing:!0},...n,maxWait:t}),H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=H(e[r],t):n[r]=e[r]}return n},ot=e=>H(e),we=300,at=(e,t=we)=>new f(n=>{const{width:r,height:s}=e.getBoundingClientRect();if(n.next({width:r,height:s}),!window.ResizeObserver)return;const i=new ResizeObserver(be(o=>{const a=o[0];if(!a)return;let l,c;a.contentBoxSize&&a.contentBoxSize[0]?(c=a.contentBoxSize[0].blockSize,l=a.contentBoxSize[0].inlineSize):a.contentRect&&(l=a.contentRect.width,c=a.contentRect.height),k(l)&&k(c)&&n.next({width:l,height:c})},t));return i.observe(e),()=>i.disconnect()});class ct extends G{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function lt(e){return new f(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new M)})}function ut(...e){return new f(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new M))}var dt=e=>new f(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),ft=e=>new f(t=>{let n=window.setInterval(()=>t.next(),e);return()=>{n&&(window.clearInterval(n),n=void 0)}}),ht=e=>new f(t=>{e.forEach(n=>t.next(n))}),bt=(e,t)=>new f(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function wt(e){return t=>new f(n=>t.subscribe(new me(n,e)))}class me{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const ge={leading:!1,trailing:!0};function mt(e,t=ge){return n=>new f(r=>n.subscribe(new pe(r,e,t)))}class pe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,k(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Ee={leading:!0,trailing:!1};function gt(e,t=Ee){return n=>new f(r=>n.subscribe(new Se(r,e,t)))}class Se{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,se(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function pt(e){return t=>new f(n=>t.subscribe(new Ae(n,e)))}class Ae{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Et(e=(t,n)=>t===n){return t=>new f(n=>t.subscribe(new Oe(n,e)))}const j={};class Oe{destination;predicate;lastValue=j;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===j||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function ye(e){return t=>new f(n=>t.subscribe(new xe(n,e)))}let xe=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function At(e){return ye(()=>e)}function Ot(){return e=>new f(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function yt(){return e=>new f(t=>e.subscribe(new ve(t)))}class ve{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function xt(e){return t=>new f(n=>t.subscribe(new Re(n,e)))}class Re{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var U;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf",e.FATAL="fatal"})(U||(U={}));class Q{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class X extends Q{constructor(){super(),this.listeners||Q.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class Te{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(Te.prototype[Symbol.toStringTag]="AbortController",X.prototype[Symbol.toStringTag]="AbortSignal");function J(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 Le(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!J({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,w){let h;w&&w.signal&&(h=w.signal,delete w.signal);const E=new n(c,w);return h&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),E},i.prototype=n.prototype);const o=t;return{fetch:(l,c)=>{const w=i&&i.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(w){let h;try{h=new DOMException("Aborted","AbortError")}catch{h=new Error("Aborted"),h.name="AbortError"}if(w.aborted)return Promise.reject(h);const E=new Promise((y,T)=>{w.addEventListener("abort",()=>T(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(l,c)])}return o(l,c)},Request:i}}const F=J({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Z=F?Le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,_e=F?Z.fetch:window.fetch;F?Z.Request:window.Request;var V;(function(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"})(V||(V={}));const Pe="vk.com",vt=async(e,t,n)=>{const r=new URL(`https://${Pe}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await _e(r.toString())).json();return Ie(i,n)},Ie=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),Me(r)])),Me=e=>Array.isArray(e)?e[0]:e;var z;(function(e){e.RU="ru",e.EN="en"})(z||(z={}));export{S as CurrentClientBrowser,b as CurrentClientDevice,U as ErrorCategory,z as InterfaceLanguage,Fe as Logger,f as Observable,G as Subject,M as Subscription,Ne as VERSION,V as VKNumericLanguage,ct as ValueSubject,m as VideoQuality,Ve as abortable,Ue as addScript,rt as areQualitiesExact,je as assertEmptyArray,x as assertNever,qe as assertNonNullable,De as assertNotEmptyArray,Ce as assertNullable,it as assertQualityIsExact,wt as buffer,ke as checkNever,ot as cloneDeep,H as cloneDeepWith,lt as combine,mt as debounce,he as debounceFn,He as detectEmbed,fe as fillWithDefault,pt as filter,Et as filterChanged,bt as fromEvent,W as getCurrentBrowser,Be as getExponentialDelay,Ke as getHighestQuality,Ge as getIOSVersion,ft as interval,Xe as isHigher,Je as isHigherOrEqual,ze as isIOS,Y as isInvariantQuality,$ as isLower,Ze as isLowerOrEqual,We as isMacLike,$e as isMobile,k as isNonNullable,se as isNullable,vt as loadVKLangPack,ye as map,At as mapTo,ut as merge,L as noop,Qe as now,ht as observableFrom,at as observeElementSize,Ot as once,yt as pairwise,Ye as safeStorage,xt as tap,gt as throttle,be as throttleFn,st as timeCodeToString,dt as timeout,et as videoHeightToQuality,nt as videoQualityToHeight,tt as videoSizeToQuality};
|
|
6
|
+
var qa=Object.create;var Be=Object.defineProperty;var Ra=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Aa=Object.getPrototypeOf,_a=Object.prototype.hasOwnProperty;var i=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),La=(e,r)=>{for(var t in r)Be(e,t,{get:r[t],enumerable:!0})},Ca=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Pa(r))!_a.call(e,o)&&o!==t&&Be(e,o,{get:()=>r[o],enumerable:!(n=Ra(r,o))||n.enumerable});return e};var Na=(e,r,t)=>(t=e!=null?qa(Aa(e)):{},Ca(r||!e||!e.__esModule?Be(t,"default",{value:e,enumerable:!0}):t,e));var P=i((zb,Nt)=>{"use strict";Nt.exports=function(e){try{return!!e()}catch{return!0}}});var ne=i((Kb,jt)=>{"use strict";var Os=P();jt.exports=!Os(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var L=i((Yb,Dt)=>{"use strict";var Mt=ne(),kt=Function.prototype,lr=kt.call,xs=Mt&&kt.bind.bind(lr,lr);Dt.exports=Mt?xs:function(e){return function(){return lr.apply(e,arguments)}}});var ye=i((Hb,Ft)=>{"use strict";var Vt=L(),Es=Vt({}.toString),Ss=Vt("".slice);Ft.exports=function(e){return Ss(Es(e),8,-1)}});var Gt=i((Xb,Ut)=>{"use strict";var ws=L(),qs=P(),Rs=ye(),cr=Object,Ps=ws("".split);Ut.exports=qs(function(){return!cr("z").propertyIsEnumerable(0)})?function(e){return Rs(e)=="String"?Ps(e,""):cr(e)}:cr});var he=i((Jb,Qt)=>{"use strict";Qt.exports=function(e){return e==null}});var fr=i((Zb,Bt)=>{"use strict";var As=he(),_s=TypeError;Bt.exports=function(e){if(As(e))throw _s("Can't call method on "+e);return e}});var H=i((ed,$t)=>{"use strict";var Ls=Gt(),Cs=fr();$t.exports=function(e){return Ls(Cs(e))}});var zt=i((rd,Wt)=>{"use strict";Wt.exports=function(){}});var G=i((td,Kt)=>{"use strict";Kt.exports={}});var S=i((Yt,Ht)=>{"use strict";var ge=function(e){return e&&e.Math==Math&&e};Ht.exports=ge(typeof globalThis=="object"&&globalThis)||ge(typeof window=="object"&&window)||ge(typeof self=="object"&&self)||ge(typeof global=="object"&&global)||function(){return this}()||Yt||Function("return this")()});var vr=i((nd,Xt)=>{"use strict";var pr=typeof document=="object"&&document.all,Ns=typeof pr>"u"&&pr!==void 0;Xt.exports={all:pr,IS_HTMLDDA:Ns}});var O=i((od,Zt)=>{"use strict";var Jt=vr(),js=Jt.all;Zt.exports=Jt.IS_HTMLDDA?function(e){return typeof e=="function"||e===js}:function(e){return typeof e=="function"}});var tn=i((id,rn)=>{"use strict";var Ms=S(),ks=O(),en=Ms.WeakMap;rn.exports=ks(en)&&/native code/.test(String(en))});var Q=i((ad,an)=>{"use strict";var nn=O(),on=vr(),Ds=on.all;an.exports=on.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:nn(e)||e===Ds}:function(e){return typeof e=="object"?e!==null:nn(e)}});var C=i((sd,sn)=>{"use strict";var Vs=P();sn.exports=!Vs(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var dr=i((ud,ln)=>{"use strict";var Fs=S(),un=Q(),br=Fs.document,Us=un(br)&&un(br.createElement);ln.exports=function(e){return Us?br.createElement(e):{}}});var mr=i((ld,cn)=>{"use strict";var Gs=C(),Qs=P(),Bs=dr();cn.exports=!Gs&&!Qs(function(){return Object.defineProperty(Bs("div"),"a",{get:function(){return 7}}).a!=7})});var Tr=i((cd,fn)=>{"use strict";var $s=C(),Ws=P();fn.exports=$s&&Ws(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var k=i((fd,pn)=>{"use strict";var zs=Q(),Ks=String,Ys=TypeError;pn.exports=function(e){if(zs(e))return e;throw Ys(Ks(e)+" is not an object")}});var D=i((pd,vn)=>{"use strict";var Hs=ne(),Ie=Function.prototype.call;vn.exports=Hs?Ie.bind(Ie):function(){return Ie.apply(Ie,arguments)}});var Oe=i((vd,bn)=>{"use strict";bn.exports={}});var gr=i((bd,mn)=>{"use strict";var yr=Oe(),hr=S(),Xs=O(),dn=function(e){return Xs(e)?e:void 0};mn.exports=function(e,r){return arguments.length<2?dn(yr[e])||dn(hr[e]):yr[e]&&yr[e][r]||hr[e]&&hr[e][r]}});var Ir=i((dd,Tn)=>{"use strict";var Js=L();Tn.exports=Js({}.isPrototypeOf)});var hn=i((md,yn)=>{"use strict";yn.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var wn=i((Td,Sn)=>{"use strict";var En=S(),Or=hn(),gn=En.process,In=En.Deno,On=gn&&gn.versions||In&&In.version,xn=On&&On.v8,q,xe;xn&&(q=xn.split("."),xe=q[0]>0&&q[0]<4?1:+(q[0]+q[1]));!xe&&Or&&(q=Or.match(/Edge\/(\d+)/),(!q||q[1]>=74)&&(q=Or.match(/Chrome\/(\d+)/),q&&(xe=+q[1])));Sn.exports=xe});var xr=i((yd,Rn)=>{"use strict";var qn=wn(),Zs=P(),eu=S(),ru=eu.String;Rn.exports=!!Object.getOwnPropertySymbols&&!Zs(function(){var e=Symbol();return!ru(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&qn&&qn<41})});var Er=i((hd,Pn)=>{"use strict";var tu=xr();Pn.exports=tu&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Sr=i((gd,An)=>{"use strict";var nu=gr(),ou=O(),iu=Ir(),au=Er(),su=Object;An.exports=au?function(e){return typeof e=="symbol"}:function(e){var r=nu("Symbol");return ou(r)&&iu(r.prototype,su(e))}});var Ee=i((Id,_n)=>{"use strict";var uu=String;_n.exports=function(e){try{return uu(e)}catch{return"Object"}}});var oe=i((Od,Ln)=>{"use strict";var lu=O(),cu=Ee(),fu=TypeError;Ln.exports=function(e){if(lu(e))return e;throw fu(cu(e)+" is not a function")}});var Se=i((xd,Cn)=>{"use strict";var pu=oe(),vu=he();Cn.exports=function(e,r){var t=e[r];return vu(t)?void 0:pu(t)}});var jn=i((Ed,Nn)=>{"use strict";var wr=D(),qr=O(),Rr=Q(),bu=TypeError;Nn.exports=function(e,r){var t,n;if(r==="string"&&qr(t=e.toString)&&!Rr(n=wr(t,e))||qr(t=e.valueOf)&&!Rr(n=wr(t,e))||r!=="string"&&qr(t=e.toString)&&!Rr(n=wr(t,e)))return n;throw bu("Can't convert object to primitive value")}});var ie=i((Sd,Mn)=>{"use strict";Mn.exports=!0});var Vn=i((wd,Dn)=>{"use strict";var kn=S(),du=Object.defineProperty;Dn.exports=function(e,r){try{du(kn,e,{value:r,configurable:!0,writable:!0})}catch{kn[e]=r}return r}});var Pr=i((qd,Un)=>{"use strict";var mu=S(),Tu=Vn(),Fn="__core-js_shared__",yu=mu[Fn]||Tu(Fn,{});Un.exports=yu});var Ar=i((Rd,Qn)=>{"use strict";var hu=ie(),Gn=Pr();(Qn.exports=function(e,r){return Gn[e]||(Gn[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:hu?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var _r=i((Pd,Bn)=>{"use strict";var gu=fr(),Iu=Object;Bn.exports=function(e){return Iu(gu(e))}});var N=i((Ad,$n)=>{"use strict";var Ou=L(),xu=_r(),Eu=Ou({}.hasOwnProperty);$n.exports=Object.hasOwn||function(r,t){return Eu(xu(r),t)}});var Lr=i((_d,Wn)=>{"use strict";var Su=L(),wu=0,qu=Math.random(),Ru=Su(1 .toString);Wn.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ru(++wu+qu,36)}});var A=i((Ld,Kn)=>{"use strict";var Pu=S(),Au=Ar(),zn=N(),_u=Lr(),Lu=xr(),Cu=Er(),X=Pu.Symbol,Cr=Au("wks"),Nu=Cu?X.for||X:X&&X.withoutSetter||_u;Kn.exports=function(e){return zn(Cr,e)||(Cr[e]=Lu&&zn(X,e)?X[e]:Nu("Symbol."+e)),Cr[e]}});var Jn=i((Cd,Xn)=>{"use strict";var ju=D(),Yn=Q(),Hn=Sr(),Mu=Se(),ku=jn(),Du=A(),Vu=TypeError,Fu=Du("toPrimitive");Xn.exports=function(e,r){if(!Yn(e)||Hn(e))return e;var t=Mu(e,Fu),n;if(t){if(r===void 0&&(r="default"),n=ju(t,e,r),!Yn(n)||Hn(n))return n;throw Vu("Can't convert object to primitive value")}return r===void 0&&(r="number"),ku(e,r)}});var we=i((Nd,Zn)=>{"use strict";var Uu=Jn(),Gu=Sr();Zn.exports=function(e){var r=Uu(e,"string");return Gu(r)?r:r+""}});var J=i(ro=>{"use strict";var Qu=C(),Bu=mr(),$u=Tr(),qe=k(),eo=we(),Wu=TypeError,Nr=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,jr="enumerable",Mr="configurable",kr="writable";ro.f=Qu?$u?function(r,t,n){if(qe(r),t=eo(t),qe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&kr in n&&!n[kr]){var o=zu(r,t);o&&o[kr]&&(r[t]=n.value,n={configurable:Mr in n?n[Mr]:o[Mr],enumerable:jr in n?n[jr]:o[jr],writable:!1})}return Nr(r,t,n)}:Nr:function(r,t,n){if(qe(r),t=eo(t),qe(n),Bu)try{return Nr(r,t,n)}catch{}if("get"in n||"set"in n)throw Wu("Accessors not supported");return"value"in n&&(r[t]=n.value),r}});var ae=i((Md,to)=>{"use strict";to.exports=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}});var B=i((kd,no)=>{"use strict";var Ku=C(),Yu=J(),Hu=ae();no.exports=Ku?function(e,r,t){return Yu.f(e,r,Hu(1,t))}:function(e,r,t){return e[r]=t,e}});var Re=i((Dd,io)=>{"use strict";var Xu=Ar(),Ju=Lr(),oo=Xu("keys");io.exports=function(e){return oo[e]||(oo[e]=Ju(e))}});var Pe=i((Vd,ao)=>{"use strict";ao.exports={}});var co=i((Fd,lo)=>{"use strict";var Zu=tn(),uo=S(),el=Q(),rl=B(),Dr=N(),Vr=Pr(),tl=Re(),nl=Pe(),so="Object already initialized",Fr=uo.TypeError,ol=uo.WeakMap,Ae,se,_e,il=function(e){return _e(e)?se(e):Ae(e,{})},al=function(e){return function(r){var t;if(!el(r)||(t=se(r)).type!==e)throw Fr("Incompatible receiver, "+e+" required");return t}};Zu||Vr.state?(R=Vr.state||(Vr.state=new ol),R.get=R.get,R.has=R.has,R.set=R.set,Ae=function(e,r){if(R.has(e))throw Fr(so);return r.facade=e,R.set(e,r),r},se=function(e){return R.get(e)||{}},_e=function(e){return R.has(e)}):($=tl("state"),nl[$]=!0,Ae=function(e,r){if(Dr(e,$))throw Fr(so);return r.facade=e,rl(e,$,r),r},se=function(e){return Dr(e,$)?e[$]:{}},_e=function(e){return Dr(e,$)});var R,$;lo.exports={set:Ae,get:se,has:_e,enforce:il,getterFor:al}});var mo=i((Ud,bo)=>{"use strict";var sl=ne(),vo=Function.prototype,fo=vo.apply,po=vo.call;bo.exports=typeof Reflect=="object"&&Reflect.apply||(sl?po.bind(fo):function(){return po.apply(fo,arguments)})});var Ur=i((Gd,To)=>{"use strict";var ul=ye(),ll=L();To.exports=function(e){if(ul(e)==="Function")return ll(e)}});var Io=i(go=>{"use strict";var yo={}.propertyIsEnumerable,ho=Object.getOwnPropertyDescriptor,cl=ho&&!yo.call({1:2},1);go.f=cl?function(r){var t=ho(this,r);return!!t&&t.enumerable}:yo});var Eo=i(xo=>{"use strict";var fl=C(),pl=D(),vl=Io(),bl=ae(),dl=H(),ml=we(),Tl=N(),yl=mr(),Oo=Object.getOwnPropertyDescriptor;xo.f=fl?Oo:function(r,t){if(r=dl(r),t=ml(t),yl)try{return Oo(r,t)}catch{}if(Tl(r,t))return bl(!pl(vl.f,r,t),r[t])}});var wo=i(($d,So)=>{"use strict";var hl=P(),gl=O(),Il=/#|\.prototype\./,ue=function(e,r){var t=xl[Ol(e)];return t==Sl?!0:t==El?!1:gl(r)?hl(r):!!r},Ol=ue.normalize=function(e){return String(e).replace(Il,".").toLowerCase()},xl=ue.data={},El=ue.NATIVE="N",Sl=ue.POLYFILL="P";So.exports=ue});var Gr=i((Wd,Ro)=>{"use strict";var qo=Ur(),wl=oe(),ql=ne(),Rl=qo(qo.bind);Ro.exports=function(e,r){return wl(e),r===void 0?e:ql?Rl(e,r):function(){return e.apply(r,arguments)}}});var Qr=i((zd,Ao)=>{"use strict";var Le=S(),Pl=mo(),Al=Ur(),_l=O(),Ll=Eo().f,Cl=wo(),Z=Oe(),Nl=Gr(),ee=B(),Po=N(),jl=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Pl(e,this,arguments)};return r.prototype=e.prototype,r};Ao.exports=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,s=n?Le:o?Le[t]:(Le[t]||{}).prototype,u=n?Z:Z[t]||ee(Z,t,{})[t],f=u.prototype,l,c,p,b,d,T,y,I,h;for(b in r)l=Cl(n?b:t+(o?".":"#")+b,e.forced),c=!l&&s&&Po(s,b),T=u[b],c&&(e.dontCallGetSet?(h=Ll(s,b),y=h&&h.value):y=s[b]),d=c&&y?y:r[b],!(c&&typeof T==typeof d)&&(e.bind&&c?I=Nl(d,Le):e.wrap&&c?I=jl(d):a&&_l(d)?I=Al(d):I=d,(e.sham||d&&d.sham||T&&T.sham)&&ee(I,"sham",!0),ee(u,b,I),a&&(p=t+"Prototype",Po(Z,p)||ee(Z,p,{}),ee(Z[p],b,d),e.real&&f&&(l||!f[b])&&ee(f,b,d)))}});var Co=i((Kd,Lo)=>{"use strict";var Br=C(),Ml=N(),_o=Function.prototype,kl=Br&&Object.getOwnPropertyDescriptor,$r=Ml(_o,"name"),Dl=$r&&function(){}.name==="something",Vl=$r&&(!Br||Br&&kl(_o,"name").configurable);Lo.exports={EXISTS:$r,PROPER:Dl,CONFIGURABLE:Vl}});var jo=i((Yd,No)=>{"use strict";var Fl=Math.ceil,Ul=Math.floor;No.exports=Math.trunc||function(r){var t=+r;return(t>0?Ul:Fl)(t)}});var Wr=i((Hd,Mo)=>{"use strict";var Gl=jo();Mo.exports=function(e){var r=+e;return r!==r||r===0?0:Gl(r)}});var Do=i((Xd,ko)=>{"use strict";var Ql=Wr(),Bl=Math.max,$l=Math.min;ko.exports=function(e,r){var t=Ql(e);return t<0?Bl(t+r,0):$l(t,r)}});var Fo=i((Jd,Vo)=>{"use strict";var Wl=Wr(),zl=Math.min;Vo.exports=function(e){return e>0?zl(Wl(e),9007199254740991):0}});var zr=i((Zd,Uo)=>{"use strict";var Kl=Fo();Uo.exports=function(e){return Kl(e.length)}});var Bo=i((em,Qo)=>{"use strict";var Yl=H(),Hl=Do(),Xl=zr(),Go=function(e){return function(r,t,n){var o=Yl(r),a=Xl(o),s=Hl(n,a),u;if(e&&t!=t){for(;a>s;)if(u=o[s++],u!=u)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===t)return e||s||0;return!e&&-1}};Qo.exports={includes:Go(!0),indexOf:Go(!1)}});var zo=i((rm,Wo)=>{"use strict";var Jl=L(),Kr=N(),Zl=H(),ec=Bo().indexOf,rc=Pe(),$o=Jl([].push);Wo.exports=function(e,r){var t=Zl(e),n=0,o=[],a;for(a in t)!Kr(rc,a)&&Kr(t,a)&&$o(o,a);for(;r.length>n;)Kr(t,a=r[n++])&&(~ec(o,a)||$o(o,a));return o}});var Yr=i((tm,Ko)=>{"use strict";Ko.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Ho=i((nm,Yo)=>{"use strict";var tc=zo(),nc=Yr();Yo.exports=Object.keys||function(r){return tc(r,nc)}});var Jo=i(Xo=>{"use strict";var oc=C(),ic=Tr(),ac=J(),sc=k(),uc=H(),lc=Ho();Xo.f=oc&&!ic?Object.defineProperties:function(r,t){sc(r);for(var n=uc(t),o=lc(t),a=o.length,s=0,u;a>s;)ac.f(r,u=o[s++],n[u]);return r}});var ei=i((im,Zo)=>{"use strict";var cc=gr();Zo.exports=cc("document","documentElement")});var Zr=i((am,si)=>{"use strict";var fc=k(),pc=Jo(),ri=Yr(),vc=Pe(),bc=ei(),dc=dr(),mc=Re(),ti=">",ni="<",Xr="prototype",Jr="script",ii=mc("IE_PROTO"),Hr=function(){},ai=function(e){return ni+Jr+ti+e+ni+"/"+Jr+ti},oi=function(e){e.write(ai("")),e.close();var r=e.parentWindow.Object;return e=null,r},Tc=function(){var e=dc("iframe"),r="java"+Jr+":",t;return e.style.display="none",bc.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(ai("document.F=Object")),t.close(),t.F},Ce,Ne=function(){try{Ce=new ActiveXObject("htmlfile")}catch{}Ne=typeof document<"u"?document.domain&&Ce?oi(Ce):Tc():oi(Ce);for(var e=ri.length;e--;)delete Ne[Xr][ri[e]];return Ne()};vc[ii]=!0;si.exports=Object.create||function(r,t){var n;return r!==null?(Hr[Xr]=fc(r),n=new Hr,Hr[Xr]=null,n[ii]=r):n=Ne(),t===void 0?n:pc.f(n,t)}});var li=i((sm,ui)=>{"use strict";var yc=P();ui.exports=!yc(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var rt=i((um,fi)=>{"use strict";var hc=N(),gc=O(),Ic=_r(),Oc=Re(),xc=li(),ci=Oc("IE_PROTO"),et=Object,Ec=et.prototype;fi.exports=xc?et.getPrototypeOf:function(e){var r=Ic(e);if(hc(r,ci))return r[ci];var t=r.constructor;return gc(t)&&r instanceof t?t.prototype:r instanceof et?Ec:null}});var tt=i((lm,pi)=>{"use strict";var Sc=B();pi.exports=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Sc(e,r,t),e}});var at=i((cm,di)=>{"use strict";var wc=P(),qc=O(),Rc=Q(),Pc=Zr(),vi=rt(),Ac=tt(),_c=A(),Lc=ie(),it=_c("iterator"),bi=!1,j,nt,ot;[].keys&&(ot=[].keys(),"next"in ot?(nt=vi(vi(ot)),nt!==Object.prototype&&(j=nt)):bi=!0);var Cc=!Rc(j)||wc(function(){var e={};return j[it].call(e)!==e});Cc?j={}:Lc&&(j=Pc(j));qc(j[it])||Ac(j,it,function(){return this});di.exports={IteratorPrototype:j,BUGGY_SAFARI_ITERATORS:bi}});var je=i((fm,Ti)=>{"use strict";var Nc=A(),jc=Nc("toStringTag"),mi={};mi[jc]="z";Ti.exports=String(mi)==="[object z]"});var ke=i((pm,yi)=>{"use strict";var Mc=je(),kc=O(),Me=ye(),Dc=A(),Vc=Dc("toStringTag"),Fc=Object,Uc=Me(function(){return arguments}())=="Arguments",Gc=function(e,r){try{return e[r]}catch{}};yi.exports=Mc?Me:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Gc(r=Fc(e),Vc))=="string"?t:Uc?Me(r):(n=Me(r))=="Object"&&kc(r.callee)?"Arguments":n}});var gi=i((vm,hi)=>{"use strict";var Qc=je(),Bc=ke();hi.exports=Qc?{}.toString:function(){return"[object "+Bc(this)+"]"}});var st=i((bm,Oi)=>{"use strict";var $c=je(),Wc=J().f,zc=B(),Kc=N(),Yc=gi(),Hc=A(),Ii=Hc("toStringTag");Oi.exports=function(e,r,t,n){if(e){var o=t?e:e.prototype;Kc(o,Ii)||Wc(o,Ii,{configurable:!0,value:r}),n&&!$c&&zc(o,"toString",Yc)}}});var Ei=i((dm,xi)=>{"use strict";var Xc=at().IteratorPrototype,Jc=Zr(),Zc=ae(),ef=st(),rf=G(),tf=function(){return this};xi.exports=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Jc(Xc,{next:Zc(+!n,t)}),ef(e,o,!1,!0),rf[o]=tf,e}});var wi=i((mm,Si)=>{"use strict";var nf=L(),of=oe();Si.exports=function(e,r,t){try{return nf(of(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}}});var Ri=i((Tm,qi)=>{"use strict";var af=O(),sf=String,uf=TypeError;qi.exports=function(e){if(typeof e=="object"||af(e))return e;throw uf("Can't set "+sf(e)+" as a prototype")}});var Ai=i((ym,Pi)=>{"use strict";var lf=wi(),cf=k(),ff=Ri();Pi.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=lf(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(o,a){return cf(o),ff(a),e?t(o,a):o.__proto__=a,o}}():void 0)});var Ui=i((hm,Fi)=>{"use strict";var pf=Qr(),vf=D(),De=ie(),Di=Co(),bf=O(),df=Ei(),_i=rt(),Li=Ai(),mf=st(),Tf=B(),ut=tt(),yf=A(),Ci=G(),Vi=at(),hf=Di.PROPER,gf=Di.CONFIGURABLE,Ni=Vi.IteratorPrototype,Ve=Vi.BUGGY_SAFARI_ITERATORS,le=yf("iterator"),ji="keys",ce="values",Mi="entries",ki=function(){return this};Fi.exports=function(e,r,t,n,o,a,s){df(t,r,n);var u=function(h){if(h===o&&b)return b;if(!Ve&&h in c)return c[h];switch(h){case ji:return function(){return new t(this,h)};case ce:return function(){return new t(this,h)};case Mi:return function(){return new t(this,h)}}return function(){return new t(this)}},f=r+" Iterator",l=!1,c=e.prototype,p=c[le]||c["@@iterator"]||o&&c[o],b=!Ve&&p||u(o),d=r=="Array"&&c.entries||p,T,y,I;if(d&&(T=_i(d.call(new e)),T!==Object.prototype&&T.next&&(!De&&_i(T)!==Ni&&(Li?Li(T,Ni):bf(T[le])||ut(T,le,ki)),mf(T,f,!0,!0),De&&(Ci[f]=ki))),hf&&o==ce&&p&&p.name!==ce&&(!De&&gf?Tf(c,"name",ce):(l=!0,b=function(){return vf(p,this)})),o)if(y={values:u(ce),keys:a?b:u(ji),entries:u(Mi)},s)for(I in y)(Ve||l||!(I in c))&&ut(c,I,y[I]);else pf({target:r,proto:!0,forced:Ve||l},y);return(!De||s)&&c[le]!==b&&ut(c,le,b,{name:o}),Ci[r]=b,y}});var Qi=i((gm,Gi)=>{"use strict";Gi.exports=function(e,r){return{value:e,done:r}}});var ct=i((Im,Ki)=>{"use strict";var If=H(),lt=zt(),Bi=G(),Wi=co(),Of=J().f,xf=Ui(),Fe=Qi(),Ef=ie(),Sf=C(),zi="Array Iterator",wf=Wi.set,qf=Wi.getterFor(zi);Ki.exports=xf(Array,"Array",function(e,r){wf(this,{type:zi,target:If(e),index:0,kind:r})},function(){var e=qf(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,Fe(void 0,!0)):t=="keys"?Fe(n,!1):t=="values"?Fe(r[n],!1):Fe([n,r[n]],!1)},"values");var $i=Bi.Arguments=Bi.Array;lt("keys");lt("values");lt("entries");if(!Ef&&Sf&&$i.name!=="values")try{Of($i,"name",{value:"values"})}catch{}});var Hi=i((Om,Yi)=>{"use strict";var Rf=A(),Pf=G(),Af=Rf("iterator"),_f=Array.prototype;Yi.exports=function(e){return e!==void 0&&(Pf.Array===e||_f[Af]===e)}});var ft=i((xm,Ji)=>{"use strict";var Lf=ke(),Xi=Se(),Cf=he(),Nf=G(),jf=A(),Mf=jf("iterator");Ji.exports=function(e){if(!Cf(e))return Xi(e,Mf)||Xi(e,"@@iterator")||Nf[Lf(e)]}});var ea=i((Em,Zi)=>{"use strict";var kf=D(),Df=oe(),Vf=k(),Ff=Ee(),Uf=ft(),Gf=TypeError;Zi.exports=function(e,r){var t=arguments.length<2?Uf(e):r;if(Df(t))return Vf(kf(t,e));throw Gf(Ff(e)+" is not iterable")}});var na=i((Sm,ta)=>{"use strict";var Qf=D(),ra=k(),Bf=Se();ta.exports=function(e,r,t){var n,o;ra(e);try{if(n=Bf(e,"return"),!n){if(r==="throw")throw t;return t}n=Qf(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ra(n),t}});var ua=i((wm,sa)=>{"use strict";var $f=Gr(),Wf=D(),zf=k(),Kf=Ee(),Yf=Hi(),Hf=zr(),oa=Ir(),Xf=ea(),Jf=ft(),ia=na(),Zf=TypeError,Ue=function(e,r){this.stopped=e,this.result=r},aa=Ue.prototype;sa.exports=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),u=!!(t&&t.INTERRUPTED),f=$f(r,n),l,c,p,b,d,T,y,I=function(g){return l&&ia(l,"normal",g),new Ue(!0,g)},h=function(g){return o?(zf(g),u?f(g[0],g[1],I):f(g[0],g[1])):u?f(g,I):f(g)};if(a)l=e.iterator;else if(s)l=e;else{if(c=Jf(e),!c)throw Zf(Kf(e)+" is not iterable");if(Yf(c)){for(p=0,b=Hf(e);b>p;p++)if(d=h(e[p]),d&&oa(aa,d))return d;return new Ue(!1)}l=Xf(e,c)}for(T=a?e.next:l.next;!(y=Wf(T,l)).done;){try{d=h(y.value)}catch(g){ia(l,"throw",g)}if(typeof d=="object"&&d&&oa(aa,d))return d}return new Ue(!1)}});var ca=i((qm,la)=>{"use strict";var ep=we(),rp=J(),tp=ae();la.exports=function(e,r,t){var n=ep(r);n in e?rp.f(e,n,tp(0,t)):e[n]=t}});var fa=i(()=>{"use strict";var np=Qr(),op=ua(),ip=ca();np({target:"Object",stat:!0},{fromEntries:function(r){var t={};return op(r,function(n,o){ip(t,n,o)},{AS_ENTRIES:!0}),t}})});var va=i((Am,pa)=>{"use strict";ct();fa();var ap=Oe();pa.exports=ap.Object.fromEntries});var da=i((_m,ba)=>{"use strict";ba.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var ya=i(()=>{"use strict";ct();var sp=da(),up=S(),lp=ke(),cp=B(),ma=G(),fp=A(),Ta=fp("toStringTag");for(Ge in sp)pt=up[Ge],Qe=pt&&pt.prototype,Qe&&lp(Qe)!==Ta&&cp(Qe,Ta,Ge),ma[Ge]=ma.Array;var pt,Qe,Ge});var ga=i((Nm,ha)=>{"use strict";var pp=va();ya();ha.exports=pp});var Oa=i((jm,Ia)=>{"use strict";var vp=ga();Ia.exports=vp});var ja="__VERSION__";var x=class{constructor(){this.subscriptions=[]}unsubscribe(){let r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}};var _=e=>{throw new Error(`${e} is value of unexpected type`)},Ma=e=>{};var F=()=>{};var v=class{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){let n;t?typeof t=="function"?n={next:t,error:F}:n={next:s=>t.next(s),error:s=>t.error?.(s)}:n={next:F,error:F};let o=typeof r=="function"?{next:s=>{try{r(s)}catch(u){n.next(u)}},error:s=>n.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):n.next(s)},a;try{a=this._subscribe(o)}catch(s){o.error?.(s)}return new x().add(()=>{switch(o.next=F,o.error=F,typeof a){case"function":a();return;case"object":a.unsubscribe();return;case"undefined":return;default:return _(a)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}};var M=class extends v{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){let n=this.keyCounter++;return this.subscribers.set(n,t),new x().add(()=>this.subscribers.delete(n))}};var $e=class{constructor(){this.log$=new M;this.logs=[];this.log=r=>{let t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)};this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}};function ka(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function Da(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function W(e){return typeof e<"u"&&e!==null}function We(e){return e==null}function Va(e,r){if(!e?.length)throw new Error(r)}function Fa(e,r){if(e?.length)throw new Error(r)}var Ua=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{u(),l.remove()});let a=()=>{u(),o()},s=()=>{u(),n()},u=()=>{f&&clearTimeout(f),l.removeEventListener("load",s),l.removeEventListener("error",a)},f;t&&(f=window.setTimeout(a,t));let l=document.createElement("script");l.addEventListener("load",s),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var Ga=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Qa=(e,r)=>async(...t)=>{let n=r(...t),o=e.aborted,a;for(;!o&&!e.aborted;)try{let s=await n.next(a);o=s.done??!1,a=s.value}catch(s){await n.throw(s)}return a};var mt=(l=>(l.Unknown="Unknown",l.Yandex="Yandex",l.Chrome="Chrome",l.Chromium="Chromium",l.Firefox="Firefox",l.Safari="Safari",l.Opera="Opera",l.Edge="Edge",l.Rest="Rest",l))(mt||{}),Tt=(f=>(f.Unknown="Unknown",f.Android="Android",f.iPhone="iPhone",f.iPad="iPad",f.iPod="iPod",f.RestMobile="RestMobile",f.Mac="Mac",f.Desktop="Desktop",f))(Tt||{}),ze=()=>{let{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?"Yandex":void 0,t=/chrome|crios/i.test(e)?"Chrome":void 0,n=/chromium/i.test(e)?"Chromium":void 0,o=/firefox|fxios/i.test(e)?"Firefox":void 0,a=/webkit|safari|khtml/i.test(e)?"Safari":void 0,s=/opr\//i.test(e)?"Opera":void 0,u=/edg/i.test(e)?"Edge":void 0,f=/android/i.test(e)?"Android":void 0,l=/iphone/i.test(e)?"iPhone":void 0,c=/ipad/i.test(e)?"iPad":void 0,p=/ipod/i.test(e)?"iPod":void 0,b=/mac/i.test(e)?"Mac":void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?"RestMobile":void 0;return{browser:r||o||s||u||t||n||a||"Rest",device:f||l||c||p||d||b||"Desktop"}},Ba=(e=!1)=>{let t=["iPhone","iPad","iPod"].includes(ze().device);if(!e)return t;let{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},$a=()=>{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;let t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Wa=()=>["Mac","iPhone","iPad","iPod"].includes(ze().device),za=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile;var Ka=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let s=r;return s*=t**e,s*=1+(Math.random()*a*2-a),s=Math.round(s),s=Math.min(s,n),s=Math.max(s,o),s};var yt={};La(yt,{clear:()=>es,get:()=>Ha,has:()=>Ja,isPersistent:()=>Ya,remove:()=>Za,set:()=>Xa});var z,U,Ke=`vk-videoplayer-dummy-key-${Math.random()}`,K=()=>{if(U!==void 0)return U;try{localStorage.setItem(Ke,"test"),localStorage.removeItem(Ke),U=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(Ke),U=1}catch(r){if(r instanceof DOMException||r instanceof TypeError)U=2;else throw r}else throw e}return U===2&&(z=new Map),U},Ya=()=>K()===0,Ha=e=>{let r=K();switch(r){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return z?.get(e);default:_(r)}},Xa=(e,r)=>{let t=K();switch(t){case 0:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void z?.set(e,r);default:_(t)}},Ja=e=>{let r=K();switch(r){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return z?.has(e)??!1;default:return _(r),!1}},Za=e=>{let r=K();switch(r){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:return void z?.delete(e);default:_(r)}},es=()=>{let e=K();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return z?.clear();default:_(e)}};var rs=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}let t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var Ye=(c=>(c.INVARIANT="Invariant quality",c.Q_144P="144p",c.Q_240P="240p",c.Q_360P="360p",c.Q_480P="480p",c.Q_720P="720p",c.Q_1080P="1080p",c.Q_1440P="1440p",c.Q_2160P="2160p",c.Q_4320P="4320p",c))(Ye||{});var E={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"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}},ts=(e,r)=>E[e].height>E[r].height,ns=(e,r)=>E[e].height>=E[r].height,He=(e,r)=>E[e].height<E[r].height,os=(e,r)=>E[e].height<=E[r].height,is=e=>e.sort((r,t)=>r===t?0:r==="Invariant quality"?1:t==="Invariant quality"?-1:He(r,t)?1:-1)[0],ht=Object.keys(E).sort((e,r)=>He(e,r)?-1:1),as=(e,r=.02)=>[...ht].find(n=>E[n].height*(1+r)>=e),ss=({width:e,height:r})=>{let t=Math.min(e,r),n=Math.max(e,r);return ht.find(o=>{let a=E[o];return a.width>=n&&a.height>=t})},us=e=>E[e].height,Xe=e=>e==="Invariant quality",ls=e=>e.every(r=>!Xe(r));function cs(e){if(Xe(e))throw new Error("Expected exact quality")}var fs=(e,r)=>{let t={};for(let n of Object.keys(r)){let o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=fs(a,o):t[n]=n in e?a:o}return t};var Kp=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function Je(e,r=0,t){let n,o,a,s,u,f,l=0,c=!1,p=!1,b=!0,d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(c=!!t.leading,p="maxWait"in t,a=t?.maxWait?Math.max(+t?.maxWait||0,r):a,b="trailing"in t?!!t.trailing:b);function T(m){let w=n,V=o;return n=o=void 0,l=m,s=e.apply(V,w),s}function y(m,w){return d?(u&&window.cancelAnimationFrame(u),window.requestAnimationFrame(m)):setTimeout(m,w)}function I(m){if(d){window.cancelAnimationFrame(m);return}clearTimeout(m)}function h(m){return l=m,u=y(fe,r),c?T(m):s}function g(m){let w=m-f,V=m-l,dt=r-w;return p?Math.min(dt,a-V):dt}function vt(m){let w=m-f,V=m-l;return f===void 0||w>=r||w<0||p&&V>=a}function fe(){let m=Date.now();if(vt(m))return bt(m);u=y(fe,g(m))}function bt(m){return u=void 0,b&&n?T(m):(n=o=void 0,s)}function Ea(){u!==void 0&&I(u),l=0,n=f=o=u=void 0}function Sa(){return u===void 0?s:bt(Date.now())}function wa(){return u!==void 0}function pe(...m){let w=Date.now(),V=vt(w);if(n=m,o=this,f=w,V){if(u===void 0)return h(f);if(p)return u=y(fe,r),T(f)}return u===void 0&&(u=y(fe,r)),s}return pe.cancel=Ea,pe.flush=Sa,pe.pending=wa,pe}var Ze=(e,r=0,t)=>Je(e,r,{...{leading:!0,trailing:!0},...t,maxWait:r});var ve=(e,r)=>{if(e===null||typeof e!="object")return e;let t=Array.isArray(e)?[]:{};for(let n in e){if(typeof r=="function"){let o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=ve(e[n],r):t[n]=e[n]}return t};var ps=e=>ve(e);var vs=300,bs=(e,r=vs)=>new v(t=>{let{width:n,height:o}=e.getBoundingClientRect();if(t.next({width:n,height:o}),!window.ResizeObserver)return;let a=new ResizeObserver(Ze(s=>{let u=s[0];if(!u)return;let f,l;u.contentBoxSize&&u.contentBoxSize[0]?(l=u.contentBoxSize[0].blockSize,f=u.contentBoxSize[0].inlineSize):u.contentRect&&(f=u.contentRect.width,l=u.contentRect.height),W(f)&&W(l)&&t.next({width:f,height:l})},r));return a.observe(e),()=>a.disconnect()});var be=class extends M{constructor(t){super();this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){let n=super._subscribe(t);return t.next(this.value),n}};function gt(e){return new v(r=>{let t={},n=Object.keys(e).length,o=a=>s=>{a in t||n--,t[a]=s,n===0&&r.next(t)};return Object.entries(e).reduce((a,[s,u])=>a.add(u.subscribe(o(s))),new x)})}function It(...e){return new v(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new x))}var ds=e=>new v(r=>{let t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)});var ms=e=>new v(r=>{let t=window.setInterval(()=>r.next(),e);return()=>{t&&(window.clearInterval(t),t=void 0)}});var Ts=e=>new v(r=>{e.forEach(t=>r.next(t))});var ys=(e,r)=>new v(t=>{let n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Ot(e){return r=>new v(t=>r.subscribe(new er(t,e)))}var er=class{constructor(r,t){this.destination=r;this.size=t;this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){this.destination.error?.(r)}};var hs={leading:!1,trailing:!0};function xt(e,r=hs){return t=>new v(n=>t.subscribe(new rr(n,e,r)))}var rr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,W(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){this.destination.error?.(r)}};var gs={leading:!0,trailing:!1};function Et(e,r=gs){return t=>new v(n=>t.subscribe(new tr(n,e,r)))}var tr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,We(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){this.destination.error?.(r)}};function St(e){return r=>new v(t=>r.subscribe(new nr(t,e)))}var nr=class{constructor(r,t){this.destination=r;this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){this.destination.error?.(r)}};function qt(e=(r,t)=>r===t){return r=>new v(t=>r.subscribe(new or(t,e)))}var wt={},or=class{constructor(r,t){this.destination=r;this.predicate=t;this.lastValue=wt}next(r){let t;try{t=this.lastValue===wt||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){this.destination.error?.(r)}};function de(e){return r=>new v(t=>r.subscribe(new ir(t,e)))}var ir=class{constructor(r,t){this.destination=r;this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){this.destination.error?.(r)}};function Rt(e){return de(()=>e)}function Pt(){return e=>new v(r=>{let t=!1,n=!1,o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{t=!0,r.error?.(a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function At(){return e=>new v(r=>e.subscribe(new ar(r)))}var ar=class{constructor(r){this.destination=r;this.hasLast=!1}next(r){let t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){this.destination.error?.(r)}};function _t(e){return r=>new v(t=>r.subscribe(new sr(t,e)))}var sr=class{constructor(r,t){this.destination=r;this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){this.destination.error?.(r)}};var Is=(u=>(u.NETWORK="network",u.VIDEO_PIPELINE="video_pipeline",u.EXTERNAL_API="external_api",u.PARSER="parser",u.DOM="dom",u.WTF="wtf",u.FATAL="fatal",u))(Is||{});var me=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;let n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;let n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){let s=n[o];try{s.callback.call(this,r)}catch(u){Promise.resolve().then(()=>{throw u})}s.options&&s.options.once&&this.removeEventListener(r.type,s.callback)}return!r.defaultPrevented}},Y=class extends me{constructor(){super(),this.listeners||me.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(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}},re=class{constructor(){Object.defineProperty(this,"signal",{value:new Y,writable:!0,configurable:!0})}abort(r){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}}let n=r;if(n===void 0)if(typeof document>"u")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch{n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol<"u"&&Symbol.toStringTag&&(re.prototype[Symbol.toStringTag]="AbortController",Y.prototype[Symbol.toStringTag]="AbortSignal");function Te(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:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!Te({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(l,c){let p;c&&c.signal&&(p=c.signal,delete c.signal);let b=new t(l,c);return p&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),b},a.prototype=t.prototype);let s=r;return{fetch:(f,l)=>{let c=a&&a.prototype.isPrototypeOf(f)?f.signal:l?l.signal:void 0;if(c){let p;try{p=new DOMException("Aborted","AbortError")}catch{p=new Error("Aborted"),p.name="AbortError"}if(c.aborted)return Promise.reject(p);let b=new Promise((d,T)=>{c.addEventListener("abort",()=>T(p),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([b,s(f,l)])}return s(f,l)},Request:a}}var te=Te({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Lt=te?ur({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ct=te?Lt.fetch:window.fetch,Qb=te?Lt.Request:window.Request,Bb=te?re:window.AbortController,$b=te?Y:window.AbortSignal;var xa=Na(Oa(),1),bp=(p=>(p.Armenian="58",p.Azerbaijani="57",p.Belarusian="114",p.English="3",p.Kazakh="97",p.Portuguese="73",p.Russian="0",p.Spanish="4",p.Ukrainian="1",p.Uzbek="65",p.Vietnamese="75",p))(bp||{}),dp="vk.com",km=async(e,r,t)=>{let n=new URL(`https://${dp}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);let a=await(await Ct(n.toString())).json();return mp(a,t)},mp=(e,r)=>(0,xa.default)(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Tp(n)])),Tp=e=>Array.isArray(e)?e[0]:e;var yp=(t=>(t.RU="ru",t.EN="en",t))(yp||{});export{mt as CurrentClientBrowser,Tt as CurrentClientDevice,Is as ErrorCategory,yp as InterfaceLanguage,$e as Logger,v as Observable,M as Subject,x as Subscription,ja as VERSION,bp as VKNumericLanguage,be as ValueSubject,Ye as VideoQuality,Qa as abortable,Ua as addScript,ls as areQualitiesExact,Fa as assertEmptyArray,_ as assertNever,ka as assertNonNullable,Va as assertNotEmptyArray,Da as assertNullable,cs as assertQualityIsExact,Ot as buffer,Ma as checkNever,ps as cloneDeep,ve as cloneDeepWith,gt as combine,xt as debounce,Je as debounceFn,rs as detectEmbed,fs as fillWithDefault,St as filter,qt as filterChanged,ys as fromEvent,ze as getCurrentBrowser,Ka as getExponentialDelay,is as getHighestQuality,$a as getIOSVersion,ms as interval,ts as isHigher,ns as isHigherOrEqual,Ba as isIOS,Xe as isInvariantQuality,He as isLower,os as isLowerOrEqual,Wa as isMacLike,za as isMobile,W as isNonNullable,We as isNullable,km as loadVKLangPack,de as map,Rt as mapTo,It as merge,F as noop,Ga as now,Ts as observableFrom,bs as observeElementSize,Pt as once,At as pairwise,yt as safeStorage,_t as tap,Et as throttle,Ze as throttleFn,Kp as timeCodeToString,ds as timeout,as as videoHeightToQuality,us as videoQualityToHeight,ss as videoSizeToQuality};
|
package/evergreen.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.36-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.36-dev.a84e6475.0
|
|
3
|
+
* Mon, 17 Jun 2024 13:25:55 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
|
|
5
5
|
*/
|
|
6
|
-
const Te="1.0.36-dev.2da9ea99.0";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},ye=e=>{},T=()=>{};class h{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let i;n?typeof n=="function"?i={next:n,error:T}:i={next:s=>n.next(s),error:s=>n.error?.(s)}:i={next:T,error:T};const o=typeof t=="function"?{next:s=>{try{t(s)}catch(a){i.next(a)}},error:s=>i.next(s)}:{next:s=>t.next(s),error:s=>t.error?t.error(s):i.next(s)};let r;try{r=this._subscribe(o)}catch(s){o.error?.(s)}return new M().add(()=>{switch(o.next=T,o.error=T,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return x(r)}})}pipe(...t){return t.reduce((n,i)=>i(n),this)}_subscribe(t){}}class W extends h{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class Re{log$=new W;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let i;try{i=t(...n)}catch{i={message:"error in `createCustomLog`",component:"Logger"}}this.log(i)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function Ie(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function _e(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function k(e){return typeof e<"u"&&e!==null}function ee(e){return e==null}function Pe(e,t){if(!e?.length)throw new Error(t)}function Me(e,t){if(e?.length)throw new Error(t)}const Le=(e,t,n)=>new Promise((i,o)=>{t.addEventListener("abort",()=>{a(),l.remove()});const r=()=>{a(),o()},s=()=>{a(),i()},a=()=>{d&&clearTimeout(d),l.removeEventListener("load",s),l.removeEventListener("error",r)};let d;n&&(d=window.setTimeout(r,n));const l=document.createElement("script");l.addEventListener("load",s),l.addEventListener("error",r),l.src=e,document.head.appendChild(l)}),Ne=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),ke=(e,t)=>async(...n)=>{const i=t(...n);let o=e.aborted,r;for(;!o&&!e.aborted;)try{const s=await i.next(r);o=s.done??!1,r=s.value}catch(s){await i.throw(s)}return r};var p;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(p||(p={}));var f;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(f||(f={}));const j=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?p.Yandex:void 0,n=/chrome|crios/i.test(e)?p.Chrome:void 0,i=/chromium/i.test(e)?p.Chromium:void 0,o=/firefox|fxios/i.test(e)?p.Firefox:void 0,r=/webkit|safari|khtml/i.test(e)?p.Safari:void 0,s=/opr\//i.test(e)?p.Opera:void 0,a=/edg/i.test(e)?p.Edge:void 0,d=/android/i.test(e)?f.Android:void 0,l=/iphone/i.test(e)?f.iPhone:void 0,y=/ipad/i.test(e)?f.iPad:void 0,S=/ipod/i.test(e)?f.iPod:void 0,v=/mac/i.test(e)?f.Mac:void 0,R=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?f.RestMobile:void 0;return{browser:t||o||s||a||n||i||r||p.Rest,device:d||l||y||S||R||v||f.Desktop}},Fe=(e=!1)=>{const n=[f.iPhone,f.iPad,f.iPod].includes(j().device);if(!e)return n;const{userAgent:i,maxTouchPoints:o}=window.navigator;return!!(n||/macintosh/i.test(i)&&o>0)},Ue=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],i=parseFloat(n);return isNaN(i)?null:i},De=()=>[f.Mac,f.iPhone,f.iPad,f.iPod].includes(j().device),Qe=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,Ve=(e,{start:t=0,factor:n=2,max:i=1/0,min:o=t,random:r=0}={})=>{let s=t;return s*=n**e,s*=1+(Math.random()*r*2-r),s=Math.round(s),s=Math.min(s,i),s=Math.max(s,o),s};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let A,E;const N=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(E!==void 0)return E;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(A=new Map),E},te=()=>O()===u.LOCAL_STORAGE,ne=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return A?.get(e);default:x(t)}},ie=(e,t)=>{const n=O();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.RUNTIME:return void A?.set(e,t);default:x(n)}},se=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return A?.has(e)??!1;default:return x(t),!1}},re=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void A?.delete(e);default:x(t)}},oe=()=>{const e=O();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return A?.clear();default:x(e)}};var ze=Object.freeze({__proto__:null,clear:oe,get:ne,has:se,isPersistent:te,remove:re,set:ie});const Ge=()=>{let e,t;try{e=window.self!==window.top}catch(i){i instanceof DOMException&&i.name==="SecurityError"?e=!0:(e=!1,console.error(i))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(i){console.error(i)}try{!t&&document.referrer&&(t=document.referrer)}catch(i){console.error(i)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var m;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(m||(m={}));const w={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},We=(e,t)=>w[e].height>w[t].height,je=(e,t)=>w[e].height>=w[t].height,q=(e,t)=>w[e].height<w[t].height,qe=(e,t)=>w[e].height<=w[t].height,$e=e=>e.sort((t,n)=>t===n?0:t===m.INVARIANT?1:n===m.INVARIANT?-1:q(t,n)?1:-1)[0],$=Object.keys(w).sort((e,t)=>q(e,t)?-1:1),He=(e,t=.02)=>[...$].find(i=>w[i].height*(1+t)>=e),Be=({width:e,height:t})=>{const n=Math.min(e,t),i=Math.max(e,t);return $.find(o=>{const r=w[o];return r.width>=i&&r.height>=n})},Ce=e=>w[e].height,H=e=>e===m.INVARIANT,Ye=e=>e.every(t=>!H(t));function Xe(e){if(H(e))throw new Error("Expected exact quality")}const ae=(e,t)=>{const n={};for(const i of Object.keys(t)){const o=t[i],r=e[i];Array.isArray(o)&&Array.isArray(r)?n[i]=r:typeof o=="object"&&typeof r=="object"?n[i]=ae(r,o):n[i]=i in e?r:o}return n},Je=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function ce(e,t=0,n){let i,o,r,s,a,d,l=0,y=!1,S=!1,v=!0;const R=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(y=!!n.leading,S="maxWait"in n,r=n?.maxWait?Math.max(+n?.maxWait||0,t):r,v="trailing"in n?!!n.trailing:v);function L(c){const g=i,b=o;return i=o=void 0,l=c,s=e.apply(b,g),s}function I(c,g){return R?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(c)):setTimeout(c,g)}function C(c){if(R){window.cancelAnimationFrame(c);return}clearTimeout(c)}function Y(c){return l=c,a=I(_,t),y?L(c):s}function X(c){const g=c-d,b=c-l,D=t-g;return S?Math.min(D,r-b):D}function F(c){const g=c-d,b=c-l;return d===void 0||g>=t||g<0||S&&b>=r}function _(){const c=Date.now();if(F(c))return U(c);a=I(_,X(c))}function U(c){return a=void 0,v&&i?L(c):(i=o=void 0,s)}function J(){a!==void 0&&C(a),l=0,i=d=o=a=void 0}function Z(){return a===void 0?s:U(Date.now())}function K(){return a!==void 0}function P(...c){const g=Date.now(),b=F(g);if(i=c,o=this,d=g,b){if(a===void 0)return Y(d);if(S)return a=I(_,t),L(d)}return a===void 0&&(a=I(_,t)),s}return P.cancel=J,P.flush=Z,P.pending=K,P}const ue=(e,t=0,n)=>ce(e,t,{...{leading:!0,trailing:!0},...n,maxWait:t}),B=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const i in e){if(typeof t=="function"){const o=t(e[i],i,e,n);if(o!==void 0){n[i]=o;continue}}typeof e[i]=="object"?n[i]=B(e[i],t):n[i]=e[i]}return n},Ze=e=>B(e),le=300,Ke=(e,t=le)=>new h(n=>{const{width:i,height:o}=e.getBoundingClientRect();if(n.next({width:i,height:o}),!window.ResizeObserver)return;const r=new ResizeObserver(ue(s=>{const a=s[0];if(!a)return;let d,l;a.contentBoxSize&&a.contentBoxSize[0]?(l=a.contentBoxSize[0].blockSize,d=a.contentBoxSize[0].inlineSize):a.contentRect&&(d=a.contentRect.width,l=a.contentRect.height),k(d)&&k(l)&&n.next({width:d,height:l})},t));return r.observe(e),()=>r.disconnect()});class et extends W{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function tt(e){return new h(t=>{const n={};let i=Object.keys(e).length;const o=r=>s=>{r in n||i--,n[r]=s,i===0&&t.next(n)};return Object.entries(e).reduce((r,[s,a])=>r.add(a.subscribe(o(s))),new M)})}function nt(...e){return new h(t=>e.reduce((n,i)=>n.add(i.subscribe(t)),new M))}var it=e=>new h(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(i){if(t.error)t.error(i);else throw i}},e);return()=>window.clearTimeout(n)}),st=e=>new h(t=>{let n=window.setInterval(()=>t.next(),e);return()=>{n&&(window.clearInterval(n),n=void 0)}}),rt=e=>new h(t=>{e.forEach(n=>t.next(n))}),ot=(e,t)=>new h(n=>{const i=o=>n.next(o);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)});function at(e){return t=>new h(n=>t.subscribe(new de(n,e)))}class de{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const he={leading:!1,trailing:!0};function ct(e,t=he){return n=>new h(i=>n.subscribe(new fe(i,e,t)))}class fe{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,k(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const me={leading:!0,trailing:!1};function ut(e,t=me){return n=>new h(i=>n.subscribe(new we(i,e,t)))}class we{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,ee(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function lt(e){return t=>new h(n=>t.subscribe(new ge(n,e)))}class ge{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function dt(e=(t,n)=>t===n){return t=>new h(n=>t.subscribe(new pe(n,e)))}const Q={};class pe{destination;predicate;lastValue=Q;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===Q||!this.predicate(this.lastValue,t),this.lastValue=t}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function be(e){return t=>new h(n=>t.subscribe(new Ee(n,e)))}let Ee=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(i){throw this.error(i),i}this.destination.next(n)}error(t){this.destination.error?.(t)}};function ft(e){return be(()=>e)}function mt(){return e=>new h(t=>{let n=!1,i=!1;const o=e.subscribe(r=>{n||(n=!0,t.next(r)),i&&o.unsubscribe()},r=>{n=!0,t.error?.(r),i&&o.unsubscribe()});return i=!0,n&&o.unsubscribe(),o})}function wt(){return e=>new h(t=>e.subscribe(new Se(t)))}class Se{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function gt(e){return t=>new h(n=>t.subscribe(new xe(n,e)))}class xe{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var V;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf",e.FATAL="fatal"})(V||(V={}));var z;(function(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"})(z||(z={}));const Ae="vk.com",pt=async(e,t,n)=>{const i=new URL(`https://${Ae}/js/lang-pack.js`);i.searchParams.set("format","json"),i.searchParams.set("name",t),e!==void 0&&i.searchParams.set("lang",e);const r=await(await fetch(i.toString())).json();return Oe(r,n)},Oe=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,i])=>[n.substring(`${t}_`.length),ve(i)])),ve=e=>Array.isArray(e)?e[0]:e;var G;(function(e){e.RU="ru",e.EN="en"})(G||(G={}));export{p as CurrentClientBrowser,f as CurrentClientDevice,V as ErrorCategory,G as InterfaceLanguage,Re as Logger,h as Observable,W as Subject,M as Subscription,Te as VERSION,z as VKNumericLanguage,et as ValueSubject,m as VideoQuality,ke as abortable,Le as addScript,Ye as areQualitiesExact,Me as assertEmptyArray,x as assertNever,Ie as assertNonNullable,Pe as assertNotEmptyArray,_e as assertNullable,Xe as assertQualityIsExact,at as buffer,ye as checkNever,Ze as cloneDeep,B as cloneDeepWith,tt as combine,ct as debounce,ce as debounceFn,Ge as detectEmbed,ae as fillWithDefault,lt as filter,dt as filterChanged,ot as fromEvent,j as getCurrentBrowser,Ve as getExponentialDelay,$e as getHighestQuality,Ue as getIOSVersion,st as interval,We as isHigher,je as isHigherOrEqual,Fe as isIOS,H as isInvariantQuality,q as isLower,qe as isLowerOrEqual,De as isMacLike,Qe as isMobile,k as isNonNullable,ee as isNullable,pt as loadVKLangPack,be as map,ft as mapTo,nt as merge,T as noop,Ne as now,rt as observableFrom,Ke as observeElementSize,mt as once,wt as pairwise,ze as safeStorage,gt as tap,ut as throttle,ue as throttleFn,Je as timeCodeToString,it as timeout,He as videoHeightToQuality,Ce as videoQualityToHeight,Be as videoSizeToQuality};
|
|
6
|
+
var ye=Object.defineProperty;var Oe=(t,e)=>{for(var r in e)ye(t,r,{get:e[r],enumerable:!0})};var we="1.0.36-dev.a84e6475.0";var f=class{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(e){return this.subscriptions.push(e),this}};var v=t=>{throw new Error(`${t} is value of unexpected type`)},Ee=t=>{};var h=()=>{};var l=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){let n;r?typeof r=="function"?n={next:r,error:h}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:h,error:h};let s=typeof e=="function"?{next:o=>{try{e(o)}catch(a){n.next(a)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new f().add(()=>{switch(s.next=h,s.error=h,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return v(i)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var I=class extends l{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(r){this.subscribers.forEach(n=>n.next(r))}error(r){this.subscribers.forEach(n=>n.error?.(r))}_subscribe(r){let n=this.keyCounter++;return this.subscribers.set(n,r),new f().add(()=>this.subscribers.delete(n))}};var N=class{constructor(){this.log$=new I;this.logs=[];this.log=e=>{let r={...e,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};this.getAllLogs=()=>this.logs}createCustomLog(e){return(...r)=>{let n;try{n=e(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(r=>({component:e,...r}))}};function Se(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Re(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function y(t){return typeof t<"u"&&t!==null}function V(t){return t==null}function Ae(t,e){if(!t?.length)throw new Error(e)}function ke(t,e){if(t?.length)throw new Error(e)}var Ce=(t,e,r)=>new Promise((n,s)=>{e.addEventListener("abort",()=>{a(),u.remove()});let i=()=>{a(),s()},o=()=>{a(),n()},a=()=>{c&&clearTimeout(c),u.removeEventListener("load",o),u.removeEventListener("error",i)},c;r&&(c=window.setTimeout(i,r));let u=document.createElement("script");u.addEventListener("load",o),u.addEventListener("error",i),u.src=t,document.head.appendChild(u)});var Le=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Pe=(t,e)=>async(...r)=>{let n=e(...r),s=t.aborted,i;for(;!s&&!t.aborted;)try{let o=await n.next(i);s=o.done??!1,i=o.value}catch(o){await n.throw(o)}return i};var ee=(u=>(u.Unknown="Unknown",u.Yandex="Yandex",u.Chrome="Chrome",u.Chromium="Chromium",u.Firefox="Firefox",u.Safari="Safari",u.Opera="Opera",u.Edge="Edge",u.Rest="Rest",u))(ee||{}),te=(c=>(c.Unknown="Unknown",c.Android="Android",c.iPhone="iPhone",c.iPad="iPad",c.iPod="iPod",c.RestMobile="RestMobile",c.Mac="Mac",c.Desktop="Desktop",c))(te||{}),Q=()=>{let{userAgent:t}=window.navigator,e=/yabrowser/i.test(t)?"Yandex":void 0,r=/chrome|crios/i.test(t)?"Chrome":void 0,n=/chromium/i.test(t)?"Chromium":void 0,s=/firefox|fxios/i.test(t)?"Firefox":void 0,i=/webkit|safari|khtml/i.test(t)?"Safari":void 0,o=/opr\//i.test(t)?"Opera":void 0,a=/edg/i.test(t)?"Edge":void 0,c=/android/i.test(t)?"Android":void 0,u=/iphone/i.test(t)?"iPhone":void 0,d=/ipad/i.test(t)?"iPad":void 0,b=/ipod/i.test(t)?"iPod":void 0,E=/mac/i.test(t)?"Mac":void 0,S=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(t)?"RestMobile":void 0;return{browser:e||s||o||a||r||n||i||"Rest",device:c||u||d||b||S||E||"Desktop"}},Me=(t=!1)=>{let r=["iPhone","iPad","iPod"].includes(Q().device);if(!t)return r;let{userAgent:n,maxTouchPoints:s}=window.navigator;return!!(r||/macintosh/i.test(n)&&s>0)},Ne=()=>{let{userAgent:t}=window.navigator,e=t.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;let r=e[1],n=parseFloat(r);return isNaN(n)?null:n},Ve=()=>["Mac","iPhone","iPad","iPod"].includes(Q().device),Qe=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile;var _e=(t,{start:e=0,factor:r=2,max:n=1/0,min:s=e,random:i=0}={})=>{let o=e;return o*=r**t,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,s),o};var re={};Oe(re,{clear:()=>Be,get:()=>Ue,has:()=>ze,isPersistent:()=>De,remove:()=>je,set:()=>Fe});var O,g,_=`vk-videoplayer-dummy-key-${Math.random()}`,w=()=>{if(g!==void 0)return g;try{localStorage.setItem(_,"test"),localStorage.removeItem(_),g=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(_),g=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)g=2;else throw e}else throw t}return g===2&&(O=new Map),g},De=()=>w()===0,Ue=t=>{let e=w();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return O?.get(t);default:v(e)}},Fe=(t,e)=>{let r=w();switch(r){case 0:try{localStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void O?.set(t,e);default:v(r)}},ze=t=>{let e=w();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return O?.has(t)??!1;default:return v(e),!1}},je=t=>{let e=w();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:return void O?.delete(t);default:v(e)}},Be=()=>{let t=w();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return O?.clear();default:v(t)}};var We=()=>{let t,e;try{t=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?t=!0:(t=!1,console.error(n))}try{window.location.ancestorOrigins&&(e=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!e&&document.referrer&&(e=document.referrer)}catch(n){console.error(n)}let r=e?new URL(e).hostname:void 0;return{isEmbed:t,host:r}};var D=(d=>(d.INVARIANT="Invariant quality",d.Q_144P="144p",d.Q_240P="240p",d.Q_360P="360p",d.Q_480P="480p",d.Q_720P="720p",d.Q_1080P="1080p",d.Q_1440P="1440p",d.Q_2160P="2160p",d.Q_4320P="4320p",d))(D||{});var m={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"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}},Ge=(t,e)=>m[t].height>m[e].height,qe=(t,e)=>m[t].height>=m[e].height,U=(t,e)=>m[t].height<m[e].height,He=(t,e)=>m[t].height<=m[e].height,Ke=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:U(e,r)?1:-1)[0],ne=Object.keys(m).sort((t,e)=>U(t,e)?-1:1),$e=(t,e=.02)=>[...ne].find(n=>m[n].height*(1+e)>=t),Ye=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return ne.find(s=>{let i=m[s];return i.width>=n&&i.height>=r})},Xe=t=>m[t].height,F=t=>t==="Invariant quality",Je=t=>t.every(e=>!F(e));function Ze(t){if(F(t))throw new Error("Expected exact quality")}var et=(t,e)=>{let r={};for(let n of Object.keys(e)){let s=e[n],i=t[n];Array.isArray(s)&&Array.isArray(i)?r[n]=i:typeof s=="object"&&typeof i=="object"?r[n]=et(i,s):r[n]=n in t?i:s}return r};var Gt=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function z(t,e=0,r){let n,s,i,o,a,c,u=0,d=!1,b=!1,E=!0,S=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(d=!!r.leading,b="maxWait"in r,i=r?.maxWait?Math.max(+r?.maxWait||0,e):i,E="trailing"in r?!!r.trailing:E);function M(p){let T=n,x=s;return n=s=void 0,u=p,o=t.apply(x,T),o}function R(p,T){return S?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(p)):setTimeout(p,T)}function Te(p){if(S){window.cancelAnimationFrame(p);return}clearTimeout(p)}function ve(p){return u=p,a=R(A,e),d?M(p):o}function Ie(p){let T=p-c,x=p-u,Z=e-T;return b?Math.min(Z,i-x):Z}function X(p){let T=p-c,x=p-u;return c===void 0||T>=e||T<0||b&&x>=i}function A(){let p=Date.now();if(X(p))return J(p);a=R(A,Ie(p))}function J(p){return a=void 0,E&&n?M(p):(n=s=void 0,o)}function xe(){a!==void 0&&Te(a),u=0,n=c=s=a=void 0}function he(){return a===void 0?o:J(Date.now())}function ge(){return a!==void 0}function k(...p){let T=Date.now(),x=X(T);if(n=p,s=this,c=T,x){if(a===void 0)return ve(c);if(b)return a=R(A,e),M(c)}return a===void 0&&(a=R(A,e)),o}return k.cancel=xe,k.flush=he,k.pending=ge,k}var j=(t,e=0,r)=>z(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var C=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let s=e(t[n],n,t,r);if(s!==void 0){r[n]=s;continue}}typeof t[n]=="object"?r[n]=C(t[n],e):r[n]=t[n]}return r};var tt=t=>C(t);var rt=300,nt=(t,e=rt)=>new l(r=>{let{width:n,height:s}=t.getBoundingClientRect();if(r.next({width:n,height:s}),!window.ResizeObserver)return;let i=new ResizeObserver(j(o=>{let a=o[0];if(!a)return;let c,u;a.contentBoxSize&&a.contentBoxSize[0]?(u=a.contentBoxSize[0].blockSize,c=a.contentBoxSize[0].inlineSize):a.contentRect&&(c=a.contentRect.width,u=a.contentRect.height),y(c)&&y(u)&&r.next({width:c,height:u})},e));return i.observe(t),()=>i.disconnect()});var L=class extends I{constructor(r){super();this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){let n=super._subscribe(r);return r.next(this.value),n}};function oe(t){return new l(e=>{let r={},n=Object.keys(t).length,s=i=>o=>{i in r||n--,r[i]=o,n===0&&e.next(r)};return Object.entries(t).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new f)})}function ie(...t){return new l(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new f))}var ot=t=>new l(e=>{let r=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>window.clearTimeout(r)});var it=t=>new l(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var st=t=>new l(e=>{t.forEach(r=>e.next(r))});var at=(t,e)=>new l(r=>{let n=s=>r.next(s);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function se(t){return e=>new l(r=>e.subscribe(new B(r,t)))}var B=class{constructor(e,r){this.destination=e;this.size=r;this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){this.destination.error?.(e)}};var lt={leading:!1,trailing:!0};function ae(t,e=lt){return r=>new l(n=>r.subscribe(new W(n,t,e)))}var W=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,y(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(e){this.destination.error?.(e)}};var ut={leading:!0,trailing:!1};function le(t,e=ut){return r=>new l(n=>r.subscribe(new G(n,t,e)))}var G=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,V(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){this.destination.error?.(e)}};function ue(t){return e=>new l(r=>e.subscribe(new q(r,t)))}var q=class{constructor(e,r){this.destination=e;this.predicate=r}next(e){let r;try{r=this.predicate(e)}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function pe(t=(e,r)=>e===r){return e=>new l(r=>e.subscribe(new H(r,t)))}var ce={},H=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=ce}next(e){let r;try{r=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function P(t){return e=>new l(r=>e.subscribe(new K(r,t)))}var K=class{constructor(e,r){this.destination=e;this.mapper=r}next(e){let r;try{r=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(r)}error(e){this.destination.error?.(e)}};function be(t){return P(()=>t)}function de(){return t=>new l(e=>{let r=!1,n=!1,s=t.subscribe(i=>{r||(r=!0,e.next(i)),n&&s.unsubscribe()},i=>{r=!0,e.error?.(i),n&&s.unsubscribe()});return n=!0,r&&s.unsubscribe(),s})}function fe(){return t=>new l(e=>t.subscribe(new $(e)))}var $=class{constructor(e){this.destination=e;this.hasLast=!1}next(e){let r=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,e])}error(e){this.destination.error?.(e)}};function me(t){return e=>new l(r=>e.subscribe(new Y(r,t)))}var Y=class{constructor(e,r){this.destination=e;this.effect=r}next(e){try{this.effect(e)}catch(r){throw this.error(r),r}this.destination.next(e)}error(e){this.destination.error?.(e)}};var ct=(a=>(a.NETWORK="network",a.VIDEO_PIPELINE="video_pipeline",a.EXTERNAL_API="external_api",a.PARSER="parser",a.DOM="dom",a.WTF="wtf",a.FATAL="fatal",a))(ct||{});var pt=(b=>(b.Armenian="58",b.Azerbaijani="57",b.Belarusian="114",b.English="3",b.Kazakh="97",b.Portuguese="73",b.Russian="0",b.Spanish="4",b.Ukrainian="1",b.Uzbek="65",b.Vietnamese="75",b))(pt||{}),bt="vk.com",Nn=async(t,e,r)=>{let n=new URL(`https://${bt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let i=await(await fetch(n.toString())).json();return dt(i,r)},dt=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),ft(n)])),ft=t=>Array.isArray(t)?t[0]:t;var mt=(r=>(r.RU="ru",r.EN="en",r))(mt||{});export{ee as CurrentClientBrowser,te as CurrentClientDevice,ct as ErrorCategory,mt as InterfaceLanguage,N as Logger,l as Observable,I as Subject,f as Subscription,we as VERSION,pt as VKNumericLanguage,L as ValueSubject,D as VideoQuality,Pe as abortable,Ce as addScript,Je as areQualitiesExact,ke as assertEmptyArray,v as assertNever,Se as assertNonNullable,Ae as assertNotEmptyArray,Re as assertNullable,Ze as assertQualityIsExact,se as buffer,Ee as checkNever,tt as cloneDeep,C as cloneDeepWith,oe as combine,ae as debounce,z as debounceFn,We as detectEmbed,et as fillWithDefault,ue as filter,pe as filterChanged,at as fromEvent,Q as getCurrentBrowser,_e as getExponentialDelay,Ke as getHighestQuality,Ne as getIOSVersion,it as interval,Ge as isHigher,qe as isHigherOrEqual,Me as isIOS,F as isInvariantQuality,U as isLower,He as isLowerOrEqual,Ve as isMacLike,Qe as isMobile,y as isNonNullable,V as isNullable,Nn as loadVKLangPack,P as map,be as mapTo,ie as merge,h as noop,Le as now,st as observableFrom,nt as observeElementSize,de as once,fe as pairwise,re as safeStorage,me as tap,le as throttle,j as throttleFn,Gt as timeCodeToString,ot as timeout,$e as videoHeightToQuality,Xe as videoQualityToHeight,Ye as videoSizeToQuality};
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-shared",
|
|
3
|
-
"version": "1.0.36-dev.
|
|
3
|
+
"version": "1.0.36-dev.a84e6475.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Shared code for vk.com videoplayer",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
7
7
|
"license": "GPL-3.0",
|
|
8
8
|
"main": "./esnext.cjs.js",
|
|
9
9
|
"module": "./esnext.esm.js",
|
|
10
|
-
"types": "./index.d.ts",
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./esnext.esm.js",
|
|
15
15
|
"require": "./esnext.cjs.js",
|
|
16
|
-
"types": "./index.d.ts"
|
|
16
|
+
"types": "./types/index.d.ts"
|
|
17
17
|
},
|
|
18
18
|
"./evergreen": {
|
|
19
19
|
"import": "./evergreen.esm.js",
|
|
20
20
|
"require": "./evergreen.cjs.js",
|
|
21
|
-
"types": "./index.d.ts"
|
|
21
|
+
"types": "./types/index.d.ts"
|
|
22
22
|
},
|
|
23
23
|
"./esnext": {
|
|
24
24
|
"import": "./esnext.esm.js",
|
|
25
25
|
"require": "./esnext.cjs.js",
|
|
26
|
-
"types": "./index.d.ts"
|
|
26
|
+
"types": "./types/index.d.ts"
|
|
27
27
|
},
|
|
28
28
|
"./es2018": {
|
|
29
29
|
"import": "./es2018.esm.js",
|
|
30
30
|
"require": "./es2018.cjs.js",
|
|
31
|
-
"types": "./index.d.ts"
|
|
31
|
+
"types": "./types/index.d.ts"
|
|
32
32
|
},
|
|
33
33
|
"./es2015": {
|
|
34
34
|
"import": "./es2015.esm.js",
|
|
35
35
|
"require": "./es2015.cjs.js",
|
|
36
|
-
"types": "./index.d.ts"
|
|
36
|
+
"types": "./types/index.d.ts"
|
|
37
37
|
},
|
|
38
38
|
"./evergreen.esm.js": "./evergeen.esm.js",
|
|
39
39
|
"./esnext.esm.js": "./esnext.esm.js",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Subject from '../reactive/Subject';
|
|
2
|
+
import type { ILogger, ILogInputEntry, IComponentLogger, ILogEntry } from './types';
|
|
3
|
+
export declare class Logger implements ILogger {
|
|
4
|
+
log$: Subject<ILogEntry>;
|
|
5
|
+
private logs;
|
|
6
|
+
log: (inputEntry: ILogInputEntry) => void;
|
|
7
|
+
createCustomLog<TArgs extends unknown[]>(transform: (...args: TArgs) => ILogInputEntry): (...args: TArgs) => void;
|
|
8
|
+
createComponentLog(component: string): IComponentLogger;
|
|
9
|
+
getAllLogs: () => ILogEntry[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { IObservable } from '../reactive/types';
|
|
2
|
+
export interface ILogger {
|
|
3
|
+
log: (entry: ILogInputEntry) => void;
|
|
4
|
+
createCustomLog: <TArgs extends unknown[]>(transform: (...args: TArgs) => ILogInputEntry) => (...args: TArgs) => void;
|
|
5
|
+
createComponentLog: (component: string) => IComponentLogger;
|
|
6
|
+
getAllLogs: () => ILogEntry[];
|
|
7
|
+
log$: IObservable<ILogEntry>;
|
|
8
|
+
}
|
|
9
|
+
export interface ILogEntry {
|
|
10
|
+
/**
|
|
11
|
+
* Сообщение.
|
|
12
|
+
*/
|
|
13
|
+
message: string;
|
|
14
|
+
/**
|
|
15
|
+
* Компонент, в котором залогировано событие. (модуль, класс или функция)
|
|
16
|
+
*/
|
|
17
|
+
component: string;
|
|
18
|
+
/**
|
|
19
|
+
* Время, в которое случилось логируемое событие
|
|
20
|
+
*/
|
|
21
|
+
timestamp: number;
|
|
22
|
+
}
|
|
23
|
+
export type IComponentLogger = (entry: IComponentLogEntry) => void;
|
|
24
|
+
export type ILogInputEntry = Omit<ILogEntry, 'timestamp'>;
|
|
25
|
+
export interface IComponentLogEntry extends Omit<ILogInputEntry, 'component'>, IOptionalComponent {
|
|
26
|
+
}
|
|
27
|
+
interface IOptionalComponent {
|
|
28
|
+
component?: ILogInputEntry['component'];
|
|
29
|
+
}
|
|
30
|
+
export {};
|
package/types/env.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION: string;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IEmitter, IListener, IObservable, IOperator, ISubscription, IUnsubscriber } from './types';
|
|
2
|
+
export default class Observable<T> implements IObservable<T> {
|
|
3
|
+
constructor(subscribe?: (emitter: IEmitter<T>) => IUnsubscriber | ISubscription | void);
|
|
4
|
+
subscribe(listener: IListener<T>, error?: IListener<Error | unknown>): ISubscription;
|
|
5
|
+
pipe(...operators: IOperator<unknown, unknown>[]): IObservable<unknown>;
|
|
6
|
+
protected _subscribe(_emitter: IEmitter<T>): IUnsubscriber | ISubscription | void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IEmitter, ISubject, ISubscription, IUnsubscriber } from './types';
|
|
2
|
+
import Observable from './Observable';
|
|
3
|
+
export default class Subject<T> extends Observable<T> implements ISubject<T> {
|
|
4
|
+
private keyCounter;
|
|
5
|
+
private subscribers;
|
|
6
|
+
constructor();
|
|
7
|
+
next(value: T): void;
|
|
8
|
+
error(value: T): void;
|
|
9
|
+
protected _subscribe(emitter: IEmitter<T>): IUnsubscriber | ISubscription | void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IEmitter, ISubscription, IUnsubscriber, IValueSubject } from './types';
|
|
2
|
+
import Subject from './Subject';
|
|
3
|
+
export default class ValueSubject<T> extends Subject<T> implements IValueSubject<T> {
|
|
4
|
+
private value;
|
|
5
|
+
constructor(initialValue: T);
|
|
6
|
+
next(value: T): void;
|
|
7
|
+
error(value: T): void;
|
|
8
|
+
getValue(): T;
|
|
9
|
+
protected _subscribe(emitter: IEmitter<T>): IUnsubscriber | ISubscription | void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IObservable, TypeOfObservable } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Создаёт Observable, который состоит из объектов, ключами которых являются последние значения исходных Observable.
|
|
4
|
+
* Первое событие возникает тогда, когда каждый исходный Observable выдал хотя бы одно значение.
|
|
5
|
+
*/
|
|
6
|
+
type CombineObservables<T extends Record<string, IObservable<unknown>>> = {
|
|
7
|
+
[key in keyof T]: TypeOfObservable<T[key]>;
|
|
8
|
+
};
|
|
9
|
+
export default function combine<T extends Record<string, IObservable<unknown>>>(observables: T): IObservable<CombineObservables<T>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IObservable } from './types';
|
|
2
|
+
interface IEventTarget {
|
|
3
|
+
addEventListener(type: string, handler: (...params: any[]) => void): void;
|
|
4
|
+
removeEventListener(type: string, handler: (...params: any[]) => void): void;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: <T>(target: IEventTarget, eventName: string) => IObservable<T>;
|
|
7
|
+
export default _default;
|