@vkontakte/videoplayer-shared 1.0.32-dev.0f82d9ff.0 → 1.0.32-dev.7bf5a18e.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 +1 -1
package/es2015.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32-dev.7bf5a18e.0
|
|
3
|
+
* Wed, 07 Feb 2024 09:56:57 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const sn="1.0.32-dev.0f82d9ff.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},cn=e=>{},G=()=>{};class p{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:G}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:G,error:G};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new Y().add(()=>{switch(a.next=G,a.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends p{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class ln{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},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(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function un(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function vn(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}function fn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function dn(e,r){if(e!=null&&e.length)throw new Error(r)}const hn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var de;const pn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now();function ot(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(c){try{l(n.next(c))}catch(u){i(u)}}function v(c){try{l(n.throw(c))}catch(u){i(u)}}function l(c){c.done?a(c.value):o(c.value).then(s,v)}l((n=n.apply(e,r||[])).next())})}const bn=(e,r)=>(...t)=>ot(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}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 Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,c=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,u=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:v||l||c||u||d||f||exports.CurrentClientDevice.Desktop}},yn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},gn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},On=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),wn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(b=new Map),j},mn=()=>k()===h.LOCAL_STORAGE,$n=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(e);default:C(n)}},En=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(e,r));default:C(t)}},Sn=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=b==null?void 0:b.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},Tn=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(b==null?void 0:b.delete(e));default:C(r)}},In=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:C(e)}};var Rn=Object.freeze({__proto__:null,clear:In,get:$n,has:Sn,isPersistent:mn,remove:Tn,set:En});const Pn=()=>{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)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};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 $={[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}},_n=(e,r)=>$[e].height>$[r].height,An=(e,r)=>$[e].height>=$[r].height,He=(e,r)=>$[e].height<$[r].height,jn=(e,r)=>$[e].height<=$[r].height,Cn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],at=Object.keys($).sort((e,r)=>He(e,r)?-1:1),Ln=(e,r=.02)=>[...at].find(n=>$[n].height*(1+r)>=e),xn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},Nn=e=>$[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Mn=e=>e.every(r=>!ze(r));function Dn(e){if(ze(e))throw new Error("Expected exact quality")}const it=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=it(a,o):t[n]=n in e?a:o}return t},Fn=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};class Gn extends qe{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){const t=super._subscribe(r);return r.next(this.value),t}}function Vn(e){return new p(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new Y)})}function kn(...e){return new p(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Bn=e=>new p(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Un=e=>new p(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Qn=e=>new p(r=>{e.forEach(t=>r.next(t))}),Kn=(e,r)=>new p(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function qn(e){return r=>new p(t=>r.subscribe(new Yn(t,e)))}class Yn{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Hn={leading:!1,trailing:!0};function zn(e,r=Hn){return t=>new p(n=>t.subscribe(new Wn(n,e,r)))}class Wn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Xn={leading:!0,trailing:!1};function Jn(e,r=Xn){return t=>new p(n=>t.subscribe(new Zn(n,e,r)))}class Zn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function eo(e){return r=>new p(t=>r.subscribe(new ro(t,e)))}class ro{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function to(e=(r,t)=>r===t){return r=>new p(t=>r.subscribe(new no(t,e)))}const lr={};class no{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=lr}next(r){let t;try{t=this.lastValue===lr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function st(e){return r=>new p(t=>r.subscribe(new oo(t,e)))}let oo=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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function ao(e){return st(()=>e)}function io(){return e=>new p(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function so(){return e=>new p(r=>e.subscribe(new co(r)))}class co{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function lo(e){return r=>new p(t=>r.subscribe(new uo(t,e)))}class uo{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{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;const 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;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class ct extends ur{constructor(){super(),this.listeners||ur.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)}}class vo{constructor(){Object.defineProperty(this,"signal",{value:new ct,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(vo.prototype[Symbol.toStringTag]="AbortController",ct.prototype[Symbol.toStringTag]="AbortSignal");function lt(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 fo(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!lt({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 u;c&&c.signal&&(u=c.signal,delete c.signal);const f=new t(l,c);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(c.aborted)return Promise.reject(u);const f=new Promise((d,O)=>{c.addEventListener("abort",()=>O(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:a}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ut=We?fo({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ho=We?ut.fetch:window.fetch;We?ut.Request:window.Request;var pe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P=function(e){try{return!!e()}catch(r){return!0}},bo=P,ve=!bo(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),vt=ve,ft=Function.prototype,De=ft.call,yo=vt&&ft.bind.bind(De,De),L=vt?yo:function(e){return function(){return De.apply(e,arguments)}},dt=L,go=dt({}.toString),Oo=dt("".slice),Xe=function(e){return Oo(go(e),8,-1)},wo=L,mo=P,$o=Xe,be=Object,Eo=wo("".split),So=mo(function(){return!be("z").propertyIsEnumerable(0)})?function(e){return $o(e)=="String"?Eo(e,""):be(e)}:be,Je=function(e){return e==null},To=Je,Io=TypeError,ht=function(e){if(To(e))throw Io("Can't call method on "+e);return e},Ro=So,Po=ht,H=function(e){return Ro(Po(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof pe=="object"&&pe)||function(){return this}()||pe||Function("return this")(),Fe=typeof document=="object"&&document.all,_o=typeof Fe=="undefined"&&Fe!==void 0,pt={all:Fe,IS_HTMLDDA:_o},bt=pt,Ao=bt.all,T=bt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Ao}:function(e){return typeof e=="function"},jo=S,Co=T,vr=jo.WeakMap,Lo=Co(vr)&&/native code/.test(String(vr)),fr=T,yt=pt,xo=yt.all,U=yt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===xo}:function(e){return typeof e=="object"?e!==null:fr(e)},No=P,x=!No(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Mo=S,dr=U,Ge=Mo.document,Do=dr(Ge)&&dr(Ge.createElement),gt=function(e){return Do?Ge.createElement(e):{}},Fo=x,Go=P,Vo=gt,Ot=!Fo&&!Go(function(){return Object.defineProperty(Vo("div"),"a",{get:function(){return 7}}).a!=7}),ko=x,Bo=P,wt=ko&&Bo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Uo=U,Qo=String,Ko=TypeError,K=function(e){if(Uo(e))return e;throw Ko(Qo(e)+" is not an object")},qo=ve,J=Function.prototype.call,N=qo?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,Yo=T,hr=function(e){return Yo(e)?e:void 0},mt=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Ho=L,$t=Ho({}.isPrototypeOf),zo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=S,Oe=zo,pr=Et.process,br=Et.Deno,yr=pr&&pr.versions||br&&br.version,gr=yr&&yr.v8,E,ce;gr&&(E=gr.split("."),ce=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!ce&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(ce=+E[1])));var Wo=ce,Or=Wo,Xo=P,Jo=S,Zo=Jo.String,St=!!Object.getOwnPropertySymbols&&!Xo(function(){var e=Symbol();return!Zo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),ea=St,Tt=ea&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ra=mt,ta=T,na=$t,oa=Tt,aa=Object,It=oa?function(e){return typeof e=="symbol"}:function(e){var r=ra("Symbol");return ta(r)&&na(r.prototype,aa(e))},ia=String,er=function(e){try{return ia(e)}catch(r){return"Object"}},sa=T,ca=er,la=TypeError,rr=function(e){if(sa(e))return e;throw la(ca(e)+" is not a function")},ua=rr,va=Je,tr=function(e,r){var t=e[r];return va(t)?void 0:ua(t)},we=N,me=T,$e=U,fa=TypeError,da=function(e,r){var t,n;if(r==="string"&&me(t=e.toString)&&!$e(n=we(t,e))||me(t=e.valueOf)&&!$e(n=we(t,e))||r!=="string"&&me(t=e.toString)&&!$e(n=we(t,e)))return n;throw fa("Can't convert object to primitive value")},Rt={exports:{}},wr=S,ha=Object.defineProperty,pa=function(e,r){try{ha(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},ba=S,ya=pa,mr="__core-js_shared__",ga=ba[mr]||ya(mr,{}),Pt=ga,$r=Pt;(Rt.exports=function(e,r){return $r[e]||($r[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var _t=Rt.exports,Oa=ht,wa=Object,At=function(e){return wa(Oa(e))},ma=L,$a=At,Ea=ma({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return Ea($a(r),t)},Sa=L,Ta=0,Ia=Math.random(),Ra=Sa(1 .toString),jt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ra(++Ta+Ia,36)},Pa=S,_a=_t,Er=A,Aa=jt,ja=St,Ca=Tt,V=Pa.Symbol,Ee=_a("wks"),La=Ca?V.for||V:V&&V.withoutSetter||Aa,_=function(e){return Er(Ee,e)||(Ee[e]=ja&&Er(V,e)?V[e]:La("Symbol."+e)),Ee[e]},xa=N,Sr=U,Tr=It,Na=tr,Ma=da,Da=_,Fa=TypeError,Ga=Da("toPrimitive"),Va=function(e,r){if(!Sr(e)||Tr(e))return e;var t=Na(e,Ga),n;if(t){if(r===void 0&&(r="default"),n=xa(t,e,r),!Sr(n)||Tr(n))return n;throw Fa("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ma(e,r)},ka=Va,Ba=It,nr=function(e){var r=ka(e,"string");return Ba(r)?r:r+""},Ua=x,Qa=Ot,Ka=wt,Z=K,Ir=nr,qa=TypeError,Se=Object.defineProperty,Ya=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Re="writable";Q.f=Ua?Ka?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Re in n&&!n[Re]){var o=Ya(r,t);o&&o[Re]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:o[Ie],enumerable:Te in n?n[Te]:o[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Qa)try{return Se(r,t,n)}catch(o){}if("get"in n||"set"in n)throw qa("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Ha=x,za=Q,Wa=fe,z=Ha?function(e,r,t){return za.f(e,r,Wa(1,t))}:function(e,r,t){return e[r]=t,e},Xa=_t,Ja=jt,Rr=Xa("keys"),or=function(e){return Rr[e]||(Rr[e]=Ja(e))},ar={},Za=Lo,Ct=S,ei=U,ri=z,Pe=A,_e=Pt,ti=or,ni=ar,Pr="Object already initialized",Ve=Ct.TypeError,oi=Ct.WeakMap,le,q,ue,ai=function(e){return ue(e)?q(e):le(e,{})},ii=function(e){return function(r){var t;if(!ei(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Za||_e.state){var I=_e.state||(_e.state=new oi);I.get=I.get,I.has=I.has,I.set=I.set,le=function(e,r){if(I.has(e))throw Ve(Pr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=ti("state");ni[M]=!0,le=function(e,r){if(Pe(e,M))throw Ve(Pr);return r.facade=e,ri(e,M,r),r},q=function(e){return Pe(e,M)?e[M]:{}},ue=function(e){return Pe(e,M)}}var si={set:le,get:q,has:ue,enforce:ai,getterFor:ii},ci=ve,Lt=Function.prototype,_r=Lt.apply,Ar=Lt.call,li=typeof Reflect=="object"&&Reflect.apply||(ci?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),ui=Xe,vi=L,xt=function(e){if(ui(e)==="Function")return vi(e)},Nt={},Mt={},Dt={}.propertyIsEnumerable,Ft=Object.getOwnPropertyDescriptor,fi=Ft&&!Dt.call({1:2},1);Mt.f=fi?function(r){var t=Ft(this,r);return!!t&&t.enumerable}:Dt;var di=x,hi=N,pi=Mt,bi=fe,yi=H,gi=nr,Oi=A,wi=Ot,jr=Object.getOwnPropertyDescriptor;Nt.f=di?jr:function(r,t){if(r=yi(r),t=gi(t),wi)try{return jr(r,t)}catch(n){}if(Oi(r,t))return bi(!hi(pi.f,r,t),r[t])};var mi=P,$i=T,Ei=/#|\.prototype\./,W=function(e,r){var t=Ti[Si(e)];return t==Ri?!0:t==Ii?!1:$i(r)?mi(r):!!r},Si=W.normalize=function(e){return String(e).replace(Ei,".").toLowerCase()},Ti=W.data={},Ii=W.NATIVE="N",Ri=W.POLYFILL="P",Pi=W,Cr=xt,_i=rr,Ai=ve,ji=Cr(Cr.bind),Gt=function(e,r){return _i(e),r===void 0?e:Ai?ji(e,r):function(){return e.apply(r,arguments)}},ee=S,Ci=li,Li=xt,xi=T,Ni=Nt.f,Mi=Pi,D=Ze,Di=Gt,F=z,Lr=A,Fi=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 Ci(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ee:o?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,u,f,d,O,m,w,y;for(f in r)l=Mi(n?f:t+(o?".":"#")+f,e.forced),c=!l&&i&&Lr(i,f),O=s[f],c&&(e.dontCallGetSet?(y=Ni(i,f),m=y&&y.value):m=i[f]),d=c&&m?m:r[f],!(c&&typeof O==typeof d)&&(e.bind&&c?w=Di(d,ee):e.wrap&&c?w=Fi(d):a&&xi(d)?w=Li(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,f,w),a&&(u=t+"Prototype",Lr(D,u)||F(D,u,{}),F(D[u],f,d),e.real&&v&&(l||!v[f])&&F(v,f,d)))},ke=x,Gi=A,kt=Function.prototype,Vi=ke&&Object.getOwnPropertyDescriptor,ir=Gi(kt,"name"),ki=ir&&function(){}.name==="something",Bi=ir&&(!ke||ke&&Vi(kt,"name").configurable),Ui={EXISTS:ir,PROPER:ki,CONFIGURABLE:Bi},Bt={},Qi=Math.ceil,Ki=Math.floor,qi=Math.trunc||function(r){var t=+r;return(t>0?Ki:Qi)(t)},Yi=qi,Ut=function(e){var r=+e;return r!==r||r===0?0:Yi(r)},Hi=Ut,zi=Math.max,Wi=Math.min,Xi=function(e,r){var t=Hi(e);return t<0?zi(t+r,0):Wi(t,r)},Ji=Ut,Zi=Math.min,es=function(e){return e>0?Zi(Ji(e),9007199254740991):0},rs=es,Qt=function(e){return rs(e.length)},ts=H,ns=Xi,os=Qt,xr=function(e){return function(r,t,n){var o=ts(r),a=os(o),i=ns(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},as={includes:xr(!0),indexOf:xr(!1)},is=L,Ae=A,ss=H,cs=as.indexOf,ls=ar,Nr=is([].push),us=function(e,r){var t=ss(e),n=0,o=[],a;for(a in t)!Ae(ls,a)&&Ae(t,a)&&Nr(o,a);for(;r.length>n;)Ae(t,a=r[n++])&&(~cs(o,a)||Nr(o,a));return o},Kt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vs=us,fs=Kt,ds=Object.keys||function(r){return vs(r,fs)},hs=x,ps=wt,bs=Q,ys=K,gs=H,Os=ds;Bt.f=hs&&!ps?Object.defineProperties:function(r,t){ys(r);for(var n=gs(t),o=Os(t),a=o.length,i=0,s;a>i;)bs.f(r,s=o[i++],n[s]);return r};var ws=mt,ms=ws("document","documentElement"),$s=K,Es=Bt,Mr=Kt,Ss=ar,Ts=ms,Is=gt,Rs=or,Dr=">",Fr="<",Be="prototype",Ue="script",qt=Rs("IE_PROTO"),je=function(){},Yt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(Yt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ps=function(){var e=Is("iframe"),r="java"+Ue+":",t;return e.style.display="none",Ts.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Yt("document.F=Object")),t.close(),t.F},re,ae=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}ae=typeof document!="undefined"?document.domain&&re?Gr(re):Ps():Gr(re);for(var e=Mr.length;e--;)delete ae[Be][Mr[e]];return ae()};Ss[qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(je[Be]=$s(r),n=new je,je[Be]=null,n[qt]=r):n=ae(),t===void 0?n:Es.f(n,t)},_s=P,As=!_s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),js=A,Cs=T,Ls=At,xs=or,Ns=As,Vr=xs("IE_PROTO"),Qe=Object,Ms=Qe.prototype,zt=Ns?Qe.getPrototypeOf:function(e){var r=Ls(e);if(js(r,Vr))return r[Vr];var t=r.constructor;return Cs(t)&&r instanceof t?t.prototype:r instanceof Qe?Ms:null},Ds=z,Wt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Ds(e,r,t),e},Fs=P,Gs=T,Vs=U,ks=Ht,kr=zt,Bs=Wt,Us=_,Ke=Us("iterator"),Xt=!1,R,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(R=Ce)):Xt=!0);var Qs=!Vs(R)||Fs(function(){var e={};return R[Ke].call(e)!==e});Qs?R={}:R=ks(R);Gs(R[Ke])||Bs(R,Ke,function(){return this});var Jt={IteratorPrototype:R,BUGGY_SAFARI_ITERATORS:Xt},Ks=_,qs=Ks("toStringTag"),Zt={};Zt[qs]="z";var sr=String(Zt)==="[object z]",Ys=sr,Hs=T,ie=Xe,zs=_,Ws=zs("toStringTag"),Xs=Object,Js=ie(function(){return arguments}())=="Arguments",Zs=function(e,r){try{return e[r]}catch(t){}},cr=Ys?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Zs(r=Xs(e),Ws))=="string"?t:Js?ie(r):(n=ie(r))=="Object"&&Hs(r.callee)?"Arguments":n},ec=sr,rc=cr,tc=ec?{}.toString:function(){return"[object "+rc(this)+"]"},nc=sr,oc=Q.f,ac=z,ic=A,sc=tc,cc=_,Br=cc("toStringTag"),en=function(e,r,t,n){if(e){var o=t?e:e.prototype;ic(o,Br)||oc(o,Br,{configurable:!0,value:r}),n&&!nc&&ac(o,"toString",sc)}},lc=Jt.IteratorPrototype,uc=Ht,vc=fe,fc=en,dc=B,hc=function(){return this},pc=function(e,r,t,n){var o=r+" Iterator";return e.prototype=uc(lc,{next:vc(+!n,t)}),fc(e,o,!1,!0),dc[o]=hc,e},bc=Vt,yc=N,rn=Ui,gc=pc,Oc=zt,wc=en,Ur=Wt,mc=_,Qr=B,tn=Jt,$c=rn.PROPER;rn.CONFIGURABLE;tn.IteratorPrototype;var te=tn.BUGGY_SAFARI_ITERATORS,xe=mc("iterator"),Kr="keys",ne="values",qr="entries",Ec=function(){return this},Sc=function(e,r,t,n,o,a,i){gc(t,r,n);var s=function(y){if(y===o&&f)return f;if(!te&&y in c)return c[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,u=c[xe]||c["@@iterator"]||o&&c[o],f=!te&&u||s(o),d=r=="Array"&&c.entries||u,O,m,w;if(d&&(O=Oc(d.call(new e)),O!==Object.prototype&&O.next&&(wc(O,v,!0,!0),Qr[v]=Ec)),$c&&o==ne&&u&&u.name!==ne&&(l=!0,f=function(){return yc(u,this)}),o)if(m={values:s(ne),keys:a?f:s(Kr),entries:s(qr)},i)for(w in m)(te||l||!(w in c))&&Ur(c,w,m[w]);else bc({target:r,proto:!0,forced:te||l},m);return i&&c[xe]!==f&&Ur(c,xe,f,{name:o}),Qr[r]=f,m},Tc=function(e,r){return{value:e,done:r}},Ic=H,Yr=B,nn=si;Q.f;var Rc=Sc,oe=Tc,on="Array Iterator",Pc=nn.set,_c=nn.getterFor(on);Rc(Array,"Array",function(e,r){Pc(this,{type:on,target:Ic(e),index:0,kind:r})},function(){var e=_c(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,oe(void 0,!0)):t=="keys"?oe(n,!1):t=="values"?oe(r[n],!1):oe([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Ac=_,jc=B,Cc=Ac("iterator"),Lc=Array.prototype,xc=function(e){return e!==void 0&&(jc.Array===e||Lc[Cc]===e)},Nc=cr,Hr=tr,Mc=Je,Dc=B,Fc=_,Gc=Fc("iterator"),an=function(e){if(!Mc(e))return Hr(e,Gc)||Hr(e,"@@iterator")||Dc[Nc(e)]},Vc=N,kc=rr,Bc=K,Uc=er,Qc=an,Kc=TypeError,qc=function(e,r){var t=arguments.length<2?Qc(e):r;if(kc(t))return Bc(Vc(t,e));throw Kc(Uc(e)+" is not iterable")},Yc=N,zr=K,Hc=tr,zc=function(e,r,t){var n,o;zr(e);try{if(n=Hc(e,"return"),!n){if(r==="throw")throw t;return t}n=Yc(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return zr(n),t},Wc=Gt,Xc=N,Jc=K,Zc=er,el=xc,rl=Qt,Wr=$t,tl=qc,nl=an,Xr=zc,ol=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,al=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Wc(r,n),l,c,u,f,d,O,m,w=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return o?(Jc(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(a)l=e.iterator;else if(i)l=e;else{if(c=nl(e),!c)throw ol(Zc(e)+" is not iterable");if(el(c)){for(u=0,f=rl(e);f>u;u++)if(d=y(e[u]),d&&Wr(Jr,d))return d;return new se(!1)}l=tl(e,c)}for(O=a?e.next:l.next;!(m=Xc(O,l)).done;){try{d=y(m.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},il=nr,sl=Q,cl=fe,ll=function(e,r,t){var n=il(r);n in e?sl.f(e,n,cl(0,t)):e[n]=t},ul=Vt,vl=al,fl=ll;ul({target:"Object",stat:!0},{fromEntries:function(r){var t={};return vl(r,function(n,o){fl(t,n,o)},{AS_ENTRIES:!0}),t}});var dl=Ze,hl=dl.Object.fromEntries,pl={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},bl=pl,yl=S,gl=cr,Ol=z,Zr=B,wl=_,et=wl("toStringTag");for(var Ne in bl){var rt=yl[Ne],Me=rt&&rt.prototype;Me&&gl(Me)!==et&&Ol(Me,et,Ne),Zr[Ne]=Zr.Array}var ml=hl,$l=ml,El=$l,Sl=El,Tl=po(Sl);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 Il="vk.com",Rl=(e,r,t)=>ot(void 0,void 0,void 0,function*(){const n=new URL(`https://${Il}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield ho(n.toString())).json();return Pl(a,t)}),Pl=(e,r)=>Tl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),_l(n)])),_l=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=ln;exports.Observable=p;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=sn;exports.ValueSubject=Gn;exports.abortable=bn;exports.addScript=hn;exports.areQualitiesExact=Mn;exports.assertEmptyArray=dn;exports.assertNever=C;exports.assertNonNullable=un;exports.assertNotEmptyArray=fn;exports.assertNullable=vn;exports.assertQualityIsExact=Dn;exports.buffer=qn;exports.checkNever=cn;exports.combine=Vn;exports.debounce=zn;exports.detectEmbed=Pn;exports.fillWithDefault=it;exports.filter=eo;exports.filterChanged=to;exports.fromEvent=Kn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=wn;exports.getHighestQuality=Cn;exports.getIOSVersion=gn;exports.interval=Un;exports.isHigher=_n;exports.isHigherOrEqual=An;exports.isIOS=yn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=jn;exports.isMacLike=On;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=Rl;exports.map=st;exports.mapTo=ao;exports.merge=kn;exports.noop=G;exports.now=pn;exports.observableFrom=Qn;exports.once=io;exports.pairwise=so;exports.safeStorage=Rn;exports.tap=lo;exports.throttle=Jn;exports.timeCodeToString=Fn;exports.timeout=Bn;exports.videoHeightToQuality=Ln;exports.videoQualityToHeight=Nn;exports.videoSizeToQuality=xn;
|
|
6
|
+
"use strict";const sn="1.0.32-dev.7bf5a18e.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},cn=e=>{},G=()=>{};class p{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:G}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:G,error:G};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new Y().add(()=>{switch(a.next=G,a.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends p{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class ln{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},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(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function un(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function vn(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}function fn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function dn(e,r){if(e!=null&&e.length)throw new Error(r)}const hn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var de;const pn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now();function ot(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(c){try{l(n.next(c))}catch(u){i(u)}}function v(c){try{l(n.throw(c))}catch(u){i(u)}}function l(c){c.done?a(c.value):o(c.value).then(s,v)}l((n=n.apply(e,r||[])).next())})}const bn=(e,r)=>(...t)=>ot(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}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 Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,c=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,u=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:v||l||c||u||d||f||exports.CurrentClientDevice.Desktop}},yn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},gn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},On=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),wn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(b=new Map),j},mn=()=>k()===h.LOCAL_STORAGE,$n=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(e);default:C(n)}},En=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(e,r));default:C(t)}},Sn=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=b==null?void 0:b.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},Tn=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(b==null?void 0:b.delete(e));default:C(r)}},In=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:C(e)}};var Rn=Object.freeze({__proto__:null,clear:In,get:$n,has:Sn,isPersistent:mn,remove:Tn,set:En});const Pn=()=>{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)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};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 $={[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}},_n=(e,r)=>$[e].height>$[r].height,An=(e,r)=>$[e].height>=$[r].height,He=(e,r)=>$[e].height<$[r].height,jn=(e,r)=>$[e].height<=$[r].height,Cn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],at=Object.keys($).sort((e,r)=>He(e,r)?-1:1),Ln=(e,r=.02)=>[...at].find(n=>$[n].height*(1+r)>=e),xn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},Nn=e=>$[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Mn=e=>e.every(r=>!ze(r));function Dn(e){if(ze(e))throw new Error("Expected exact quality")}const it=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=it(a,o):t[n]=n in e?a:o}return t},Fn=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};class Gn extends qe{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){const t=super._subscribe(r);return r.next(this.value),t}}function Vn(e){return new p(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new Y)})}function kn(...e){return new p(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Bn=e=>new p(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Un=e=>new p(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Qn=e=>new p(r=>{e.forEach(t=>r.next(t))}),Kn=(e,r)=>new p(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function qn(e){return r=>new p(t=>r.subscribe(new Yn(t,e)))}class Yn{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Hn={leading:!1,trailing:!0};function zn(e,r=Hn){return t=>new p(n=>t.subscribe(new Wn(n,e,r)))}class Wn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Xn={leading:!0,trailing:!1};function Jn(e,r=Xn){return t=>new p(n=>t.subscribe(new Zn(n,e,r)))}class Zn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function eo(e){return r=>new p(t=>r.subscribe(new ro(t,e)))}class ro{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function to(e=(r,t)=>r===t){return r=>new p(t=>r.subscribe(new no(t,e)))}const lr={};class no{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=lr}next(r){let t;try{t=this.lastValue===lr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function st(e){return r=>new p(t=>r.subscribe(new oo(t,e)))}let oo=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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function ao(e){return st(()=>e)}function io(){return e=>new p(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function so(){return e=>new p(r=>e.subscribe(new co(r)))}class co{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function lo(e){return r=>new p(t=>r.subscribe(new uo(t,e)))}class uo{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{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;const 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;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class ct extends ur{constructor(){super(),this.listeners||ur.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)}}class vo{constructor(){Object.defineProperty(this,"signal",{value:new ct,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(vo.prototype[Symbol.toStringTag]="AbortController",ct.prototype[Symbol.toStringTag]="AbortSignal");function lt(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 fo(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!lt({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 u;c&&c.signal&&(u=c.signal,delete c.signal);const f=new t(l,c);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(c.aborted)return Promise.reject(u);const f=new Promise((d,O)=>{c.addEventListener("abort",()=>O(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:a}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ut=We?fo({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ho=We?ut.fetch:window.fetch;We?ut.Request:window.Request;var pe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P=function(e){try{return!!e()}catch(r){return!0}},bo=P,ve=!bo(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),vt=ve,ft=Function.prototype,De=ft.call,yo=vt&&ft.bind.bind(De,De),L=vt?yo:function(e){return function(){return De.apply(e,arguments)}},dt=L,go=dt({}.toString),Oo=dt("".slice),Xe=function(e){return Oo(go(e),8,-1)},wo=L,mo=P,$o=Xe,be=Object,Eo=wo("".split),So=mo(function(){return!be("z").propertyIsEnumerable(0)})?function(e){return $o(e)=="String"?Eo(e,""):be(e)}:be,Je=function(e){return e==null},To=Je,Io=TypeError,ht=function(e){if(To(e))throw Io("Can't call method on "+e);return e},Ro=So,Po=ht,H=function(e){return Ro(Po(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof pe=="object"&&pe)||function(){return this}()||pe||Function("return this")(),Fe=typeof document=="object"&&document.all,_o=typeof Fe=="undefined"&&Fe!==void 0,pt={all:Fe,IS_HTMLDDA:_o},bt=pt,Ao=bt.all,T=bt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Ao}:function(e){return typeof e=="function"},jo=S,Co=T,vr=jo.WeakMap,Lo=Co(vr)&&/native code/.test(String(vr)),fr=T,yt=pt,xo=yt.all,U=yt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===xo}:function(e){return typeof e=="object"?e!==null:fr(e)},No=P,x=!No(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Mo=S,dr=U,Ge=Mo.document,Do=dr(Ge)&&dr(Ge.createElement),gt=function(e){return Do?Ge.createElement(e):{}},Fo=x,Go=P,Vo=gt,Ot=!Fo&&!Go(function(){return Object.defineProperty(Vo("div"),"a",{get:function(){return 7}}).a!=7}),ko=x,Bo=P,wt=ko&&Bo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Uo=U,Qo=String,Ko=TypeError,K=function(e){if(Uo(e))return e;throw Ko(Qo(e)+" is not an object")},qo=ve,J=Function.prototype.call,N=qo?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,Yo=T,hr=function(e){return Yo(e)?e:void 0},mt=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Ho=L,$t=Ho({}.isPrototypeOf),zo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=S,Oe=zo,pr=Et.process,br=Et.Deno,yr=pr&&pr.versions||br&&br.version,gr=yr&&yr.v8,E,ce;gr&&(E=gr.split("."),ce=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!ce&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(ce=+E[1])));var Wo=ce,Or=Wo,Xo=P,Jo=S,Zo=Jo.String,St=!!Object.getOwnPropertySymbols&&!Xo(function(){var e=Symbol();return!Zo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),ea=St,Tt=ea&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ra=mt,ta=T,na=$t,oa=Tt,aa=Object,It=oa?function(e){return typeof e=="symbol"}:function(e){var r=ra("Symbol");return ta(r)&&na(r.prototype,aa(e))},ia=String,er=function(e){try{return ia(e)}catch(r){return"Object"}},sa=T,ca=er,la=TypeError,rr=function(e){if(sa(e))return e;throw la(ca(e)+" is not a function")},ua=rr,va=Je,tr=function(e,r){var t=e[r];return va(t)?void 0:ua(t)},we=N,me=T,$e=U,fa=TypeError,da=function(e,r){var t,n;if(r==="string"&&me(t=e.toString)&&!$e(n=we(t,e))||me(t=e.valueOf)&&!$e(n=we(t,e))||r!=="string"&&me(t=e.toString)&&!$e(n=we(t,e)))return n;throw fa("Can't convert object to primitive value")},Rt={exports:{}},wr=S,ha=Object.defineProperty,pa=function(e,r){try{ha(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},ba=S,ya=pa,mr="__core-js_shared__",ga=ba[mr]||ya(mr,{}),Pt=ga,$r=Pt;(Rt.exports=function(e,r){return $r[e]||($r[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var _t=Rt.exports,Oa=ht,wa=Object,At=function(e){return wa(Oa(e))},ma=L,$a=At,Ea=ma({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return Ea($a(r),t)},Sa=L,Ta=0,Ia=Math.random(),Ra=Sa(1 .toString),jt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ra(++Ta+Ia,36)},Pa=S,_a=_t,Er=A,Aa=jt,ja=St,Ca=Tt,V=Pa.Symbol,Ee=_a("wks"),La=Ca?V.for||V:V&&V.withoutSetter||Aa,_=function(e){return Er(Ee,e)||(Ee[e]=ja&&Er(V,e)?V[e]:La("Symbol."+e)),Ee[e]},xa=N,Sr=U,Tr=It,Na=tr,Ma=da,Da=_,Fa=TypeError,Ga=Da("toPrimitive"),Va=function(e,r){if(!Sr(e)||Tr(e))return e;var t=Na(e,Ga),n;if(t){if(r===void 0&&(r="default"),n=xa(t,e,r),!Sr(n)||Tr(n))return n;throw Fa("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ma(e,r)},ka=Va,Ba=It,nr=function(e){var r=ka(e,"string");return Ba(r)?r:r+""},Ua=x,Qa=Ot,Ka=wt,Z=K,Ir=nr,qa=TypeError,Se=Object.defineProperty,Ya=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Re="writable";Q.f=Ua?Ka?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Re in n&&!n[Re]){var o=Ya(r,t);o&&o[Re]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:o[Ie],enumerable:Te in n?n[Te]:o[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Qa)try{return Se(r,t,n)}catch(o){}if("get"in n||"set"in n)throw qa("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Ha=x,za=Q,Wa=fe,z=Ha?function(e,r,t){return za.f(e,r,Wa(1,t))}:function(e,r,t){return e[r]=t,e},Xa=_t,Ja=jt,Rr=Xa("keys"),or=function(e){return Rr[e]||(Rr[e]=Ja(e))},ar={},Za=Lo,Ct=S,ei=U,ri=z,Pe=A,_e=Pt,ti=or,ni=ar,Pr="Object already initialized",Ve=Ct.TypeError,oi=Ct.WeakMap,le,q,ue,ai=function(e){return ue(e)?q(e):le(e,{})},ii=function(e){return function(r){var t;if(!ei(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Za||_e.state){var I=_e.state||(_e.state=new oi);I.get=I.get,I.has=I.has,I.set=I.set,le=function(e,r){if(I.has(e))throw Ve(Pr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=ti("state");ni[M]=!0,le=function(e,r){if(Pe(e,M))throw Ve(Pr);return r.facade=e,ri(e,M,r),r},q=function(e){return Pe(e,M)?e[M]:{}},ue=function(e){return Pe(e,M)}}var si={set:le,get:q,has:ue,enforce:ai,getterFor:ii},ci=ve,Lt=Function.prototype,_r=Lt.apply,Ar=Lt.call,li=typeof Reflect=="object"&&Reflect.apply||(ci?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),ui=Xe,vi=L,xt=function(e){if(ui(e)==="Function")return vi(e)},Nt={},Mt={},Dt={}.propertyIsEnumerable,Ft=Object.getOwnPropertyDescriptor,fi=Ft&&!Dt.call({1:2},1);Mt.f=fi?function(r){var t=Ft(this,r);return!!t&&t.enumerable}:Dt;var di=x,hi=N,pi=Mt,bi=fe,yi=H,gi=nr,Oi=A,wi=Ot,jr=Object.getOwnPropertyDescriptor;Nt.f=di?jr:function(r,t){if(r=yi(r),t=gi(t),wi)try{return jr(r,t)}catch(n){}if(Oi(r,t))return bi(!hi(pi.f,r,t),r[t])};var mi=P,$i=T,Ei=/#|\.prototype\./,W=function(e,r){var t=Ti[Si(e)];return t==Ri?!0:t==Ii?!1:$i(r)?mi(r):!!r},Si=W.normalize=function(e){return String(e).replace(Ei,".").toLowerCase()},Ti=W.data={},Ii=W.NATIVE="N",Ri=W.POLYFILL="P",Pi=W,Cr=xt,_i=rr,Ai=ve,ji=Cr(Cr.bind),Gt=function(e,r){return _i(e),r===void 0?e:Ai?ji(e,r):function(){return e.apply(r,arguments)}},ee=S,Ci=li,Li=xt,xi=T,Ni=Nt.f,Mi=Pi,D=Ze,Di=Gt,F=z,Lr=A,Fi=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 Ci(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ee:o?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,u,f,d,O,m,w,y;for(f in r)l=Mi(n?f:t+(o?".":"#")+f,e.forced),c=!l&&i&&Lr(i,f),O=s[f],c&&(e.dontCallGetSet?(y=Ni(i,f),m=y&&y.value):m=i[f]),d=c&&m?m:r[f],!(c&&typeof O==typeof d)&&(e.bind&&c?w=Di(d,ee):e.wrap&&c?w=Fi(d):a&&xi(d)?w=Li(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,f,w),a&&(u=t+"Prototype",Lr(D,u)||F(D,u,{}),F(D[u],f,d),e.real&&v&&(l||!v[f])&&F(v,f,d)))},ke=x,Gi=A,kt=Function.prototype,Vi=ke&&Object.getOwnPropertyDescriptor,ir=Gi(kt,"name"),ki=ir&&function(){}.name==="something",Bi=ir&&(!ke||ke&&Vi(kt,"name").configurable),Ui={EXISTS:ir,PROPER:ki,CONFIGURABLE:Bi},Bt={},Qi=Math.ceil,Ki=Math.floor,qi=Math.trunc||function(r){var t=+r;return(t>0?Ki:Qi)(t)},Yi=qi,Ut=function(e){var r=+e;return r!==r||r===0?0:Yi(r)},Hi=Ut,zi=Math.max,Wi=Math.min,Xi=function(e,r){var t=Hi(e);return t<0?zi(t+r,0):Wi(t,r)},Ji=Ut,Zi=Math.min,es=function(e){return e>0?Zi(Ji(e),9007199254740991):0},rs=es,Qt=function(e){return rs(e.length)},ts=H,ns=Xi,os=Qt,xr=function(e){return function(r,t,n){var o=ts(r),a=os(o),i=ns(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},as={includes:xr(!0),indexOf:xr(!1)},is=L,Ae=A,ss=H,cs=as.indexOf,ls=ar,Nr=is([].push),us=function(e,r){var t=ss(e),n=0,o=[],a;for(a in t)!Ae(ls,a)&&Ae(t,a)&&Nr(o,a);for(;r.length>n;)Ae(t,a=r[n++])&&(~cs(o,a)||Nr(o,a));return o},Kt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vs=us,fs=Kt,ds=Object.keys||function(r){return vs(r,fs)},hs=x,ps=wt,bs=Q,ys=K,gs=H,Os=ds;Bt.f=hs&&!ps?Object.defineProperties:function(r,t){ys(r);for(var n=gs(t),o=Os(t),a=o.length,i=0,s;a>i;)bs.f(r,s=o[i++],n[s]);return r};var ws=mt,ms=ws("document","documentElement"),$s=K,Es=Bt,Mr=Kt,Ss=ar,Ts=ms,Is=gt,Rs=or,Dr=">",Fr="<",Be="prototype",Ue="script",qt=Rs("IE_PROTO"),je=function(){},Yt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(Yt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ps=function(){var e=Is("iframe"),r="java"+Ue+":",t;return e.style.display="none",Ts.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Yt("document.F=Object")),t.close(),t.F},re,ae=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}ae=typeof document!="undefined"?document.domain&&re?Gr(re):Ps():Gr(re);for(var e=Mr.length;e--;)delete ae[Be][Mr[e]];return ae()};Ss[qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(je[Be]=$s(r),n=new je,je[Be]=null,n[qt]=r):n=ae(),t===void 0?n:Es.f(n,t)},_s=P,As=!_s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),js=A,Cs=T,Ls=At,xs=or,Ns=As,Vr=xs("IE_PROTO"),Qe=Object,Ms=Qe.prototype,zt=Ns?Qe.getPrototypeOf:function(e){var r=Ls(e);if(js(r,Vr))return r[Vr];var t=r.constructor;return Cs(t)&&r instanceof t?t.prototype:r instanceof Qe?Ms:null},Ds=z,Wt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Ds(e,r,t),e},Fs=P,Gs=T,Vs=U,ks=Ht,kr=zt,Bs=Wt,Us=_,Ke=Us("iterator"),Xt=!1,R,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(R=Ce)):Xt=!0);var Qs=!Vs(R)||Fs(function(){var e={};return R[Ke].call(e)!==e});Qs?R={}:R=ks(R);Gs(R[Ke])||Bs(R,Ke,function(){return this});var Jt={IteratorPrototype:R,BUGGY_SAFARI_ITERATORS:Xt},Ks=_,qs=Ks("toStringTag"),Zt={};Zt[qs]="z";var sr=String(Zt)==="[object z]",Ys=sr,Hs=T,ie=Xe,zs=_,Ws=zs("toStringTag"),Xs=Object,Js=ie(function(){return arguments}())=="Arguments",Zs=function(e,r){try{return e[r]}catch(t){}},cr=Ys?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Zs(r=Xs(e),Ws))=="string"?t:Js?ie(r):(n=ie(r))=="Object"&&Hs(r.callee)?"Arguments":n},ec=sr,rc=cr,tc=ec?{}.toString:function(){return"[object "+rc(this)+"]"},nc=sr,oc=Q.f,ac=z,ic=A,sc=tc,cc=_,Br=cc("toStringTag"),en=function(e,r,t,n){if(e){var o=t?e:e.prototype;ic(o,Br)||oc(o,Br,{configurable:!0,value:r}),n&&!nc&&ac(o,"toString",sc)}},lc=Jt.IteratorPrototype,uc=Ht,vc=fe,fc=en,dc=B,hc=function(){return this},pc=function(e,r,t,n){var o=r+" Iterator";return e.prototype=uc(lc,{next:vc(+!n,t)}),fc(e,o,!1,!0),dc[o]=hc,e},bc=Vt,yc=N,rn=Ui,gc=pc,Oc=zt,wc=en,Ur=Wt,mc=_,Qr=B,tn=Jt,$c=rn.PROPER;rn.CONFIGURABLE;tn.IteratorPrototype;var te=tn.BUGGY_SAFARI_ITERATORS,xe=mc("iterator"),Kr="keys",ne="values",qr="entries",Ec=function(){return this},Sc=function(e,r,t,n,o,a,i){gc(t,r,n);var s=function(y){if(y===o&&f)return f;if(!te&&y in c)return c[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,u=c[xe]||c["@@iterator"]||o&&c[o],f=!te&&u||s(o),d=r=="Array"&&c.entries||u,O,m,w;if(d&&(O=Oc(d.call(new e)),O!==Object.prototype&&O.next&&(wc(O,v,!0,!0),Qr[v]=Ec)),$c&&o==ne&&u&&u.name!==ne&&(l=!0,f=function(){return yc(u,this)}),o)if(m={values:s(ne),keys:a?f:s(Kr),entries:s(qr)},i)for(w in m)(te||l||!(w in c))&&Ur(c,w,m[w]);else bc({target:r,proto:!0,forced:te||l},m);return i&&c[xe]!==f&&Ur(c,xe,f,{name:o}),Qr[r]=f,m},Tc=function(e,r){return{value:e,done:r}},Ic=H,Yr=B,nn=si;Q.f;var Rc=Sc,oe=Tc,on="Array Iterator",Pc=nn.set,_c=nn.getterFor(on);Rc(Array,"Array",function(e,r){Pc(this,{type:on,target:Ic(e),index:0,kind:r})},function(){var e=_c(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,oe(void 0,!0)):t=="keys"?oe(n,!1):t=="values"?oe(r[n],!1):oe([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Ac=_,jc=B,Cc=Ac("iterator"),Lc=Array.prototype,xc=function(e){return e!==void 0&&(jc.Array===e||Lc[Cc]===e)},Nc=cr,Hr=tr,Mc=Je,Dc=B,Fc=_,Gc=Fc("iterator"),an=function(e){if(!Mc(e))return Hr(e,Gc)||Hr(e,"@@iterator")||Dc[Nc(e)]},Vc=N,kc=rr,Bc=K,Uc=er,Qc=an,Kc=TypeError,qc=function(e,r){var t=arguments.length<2?Qc(e):r;if(kc(t))return Bc(Vc(t,e));throw Kc(Uc(e)+" is not iterable")},Yc=N,zr=K,Hc=tr,zc=function(e,r,t){var n,o;zr(e);try{if(n=Hc(e,"return"),!n){if(r==="throw")throw t;return t}n=Yc(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return zr(n),t},Wc=Gt,Xc=N,Jc=K,Zc=er,el=xc,rl=Qt,Wr=$t,tl=qc,nl=an,Xr=zc,ol=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,al=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Wc(r,n),l,c,u,f,d,O,m,w=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return o?(Jc(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(a)l=e.iterator;else if(i)l=e;else{if(c=nl(e),!c)throw ol(Zc(e)+" is not iterable");if(el(c)){for(u=0,f=rl(e);f>u;u++)if(d=y(e[u]),d&&Wr(Jr,d))return d;return new se(!1)}l=tl(e,c)}for(O=a?e.next:l.next;!(m=Xc(O,l)).done;){try{d=y(m.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},il=nr,sl=Q,cl=fe,ll=function(e,r,t){var n=il(r);n in e?sl.f(e,n,cl(0,t)):e[n]=t},ul=Vt,vl=al,fl=ll;ul({target:"Object",stat:!0},{fromEntries:function(r){var t={};return vl(r,function(n,o){fl(t,n,o)},{AS_ENTRIES:!0}),t}});var dl=Ze,hl=dl.Object.fromEntries,pl={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},bl=pl,yl=S,gl=cr,Ol=z,Zr=B,wl=_,et=wl("toStringTag");for(var Ne in bl){var rt=yl[Ne],Me=rt&&rt.prototype;Me&&gl(Me)!==et&&Ol(Me,et,Ne),Zr[Ne]=Zr.Array}var ml=hl,$l=ml,El=$l,Sl=El,Tl=po(Sl);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 Il="vk.com",Rl=(e,r,t)=>ot(void 0,void 0,void 0,function*(){const n=new URL(`https://${Il}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield ho(n.toString())).json();return Pl(a,t)}),Pl=(e,r)=>Tl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),_l(n)])),_l=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=ln;exports.Observable=p;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=sn;exports.ValueSubject=Gn;exports.abortable=bn;exports.addScript=hn;exports.areQualitiesExact=Mn;exports.assertEmptyArray=dn;exports.assertNever=C;exports.assertNonNullable=un;exports.assertNotEmptyArray=fn;exports.assertNullable=vn;exports.assertQualityIsExact=Dn;exports.buffer=qn;exports.checkNever=cn;exports.combine=Vn;exports.debounce=zn;exports.detectEmbed=Pn;exports.fillWithDefault=it;exports.filter=eo;exports.filterChanged=to;exports.fromEvent=Kn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=wn;exports.getHighestQuality=Cn;exports.getIOSVersion=gn;exports.interval=Un;exports.isHigher=_n;exports.isHigherOrEqual=An;exports.isIOS=yn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=jn;exports.isMacLike=On;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=Rl;exports.map=st;exports.mapTo=ao;exports.merge=kn;exports.noop=G;exports.now=pn;exports.observableFrom=Qn;exports.once=io;exports.pairwise=so;exports.safeStorage=Rn;exports.tap=lo;exports.throttle=Jn;exports.timeCodeToString=Fn;exports.timeout=Bn;exports.videoHeightToQuality=Ln;exports.videoQualityToHeight=Nn;exports.videoSizeToQuality=xn;
|
package/es2015.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32-dev.7bf5a18e.0
|
|
3
|
+
* Wed, 07 Feb 2024 09:56:57 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const zc="1.0.32-dev.0f82d9ff.0";class dr{constructor(){this.subscriptions=[]}unsubscribe(){const e=this.subscriptions;this.subscriptions=[],e.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(e){return this.subscriptions.push(e),this}}const V=r=>{throw new Error(`${r} is value of unexpected type`)},Qc=r=>{},Q=()=>{};class y{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let o;t?typeof t=="function"?o={next:t,error:Q}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:Q,error:Q};const a=typeof e=="function"?{next:s=>{try{e(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new dr().add(()=>{switch(a.next=Q,a.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...e){return e.reduce((t,n)=>n(t),this)}_subscribe(e){}}class ot extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,e)})}_subscribe(e){const t=this.keyCounter++;return this.subscribers.set(t,e),new dr().add(()=>this.subscribers.delete(t))}}class Wc{constructor(){this.log$=new ot,this.logs=[],this.log=e=>{const t=Object.assign(Object.assign({},e),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>Object.assign({component:e},t))}}function Hc(r,e='Assertion "value is not nullable" failed'){if(r==null)throw new Error(e)}function Xc(r,e='Assertion "value is nullable" failed'){if(r!=null)throw new Error(e)}function ln(r){return typeof r!="undefined"&&r!==null}function un(r){return r==null}function Jc(r,e){if(!(r!=null&&r.length))throw new Error(e)}function Zc(r,e){if(r!=null&&r.length)throw new Error(e)}const rl=(r,e,t)=>new Promise((n,o)=>{e.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=r,document.head.appendChild(l)});var br;const el=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now();function at(r,e,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(c){try{l(n.next(c))}catch(u){i(u)}}function v(c){try{l(n.throw(c))}catch(u){i(u)}}function l(c){c.done?a(c.value):o(c.value).then(s,v)}l((n=n.apply(r,e||[])).next())})}const tl=(r,e)=>(...t)=>at(void 0,void 0,void 0,function*(){var n;const o=e(...t);let a=r.aborted,i;for(;!a&&!r.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});var _;(function(r){r.Unknown="Unknown",r.Yandex="Yandex",r.Chrome="Chrome",r.Chromium="Chromium",r.Firefox="Firefox",r.Safari="Safari",r.Opera="Opera",r.Edge="Edge",r.Rest="Rest"})(_||(_={}));var p;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Mac="Mac",r.Desktop="Desktop"})(p||(p={}));const it=()=>{const{userAgent:r}=window.navigator,e=/yabrowser/i.test(r)?_.Yandex:void 0,t=/chrome|crios/i.test(r)?_.Chrome:void 0,n=/chromium/i.test(r)?_.Chromium:void 0,o=/firefox|fxios/i.test(r)?_.Firefox:void 0,a=/webkit|safari|khtml/i.test(r)?_.Safari:void 0,i=/opr\//i.test(r)?_.Opera:void 0,s=/edg/i.test(r)?_.Edge:void 0,v=/android/i.test(r)?p.Android:void 0,l=/iphone/i.test(r)?p.iPhone:void 0,c=/ipad/i.test(r)?p.iPad:void 0,u=/ipod/i.test(r)?p.iPod:void 0,f=/mac/i.test(r)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?p.RestMobile:void 0;return{browser:e||o||i||s||t||n||a||_.Rest,device:v||l||c||u||d||f||p.Desktop}},nl=(r=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(it().device);if(!r)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},ol=()=>{const{userAgent:r}=window.navigator,e=r.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;const t=e[1],n=parseFloat(t);return isNaN(n)?null:n},al=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(it().device),il=(r,{start:e=0,factor:t=2,max:n=1/0,min:o=e,random:a=0}={})=>{let i=e;return i*=Math.pow(t,r),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(r){r[r.LOCAL_STORAGE=0]="LOCAL_STORAGE",r[r.SESSION_STORAGE=1]="SESSION_STORAGE",r[r.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const yr=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(yr,"test"),localStorage.removeItem(yr),M=h.LOCAL_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)try{sessionStorage.getItem(yr),M=h.SESSION_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)M=h.RUNTIME;else throw e}else throw r}return M===h.RUNTIME&&(b=new Map),M},vn=()=>B()===h.LOCAL_STORAGE,fn=r=>{var e,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(e=localStorage.getItem(r))!==null&&e!==void 0?e:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(r))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(r);default:V(n)}},dn=(r,e)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(r,e));default:V(t)}},hn=r=>{var e;const t=B();switch(t){case h.LOCAL_STORAGE:return r in localStorage;case h.SESSION_STORAGE:return r in sessionStorage;case h.RUNTIME:return(e=b==null?void 0:b.has(r))!==null&&e!==void 0?e:!1;default:return V(t),!1}},pn=r=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.removeItem(r);case h.SESSION_STORAGE:return sessionStorage.removeItem(r);case h.RUNTIME:return void(b==null?void 0:b.delete(r));default:V(e)}},bn=()=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(r)}};var sl=Object.freeze({__proto__:null,clear:bn,get:fn,has:hn,isPersistent:vn,remove:pn,set:dn});const cl=()=>{let r,e;try{r=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?r=!0:(r=!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)}const t=e?new URL(e).hostname:void 0;return{isEmbed:r,host:t}};var $;(function(r){r.INVARIANT="Invariant quality",r.Q_144P="144p",r.Q_240P="240p",r.Q_360P="360p",r.Q_480P="480p",r.Q_720P="720p",r.Q_1080P="1080p",r.Q_1440P="1440p",r.Q_2160P="2160p",r.Q_4320P="4320p"})($||($={}));const S={[$.Q_144P]:{width:256,height:144},[$.Q_240P]:{width:428,height:240},[$.Q_360P]:{width:640,height:360},[$.Q_480P]:{width:856,height:480},[$.Q_720P]:{width:1280,height:720},[$.Q_1080P]:{width:1920,height:1080},[$.Q_1440P]:{width:2560,height:1440},[$.Q_2160P]:{width:3840,height:2160},[$.Q_4320P]:{width:7680,height:4320}},ll=(r,e)=>S[r].height>S[e].height,ul=(r,e)=>S[r].height>=S[e].height,st=(r,e)=>S[r].height<S[e].height,vl=(r,e)=>S[r].height<=S[e].height,fl=r=>r.sort((e,t)=>e===t?0:e===$.INVARIANT?1:t===$.INVARIANT?-1:st(e,t)?1:-1)[0],ct=Object.keys(S).sort((r,e)=>st(r,e)?-1:1),dl=(r,e=.02)=>[...ct].find(n=>S[n].height*(1+e)>=r),hl=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return ct.find(o=>{const a=S[o];return a.width>=n&&a.height>=t})},pl=r=>S[r].height,lt=r=>r===$.INVARIANT,bl=r=>r.every(e=>!lt(e));function yl(r){if(lt(r))throw new Error("Expected exact quality")}const yn=(r,e)=>{const t={};for(const n of Object.keys(e)){const o=e[n],a=r[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=yn(a,o):t[n]=n in r?a:o}return t},gl=r=>{let e="";return r>=3600&&(e+=Math.floor(r/3600)+"h",r=r%3600),r>=60&&(e+=Math.floor(r/60)+"m",r=r%60),r>0&&(e+=Math.floor(r)+"s"),e};class Ol extends ot{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){const t=super._subscribe(e);return e.next(this.value),t}}function wl(r){return new y(e=>{const t={};let n=Object.keys(r).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&e.next(t)};return Object.entries(r).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new dr)})}function ml(...r){return new y(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var $l=r=>new y(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),El=r=>new y(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),Sl=r=>new y(e=>{r.forEach(t=>e.next(t))}),Tl=(r,e)=>new y(t=>{const n=o=>t.next(o);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function Il(r){return e=>new y(t=>e.subscribe(new gn(t,r)))}class gn{constructor(e,t){this.destination=e,this.size=t,this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const On={leading:!1,trailing:!0};function Rl(r,e=On){return t=>new y(n=>t.subscribe(new wn(n,r,e)))}class wn{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,ln(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(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const mn={leading:!0,trailing:!1};function Pl(r,e=mn){return t=>new y(n=>t.subscribe(new $n(n,r,e)))}class $n{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,un(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function _l(r){return e=>new y(t=>e.subscribe(new En(t,r)))}class En{constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Al(r=(e,t)=>e===t){return e=>new y(t=>e.subscribe(new Sn(t,r)))}const ce={};class Sn{constructor(e,t){this.destination=e,this.predicate=t,this.lastValue=ce}next(e){let t;try{t=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Tn(r){return e=>new y(t=>e.subscribe(new In(t,r)))}let In=class{constructor(e,t){this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(t)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}};function Ll(r){return Tn(()=>r)}function xl(){return r=>new y(e=>{let t=!1,n=!1;const o=r.subscribe(a=>{t||(t=!0,e.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Ml(){return r=>new y(e=>r.subscribe(new Rn(e)))}class Rn{constructor(e){this.destination=e,this.hasLast=!1}next(e){const t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Nl(r){return e=>new y(t=>e.subscribe(new Pn(t,r)))}class Pn{constructor(e,t){this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(t){throw this.error(t),t}this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}var le;(function(r){r.NETWORK="network",r.VIDEO_PIPELINE="video_pipeline",r.EXTERNAL_API="external_api",r.PARSER="parser",r.DOM="dom",r.WTF="wtf"})(le||(le={}));class ue{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;const n=this.listeners[e];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,e)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}class ut extends ue{constructor(){super(),this.listeners||ue.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}}class _n{constructor(){Object.defineProperty(this,"signal",{value:new ut,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=e;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(_n.prototype[Symbol.toStringTag]="AbortController",ut.prototype[Symbol.toStringTag]="AbortSignal");function vt(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function An(r){typeof r=="function"&&(r={fetch:r});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!vt({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(l,c){let u;c&&c.signal&&(u=c.signal,delete c.signal);const f=new t(l,c);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=e;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(c.aborted)return Promise.reject(u);const f=new Promise((d,w)=>{c.addEventListener("abort",()=>w(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:a}}const Wr=vt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ft=Wr?An({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,jn=Wr?ft.fetch:window.fetch;Wr?ft.Request:window.Request;var gr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ln(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j=function(r){try{return!!r()}catch(e){return!0}},xn=j,hr=!xn(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),dt=hr,ht=Function.prototype,kr=ht.call,Mn=dt&&ht.bind.bind(kr,kr),N=dt?Mn:function(r){return function(){return kr.apply(r,arguments)}},pt=N,Nn=pt({}.toString),Cn=pt("".slice),Hr=function(r){return Cn(Nn(r),8,-1)},Fn=N,Gn=j,Dn=Hr,Or=Object,kn=Fn("".split),Un=Gn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Dn(r)=="String"?kn(r,""):Or(r)}:Or,Xr=function(r){return r==null},Vn=Xr,Bn=TypeError,bt=function(r){if(Vn(r))throw Bn("Can't call method on "+r);return r},Kn=Un,qn=bt,H=function(r){return Kn(qn(r))},K={},Z=function(r){return r&&r.Math==Math&&r},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof gr=="object"&&gr)||function(){return this}()||gr||Function("return this")(),Ur=typeof document=="object"&&document.all,Yn=typeof Ur=="undefined"&&Ur!==void 0,yt={all:Ur,IS_HTMLDDA:Yn},gt=yt,zn=gt.all,R=gt.IS_HTMLDDA?function(r){return typeof r=="function"||r===zn}:function(r){return typeof r=="function"},Qn=I,Wn=R,ve=Qn.WeakMap,Hn=Wn(ve)&&/native code/.test(String(ve)),fe=R,Ot=yt,Xn=Ot.all,q=Ot.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:fe(r)||r===Xn}:function(r){return typeof r=="object"?r!==null:fe(r)},Jn=j,C=!Jn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Zn=I,de=q,Vr=Zn.document,ro=de(Vr)&&de(Vr.createElement),wt=function(r){return ro?Vr.createElement(r):{}},eo=C,to=j,no=wt,mt=!eo&&!to(function(){return Object.defineProperty(no("div"),"a",{get:function(){return 7}}).a!=7}),oo=C,ao=j,$t=oo&&ao(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),io=q,so=String,co=TypeError,z=function(r){if(io(r))return r;throw co(so(r)+" is not an object")},lo=hr,rr=Function.prototype.call,F=lo?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},wr=Jr,mr=I,uo=R,he=function(r){return uo(r)?r:void 0},Et=function(r,e){return arguments.length<2?he(wr[r])||he(mr[r]):wr[r]&&wr[r][e]||mr[r]&&mr[r][e]},vo=N,St=vo({}.isPrototypeOf),fo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Tt=I,$r=fo,pe=Tt.process,be=Tt.Deno,ye=pe&&pe.versions||be&&be.version,ge=ye&&ye.v8,T,ur;ge&&(T=ge.split("."),ur=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ur&&$r&&(T=$r.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=$r.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var ho=ur,Oe=ho,po=j,bo=I,yo=bo.String,It=!!Object.getOwnPropertySymbols&&!po(function(){var r=Symbol();return!yo(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),go=It,Rt=go&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Oo=Et,wo=R,mo=St,$o=Rt,Eo=Object,Pt=$o?function(r){return typeof r=="symbol"}:function(r){var e=Oo("Symbol");return wo(e)&&mo(e.prototype,Eo(r))},So=String,Zr=function(r){try{return So(r)}catch(e){return"Object"}},To=R,Io=Zr,Ro=TypeError,re=function(r){if(To(r))return r;throw Ro(Io(r)+" is not a function")},Po=re,_o=Xr,ee=function(r,e){var t=r[e];return _o(t)?void 0:Po(t)},Er=F,Sr=R,Tr=q,Ao=TypeError,jo=function(r,e){var t,n;if(e==="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r))||Sr(t=r.valueOf)&&!Tr(n=Er(t,r))||e!=="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r)))return n;throw Ao("Can't convert object to primitive value")},_t={exports:{}},we=I,Lo=Object.defineProperty,xo=function(r,e){try{Lo(we,r,{value:e,configurable:!0,writable:!0})}catch(t){we[r]=e}return e},Mo=I,No=xo,me="__core-js_shared__",Co=Mo[me]||No(me,{}),At=Co,$e=At;(_t.exports=function(r,e){return $e[r]||($e[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var jt=_t.exports,Fo=bt,Go=Object,Lt=function(r){return Go(Fo(r))},Do=N,ko=Lt,Uo=Do({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return Uo(ko(e),t)},Vo=N,Bo=0,Ko=Math.random(),qo=Vo(1 .toString),xt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+qo(++Bo+Ko,36)},Yo=I,zo=jt,Ee=x,Qo=xt,Wo=It,Ho=Rt,U=Yo.Symbol,Ir=zo("wks"),Xo=Ho?U.for||U:U&&U.withoutSetter||Qo,L=function(r){return Ee(Ir,r)||(Ir[r]=Wo&&Ee(U,r)?U[r]:Xo("Symbol."+r)),Ir[r]},Jo=F,Se=q,Te=Pt,Zo=ee,ra=jo,ea=L,ta=TypeError,na=ea("toPrimitive"),oa=function(r,e){if(!Se(r)||Te(r))return r;var t=Zo(r,na),n;if(t){if(e===void 0&&(e="default"),n=Jo(t,r,e),!Se(n)||Te(n))return n;throw ta("Can't convert object to primitive value")}return e===void 0&&(e="number"),ra(r,e)},aa=oa,ia=Pt,te=function(r){var e=aa(r,"string");return ia(e)?e:e+""},sa=C,ca=mt,la=$t,er=z,Ie=te,ua=TypeError,Rr=Object.defineProperty,va=Object.getOwnPropertyDescriptor,Pr="enumerable",_r="configurable",Ar="writable";Y.f=sa?la?function(e,t,n){if(er(e),t=Ie(t),er(n),typeof e=="function"&&t==="prototype"&&"value"in n&&Ar in n&&!n[Ar]){var o=va(e,t);o&&o[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:o[_r],enumerable:Pr in n?n[Pr]:o[Pr],writable:!1})}return Rr(e,t,n)}:Rr:function(e,t,n){if(er(e),t=Ie(t),er(n),ca)try{return Rr(e,t,n)}catch(o){}if("get"in n||"set"in n)throw ua("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var pr=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},fa=C,da=Y,ha=pr,X=fa?function(r,e,t){return da.f(r,e,ha(1,t))}:function(r,e,t){return r[e]=t,r},pa=jt,ba=xt,Re=pa("keys"),ne=function(r){return Re[r]||(Re[r]=ba(r))},oe={},ya=Hn,Mt=I,ga=q,Oa=X,jr=x,Lr=At,wa=ne,ma=oe,Pe="Object already initialized",Br=Mt.TypeError,$a=Mt.WeakMap,vr,W,fr,Ea=function(r){return fr(r)?W(r):vr(r,{})},Sa=function(r){return function(e){var t;if(!ga(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(ya||Lr.state){var P=Lr.state||(Lr.state=new $a);P.get=P.get,P.has=P.has,P.set=P.set,vr=function(r,e){if(P.has(r))throw Br(Pe);return e.facade=r,P.set(r,e),e},W=function(r){return P.get(r)||{}},fr=function(r){return P.has(r)}}else{var G=wa("state");ma[G]=!0,vr=function(r,e){if(jr(r,G))throw Br(Pe);return e.facade=r,Oa(r,G,e),e},W=function(r){return jr(r,G)?r[G]:{}},fr=function(r){return jr(r,G)}}var Ta={set:vr,get:W,has:fr,enforce:Ea,getterFor:Sa},Ia=hr,Nt=Function.prototype,_e=Nt.apply,Ae=Nt.call,Ra=typeof Reflect=="object"&&Reflect.apply||(Ia?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Pa=Hr,_a=N,Ct=function(r){if(Pa(r)==="Function")return _a(r)},Ft={},Gt={},Dt={}.propertyIsEnumerable,kt=Object.getOwnPropertyDescriptor,Aa=kt&&!Dt.call({1:2},1);Gt.f=Aa?function(e){var t=kt(this,e);return!!t&&t.enumerable}:Dt;var ja=C,La=F,xa=Gt,Ma=pr,Na=H,Ca=te,Fa=x,Ga=mt,je=Object.getOwnPropertyDescriptor;Ft.f=ja?je:function(e,t){if(e=Na(e),t=Ca(t),Ga)try{return je(e,t)}catch(n){}if(Fa(e,t))return Ma(!La(xa.f,e,t),e[t])};var Da=j,ka=R,Ua=/#|\.prototype\./,J=function(r,e){var t=Ba[Va(r)];return t==qa?!0:t==Ka?!1:ka(e)?Da(e):!!e},Va=J.normalize=function(r){return String(r).replace(Ua,".").toLowerCase()},Ba=J.data={},Ka=J.NATIVE="N",qa=J.POLYFILL="P",Ya=J,Le=Ct,za=re,Qa=hr,Wa=Le(Le.bind),Ut=function(r,e){return za(r),e===void 0?r:Qa?Wa(r,e):function(){return r.apply(e,arguments)}},tr=I,Ha=Ra,Xa=Ct,Ja=R,Za=Ft.f,ri=Ya,D=Jr,ei=Ut,k=X,xe=x,ti=function(r){var e=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,n)}return new r(t,n,o)}return Ha(r,this,arguments)};return e.prototype=r.prototype,e},Vt=function(r,e){var t=r.target,n=r.global,o=r.stat,a=r.proto,i=n?tr:o?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,l,c,u,f,d,w,E,m,g;for(f in e)l=ri(n?f:t+(o?".":"#")+f,r.forced),c=!l&&i&&xe(i,f),w=s[f],c&&(r.dontCallGetSet?(g=Za(i,f),E=g&&g.value):E=i[f]),d=c&&E?E:e[f],!(c&&typeof w==typeof d)&&(r.bind&&c?m=ei(d,tr):r.wrap&&c?m=ti(d):a&&Ja(d)?m=Xa(d):m=d,(r.sham||d&&d.sham||w&&w.sham)&&k(m,"sham",!0),k(s,f,m),a&&(u=t+"Prototype",xe(D,u)||k(D,u,{}),k(D[u],f,d),r.real&&v&&(l||!v[f])&&k(v,f,d)))},Kr=C,ni=x,Bt=Function.prototype,oi=Kr&&Object.getOwnPropertyDescriptor,ae=ni(Bt,"name"),ai=ae&&function(){}.name==="something",ii=ae&&(!Kr||Kr&&oi(Bt,"name").configurable),si={EXISTS:ae,PROPER:ai,CONFIGURABLE:ii},Kt={},ci=Math.ceil,li=Math.floor,ui=Math.trunc||function(e){var t=+e;return(t>0?li:ci)(t)},vi=ui,qt=function(r){var e=+r;return e!==e||e===0?0:vi(e)},fi=qt,di=Math.max,hi=Math.min,pi=function(r,e){var t=fi(r);return t<0?di(t+e,0):hi(t,e)},bi=qt,yi=Math.min,gi=function(r){return r>0?yi(bi(r),9007199254740991):0},Oi=gi,Yt=function(r){return Oi(r.length)},wi=H,mi=pi,$i=Yt,Me=function(r){return function(e,t,n){var o=wi(e),a=$i(o),i=mi(n,a),s;if(r&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((r||i in o)&&o[i]===t)return r||i||0;return!r&&-1}},Ei={includes:Me(!0),indexOf:Me(!1)},Si=N,xr=x,Ti=H,Ii=Ei.indexOf,Ri=oe,Ne=Si([].push),Pi=function(r,e){var t=Ti(r),n=0,o=[],a;for(a in t)!xr(Ri,a)&&xr(t,a)&&Ne(o,a);for(;e.length>n;)xr(t,a=e[n++])&&(~Ii(o,a)||Ne(o,a));return o},zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_i=Pi,Ai=zt,ji=Object.keys||function(e){return _i(e,Ai)},Li=C,xi=$t,Mi=Y,Ni=z,Ci=H,Fi=ji;Kt.f=Li&&!xi?Object.defineProperties:function(e,t){Ni(e);for(var n=Ci(t),o=Fi(t),a=o.length,i=0,s;a>i;)Mi.f(e,s=o[i++],n[s]);return e};var Gi=Et,Di=Gi("document","documentElement"),ki=z,Ui=Kt,Ce=zt,Vi=oe,Bi=Di,Ki=wt,qi=ne,Fe=">",Ge="<",qr="prototype",Yr="script",Qt=qi("IE_PROTO"),Mr=function(){},Wt=function(r){return Ge+Yr+Fe+r+Ge+"/"+Yr+Fe},De=function(r){r.write(Wt("")),r.close();var e=r.parentWindow.Object;return r=null,e},Yi=function(){var r=Ki("iframe"),e="java"+Yr+":",t;return r.style.display="none",Bi.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Wt("document.F=Object")),t.close(),t.F},nr,sr=function(){try{nr=new ActiveXObject("htmlfile")}catch(e){}sr=typeof document!="undefined"?document.domain&&nr?De(nr):Yi():De(nr);for(var r=Ce.length;r--;)delete sr[qr][Ce[r]];return sr()};Vi[Qt]=!0;var Ht=Object.create||function(e,t){var n;return e!==null?(Mr[qr]=ki(e),n=new Mr,Mr[qr]=null,n[Qt]=e):n=sr(),t===void 0?n:Ui.f(n,t)},zi=j,Qi=!zi(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Wi=x,Hi=R,Xi=Lt,Ji=ne,Zi=Qi,ke=Ji("IE_PROTO"),zr=Object,rs=zr.prototype,Xt=Zi?zr.getPrototypeOf:function(r){var e=Xi(r);if(Wi(e,ke))return e[ke];var t=e.constructor;return Hi(t)&&e instanceof t?t.prototype:e instanceof zr?rs:null},es=X,Jt=function(r,e,t,n){return n&&n.enumerable?r[e]=t:es(r,e,t),r},ts=j,ns=R,os=q,as=Ht,Ue=Xt,is=Jt,ss=L,Qr=ss("iterator"),Zt=!1,A,Nr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Nr=Ue(Ue(Cr)),Nr!==Object.prototype&&(A=Nr)):Zt=!0);var cs=!os(A)||ts(function(){var r={};return A[Qr].call(r)!==r});cs?A={}:A=as(A);ns(A[Qr])||is(A,Qr,function(){return this});var rn={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Zt},ls=L,us=ls("toStringTag"),en={};en[us]="z";var ie=String(en)==="[object z]",vs=ie,fs=R,cr=Hr,ds=L,hs=ds("toStringTag"),ps=Object,bs=cr(function(){return arguments}())=="Arguments",ys=function(r,e){try{return r[e]}catch(t){}},se=vs?cr:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=ys(e=ps(r),hs))=="string"?t:bs?cr(e):(n=cr(e))=="Object"&&fs(e.callee)?"Arguments":n},gs=ie,Os=se,ws=gs?{}.toString:function(){return"[object "+Os(this)+"]"},ms=ie,$s=Y.f,Es=X,Ss=x,Ts=ws,Is=L,Ve=Is("toStringTag"),tn=function(r,e,t,n){if(r){var o=t?r:r.prototype;Ss(o,Ve)||$s(o,Ve,{configurable:!0,value:e}),n&&!ms&&Es(o,"toString",Ts)}},Rs=rn.IteratorPrototype,Ps=Ht,_s=pr,As=tn,js=K,Ls=function(){return this},xs=function(r,e,t,n){var o=e+" Iterator";return r.prototype=Ps(Rs,{next:_s(+!n,t)}),As(r,o,!1,!0),js[o]=Ls,r},Ms=Vt,Ns=F,nn=si,Cs=xs,Fs=Xt,Gs=tn,Be=Jt,Ds=L,Ke=K,on=rn,ks=nn.PROPER;nn.CONFIGURABLE;on.IteratorPrototype;var or=on.BUGGY_SAFARI_ITERATORS,Fr=Ds("iterator"),qe="keys",ar="values",Ye="entries",Us=function(){return this},Vs=function(r,e,t,n,o,a,i){Cs(t,e,n);var s=function(g){if(g===o&&f)return f;if(!or&&g in c)return c[g];switch(g){case qe:return function(){return new t(this,g)};case ar:return function(){return new t(this,g)};case Ye:return function(){return new t(this,g)}}return function(){return new t(this)}},v=e+" Iterator",l=!1,c=r.prototype,u=c[Fr]||c["@@iterator"]||o&&c[o],f=!or&&u||s(o),d=e=="Array"&&c.entries||u,w,E,m;if(d&&(w=Fs(d.call(new r)),w!==Object.prototype&&w.next&&(Gs(w,v,!0,!0),Ke[v]=Us)),ks&&o==ar&&u&&u.name!==ar&&(l=!0,f=function(){return Ns(u,this)}),o)if(E={values:s(ar),keys:a?f:s(qe),entries:s(Ye)},i)for(m in E)(or||l||!(m in c))&&Be(c,m,E[m]);else Ms({target:e,proto:!0,forced:or||l},E);return i&&c[Fr]!==f&&Be(c,Fr,f,{name:o}),Ke[e]=f,E},Bs=function(r,e){return{value:r,done:e}},Ks=H,ze=K,an=Ta;Y.f;var qs=Vs,ir=Bs,sn="Array Iterator",Ys=an.set,zs=an.getterFor(sn);qs(Array,"Array",function(r,e){Ys(this,{type:sn,target:Ks(r),index:0,kind:e})},function(){var r=zs(this),e=r.target,t=r.kind,n=r.index++;return!e||n>=e.length?(r.target=void 0,ir(void 0,!0)):t=="keys"?ir(n,!1):t=="values"?ir(e[n],!1):ir([n,e[n]],!1)},"values");ze.Arguments=ze.Array;var Qs=L,Ws=K,Hs=Qs("iterator"),Xs=Array.prototype,Js=function(r){return r!==void 0&&(Ws.Array===r||Xs[Hs]===r)},Zs=se,Qe=ee,rc=Xr,ec=K,tc=L,nc=tc("iterator"),cn=function(r){if(!rc(r))return Qe(r,nc)||Qe(r,"@@iterator")||ec[Zs(r)]},oc=F,ac=re,ic=z,sc=Zr,cc=cn,lc=TypeError,uc=function(r,e){var t=arguments.length<2?cc(r):e;if(ac(t))return ic(oc(t,r));throw lc(sc(r)+" is not iterable")},vc=F,We=z,fc=ee,dc=function(r,e,t){var n,o;We(r);try{if(n=fc(r,"return"),!n){if(e==="throw")throw t;return t}n=vc(n,r)}catch(a){o=!0,n=a}if(e==="throw")throw t;if(o)throw n;return We(n),t},hc=Ut,pc=F,bc=z,yc=Zr,gc=Js,Oc=Yt,He=St,wc=uc,mc=cn,Xe=dc,$c=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,Ec=function(r,e,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=hc(e,n),l,c,u,f,d,w,E,m=function(O){return l&&Xe(l,"normal",O),new lr(!0,O)},g=function(O){return o?(bc(O),s?v(O[0],O[1],m):v(O[0],O[1])):s?v(O,m):v(O)};if(a)l=r.iterator;else if(i)l=r;else{if(c=mc(r),!c)throw $c(yc(r)+" is not iterable");if(gc(c)){for(u=0,f=Oc(r);f>u;u++)if(d=g(r[u]),d&&He(Je,d))return d;return new lr(!1)}l=wc(r,c)}for(w=a?r.next:l.next;!(E=pc(w,l)).done;){try{d=g(E.value)}catch(O){Xe(l,"throw",O)}if(typeof d=="object"&&d&&He(Je,d))return d}return new lr(!1)},Sc=te,Tc=Y,Ic=pr,Rc=function(r,e,t){var n=Sc(e);n in r?Tc.f(r,n,Ic(0,t)):r[n]=t},Pc=Vt,_c=Ec,Ac=Rc;Pc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return _c(e,function(n,o){Ac(t,n,o)},{AS_ENTRIES:!0}),t}});var jc=Jr,Lc=jc.Object.fromEntries,xc={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},Mc=xc,Nc=I,Cc=se,Fc=X,Ze=K,Gc=L,rt=Gc("toStringTag");for(var Gr in Mc){var et=Nc[Gr],Dr=et&&et.prototype;Dr&&Cc(Dr)!==rt&&Fc(Dr,rt,Gr),Ze[Gr]=Ze.Array}var Dc=Lc,kc=Dc,Uc=kc,Vc=Uc,Bc=Ln(Vc),tt;(function(r){r.Armenian="58",r.Azerbaijani="57",r.Belarusian="114",r.English="3",r.Kazakh="97",r.Portuguese="73",r.Russian="0",r.Spanish="4",r.Ukrainian="1",r.Uzbek="65",r.Vietnamese="75"})(tt||(tt={}));const Kc="vk.com",Cl=(r,e,t)=>at(void 0,void 0,void 0,function*(){const n=new URL(`https://${Kc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),r!==void 0&&n.searchParams.set("lang",r);const a=yield(yield jn(n.toString())).json();return qc(a,t)}),qc=(r,e)=>Bc(Object.entries(r.keys).map(([t,n])=>[t.substring(`${e}_`.length),Yc(n)])),Yc=r=>Array.isArray(r)?r[0]:r;var nt;(function(r){r.RU="ru",r.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Wc as Logger,y as Observable,ot as Subject,dr as Subscription,zc as VERSION,tt as VKNumericLanguage,Ol as ValueSubject,$ as VideoQuality,tl as abortable,rl as addScript,bl as areQualitiesExact,Zc as assertEmptyArray,V as assertNever,Hc as assertNonNullable,Jc as assertNotEmptyArray,Xc as assertNullable,yl as assertQualityIsExact,Il as buffer,Qc as checkNever,wl as combine,Rl as debounce,cl as detectEmbed,yn as fillWithDefault,_l as filter,Al as filterChanged,Tl as fromEvent,it as getCurrentBrowser,il as getExponentialDelay,fl as getHighestQuality,ol as getIOSVersion,El as interval,ll as isHigher,ul as isHigherOrEqual,nl as isIOS,lt as isInvariantQuality,st as isLower,vl as isLowerOrEqual,al as isMacLike,ln as isNonNullable,un as isNullable,Cl as loadVKLangPack,Tn as map,Ll as mapTo,ml as merge,Q as noop,el as now,Sl as observableFrom,xl as once,Ml as pairwise,sl as safeStorage,Nl as tap,Pl as throttle,gl as timeCodeToString,$l as timeout,dl as videoHeightToQuality,pl as videoQualityToHeight,hl as videoSizeToQuality};
|
|
6
|
+
const zc="1.0.32-dev.7bf5a18e.0";class dr{constructor(){this.subscriptions=[]}unsubscribe(){const e=this.subscriptions;this.subscriptions=[],e.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(e){return this.subscriptions.push(e),this}}const V=r=>{throw new Error(`${r} is value of unexpected type`)},Qc=r=>{},Q=()=>{};class y{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let o;t?typeof t=="function"?o={next:t,error:Q}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:Q,error:Q};const a=typeof e=="function"?{next:s=>{try{e(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new dr().add(()=>{switch(a.next=Q,a.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...e){return e.reduce((t,n)=>n(t),this)}_subscribe(e){}}class ot extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,e)})}_subscribe(e){const t=this.keyCounter++;return this.subscribers.set(t,e),new dr().add(()=>this.subscribers.delete(t))}}class Wc{constructor(){this.log$=new ot,this.logs=[],this.log=e=>{const t=Object.assign(Object.assign({},e),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>Object.assign({component:e},t))}}function Hc(r,e='Assertion "value is not nullable" failed'){if(r==null)throw new Error(e)}function Xc(r,e='Assertion "value is nullable" failed'){if(r!=null)throw new Error(e)}function ln(r){return typeof r!="undefined"&&r!==null}function un(r){return r==null}function Jc(r,e){if(!(r!=null&&r.length))throw new Error(e)}function Zc(r,e){if(r!=null&&r.length)throw new Error(e)}const rl=(r,e,t)=>new Promise((n,o)=>{e.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=r,document.head.appendChild(l)});var br;const el=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now();function at(r,e,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(c){try{l(n.next(c))}catch(u){i(u)}}function v(c){try{l(n.throw(c))}catch(u){i(u)}}function l(c){c.done?a(c.value):o(c.value).then(s,v)}l((n=n.apply(r,e||[])).next())})}const tl=(r,e)=>(...t)=>at(void 0,void 0,void 0,function*(){var n;const o=e(...t);let a=r.aborted,i;for(;!a&&!r.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});var _;(function(r){r.Unknown="Unknown",r.Yandex="Yandex",r.Chrome="Chrome",r.Chromium="Chromium",r.Firefox="Firefox",r.Safari="Safari",r.Opera="Opera",r.Edge="Edge",r.Rest="Rest"})(_||(_={}));var p;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Mac="Mac",r.Desktop="Desktop"})(p||(p={}));const it=()=>{const{userAgent:r}=window.navigator,e=/yabrowser/i.test(r)?_.Yandex:void 0,t=/chrome|crios/i.test(r)?_.Chrome:void 0,n=/chromium/i.test(r)?_.Chromium:void 0,o=/firefox|fxios/i.test(r)?_.Firefox:void 0,a=/webkit|safari|khtml/i.test(r)?_.Safari:void 0,i=/opr\//i.test(r)?_.Opera:void 0,s=/edg/i.test(r)?_.Edge:void 0,v=/android/i.test(r)?p.Android:void 0,l=/iphone/i.test(r)?p.iPhone:void 0,c=/ipad/i.test(r)?p.iPad:void 0,u=/ipod/i.test(r)?p.iPod:void 0,f=/mac/i.test(r)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?p.RestMobile:void 0;return{browser:e||o||i||s||t||n||a||_.Rest,device:v||l||c||u||d||f||p.Desktop}},nl=(r=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(it().device);if(!r)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},ol=()=>{const{userAgent:r}=window.navigator,e=r.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;const t=e[1],n=parseFloat(t);return isNaN(n)?null:n},al=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(it().device),il=(r,{start:e=0,factor:t=2,max:n=1/0,min:o=e,random:a=0}={})=>{let i=e;return i*=Math.pow(t,r),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(r){r[r.LOCAL_STORAGE=0]="LOCAL_STORAGE",r[r.SESSION_STORAGE=1]="SESSION_STORAGE",r[r.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const yr=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(yr,"test"),localStorage.removeItem(yr),M=h.LOCAL_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)try{sessionStorage.getItem(yr),M=h.SESSION_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)M=h.RUNTIME;else throw e}else throw r}return M===h.RUNTIME&&(b=new Map),M},vn=()=>B()===h.LOCAL_STORAGE,fn=r=>{var e,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(e=localStorage.getItem(r))!==null&&e!==void 0?e:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(r))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(r);default:V(n)}},dn=(r,e)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(r,e));default:V(t)}},hn=r=>{var e;const t=B();switch(t){case h.LOCAL_STORAGE:return r in localStorage;case h.SESSION_STORAGE:return r in sessionStorage;case h.RUNTIME:return(e=b==null?void 0:b.has(r))!==null&&e!==void 0?e:!1;default:return V(t),!1}},pn=r=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.removeItem(r);case h.SESSION_STORAGE:return sessionStorage.removeItem(r);case h.RUNTIME:return void(b==null?void 0:b.delete(r));default:V(e)}},bn=()=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(r)}};var sl=Object.freeze({__proto__:null,clear:bn,get:fn,has:hn,isPersistent:vn,remove:pn,set:dn});const cl=()=>{let r,e;try{r=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?r=!0:(r=!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)}const t=e?new URL(e).hostname:void 0;return{isEmbed:r,host:t}};var $;(function(r){r.INVARIANT="Invariant quality",r.Q_144P="144p",r.Q_240P="240p",r.Q_360P="360p",r.Q_480P="480p",r.Q_720P="720p",r.Q_1080P="1080p",r.Q_1440P="1440p",r.Q_2160P="2160p",r.Q_4320P="4320p"})($||($={}));const S={[$.Q_144P]:{width:256,height:144},[$.Q_240P]:{width:428,height:240},[$.Q_360P]:{width:640,height:360},[$.Q_480P]:{width:856,height:480},[$.Q_720P]:{width:1280,height:720},[$.Q_1080P]:{width:1920,height:1080},[$.Q_1440P]:{width:2560,height:1440},[$.Q_2160P]:{width:3840,height:2160},[$.Q_4320P]:{width:7680,height:4320}},ll=(r,e)=>S[r].height>S[e].height,ul=(r,e)=>S[r].height>=S[e].height,st=(r,e)=>S[r].height<S[e].height,vl=(r,e)=>S[r].height<=S[e].height,fl=r=>r.sort((e,t)=>e===t?0:e===$.INVARIANT?1:t===$.INVARIANT?-1:st(e,t)?1:-1)[0],ct=Object.keys(S).sort((r,e)=>st(r,e)?-1:1),dl=(r,e=.02)=>[...ct].find(n=>S[n].height*(1+e)>=r),hl=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return ct.find(o=>{const a=S[o];return a.width>=n&&a.height>=t})},pl=r=>S[r].height,lt=r=>r===$.INVARIANT,bl=r=>r.every(e=>!lt(e));function yl(r){if(lt(r))throw new Error("Expected exact quality")}const yn=(r,e)=>{const t={};for(const n of Object.keys(e)){const o=e[n],a=r[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=yn(a,o):t[n]=n in r?a:o}return t},gl=r=>{let e="";return r>=3600&&(e+=Math.floor(r/3600)+"h",r=r%3600),r>=60&&(e+=Math.floor(r/60)+"m",r=r%60),r>0&&(e+=Math.floor(r)+"s"),e};class Ol extends ot{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){const t=super._subscribe(e);return e.next(this.value),t}}function wl(r){return new y(e=>{const t={};let n=Object.keys(r).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&e.next(t)};return Object.entries(r).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new dr)})}function ml(...r){return new y(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var $l=r=>new y(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),El=r=>new y(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),Sl=r=>new y(e=>{r.forEach(t=>e.next(t))}),Tl=(r,e)=>new y(t=>{const n=o=>t.next(o);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function Il(r){return e=>new y(t=>e.subscribe(new gn(t,r)))}class gn{constructor(e,t){this.destination=e,this.size=t,this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const On={leading:!1,trailing:!0};function Rl(r,e=On){return t=>new y(n=>t.subscribe(new wn(n,r,e)))}class wn{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,ln(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(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const mn={leading:!0,trailing:!1};function Pl(r,e=mn){return t=>new y(n=>t.subscribe(new $n(n,r,e)))}class $n{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,un(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function _l(r){return e=>new y(t=>e.subscribe(new En(t,r)))}class En{constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Al(r=(e,t)=>e===t){return e=>new y(t=>e.subscribe(new Sn(t,r)))}const ce={};class Sn{constructor(e,t){this.destination=e,this.predicate=t,this.lastValue=ce}next(e){let t;try{t=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Tn(r){return e=>new y(t=>e.subscribe(new In(t,r)))}let In=class{constructor(e,t){this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(t)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}};function Ll(r){return Tn(()=>r)}function xl(){return r=>new y(e=>{let t=!1,n=!1;const o=r.subscribe(a=>{t||(t=!0,e.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Ml(){return r=>new y(e=>r.subscribe(new Rn(e)))}class Rn{constructor(e){this.destination=e,this.hasLast=!1}next(e){const t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Nl(r){return e=>new y(t=>e.subscribe(new Pn(t,r)))}class Pn{constructor(e,t){this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(t){throw this.error(t),t}this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}var le;(function(r){r.NETWORK="network",r.VIDEO_PIPELINE="video_pipeline",r.EXTERNAL_API="external_api",r.PARSER="parser",r.DOM="dom",r.WTF="wtf"})(le||(le={}));class ue{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;const n=this.listeners[e];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,e)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}class ut extends ue{constructor(){super(),this.listeners||ue.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}}class _n{constructor(){Object.defineProperty(this,"signal",{value:new ut,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=e;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(_n.prototype[Symbol.toStringTag]="AbortController",ut.prototype[Symbol.toStringTag]="AbortSignal");function vt(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function An(r){typeof r=="function"&&(r={fetch:r});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!vt({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(l,c){let u;c&&c.signal&&(u=c.signal,delete c.signal);const f=new t(l,c);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=e;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(c.aborted)return Promise.reject(u);const f=new Promise((d,w)=>{c.addEventListener("abort",()=>w(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:a}}const Wr=vt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ft=Wr?An({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,jn=Wr?ft.fetch:window.fetch;Wr?ft.Request:window.Request;var gr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ln(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j=function(r){try{return!!r()}catch(e){return!0}},xn=j,hr=!xn(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),dt=hr,ht=Function.prototype,kr=ht.call,Mn=dt&&ht.bind.bind(kr,kr),N=dt?Mn:function(r){return function(){return kr.apply(r,arguments)}},pt=N,Nn=pt({}.toString),Cn=pt("".slice),Hr=function(r){return Cn(Nn(r),8,-1)},Fn=N,Gn=j,Dn=Hr,Or=Object,kn=Fn("".split),Un=Gn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Dn(r)=="String"?kn(r,""):Or(r)}:Or,Xr=function(r){return r==null},Vn=Xr,Bn=TypeError,bt=function(r){if(Vn(r))throw Bn("Can't call method on "+r);return r},Kn=Un,qn=bt,H=function(r){return Kn(qn(r))},K={},Z=function(r){return r&&r.Math==Math&&r},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof gr=="object"&&gr)||function(){return this}()||gr||Function("return this")(),Ur=typeof document=="object"&&document.all,Yn=typeof Ur=="undefined"&&Ur!==void 0,yt={all:Ur,IS_HTMLDDA:Yn},gt=yt,zn=gt.all,R=gt.IS_HTMLDDA?function(r){return typeof r=="function"||r===zn}:function(r){return typeof r=="function"},Qn=I,Wn=R,ve=Qn.WeakMap,Hn=Wn(ve)&&/native code/.test(String(ve)),fe=R,Ot=yt,Xn=Ot.all,q=Ot.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:fe(r)||r===Xn}:function(r){return typeof r=="object"?r!==null:fe(r)},Jn=j,C=!Jn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Zn=I,de=q,Vr=Zn.document,ro=de(Vr)&&de(Vr.createElement),wt=function(r){return ro?Vr.createElement(r):{}},eo=C,to=j,no=wt,mt=!eo&&!to(function(){return Object.defineProperty(no("div"),"a",{get:function(){return 7}}).a!=7}),oo=C,ao=j,$t=oo&&ao(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),io=q,so=String,co=TypeError,z=function(r){if(io(r))return r;throw co(so(r)+" is not an object")},lo=hr,rr=Function.prototype.call,F=lo?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},wr=Jr,mr=I,uo=R,he=function(r){return uo(r)?r:void 0},Et=function(r,e){return arguments.length<2?he(wr[r])||he(mr[r]):wr[r]&&wr[r][e]||mr[r]&&mr[r][e]},vo=N,St=vo({}.isPrototypeOf),fo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Tt=I,$r=fo,pe=Tt.process,be=Tt.Deno,ye=pe&&pe.versions||be&&be.version,ge=ye&&ye.v8,T,ur;ge&&(T=ge.split("."),ur=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ur&&$r&&(T=$r.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=$r.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var ho=ur,Oe=ho,po=j,bo=I,yo=bo.String,It=!!Object.getOwnPropertySymbols&&!po(function(){var r=Symbol();return!yo(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),go=It,Rt=go&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Oo=Et,wo=R,mo=St,$o=Rt,Eo=Object,Pt=$o?function(r){return typeof r=="symbol"}:function(r){var e=Oo("Symbol");return wo(e)&&mo(e.prototype,Eo(r))},So=String,Zr=function(r){try{return So(r)}catch(e){return"Object"}},To=R,Io=Zr,Ro=TypeError,re=function(r){if(To(r))return r;throw Ro(Io(r)+" is not a function")},Po=re,_o=Xr,ee=function(r,e){var t=r[e];return _o(t)?void 0:Po(t)},Er=F,Sr=R,Tr=q,Ao=TypeError,jo=function(r,e){var t,n;if(e==="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r))||Sr(t=r.valueOf)&&!Tr(n=Er(t,r))||e!=="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r)))return n;throw Ao("Can't convert object to primitive value")},_t={exports:{}},we=I,Lo=Object.defineProperty,xo=function(r,e){try{Lo(we,r,{value:e,configurable:!0,writable:!0})}catch(t){we[r]=e}return e},Mo=I,No=xo,me="__core-js_shared__",Co=Mo[me]||No(me,{}),At=Co,$e=At;(_t.exports=function(r,e){return $e[r]||($e[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var jt=_t.exports,Fo=bt,Go=Object,Lt=function(r){return Go(Fo(r))},Do=N,ko=Lt,Uo=Do({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return Uo(ko(e),t)},Vo=N,Bo=0,Ko=Math.random(),qo=Vo(1 .toString),xt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+qo(++Bo+Ko,36)},Yo=I,zo=jt,Ee=x,Qo=xt,Wo=It,Ho=Rt,U=Yo.Symbol,Ir=zo("wks"),Xo=Ho?U.for||U:U&&U.withoutSetter||Qo,L=function(r){return Ee(Ir,r)||(Ir[r]=Wo&&Ee(U,r)?U[r]:Xo("Symbol."+r)),Ir[r]},Jo=F,Se=q,Te=Pt,Zo=ee,ra=jo,ea=L,ta=TypeError,na=ea("toPrimitive"),oa=function(r,e){if(!Se(r)||Te(r))return r;var t=Zo(r,na),n;if(t){if(e===void 0&&(e="default"),n=Jo(t,r,e),!Se(n)||Te(n))return n;throw ta("Can't convert object to primitive value")}return e===void 0&&(e="number"),ra(r,e)},aa=oa,ia=Pt,te=function(r){var e=aa(r,"string");return ia(e)?e:e+""},sa=C,ca=mt,la=$t,er=z,Ie=te,ua=TypeError,Rr=Object.defineProperty,va=Object.getOwnPropertyDescriptor,Pr="enumerable",_r="configurable",Ar="writable";Y.f=sa?la?function(e,t,n){if(er(e),t=Ie(t),er(n),typeof e=="function"&&t==="prototype"&&"value"in n&&Ar in n&&!n[Ar]){var o=va(e,t);o&&o[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:o[_r],enumerable:Pr in n?n[Pr]:o[Pr],writable:!1})}return Rr(e,t,n)}:Rr:function(e,t,n){if(er(e),t=Ie(t),er(n),ca)try{return Rr(e,t,n)}catch(o){}if("get"in n||"set"in n)throw ua("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var pr=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},fa=C,da=Y,ha=pr,X=fa?function(r,e,t){return da.f(r,e,ha(1,t))}:function(r,e,t){return r[e]=t,r},pa=jt,ba=xt,Re=pa("keys"),ne=function(r){return Re[r]||(Re[r]=ba(r))},oe={},ya=Hn,Mt=I,ga=q,Oa=X,jr=x,Lr=At,wa=ne,ma=oe,Pe="Object already initialized",Br=Mt.TypeError,$a=Mt.WeakMap,vr,W,fr,Ea=function(r){return fr(r)?W(r):vr(r,{})},Sa=function(r){return function(e){var t;if(!ga(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(ya||Lr.state){var P=Lr.state||(Lr.state=new $a);P.get=P.get,P.has=P.has,P.set=P.set,vr=function(r,e){if(P.has(r))throw Br(Pe);return e.facade=r,P.set(r,e),e},W=function(r){return P.get(r)||{}},fr=function(r){return P.has(r)}}else{var G=wa("state");ma[G]=!0,vr=function(r,e){if(jr(r,G))throw Br(Pe);return e.facade=r,Oa(r,G,e),e},W=function(r){return jr(r,G)?r[G]:{}},fr=function(r){return jr(r,G)}}var Ta={set:vr,get:W,has:fr,enforce:Ea,getterFor:Sa},Ia=hr,Nt=Function.prototype,_e=Nt.apply,Ae=Nt.call,Ra=typeof Reflect=="object"&&Reflect.apply||(Ia?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Pa=Hr,_a=N,Ct=function(r){if(Pa(r)==="Function")return _a(r)},Ft={},Gt={},Dt={}.propertyIsEnumerable,kt=Object.getOwnPropertyDescriptor,Aa=kt&&!Dt.call({1:2},1);Gt.f=Aa?function(e){var t=kt(this,e);return!!t&&t.enumerable}:Dt;var ja=C,La=F,xa=Gt,Ma=pr,Na=H,Ca=te,Fa=x,Ga=mt,je=Object.getOwnPropertyDescriptor;Ft.f=ja?je:function(e,t){if(e=Na(e),t=Ca(t),Ga)try{return je(e,t)}catch(n){}if(Fa(e,t))return Ma(!La(xa.f,e,t),e[t])};var Da=j,ka=R,Ua=/#|\.prototype\./,J=function(r,e){var t=Ba[Va(r)];return t==qa?!0:t==Ka?!1:ka(e)?Da(e):!!e},Va=J.normalize=function(r){return String(r).replace(Ua,".").toLowerCase()},Ba=J.data={},Ka=J.NATIVE="N",qa=J.POLYFILL="P",Ya=J,Le=Ct,za=re,Qa=hr,Wa=Le(Le.bind),Ut=function(r,e){return za(r),e===void 0?r:Qa?Wa(r,e):function(){return r.apply(e,arguments)}},tr=I,Ha=Ra,Xa=Ct,Ja=R,Za=Ft.f,ri=Ya,D=Jr,ei=Ut,k=X,xe=x,ti=function(r){var e=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,n)}return new r(t,n,o)}return Ha(r,this,arguments)};return e.prototype=r.prototype,e},Vt=function(r,e){var t=r.target,n=r.global,o=r.stat,a=r.proto,i=n?tr:o?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,l,c,u,f,d,w,E,m,g;for(f in e)l=ri(n?f:t+(o?".":"#")+f,r.forced),c=!l&&i&&xe(i,f),w=s[f],c&&(r.dontCallGetSet?(g=Za(i,f),E=g&&g.value):E=i[f]),d=c&&E?E:e[f],!(c&&typeof w==typeof d)&&(r.bind&&c?m=ei(d,tr):r.wrap&&c?m=ti(d):a&&Ja(d)?m=Xa(d):m=d,(r.sham||d&&d.sham||w&&w.sham)&&k(m,"sham",!0),k(s,f,m),a&&(u=t+"Prototype",xe(D,u)||k(D,u,{}),k(D[u],f,d),r.real&&v&&(l||!v[f])&&k(v,f,d)))},Kr=C,ni=x,Bt=Function.prototype,oi=Kr&&Object.getOwnPropertyDescriptor,ae=ni(Bt,"name"),ai=ae&&function(){}.name==="something",ii=ae&&(!Kr||Kr&&oi(Bt,"name").configurable),si={EXISTS:ae,PROPER:ai,CONFIGURABLE:ii},Kt={},ci=Math.ceil,li=Math.floor,ui=Math.trunc||function(e){var t=+e;return(t>0?li:ci)(t)},vi=ui,qt=function(r){var e=+r;return e!==e||e===0?0:vi(e)},fi=qt,di=Math.max,hi=Math.min,pi=function(r,e){var t=fi(r);return t<0?di(t+e,0):hi(t,e)},bi=qt,yi=Math.min,gi=function(r){return r>0?yi(bi(r),9007199254740991):0},Oi=gi,Yt=function(r){return Oi(r.length)},wi=H,mi=pi,$i=Yt,Me=function(r){return function(e,t,n){var o=wi(e),a=$i(o),i=mi(n,a),s;if(r&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((r||i in o)&&o[i]===t)return r||i||0;return!r&&-1}},Ei={includes:Me(!0),indexOf:Me(!1)},Si=N,xr=x,Ti=H,Ii=Ei.indexOf,Ri=oe,Ne=Si([].push),Pi=function(r,e){var t=Ti(r),n=0,o=[],a;for(a in t)!xr(Ri,a)&&xr(t,a)&&Ne(o,a);for(;e.length>n;)xr(t,a=e[n++])&&(~Ii(o,a)||Ne(o,a));return o},zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_i=Pi,Ai=zt,ji=Object.keys||function(e){return _i(e,Ai)},Li=C,xi=$t,Mi=Y,Ni=z,Ci=H,Fi=ji;Kt.f=Li&&!xi?Object.defineProperties:function(e,t){Ni(e);for(var n=Ci(t),o=Fi(t),a=o.length,i=0,s;a>i;)Mi.f(e,s=o[i++],n[s]);return e};var Gi=Et,Di=Gi("document","documentElement"),ki=z,Ui=Kt,Ce=zt,Vi=oe,Bi=Di,Ki=wt,qi=ne,Fe=">",Ge="<",qr="prototype",Yr="script",Qt=qi("IE_PROTO"),Mr=function(){},Wt=function(r){return Ge+Yr+Fe+r+Ge+"/"+Yr+Fe},De=function(r){r.write(Wt("")),r.close();var e=r.parentWindow.Object;return r=null,e},Yi=function(){var r=Ki("iframe"),e="java"+Yr+":",t;return r.style.display="none",Bi.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Wt("document.F=Object")),t.close(),t.F},nr,sr=function(){try{nr=new ActiveXObject("htmlfile")}catch(e){}sr=typeof document!="undefined"?document.domain&&nr?De(nr):Yi():De(nr);for(var r=Ce.length;r--;)delete sr[qr][Ce[r]];return sr()};Vi[Qt]=!0;var Ht=Object.create||function(e,t){var n;return e!==null?(Mr[qr]=ki(e),n=new Mr,Mr[qr]=null,n[Qt]=e):n=sr(),t===void 0?n:Ui.f(n,t)},zi=j,Qi=!zi(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Wi=x,Hi=R,Xi=Lt,Ji=ne,Zi=Qi,ke=Ji("IE_PROTO"),zr=Object,rs=zr.prototype,Xt=Zi?zr.getPrototypeOf:function(r){var e=Xi(r);if(Wi(e,ke))return e[ke];var t=e.constructor;return Hi(t)&&e instanceof t?t.prototype:e instanceof zr?rs:null},es=X,Jt=function(r,e,t,n){return n&&n.enumerable?r[e]=t:es(r,e,t),r},ts=j,ns=R,os=q,as=Ht,Ue=Xt,is=Jt,ss=L,Qr=ss("iterator"),Zt=!1,A,Nr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Nr=Ue(Ue(Cr)),Nr!==Object.prototype&&(A=Nr)):Zt=!0);var cs=!os(A)||ts(function(){var r={};return A[Qr].call(r)!==r});cs?A={}:A=as(A);ns(A[Qr])||is(A,Qr,function(){return this});var rn={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Zt},ls=L,us=ls("toStringTag"),en={};en[us]="z";var ie=String(en)==="[object z]",vs=ie,fs=R,cr=Hr,ds=L,hs=ds("toStringTag"),ps=Object,bs=cr(function(){return arguments}())=="Arguments",ys=function(r,e){try{return r[e]}catch(t){}},se=vs?cr:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=ys(e=ps(r),hs))=="string"?t:bs?cr(e):(n=cr(e))=="Object"&&fs(e.callee)?"Arguments":n},gs=ie,Os=se,ws=gs?{}.toString:function(){return"[object "+Os(this)+"]"},ms=ie,$s=Y.f,Es=X,Ss=x,Ts=ws,Is=L,Ve=Is("toStringTag"),tn=function(r,e,t,n){if(r){var o=t?r:r.prototype;Ss(o,Ve)||$s(o,Ve,{configurable:!0,value:e}),n&&!ms&&Es(o,"toString",Ts)}},Rs=rn.IteratorPrototype,Ps=Ht,_s=pr,As=tn,js=K,Ls=function(){return this},xs=function(r,e,t,n){var o=e+" Iterator";return r.prototype=Ps(Rs,{next:_s(+!n,t)}),As(r,o,!1,!0),js[o]=Ls,r},Ms=Vt,Ns=F,nn=si,Cs=xs,Fs=Xt,Gs=tn,Be=Jt,Ds=L,Ke=K,on=rn,ks=nn.PROPER;nn.CONFIGURABLE;on.IteratorPrototype;var or=on.BUGGY_SAFARI_ITERATORS,Fr=Ds("iterator"),qe="keys",ar="values",Ye="entries",Us=function(){return this},Vs=function(r,e,t,n,o,a,i){Cs(t,e,n);var s=function(g){if(g===o&&f)return f;if(!or&&g in c)return c[g];switch(g){case qe:return function(){return new t(this,g)};case ar:return function(){return new t(this,g)};case Ye:return function(){return new t(this,g)}}return function(){return new t(this)}},v=e+" Iterator",l=!1,c=r.prototype,u=c[Fr]||c["@@iterator"]||o&&c[o],f=!or&&u||s(o),d=e=="Array"&&c.entries||u,w,E,m;if(d&&(w=Fs(d.call(new r)),w!==Object.prototype&&w.next&&(Gs(w,v,!0,!0),Ke[v]=Us)),ks&&o==ar&&u&&u.name!==ar&&(l=!0,f=function(){return Ns(u,this)}),o)if(E={values:s(ar),keys:a?f:s(qe),entries:s(Ye)},i)for(m in E)(or||l||!(m in c))&&Be(c,m,E[m]);else Ms({target:e,proto:!0,forced:or||l},E);return i&&c[Fr]!==f&&Be(c,Fr,f,{name:o}),Ke[e]=f,E},Bs=function(r,e){return{value:r,done:e}},Ks=H,ze=K,an=Ta;Y.f;var qs=Vs,ir=Bs,sn="Array Iterator",Ys=an.set,zs=an.getterFor(sn);qs(Array,"Array",function(r,e){Ys(this,{type:sn,target:Ks(r),index:0,kind:e})},function(){var r=zs(this),e=r.target,t=r.kind,n=r.index++;return!e||n>=e.length?(r.target=void 0,ir(void 0,!0)):t=="keys"?ir(n,!1):t=="values"?ir(e[n],!1):ir([n,e[n]],!1)},"values");ze.Arguments=ze.Array;var Qs=L,Ws=K,Hs=Qs("iterator"),Xs=Array.prototype,Js=function(r){return r!==void 0&&(Ws.Array===r||Xs[Hs]===r)},Zs=se,Qe=ee,rc=Xr,ec=K,tc=L,nc=tc("iterator"),cn=function(r){if(!rc(r))return Qe(r,nc)||Qe(r,"@@iterator")||ec[Zs(r)]},oc=F,ac=re,ic=z,sc=Zr,cc=cn,lc=TypeError,uc=function(r,e){var t=arguments.length<2?cc(r):e;if(ac(t))return ic(oc(t,r));throw lc(sc(r)+" is not iterable")},vc=F,We=z,fc=ee,dc=function(r,e,t){var n,o;We(r);try{if(n=fc(r,"return"),!n){if(e==="throw")throw t;return t}n=vc(n,r)}catch(a){o=!0,n=a}if(e==="throw")throw t;if(o)throw n;return We(n),t},hc=Ut,pc=F,bc=z,yc=Zr,gc=Js,Oc=Yt,He=St,wc=uc,mc=cn,Xe=dc,$c=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,Ec=function(r,e,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=hc(e,n),l,c,u,f,d,w,E,m=function(O){return l&&Xe(l,"normal",O),new lr(!0,O)},g=function(O){return o?(bc(O),s?v(O[0],O[1],m):v(O[0],O[1])):s?v(O,m):v(O)};if(a)l=r.iterator;else if(i)l=r;else{if(c=mc(r),!c)throw $c(yc(r)+" is not iterable");if(gc(c)){for(u=0,f=Oc(r);f>u;u++)if(d=g(r[u]),d&&He(Je,d))return d;return new lr(!1)}l=wc(r,c)}for(w=a?r.next:l.next;!(E=pc(w,l)).done;){try{d=g(E.value)}catch(O){Xe(l,"throw",O)}if(typeof d=="object"&&d&&He(Je,d))return d}return new lr(!1)},Sc=te,Tc=Y,Ic=pr,Rc=function(r,e,t){var n=Sc(e);n in r?Tc.f(r,n,Ic(0,t)):r[n]=t},Pc=Vt,_c=Ec,Ac=Rc;Pc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return _c(e,function(n,o){Ac(t,n,o)},{AS_ENTRIES:!0}),t}});var jc=Jr,Lc=jc.Object.fromEntries,xc={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},Mc=xc,Nc=I,Cc=se,Fc=X,Ze=K,Gc=L,rt=Gc("toStringTag");for(var Gr in Mc){var et=Nc[Gr],Dr=et&&et.prototype;Dr&&Cc(Dr)!==rt&&Fc(Dr,rt,Gr),Ze[Gr]=Ze.Array}var Dc=Lc,kc=Dc,Uc=kc,Vc=Uc,Bc=Ln(Vc),tt;(function(r){r.Armenian="58",r.Azerbaijani="57",r.Belarusian="114",r.English="3",r.Kazakh="97",r.Portuguese="73",r.Russian="0",r.Spanish="4",r.Ukrainian="1",r.Uzbek="65",r.Vietnamese="75"})(tt||(tt={}));const Kc="vk.com",Cl=(r,e,t)=>at(void 0,void 0,void 0,function*(){const n=new URL(`https://${Kc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),r!==void 0&&n.searchParams.set("lang",r);const a=yield(yield jn(n.toString())).json();return qc(a,t)}),qc=(r,e)=>Bc(Object.entries(r.keys).map(([t,n])=>[t.substring(`${e}_`.length),Yc(n)])),Yc=r=>Array.isArray(r)?r[0]:r;var nt;(function(r){r.RU="ru",r.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Wc as Logger,y as Observable,ot as Subject,dr as Subscription,zc as VERSION,tt as VKNumericLanguage,Ol as ValueSubject,$ as VideoQuality,tl as abortable,rl as addScript,bl as areQualitiesExact,Zc as assertEmptyArray,V as assertNever,Hc as assertNonNullable,Jc as assertNotEmptyArray,Xc as assertNullable,yl as assertQualityIsExact,Il as buffer,Qc as checkNever,wl as combine,Rl as debounce,cl as detectEmbed,yn as fillWithDefault,_l as filter,Al as filterChanged,Tl as fromEvent,it as getCurrentBrowser,il as getExponentialDelay,fl as getHighestQuality,ol as getIOSVersion,El as interval,ll as isHigher,ul as isHigherOrEqual,nl as isIOS,lt as isInvariantQuality,st as isLower,vl as isLowerOrEqual,al as isMacLike,ln as isNonNullable,un as isNullable,Cl as loadVKLangPack,Tn as map,Ll as mapTo,ml as merge,Q as noop,el as now,Sl as observableFrom,xl as once,Ml as pairwise,sl as safeStorage,Nl as tap,Pl as throttle,gl as timeCodeToString,$l as timeout,dl as videoHeightToQuality,pl as videoQualityToHeight,hl as videoSizeToQuality};
|
package/es2018.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32-dev.7bf5a18e.0
|
|
3
|
+
* Wed, 07 Feb 2024 09:56:57 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const an="1.0.32-dev.0f82d9ff.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},sn=e=>{},G=()=>{};class p{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:G}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:G,error:G};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new Y().add(()=>{switch(a.next=G,a.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends p{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class ln{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const 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(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function cn(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function un(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}function vn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function fn(e,r){if(e!=null&&e.length)throw new Error(r)}const dn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var de;const hn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now(),pn=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}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 Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,c=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,f=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,u=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:v||l||c||f||d||u||exports.CurrentClientDevice.Desktop}},bn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},yn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},gn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),wn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(b=new Map),j},On=()=>k()===h.LOCAL_STORAGE,mn=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(e);default:C(n)}},$n=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(e,r));default:C(t)}},En=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=b==null?void 0:b.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},Sn=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(b==null?void 0:b.delete(e));default:C(r)}},Tn=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:C(e)}};var In=Object.freeze({__proto__:null,clear:Tn,get:mn,has:En,isPersistent:On,remove:Sn,set:$n});const Pn=()=>{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)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};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 $={[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}},Rn=(e,r)=>$[e].height>$[r].height,_n=(e,r)=>$[e].height>=$[r].height,He=(e,r)=>$[e].height<$[r].height,An=(e,r)=>$[e].height<=$[r].height,jn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],ot=Object.keys($).sort((e,r)=>He(e,r)?-1:1),Cn=(e,r=.02)=>[...ot].find(n=>$[n].height*(1+r)>=e),Ln=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ot.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},xn=e=>$[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Nn=e=>e.every(r=>!ze(r));function Mn(e){if(ze(e))throw new Error("Expected exact quality")}const at=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=at(a,o):t[n]=n in e?a:o}return t},Dn=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};class Fn extends qe{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){const t=super._subscribe(r);return r.next(this.value),t}}function Gn(e){return new p(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new Y)})}function Vn(...e){return new p(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var kn=e=>new p(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Bn=e=>new p(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Un=e=>new p(r=>{e.forEach(t=>r.next(t))}),Qn=(e,r)=>new p(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Kn(e){return r=>new p(t=>r.subscribe(new qn(t,e)))}class qn{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Yn={leading:!1,trailing:!0};function Hn(e,r=Yn){return t=>new p(n=>t.subscribe(new zn(n,e,r)))}class zn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Wn={leading:!0,trailing:!1};function Xn(e,r=Wn){return t=>new p(n=>t.subscribe(new Jn(n,e,r)))}class Jn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Zn(e){return r=>new p(t=>r.subscribe(new eo(t,e)))}class eo{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ro(e=(r,t)=>r===t){return r=>new p(t=>r.subscribe(new to(t,e)))}const cr={};class to{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=cr}next(r){let t;try{t=this.lastValue===cr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function it(e){return r=>new p(t=>r.subscribe(new no(t,e)))}let no=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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function oo(e){return it(()=>e)}function ao(){return e=>new p(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function io(){return e=>new p(r=>e.subscribe(new so(r)))}class so{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function lo(e){return r=>new p(t=>r.subscribe(new co(t,e)))}class co{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{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;const 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;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class st extends ur{constructor(){super(),this.listeners||ur.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)}}class uo{constructor(){Object.defineProperty(this,"signal",{value:new st,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(uo.prototype[Symbol.toStringTag]="AbortController",st.prototype[Symbol.toStringTag]="AbortSignal");function lt(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 vo(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!lt({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 f;c&&c.signal&&(f=c.signal,delete c.signal);const u=new t(l,c);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},a.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(c.aborted)return Promise.reject(f);const u=new Promise((d,w)=>{c.addEventListener("abort",()=>w(f),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([u,i(v,l)])}return i(v,l)},Request:a}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ct=We?vo({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,fo=We?ct.fetch:window.fetch;We?ct.Request:window.Request;var pe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ho(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R=function(e){try{return!!e()}catch(r){return!0}},po=R,ve=!po(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ut=ve,vt=Function.prototype,De=vt.call,bo=ut&&vt.bind.bind(De,De),L=ut?bo:function(e){return function(){return De.apply(e,arguments)}},ft=L,yo=ft({}.toString),go=ft("".slice),Xe=function(e){return go(yo(e),8,-1)},wo=L,Oo=R,mo=Xe,be=Object,$o=wo("".split),Eo=Oo(function(){return!be("z").propertyIsEnumerable(0)})?function(e){return mo(e)=="String"?$o(e,""):be(e)}:be,Je=function(e){return e==null},So=Je,To=TypeError,dt=function(e){if(So(e))throw To("Can't call method on "+e);return e},Io=Eo,Po=dt,H=function(e){return Io(Po(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof pe=="object"&&pe)||function(){return this}()||pe||Function("return this")(),Fe=typeof document=="object"&&document.all,Ro=typeof Fe=="undefined"&&Fe!==void 0,ht={all:Fe,IS_HTMLDDA:Ro},pt=ht,_o=pt.all,T=pt.IS_HTMLDDA?function(e){return typeof e=="function"||e===_o}:function(e){return typeof e=="function"},Ao=S,jo=T,vr=Ao.WeakMap,Co=jo(vr)&&/native code/.test(String(vr)),fr=T,bt=ht,Lo=bt.all,U=bt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Lo}:function(e){return typeof e=="object"?e!==null:fr(e)},xo=R,x=!xo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},No=S,dr=U,Ge=No.document,Mo=dr(Ge)&&dr(Ge.createElement),yt=function(e){return Mo?Ge.createElement(e):{}},Do=x,Fo=R,Go=yt,gt=!Do&&!Fo(function(){return Object.defineProperty(Go("div"),"a",{get:function(){return 7}}).a!=7}),Vo=x,ko=R,wt=Vo&&ko(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Bo=U,Uo=String,Qo=TypeError,K=function(e){if(Bo(e))return e;throw Qo(Uo(e)+" is not an object")},Ko=ve,J=Function.prototype.call,N=Ko?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,qo=T,hr=function(e){return qo(e)?e:void 0},Ot=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Yo=L,mt=Yo({}.isPrototypeOf),Ho=typeof navigator!="undefined"&&String(navigator.userAgent)||"",$t=S,we=Ho,pr=$t.process,br=$t.Deno,yr=pr&&pr.versions||br&&br.version,gr=yr&&yr.v8,E,le;gr&&(E=gr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&we&&(E=we.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=we.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var zo=le,wr=zo,Wo=R,Xo=S,Jo=Xo.String,Et=!!Object.getOwnPropertySymbols&&!Wo(function(){var e=Symbol();return!Jo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&wr&&wr<41}),Zo=Et,St=Zo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ea=Ot,ra=T,ta=mt,na=St,oa=Object,Tt=na?function(e){return typeof e=="symbol"}:function(e){var r=ea("Symbol");return ra(r)&&ta(r.prototype,oa(e))},aa=String,er=function(e){try{return aa(e)}catch(r){return"Object"}},ia=T,sa=er,la=TypeError,rr=function(e){if(ia(e))return e;throw la(sa(e)+" is not a function")},ca=rr,ua=Je,tr=function(e,r){var t=e[r];return ua(t)?void 0:ca(t)},Oe=N,me=T,$e=U,va=TypeError,fa=function(e,r){var t,n;if(r==="string"&&me(t=e.toString)&&!$e(n=Oe(t,e))||me(t=e.valueOf)&&!$e(n=Oe(t,e))||r!=="string"&&me(t=e.toString)&&!$e(n=Oe(t,e)))return n;throw va("Can't convert object to primitive value")},It={exports:{}},Or=S,da=Object.defineProperty,ha=function(e,r){try{da(Or,e,{value:r,configurable:!0,writable:!0})}catch(t){Or[e]=r}return r},pa=S,ba=ha,mr="__core-js_shared__",ya=pa[mr]||ba(mr,{}),Pt=ya,$r=Pt;(It.exports=function(e,r){return $r[e]||($r[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Rt=It.exports,ga=dt,wa=Object,_t=function(e){return wa(ga(e))},Oa=L,ma=_t,$a=Oa({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return $a(ma(r),t)},Ea=L,Sa=0,Ta=Math.random(),Ia=Ea(1 .toString),At=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ia(++Sa+Ta,36)},Pa=S,Ra=Rt,Er=A,_a=At,Aa=Et,ja=St,V=Pa.Symbol,Ee=Ra("wks"),Ca=ja?V.for||V:V&&V.withoutSetter||_a,_=function(e){return Er(Ee,e)||(Ee[e]=Aa&&Er(V,e)?V[e]:Ca("Symbol."+e)),Ee[e]},La=N,Sr=U,Tr=Tt,xa=tr,Na=fa,Ma=_,Da=TypeError,Fa=Ma("toPrimitive"),Ga=function(e,r){if(!Sr(e)||Tr(e))return e;var t=xa(e,Fa),n;if(t){if(r===void 0&&(r="default"),n=La(t,e,r),!Sr(n)||Tr(n))return n;throw Da("Can't convert object to primitive value")}return r===void 0&&(r="number"),Na(e,r)},Va=Ga,ka=Tt,nr=function(e){var r=Va(e,"string");return ka(r)?r:r+""},Ba=x,Ua=gt,Qa=wt,Z=K,Ir=nr,Ka=TypeError,Se=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Pe="writable";Q.f=Ba?Qa?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Pe in n&&!n[Pe]){var o=qa(r,t);o&&o[Pe]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:o[Ie],enumerable:Te in n?n[Te]:o[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Ua)try{return Se(r,t,n)}catch(o){}if("get"in n||"set"in n)throw Ka("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Ya=x,Ha=Q,za=fe,z=Ya?function(e,r,t){return Ha.f(e,r,za(1,t))}:function(e,r,t){return e[r]=t,e},Wa=Rt,Xa=At,Pr=Wa("keys"),or=function(e){return Pr[e]||(Pr[e]=Xa(e))},ar={},Ja=Co,jt=S,Za=U,ei=z,Re=A,_e=Pt,ri=or,ti=ar,Rr="Object already initialized",Ve=jt.TypeError,ni=jt.WeakMap,ce,q,ue,oi=function(e){return ue(e)?q(e):ce(e,{})},ai=function(e){return function(r){var t;if(!Za(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Ja||_e.state){var I=_e.state||(_e.state=new ni);I.get=I.get,I.has=I.has,I.set=I.set,ce=function(e,r){if(I.has(e))throw Ve(Rr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=ri("state");ti[M]=!0,ce=function(e,r){if(Re(e,M))throw Ve(Rr);return r.facade=e,ei(e,M,r),r},q=function(e){return Re(e,M)?e[M]:{}},ue=function(e){return Re(e,M)}}var ii={set:ce,get:q,has:ue,enforce:oi,getterFor:ai},si=ve,Ct=Function.prototype,_r=Ct.apply,Ar=Ct.call,li=typeof Reflect=="object"&&Reflect.apply||(si?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),ci=Xe,ui=L,Lt=function(e){if(ci(e)==="Function")return ui(e)},xt={},Nt={},Mt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,vi=Dt&&!Mt.call({1:2},1);Nt.f=vi?function(r){var t=Dt(this,r);return!!t&&t.enumerable}:Mt;var fi=x,di=N,hi=Nt,pi=fe,bi=H,yi=nr,gi=A,wi=gt,jr=Object.getOwnPropertyDescriptor;xt.f=fi?jr:function(r,t){if(r=bi(r),t=yi(t),wi)try{return jr(r,t)}catch(n){}if(gi(r,t))return pi(!di(hi.f,r,t),r[t])};var Oi=R,mi=T,$i=/#|\.prototype\./,W=function(e,r){var t=Si[Ei(e)];return t==Ii?!0:t==Ti?!1:mi(r)?Oi(r):!!r},Ei=W.normalize=function(e){return String(e).replace($i,".").toLowerCase()},Si=W.data={},Ti=W.NATIVE="N",Ii=W.POLYFILL="P",Pi=W,Cr=Lt,Ri=rr,_i=ve,Ai=Cr(Cr.bind),Ft=function(e,r){return Ri(e),r===void 0?e:_i?Ai(e,r):function(){return e.apply(r,arguments)}},ee=S,ji=li,Ci=Lt,Li=T,xi=xt.f,Ni=Pi,D=Ze,Mi=Ft,F=z,Lr=A,Di=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 ji(e,this,arguments)};return r.prototype=e.prototype,r},Gt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ee:o?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,f,u,d,w,m,O,y;for(u in r)l=Ni(n?u:t+(o?".":"#")+u,e.forced),c=!l&&i&&Lr(i,u),w=s[u],c&&(e.dontCallGetSet?(y=xi(i,u),m=y&&y.value):m=i[u]),d=c&&m?m:r[u],!(c&&typeof w==typeof d)&&(e.bind&&c?O=Mi(d,ee):e.wrap&&c?O=Di(d):a&&Li(d)?O=Ci(d):O=d,(e.sham||d&&d.sham||w&&w.sham)&&F(O,"sham",!0),F(s,u,O),a&&(f=t+"Prototype",Lr(D,f)||F(D,f,{}),F(D[f],u,d),e.real&&v&&(l||!v[u])&&F(v,u,d)))},ke=x,Fi=A,Vt=Function.prototype,Gi=ke&&Object.getOwnPropertyDescriptor,ir=Fi(Vt,"name"),Vi=ir&&function(){}.name==="something",ki=ir&&(!ke||ke&&Gi(Vt,"name").configurable),Bi={EXISTS:ir,PROPER:Vi,CONFIGURABLE:ki},kt={},Ui=Math.ceil,Qi=Math.floor,Ki=Math.trunc||function(r){var t=+r;return(t>0?Qi:Ui)(t)},qi=Ki,Bt=function(e){var r=+e;return r!==r||r===0?0:qi(r)},Yi=Bt,Hi=Math.max,zi=Math.min,Wi=function(e,r){var t=Yi(e);return t<0?Hi(t+r,0):zi(t,r)},Xi=Bt,Ji=Math.min,Zi=function(e){return e>0?Ji(Xi(e),9007199254740991):0},es=Zi,Ut=function(e){return es(e.length)},rs=H,ts=Wi,ns=Ut,xr=function(e){return function(r,t,n){var o=rs(r),a=ns(o),i=ts(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},os={includes:xr(!0),indexOf:xr(!1)},as=L,Ae=A,is=H,ss=os.indexOf,ls=ar,Nr=as([].push),cs=function(e,r){var t=is(e),n=0,o=[],a;for(a in t)!Ae(ls,a)&&Ae(t,a)&&Nr(o,a);for(;r.length>n;)Ae(t,a=r[n++])&&(~ss(o,a)||Nr(o,a));return o},Qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],us=cs,vs=Qt,fs=Object.keys||function(r){return us(r,vs)},ds=x,hs=wt,ps=Q,bs=K,ys=H,gs=fs;kt.f=ds&&!hs?Object.defineProperties:function(r,t){bs(r);for(var n=ys(t),o=gs(t),a=o.length,i=0,s;a>i;)ps.f(r,s=o[i++],n[s]);return r};var ws=Ot,Os=ws("document","documentElement"),ms=K,$s=kt,Mr=Qt,Es=ar,Ss=Os,Ts=yt,Is=or,Dr=">",Fr="<",Be="prototype",Ue="script",Kt=Is("IE_PROTO"),je=function(){},qt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(qt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ps=function(){var e=Ts("iframe"),r="java"+Ue+":",t;return e.style.display="none",Ss.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(qt("document.F=Object")),t.close(),t.F},re,ae=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}ae=typeof document!="undefined"?document.domain&&re?Gr(re):Ps():Gr(re);for(var e=Mr.length;e--;)delete ae[Be][Mr[e]];return ae()};Es[Kt]=!0;var Yt=Object.create||function(r,t){var n;return r!==null?(je[Be]=ms(r),n=new je,je[Be]=null,n[Kt]=r):n=ae(),t===void 0?n:$s.f(n,t)},Rs=R,_s=!Rs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),As=A,js=T,Cs=_t,Ls=or,xs=_s,Vr=Ls("IE_PROTO"),Qe=Object,Ns=Qe.prototype,Ht=xs?Qe.getPrototypeOf:function(e){var r=Cs(e);if(As(r,Vr))return r[Vr];var t=r.constructor;return js(t)&&r instanceof t?t.prototype:r instanceof Qe?Ns:null},Ms=z,zt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Ms(e,r,t),e},Ds=R,Fs=T,Gs=U,Vs=Yt,kr=Ht,ks=zt,Bs=_,Ke=Bs("iterator"),Wt=!1,P,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(P=Ce)):Wt=!0);var Us=!Gs(P)||Ds(function(){var e={};return P[Ke].call(e)!==e});Us?P={}:P=Vs(P);Fs(P[Ke])||ks(P,Ke,function(){return this});var Xt={IteratorPrototype:P,BUGGY_SAFARI_ITERATORS:Wt},Qs=_,Ks=Qs("toStringTag"),Jt={};Jt[Ks]="z";var sr=String(Jt)==="[object z]",qs=sr,Ys=T,ie=Xe,Hs=_,zs=Hs("toStringTag"),Ws=Object,Xs=ie(function(){return arguments}())=="Arguments",Js=function(e,r){try{return e[r]}catch(t){}},lr=qs?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Js(r=Ws(e),zs))=="string"?t:Xs?ie(r):(n=ie(r))=="Object"&&Ys(r.callee)?"Arguments":n},Zs=sr,el=lr,rl=Zs?{}.toString:function(){return"[object "+el(this)+"]"},tl=sr,nl=Q.f,ol=z,al=A,il=rl,sl=_,Br=sl("toStringTag"),Zt=function(e,r,t,n){if(e){var o=t?e:e.prototype;al(o,Br)||nl(o,Br,{configurable:!0,value:r}),n&&!tl&&ol(o,"toString",il)}},ll=Xt.IteratorPrototype,cl=Yt,ul=fe,vl=Zt,fl=B,dl=function(){return this},hl=function(e,r,t,n){var o=r+" Iterator";return e.prototype=cl(ll,{next:ul(+!n,t)}),vl(e,o,!1,!0),fl[o]=dl,e},pl=Gt,bl=N,en=Bi,yl=hl,gl=Ht,wl=Zt,Ur=zt,Ol=_,Qr=B,rn=Xt,ml=en.PROPER;en.CONFIGURABLE;rn.IteratorPrototype;var te=rn.BUGGY_SAFARI_ITERATORS,xe=Ol("iterator"),Kr="keys",ne="values",qr="entries",$l=function(){return this},El=function(e,r,t,n,o,a,i){yl(t,r,n);var s=function(y){if(y===o&&u)return u;if(!te&&y in c)return c[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,f=c[xe]||c["@@iterator"]||o&&c[o],u=!te&&f||s(o),d=r=="Array"&&c.entries||f,w,m,O;if(d&&(w=gl(d.call(new e)),w!==Object.prototype&&w.next&&(wl(w,v,!0,!0),Qr[v]=$l)),ml&&o==ne&&f&&f.name!==ne&&(l=!0,u=function(){return bl(f,this)}),o)if(m={values:s(ne),keys:a?u:s(Kr),entries:s(qr)},i)for(O in m)(te||l||!(O in c))&&Ur(c,O,m[O]);else pl({target:r,proto:!0,forced:te||l},m);return i&&c[xe]!==u&&Ur(c,xe,u,{name:o}),Qr[r]=u,m},Sl=function(e,r){return{value:e,done:r}},Tl=H,Yr=B,tn=ii;Q.f;var Il=El,oe=Sl,nn="Array Iterator",Pl=tn.set,Rl=tn.getterFor(nn);Il(Array,"Array",function(e,r){Pl(this,{type:nn,target:Tl(e),index:0,kind:r})},function(){var e=Rl(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,oe(void 0,!0)):t=="keys"?oe(n,!1):t=="values"?oe(r[n],!1):oe([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var _l=_,Al=B,jl=_l("iterator"),Cl=Array.prototype,Ll=function(e){return e!==void 0&&(Al.Array===e||Cl[jl]===e)},xl=lr,Hr=tr,Nl=Je,Ml=B,Dl=_,Fl=Dl("iterator"),on=function(e){if(!Nl(e))return Hr(e,Fl)||Hr(e,"@@iterator")||Ml[xl(e)]},Gl=N,Vl=rr,kl=K,Bl=er,Ul=on,Ql=TypeError,Kl=function(e,r){var t=arguments.length<2?Ul(e):r;if(Vl(t))return kl(Gl(t,e));throw Ql(Bl(e)+" is not iterable")},ql=N,zr=K,Yl=tr,Hl=function(e,r,t){var n,o;zr(e);try{if(n=Yl(e,"return"),!n){if(r==="throw")throw t;return t}n=ql(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return zr(n),t},zl=Ft,Wl=N,Xl=K,Jl=er,Zl=Ll,ec=Ut,Wr=mt,rc=Kl,tc=on,Xr=Hl,nc=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,oc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=zl(r,n),l,c,f,u,d,w,m,O=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return o?(Xl(g),s?v(g[0],g[1],O):v(g[0],g[1])):s?v(g,O):v(g)};if(a)l=e.iterator;else if(i)l=e;else{if(c=tc(e),!c)throw nc(Jl(e)+" is not iterable");if(Zl(c)){for(f=0,u=ec(e);u>f;f++)if(d=y(e[f]),d&&Wr(Jr,d))return d;return new se(!1)}l=rc(e,c)}for(w=a?e.next:l.next;!(m=Wl(w,l)).done;){try{d=y(m.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},ac=nr,ic=Q,sc=fe,lc=function(e,r,t){var n=ac(r);n in e?ic.f(e,n,sc(0,t)):e[n]=t},cc=Gt,uc=oc,vc=lc;cc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return uc(r,function(n,o){vc(t,n,o)},{AS_ENTRIES:!0}),t}});var fc=Ze,dc=fc.Object.fromEntries,hc={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},pc=hc,bc=S,yc=lr,gc=z,Zr=B,wc=_,et=wc("toStringTag");for(var Ne in pc){var rt=bc[Ne],Me=rt&&rt.prototype;Me&&yc(Me)!==et&&gc(Me,et,Ne),Zr[Ne]=Zr.Array}var Oc=dc,mc=Oc,$c=mc,Ec=$c,Sc=ho(Ec);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 Tc="vk.com",Ic=async(e,r,t)=>{const n=new URL(`https://${Tc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await fo(n.toString())).json();return Pc(a,t)},Pc=(e,r)=>Sc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Rc(n)])),Rc=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=ln;exports.Observable=p;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=an;exports.ValueSubject=Fn;exports.abortable=pn;exports.addScript=dn;exports.areQualitiesExact=Nn;exports.assertEmptyArray=fn;exports.assertNever=C;exports.assertNonNullable=cn;exports.assertNotEmptyArray=vn;exports.assertNullable=un;exports.assertQualityIsExact=Mn;exports.buffer=Kn;exports.checkNever=sn;exports.combine=Gn;exports.debounce=Hn;exports.detectEmbed=Pn;exports.fillWithDefault=at;exports.filter=Zn;exports.filterChanged=ro;exports.fromEvent=Qn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=wn;exports.getHighestQuality=jn;exports.getIOSVersion=yn;exports.interval=Bn;exports.isHigher=Rn;exports.isHigherOrEqual=_n;exports.isIOS=bn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=An;exports.isMacLike=gn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=Ic;exports.map=it;exports.mapTo=oo;exports.merge=Vn;exports.noop=G;exports.now=hn;exports.observableFrom=Un;exports.once=ao;exports.pairwise=io;exports.safeStorage=In;exports.tap=lo;exports.throttle=Xn;exports.timeCodeToString=Dn;exports.timeout=kn;exports.videoHeightToQuality=Cn;exports.videoQualityToHeight=xn;exports.videoSizeToQuality=Ln;
|
|
6
|
+
"use strict";const an="1.0.32-dev.7bf5a18e.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},sn=e=>{},G=()=>{};class p{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:G}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:G,error:G};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new Y().add(()=>{switch(a.next=G,a.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends p{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class ln{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const 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(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function cn(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function un(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}function vn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function fn(e,r){if(e!=null&&e.length)throw new Error(r)}const dn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var de;const hn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now(),pn=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}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 Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,c=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,f=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,u=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:v||l||c||f||d||u||exports.CurrentClientDevice.Desktop}},bn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},yn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},gn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),wn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(b=new Map),j},On=()=>k()===h.LOCAL_STORAGE,mn=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(e);default:C(n)}},$n=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(e,r));default:C(t)}},En=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=b==null?void 0:b.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},Sn=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(b==null?void 0:b.delete(e));default:C(r)}},Tn=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:C(e)}};var In=Object.freeze({__proto__:null,clear:Tn,get:mn,has:En,isPersistent:On,remove:Sn,set:$n});const Pn=()=>{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)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};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 $={[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}},Rn=(e,r)=>$[e].height>$[r].height,_n=(e,r)=>$[e].height>=$[r].height,He=(e,r)=>$[e].height<$[r].height,An=(e,r)=>$[e].height<=$[r].height,jn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],ot=Object.keys($).sort((e,r)=>He(e,r)?-1:1),Cn=(e,r=.02)=>[...ot].find(n=>$[n].height*(1+r)>=e),Ln=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ot.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},xn=e=>$[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Nn=e=>e.every(r=>!ze(r));function Mn(e){if(ze(e))throw new Error("Expected exact quality")}const at=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=at(a,o):t[n]=n in e?a:o}return t},Dn=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};class Fn extends qe{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){const t=super._subscribe(r);return r.next(this.value),t}}function Gn(e){return new p(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new Y)})}function Vn(...e){return new p(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var kn=e=>new p(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Bn=e=>new p(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Un=e=>new p(r=>{e.forEach(t=>r.next(t))}),Qn=(e,r)=>new p(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Kn(e){return r=>new p(t=>r.subscribe(new qn(t,e)))}class qn{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Yn={leading:!1,trailing:!0};function Hn(e,r=Yn){return t=>new p(n=>t.subscribe(new zn(n,e,r)))}class zn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Wn={leading:!0,trailing:!1};function Xn(e,r=Wn){return t=>new p(n=>t.subscribe(new Jn(n,e,r)))}class Jn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Zn(e){return r=>new p(t=>r.subscribe(new eo(t,e)))}class eo{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ro(e=(r,t)=>r===t){return r=>new p(t=>r.subscribe(new to(t,e)))}const cr={};class to{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=cr}next(r){let t;try{t=this.lastValue===cr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function it(e){return r=>new p(t=>r.subscribe(new no(t,e)))}let no=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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function oo(e){return it(()=>e)}function ao(){return e=>new p(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function io(){return e=>new p(r=>e.subscribe(new so(r)))}class so{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function lo(e){return r=>new p(t=>r.subscribe(new co(t,e)))}class co{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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{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;const 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;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class st extends ur{constructor(){super(),this.listeners||ur.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)}}class uo{constructor(){Object.defineProperty(this,"signal",{value:new st,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(uo.prototype[Symbol.toStringTag]="AbortController",st.prototype[Symbol.toStringTag]="AbortSignal");function lt(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 vo(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!lt({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 f;c&&c.signal&&(f=c.signal,delete c.signal);const u=new t(l,c);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},a.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(c.aborted)return Promise.reject(f);const u=new Promise((d,w)=>{c.addEventListener("abort",()=>w(f),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([u,i(v,l)])}return i(v,l)},Request:a}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ct=We?vo({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,fo=We?ct.fetch:window.fetch;We?ct.Request:window.Request;var pe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ho(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R=function(e){try{return!!e()}catch(r){return!0}},po=R,ve=!po(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ut=ve,vt=Function.prototype,De=vt.call,bo=ut&&vt.bind.bind(De,De),L=ut?bo:function(e){return function(){return De.apply(e,arguments)}},ft=L,yo=ft({}.toString),go=ft("".slice),Xe=function(e){return go(yo(e),8,-1)},wo=L,Oo=R,mo=Xe,be=Object,$o=wo("".split),Eo=Oo(function(){return!be("z").propertyIsEnumerable(0)})?function(e){return mo(e)=="String"?$o(e,""):be(e)}:be,Je=function(e){return e==null},So=Je,To=TypeError,dt=function(e){if(So(e))throw To("Can't call method on "+e);return e},Io=Eo,Po=dt,H=function(e){return Io(Po(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof pe=="object"&&pe)||function(){return this}()||pe||Function("return this")(),Fe=typeof document=="object"&&document.all,Ro=typeof Fe=="undefined"&&Fe!==void 0,ht={all:Fe,IS_HTMLDDA:Ro},pt=ht,_o=pt.all,T=pt.IS_HTMLDDA?function(e){return typeof e=="function"||e===_o}:function(e){return typeof e=="function"},Ao=S,jo=T,vr=Ao.WeakMap,Co=jo(vr)&&/native code/.test(String(vr)),fr=T,bt=ht,Lo=bt.all,U=bt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Lo}:function(e){return typeof e=="object"?e!==null:fr(e)},xo=R,x=!xo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},No=S,dr=U,Ge=No.document,Mo=dr(Ge)&&dr(Ge.createElement),yt=function(e){return Mo?Ge.createElement(e):{}},Do=x,Fo=R,Go=yt,gt=!Do&&!Fo(function(){return Object.defineProperty(Go("div"),"a",{get:function(){return 7}}).a!=7}),Vo=x,ko=R,wt=Vo&&ko(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Bo=U,Uo=String,Qo=TypeError,K=function(e){if(Bo(e))return e;throw Qo(Uo(e)+" is not an object")},Ko=ve,J=Function.prototype.call,N=Ko?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,qo=T,hr=function(e){return qo(e)?e:void 0},Ot=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Yo=L,mt=Yo({}.isPrototypeOf),Ho=typeof navigator!="undefined"&&String(navigator.userAgent)||"",$t=S,we=Ho,pr=$t.process,br=$t.Deno,yr=pr&&pr.versions||br&&br.version,gr=yr&&yr.v8,E,le;gr&&(E=gr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&we&&(E=we.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=we.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var zo=le,wr=zo,Wo=R,Xo=S,Jo=Xo.String,Et=!!Object.getOwnPropertySymbols&&!Wo(function(){var e=Symbol();return!Jo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&wr&&wr<41}),Zo=Et,St=Zo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ea=Ot,ra=T,ta=mt,na=St,oa=Object,Tt=na?function(e){return typeof e=="symbol"}:function(e){var r=ea("Symbol");return ra(r)&&ta(r.prototype,oa(e))},aa=String,er=function(e){try{return aa(e)}catch(r){return"Object"}},ia=T,sa=er,la=TypeError,rr=function(e){if(ia(e))return e;throw la(sa(e)+" is not a function")},ca=rr,ua=Je,tr=function(e,r){var t=e[r];return ua(t)?void 0:ca(t)},Oe=N,me=T,$e=U,va=TypeError,fa=function(e,r){var t,n;if(r==="string"&&me(t=e.toString)&&!$e(n=Oe(t,e))||me(t=e.valueOf)&&!$e(n=Oe(t,e))||r!=="string"&&me(t=e.toString)&&!$e(n=Oe(t,e)))return n;throw va("Can't convert object to primitive value")},It={exports:{}},Or=S,da=Object.defineProperty,ha=function(e,r){try{da(Or,e,{value:r,configurable:!0,writable:!0})}catch(t){Or[e]=r}return r},pa=S,ba=ha,mr="__core-js_shared__",ya=pa[mr]||ba(mr,{}),Pt=ya,$r=Pt;(It.exports=function(e,r){return $r[e]||($r[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Rt=It.exports,ga=dt,wa=Object,_t=function(e){return wa(ga(e))},Oa=L,ma=_t,$a=Oa({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return $a(ma(r),t)},Ea=L,Sa=0,Ta=Math.random(),Ia=Ea(1 .toString),At=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ia(++Sa+Ta,36)},Pa=S,Ra=Rt,Er=A,_a=At,Aa=Et,ja=St,V=Pa.Symbol,Ee=Ra("wks"),Ca=ja?V.for||V:V&&V.withoutSetter||_a,_=function(e){return Er(Ee,e)||(Ee[e]=Aa&&Er(V,e)?V[e]:Ca("Symbol."+e)),Ee[e]},La=N,Sr=U,Tr=Tt,xa=tr,Na=fa,Ma=_,Da=TypeError,Fa=Ma("toPrimitive"),Ga=function(e,r){if(!Sr(e)||Tr(e))return e;var t=xa(e,Fa),n;if(t){if(r===void 0&&(r="default"),n=La(t,e,r),!Sr(n)||Tr(n))return n;throw Da("Can't convert object to primitive value")}return r===void 0&&(r="number"),Na(e,r)},Va=Ga,ka=Tt,nr=function(e){var r=Va(e,"string");return ka(r)?r:r+""},Ba=x,Ua=gt,Qa=wt,Z=K,Ir=nr,Ka=TypeError,Se=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Pe="writable";Q.f=Ba?Qa?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Pe in n&&!n[Pe]){var o=qa(r,t);o&&o[Pe]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:o[Ie],enumerable:Te in n?n[Te]:o[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Ua)try{return Se(r,t,n)}catch(o){}if("get"in n||"set"in n)throw Ka("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Ya=x,Ha=Q,za=fe,z=Ya?function(e,r,t){return Ha.f(e,r,za(1,t))}:function(e,r,t){return e[r]=t,e},Wa=Rt,Xa=At,Pr=Wa("keys"),or=function(e){return Pr[e]||(Pr[e]=Xa(e))},ar={},Ja=Co,jt=S,Za=U,ei=z,Re=A,_e=Pt,ri=or,ti=ar,Rr="Object already initialized",Ve=jt.TypeError,ni=jt.WeakMap,ce,q,ue,oi=function(e){return ue(e)?q(e):ce(e,{})},ai=function(e){return function(r){var t;if(!Za(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Ja||_e.state){var I=_e.state||(_e.state=new ni);I.get=I.get,I.has=I.has,I.set=I.set,ce=function(e,r){if(I.has(e))throw Ve(Rr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=ri("state");ti[M]=!0,ce=function(e,r){if(Re(e,M))throw Ve(Rr);return r.facade=e,ei(e,M,r),r},q=function(e){return Re(e,M)?e[M]:{}},ue=function(e){return Re(e,M)}}var ii={set:ce,get:q,has:ue,enforce:oi,getterFor:ai},si=ve,Ct=Function.prototype,_r=Ct.apply,Ar=Ct.call,li=typeof Reflect=="object"&&Reflect.apply||(si?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),ci=Xe,ui=L,Lt=function(e){if(ci(e)==="Function")return ui(e)},xt={},Nt={},Mt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,vi=Dt&&!Mt.call({1:2},1);Nt.f=vi?function(r){var t=Dt(this,r);return!!t&&t.enumerable}:Mt;var fi=x,di=N,hi=Nt,pi=fe,bi=H,yi=nr,gi=A,wi=gt,jr=Object.getOwnPropertyDescriptor;xt.f=fi?jr:function(r,t){if(r=bi(r),t=yi(t),wi)try{return jr(r,t)}catch(n){}if(gi(r,t))return pi(!di(hi.f,r,t),r[t])};var Oi=R,mi=T,$i=/#|\.prototype\./,W=function(e,r){var t=Si[Ei(e)];return t==Ii?!0:t==Ti?!1:mi(r)?Oi(r):!!r},Ei=W.normalize=function(e){return String(e).replace($i,".").toLowerCase()},Si=W.data={},Ti=W.NATIVE="N",Ii=W.POLYFILL="P",Pi=W,Cr=Lt,Ri=rr,_i=ve,Ai=Cr(Cr.bind),Ft=function(e,r){return Ri(e),r===void 0?e:_i?Ai(e,r):function(){return e.apply(r,arguments)}},ee=S,ji=li,Ci=Lt,Li=T,xi=xt.f,Ni=Pi,D=Ze,Mi=Ft,F=z,Lr=A,Di=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 ji(e,this,arguments)};return r.prototype=e.prototype,r},Gt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ee:o?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,f,u,d,w,m,O,y;for(u in r)l=Ni(n?u:t+(o?".":"#")+u,e.forced),c=!l&&i&&Lr(i,u),w=s[u],c&&(e.dontCallGetSet?(y=xi(i,u),m=y&&y.value):m=i[u]),d=c&&m?m:r[u],!(c&&typeof w==typeof d)&&(e.bind&&c?O=Mi(d,ee):e.wrap&&c?O=Di(d):a&&Li(d)?O=Ci(d):O=d,(e.sham||d&&d.sham||w&&w.sham)&&F(O,"sham",!0),F(s,u,O),a&&(f=t+"Prototype",Lr(D,f)||F(D,f,{}),F(D[f],u,d),e.real&&v&&(l||!v[u])&&F(v,u,d)))},ke=x,Fi=A,Vt=Function.prototype,Gi=ke&&Object.getOwnPropertyDescriptor,ir=Fi(Vt,"name"),Vi=ir&&function(){}.name==="something",ki=ir&&(!ke||ke&&Gi(Vt,"name").configurable),Bi={EXISTS:ir,PROPER:Vi,CONFIGURABLE:ki},kt={},Ui=Math.ceil,Qi=Math.floor,Ki=Math.trunc||function(r){var t=+r;return(t>0?Qi:Ui)(t)},qi=Ki,Bt=function(e){var r=+e;return r!==r||r===0?0:qi(r)},Yi=Bt,Hi=Math.max,zi=Math.min,Wi=function(e,r){var t=Yi(e);return t<0?Hi(t+r,0):zi(t,r)},Xi=Bt,Ji=Math.min,Zi=function(e){return e>0?Ji(Xi(e),9007199254740991):0},es=Zi,Ut=function(e){return es(e.length)},rs=H,ts=Wi,ns=Ut,xr=function(e){return function(r,t,n){var o=rs(r),a=ns(o),i=ts(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},os={includes:xr(!0),indexOf:xr(!1)},as=L,Ae=A,is=H,ss=os.indexOf,ls=ar,Nr=as([].push),cs=function(e,r){var t=is(e),n=0,o=[],a;for(a in t)!Ae(ls,a)&&Ae(t,a)&&Nr(o,a);for(;r.length>n;)Ae(t,a=r[n++])&&(~ss(o,a)||Nr(o,a));return o},Qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],us=cs,vs=Qt,fs=Object.keys||function(r){return us(r,vs)},ds=x,hs=wt,ps=Q,bs=K,ys=H,gs=fs;kt.f=ds&&!hs?Object.defineProperties:function(r,t){bs(r);for(var n=ys(t),o=gs(t),a=o.length,i=0,s;a>i;)ps.f(r,s=o[i++],n[s]);return r};var ws=Ot,Os=ws("document","documentElement"),ms=K,$s=kt,Mr=Qt,Es=ar,Ss=Os,Ts=yt,Is=or,Dr=">",Fr="<",Be="prototype",Ue="script",Kt=Is("IE_PROTO"),je=function(){},qt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(qt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ps=function(){var e=Ts("iframe"),r="java"+Ue+":",t;return e.style.display="none",Ss.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(qt("document.F=Object")),t.close(),t.F},re,ae=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}ae=typeof document!="undefined"?document.domain&&re?Gr(re):Ps():Gr(re);for(var e=Mr.length;e--;)delete ae[Be][Mr[e]];return ae()};Es[Kt]=!0;var Yt=Object.create||function(r,t){var n;return r!==null?(je[Be]=ms(r),n=new je,je[Be]=null,n[Kt]=r):n=ae(),t===void 0?n:$s.f(n,t)},Rs=R,_s=!Rs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),As=A,js=T,Cs=_t,Ls=or,xs=_s,Vr=Ls("IE_PROTO"),Qe=Object,Ns=Qe.prototype,Ht=xs?Qe.getPrototypeOf:function(e){var r=Cs(e);if(As(r,Vr))return r[Vr];var t=r.constructor;return js(t)&&r instanceof t?t.prototype:r instanceof Qe?Ns:null},Ms=z,zt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Ms(e,r,t),e},Ds=R,Fs=T,Gs=U,Vs=Yt,kr=Ht,ks=zt,Bs=_,Ke=Bs("iterator"),Wt=!1,P,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(P=Ce)):Wt=!0);var Us=!Gs(P)||Ds(function(){var e={};return P[Ke].call(e)!==e});Us?P={}:P=Vs(P);Fs(P[Ke])||ks(P,Ke,function(){return this});var Xt={IteratorPrototype:P,BUGGY_SAFARI_ITERATORS:Wt},Qs=_,Ks=Qs("toStringTag"),Jt={};Jt[Ks]="z";var sr=String(Jt)==="[object z]",qs=sr,Ys=T,ie=Xe,Hs=_,zs=Hs("toStringTag"),Ws=Object,Xs=ie(function(){return arguments}())=="Arguments",Js=function(e,r){try{return e[r]}catch(t){}},lr=qs?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Js(r=Ws(e),zs))=="string"?t:Xs?ie(r):(n=ie(r))=="Object"&&Ys(r.callee)?"Arguments":n},Zs=sr,el=lr,rl=Zs?{}.toString:function(){return"[object "+el(this)+"]"},tl=sr,nl=Q.f,ol=z,al=A,il=rl,sl=_,Br=sl("toStringTag"),Zt=function(e,r,t,n){if(e){var o=t?e:e.prototype;al(o,Br)||nl(o,Br,{configurable:!0,value:r}),n&&!tl&&ol(o,"toString",il)}},ll=Xt.IteratorPrototype,cl=Yt,ul=fe,vl=Zt,fl=B,dl=function(){return this},hl=function(e,r,t,n){var o=r+" Iterator";return e.prototype=cl(ll,{next:ul(+!n,t)}),vl(e,o,!1,!0),fl[o]=dl,e},pl=Gt,bl=N,en=Bi,yl=hl,gl=Ht,wl=Zt,Ur=zt,Ol=_,Qr=B,rn=Xt,ml=en.PROPER;en.CONFIGURABLE;rn.IteratorPrototype;var te=rn.BUGGY_SAFARI_ITERATORS,xe=Ol("iterator"),Kr="keys",ne="values",qr="entries",$l=function(){return this},El=function(e,r,t,n,o,a,i){yl(t,r,n);var s=function(y){if(y===o&&u)return u;if(!te&&y in c)return c[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,f=c[xe]||c["@@iterator"]||o&&c[o],u=!te&&f||s(o),d=r=="Array"&&c.entries||f,w,m,O;if(d&&(w=gl(d.call(new e)),w!==Object.prototype&&w.next&&(wl(w,v,!0,!0),Qr[v]=$l)),ml&&o==ne&&f&&f.name!==ne&&(l=!0,u=function(){return bl(f,this)}),o)if(m={values:s(ne),keys:a?u:s(Kr),entries:s(qr)},i)for(O in m)(te||l||!(O in c))&&Ur(c,O,m[O]);else pl({target:r,proto:!0,forced:te||l},m);return i&&c[xe]!==u&&Ur(c,xe,u,{name:o}),Qr[r]=u,m},Sl=function(e,r){return{value:e,done:r}},Tl=H,Yr=B,tn=ii;Q.f;var Il=El,oe=Sl,nn="Array Iterator",Pl=tn.set,Rl=tn.getterFor(nn);Il(Array,"Array",function(e,r){Pl(this,{type:nn,target:Tl(e),index:0,kind:r})},function(){var e=Rl(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,oe(void 0,!0)):t=="keys"?oe(n,!1):t=="values"?oe(r[n],!1):oe([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var _l=_,Al=B,jl=_l("iterator"),Cl=Array.prototype,Ll=function(e){return e!==void 0&&(Al.Array===e||Cl[jl]===e)},xl=lr,Hr=tr,Nl=Je,Ml=B,Dl=_,Fl=Dl("iterator"),on=function(e){if(!Nl(e))return Hr(e,Fl)||Hr(e,"@@iterator")||Ml[xl(e)]},Gl=N,Vl=rr,kl=K,Bl=er,Ul=on,Ql=TypeError,Kl=function(e,r){var t=arguments.length<2?Ul(e):r;if(Vl(t))return kl(Gl(t,e));throw Ql(Bl(e)+" is not iterable")},ql=N,zr=K,Yl=tr,Hl=function(e,r,t){var n,o;zr(e);try{if(n=Yl(e,"return"),!n){if(r==="throw")throw t;return t}n=ql(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return zr(n),t},zl=Ft,Wl=N,Xl=K,Jl=er,Zl=Ll,ec=Ut,Wr=mt,rc=Kl,tc=on,Xr=Hl,nc=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,oc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=zl(r,n),l,c,f,u,d,w,m,O=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return o?(Xl(g),s?v(g[0],g[1],O):v(g[0],g[1])):s?v(g,O):v(g)};if(a)l=e.iterator;else if(i)l=e;else{if(c=tc(e),!c)throw nc(Jl(e)+" is not iterable");if(Zl(c)){for(f=0,u=ec(e);u>f;f++)if(d=y(e[f]),d&&Wr(Jr,d))return d;return new se(!1)}l=rc(e,c)}for(w=a?e.next:l.next;!(m=Wl(w,l)).done;){try{d=y(m.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},ac=nr,ic=Q,sc=fe,lc=function(e,r,t){var n=ac(r);n in e?ic.f(e,n,sc(0,t)):e[n]=t},cc=Gt,uc=oc,vc=lc;cc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return uc(r,function(n,o){vc(t,n,o)},{AS_ENTRIES:!0}),t}});var fc=Ze,dc=fc.Object.fromEntries,hc={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},pc=hc,bc=S,yc=lr,gc=z,Zr=B,wc=_,et=wc("toStringTag");for(var Ne in pc){var rt=bc[Ne],Me=rt&&rt.prototype;Me&&yc(Me)!==et&&gc(Me,et,Ne),Zr[Ne]=Zr.Array}var Oc=dc,mc=Oc,$c=mc,Ec=$c,Sc=ho(Ec);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 Tc="vk.com",Ic=async(e,r,t)=>{const n=new URL(`https://${Tc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await fo(n.toString())).json();return Pc(a,t)},Pc=(e,r)=>Sc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Rc(n)])),Rc=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=ln;exports.Observable=p;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=an;exports.ValueSubject=Fn;exports.abortable=pn;exports.addScript=dn;exports.areQualitiesExact=Nn;exports.assertEmptyArray=fn;exports.assertNever=C;exports.assertNonNullable=cn;exports.assertNotEmptyArray=vn;exports.assertNullable=un;exports.assertQualityIsExact=Mn;exports.buffer=Kn;exports.checkNever=sn;exports.combine=Gn;exports.debounce=Hn;exports.detectEmbed=Pn;exports.fillWithDefault=at;exports.filter=Zn;exports.filterChanged=ro;exports.fromEvent=Qn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=wn;exports.getHighestQuality=jn;exports.getIOSVersion=yn;exports.interval=Bn;exports.isHigher=Rn;exports.isHigherOrEqual=_n;exports.isIOS=bn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=An;exports.isMacLike=gn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=Ic;exports.map=it;exports.mapTo=oo;exports.merge=Vn;exports.noop=G;exports.now=hn;exports.observableFrom=Un;exports.once=ao;exports.pairwise=io;exports.safeStorage=In;exports.tap=lo;exports.throttle=Xn;exports.timeCodeToString=Dn;exports.timeout=kn;exports.videoHeightToQuality=Cn;exports.videoQualityToHeight=xn;exports.videoSizeToQuality=Ln;
|
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32-dev.7bf5a18e.0
|
|
3
|
+
* Wed, 07 Feb 2024 09:56:57 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const Yc="1.0.32-dev.0f82d9ff.0";class dr{constructor(){this.subscriptions=[]}unsubscribe(){const e=this.subscriptions;this.subscriptions=[],e.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(e){return this.subscriptions.push(e),this}}const V=r=>{throw new Error(`${r} is value of unexpected type`)},zc=r=>{},Q=()=>{};class y{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let o;t?typeof t=="function"?o={next:t,error:Q}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:Q,error:Q};const a=typeof e=="function"?{next:s=>{try{e(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new dr().add(()=>{switch(a.next=Q,a.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...e){return e.reduce((t,n)=>n(t),this)}_subscribe(e){}}class ot extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,e)})}_subscribe(e){const t=this.keyCounter++;return this.subscribers.set(t,e),new dr().add(()=>this.subscribers.delete(t))}}class Qc{constructor(){this.log$=new ot,this.logs=[],this.log=e=>{const t={...e,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>({component:e,...t}))}}function Wc(r,e='Assertion "value is not nullable" failed'){if(r==null)throw new Error(e)}function Hc(r,e='Assertion "value is nullable" failed'){if(r!=null)throw new Error(e)}function cn(r){return typeof r!="undefined"&&r!==null}function ln(r){return r==null}function Xc(r,e){if(!(r!=null&&r.length))throw new Error(e)}function Jc(r,e){if(r!=null&&r.length)throw new Error(e)}const Zc=(r,e,t)=>new Promise((n,o)=>{e.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=r,document.head.appendChild(c)});var br;const rl=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now(),el=(r,e)=>async(...t)=>{var n;const o=e(...t);let a=r.aborted,i;for(;!a&&!r.aborted;){const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i};var _;(function(r){r.Unknown="Unknown",r.Yandex="Yandex",r.Chrome="Chrome",r.Chromium="Chromium",r.Firefox="Firefox",r.Safari="Safari",r.Opera="Opera",r.Edge="Edge",r.Rest="Rest"})(_||(_={}));var p;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Mac="Mac",r.Desktop="Desktop"})(p||(p={}));const at=()=>{const{userAgent:r}=window.navigator,e=/yabrowser/i.test(r)?_.Yandex:void 0,t=/chrome|crios/i.test(r)?_.Chrome:void 0,n=/chromium/i.test(r)?_.Chromium:void 0,o=/firefox|fxios/i.test(r)?_.Firefox:void 0,a=/webkit|safari|khtml/i.test(r)?_.Safari:void 0,i=/opr\//i.test(r)?_.Opera:void 0,s=/edg/i.test(r)?_.Edge:void 0,v=/android/i.test(r)?p.Android:void 0,c=/iphone/i.test(r)?p.iPhone:void 0,l=/ipad/i.test(r)?p.iPad:void 0,f=/ipod/i.test(r)?p.iPod:void 0,u=/mac/i.test(r)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?p.RestMobile:void 0;return{browser:e||o||i||s||t||n||a||_.Rest,device:v||c||l||f||d||u||p.Desktop}},tl=(r=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(at().device);if(!r)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},nl=()=>{const{userAgent:r}=window.navigator,e=r.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;const t=e[1],n=parseFloat(t);return isNaN(n)?null:n},ol=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(at().device),al=(r,{start:e=0,factor:t=2,max:n=1/0,min:o=e,random:a=0}={})=>{let i=e;return i*=t**r,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(r){r[r.LOCAL_STORAGE=0]="LOCAL_STORAGE",r[r.SESSION_STORAGE=1]="SESSION_STORAGE",r[r.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const yr=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(yr,"test"),localStorage.removeItem(yr),M=h.LOCAL_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)try{sessionStorage.getItem(yr),M=h.SESSION_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)M=h.RUNTIME;else throw e}else throw r}return M===h.RUNTIME&&(b=new Map),M},un=()=>B()===h.LOCAL_STORAGE,vn=r=>{var e,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(e=localStorage.getItem(r))!==null&&e!==void 0?e:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(r))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(r);default:V(n)}},fn=(r,e)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(r,e));default:V(t)}},dn=r=>{var e;const t=B();switch(t){case h.LOCAL_STORAGE:return r in localStorage;case h.SESSION_STORAGE:return r in sessionStorage;case h.RUNTIME:return(e=b==null?void 0:b.has(r))!==null&&e!==void 0?e:!1;default:return V(t),!1}},hn=r=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.removeItem(r);case h.SESSION_STORAGE:return sessionStorage.removeItem(r);case h.RUNTIME:return void(b==null?void 0:b.delete(r));default:V(e)}},pn=()=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(r)}};var il=Object.freeze({__proto__:null,clear:pn,get:vn,has:dn,isPersistent:un,remove:hn,set:fn});const sl=()=>{let r,e;try{r=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?r=!0:(r=!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)}const t=e?new URL(e).hostname:void 0;return{isEmbed:r,host:t}};var $;(function(r){r.INVARIANT="Invariant quality",r.Q_144P="144p",r.Q_240P="240p",r.Q_360P="360p",r.Q_480P="480p",r.Q_720P="720p",r.Q_1080P="1080p",r.Q_1440P="1440p",r.Q_2160P="2160p",r.Q_4320P="4320p"})($||($={}));const S={[$.Q_144P]:{width:256,height:144},[$.Q_240P]:{width:428,height:240},[$.Q_360P]:{width:640,height:360},[$.Q_480P]:{width:856,height:480},[$.Q_720P]:{width:1280,height:720},[$.Q_1080P]:{width:1920,height:1080},[$.Q_1440P]:{width:2560,height:1440},[$.Q_2160P]:{width:3840,height:2160},[$.Q_4320P]:{width:7680,height:4320}},cl=(r,e)=>S[r].height>S[e].height,ll=(r,e)=>S[r].height>=S[e].height,it=(r,e)=>S[r].height<S[e].height,ul=(r,e)=>S[r].height<=S[e].height,vl=r=>r.sort((e,t)=>e===t?0:e===$.INVARIANT?1:t===$.INVARIANT?-1:it(e,t)?1:-1)[0],st=Object.keys(S).sort((r,e)=>it(r,e)?-1:1),fl=(r,e=.02)=>[...st].find(n=>S[n].height*(1+e)>=r),dl=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return st.find(o=>{const a=S[o];return a.width>=n&&a.height>=t})},hl=r=>S[r].height,ct=r=>r===$.INVARIANT,pl=r=>r.every(e=>!ct(e));function bl(r){if(ct(r))throw new Error("Expected exact quality")}const bn=(r,e)=>{const t={};for(const n of Object.keys(e)){const o=e[n],a=r[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=bn(a,o):t[n]=n in r?a:o}return t},yl=r=>{let e="";return r>=3600&&(e+=Math.floor(r/3600)+"h",r=r%3600),r>=60&&(e+=Math.floor(r/60)+"m",r=r%60),r>0&&(e+=Math.floor(r)+"s"),e};class gl extends ot{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){const t=super._subscribe(e);return e.next(this.value),t}}function Ol(r){return new y(e=>{const t={};let n=Object.keys(r).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&e.next(t)};return Object.entries(r).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new dr)})}function wl(...r){return new y(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var ml=r=>new y(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),$l=r=>new y(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),El=r=>new y(e=>{r.forEach(t=>e.next(t))}),Sl=(r,e)=>new y(t=>{const n=o=>t.next(o);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function Tl(r){return e=>new y(t=>e.subscribe(new yn(t,r)))}class yn{constructor(e,t){this.destination=e,this.size=t,this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const gn={leading:!1,trailing:!0};function Il(r,e=gn){return t=>new y(n=>t.subscribe(new On(n,r,e)))}class On{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,cn(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(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const wn={leading:!0,trailing:!1};function Pl(r,e=wn){return t=>new y(n=>t.subscribe(new mn(n,r,e)))}class mn{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,ln(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Rl(r){return e=>new y(t=>e.subscribe(new $n(t,r)))}class $n{constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function _l(r=(e,t)=>e===t){return e=>new y(t=>e.subscribe(new En(t,r)))}const ce={};class En{constructor(e,t){this.destination=e,this.predicate=t,this.lastValue=ce}next(e){let t;try{t=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Sn(r){return e=>new y(t=>e.subscribe(new Tn(t,r)))}let Tn=class{constructor(e,t){this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(t)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}};function jl(r){return Sn(()=>r)}function Ll(){return r=>new y(e=>{let t=!1,n=!1;const o=r.subscribe(a=>{t||(t=!0,e.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function xl(){return r=>new y(e=>r.subscribe(new In(e)))}class In{constructor(e){this.destination=e,this.hasLast=!1}next(e){const t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Ml(r){return e=>new y(t=>e.subscribe(new Pn(t,r)))}class Pn{constructor(e,t){this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(t){throw this.error(t),t}this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}var le;(function(r){r.NETWORK="network",r.VIDEO_PIPELINE="video_pipeline",r.EXTERNAL_API="external_api",r.PARSER="parser",r.DOM="dom",r.WTF="wtf"})(le||(le={}));class ue{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;const n=this.listeners[e];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,e)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}class lt extends ue{constructor(){super(),this.listeners||ue.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}}class Rn{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=e;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Rn.prototype[Symbol.toStringTag]="AbortController",lt.prototype[Symbol.toStringTag]="AbortSignal");function ut(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function _n(r){typeof r=="function"&&(r={fetch:r});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!ut({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const u=new t(c,l);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},a.prototype=t.prototype);const i=e;return{fetch:(v,c)=>{const l=a&&a.prototype.isPrototypeOf(v)?v.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const u=new Promise((d,w)=>{l.addEventListener("abort",()=>w(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([u,i(v,c)])}return i(v,c)},Request:a}}const Wr=ut({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),vt=Wr?_n({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,An=Wr?vt.fetch:window.fetch;Wr?vt.Request:window.Request;var gr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function jn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j=function(r){try{return!!r()}catch(e){return!0}},Ln=j,hr=!Ln(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),ft=hr,dt=Function.prototype,kr=dt.call,xn=ft&&dt.bind.bind(kr,kr),N=ft?xn:function(r){return function(){return kr.apply(r,arguments)}},ht=N,Mn=ht({}.toString),Nn=ht("".slice),Hr=function(r){return Nn(Mn(r),8,-1)},Cn=N,Fn=j,Gn=Hr,Or=Object,Dn=Cn("".split),kn=Fn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Gn(r)=="String"?Dn(r,""):Or(r)}:Or,Xr=function(r){return r==null},Un=Xr,Vn=TypeError,pt=function(r){if(Un(r))throw Vn("Can't call method on "+r);return r},Bn=kn,Kn=pt,H=function(r){return Bn(Kn(r))},K={},Z=function(r){return r&&r.Math==Math&&r},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof gr=="object"&&gr)||function(){return this}()||gr||Function("return this")(),Ur=typeof document=="object"&&document.all,qn=typeof Ur=="undefined"&&Ur!==void 0,bt={all:Ur,IS_HTMLDDA:qn},yt=bt,Yn=yt.all,P=yt.IS_HTMLDDA?function(r){return typeof r=="function"||r===Yn}:function(r){return typeof r=="function"},zn=I,Qn=P,ve=zn.WeakMap,Wn=Qn(ve)&&/native code/.test(String(ve)),fe=P,gt=bt,Hn=gt.all,q=gt.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:fe(r)||r===Hn}:function(r){return typeof r=="object"?r!==null:fe(r)},Xn=j,C=!Xn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Jn=I,de=q,Vr=Jn.document,Zn=de(Vr)&&de(Vr.createElement),Ot=function(r){return Zn?Vr.createElement(r):{}},ro=C,eo=j,to=Ot,wt=!ro&&!eo(function(){return Object.defineProperty(to("div"),"a",{get:function(){return 7}}).a!=7}),no=C,oo=j,mt=no&&oo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ao=q,io=String,so=TypeError,z=function(r){if(ao(r))return r;throw so(io(r)+" is not an object")},co=hr,rr=Function.prototype.call,F=co?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},wr=Jr,mr=I,lo=P,he=function(r){return lo(r)?r:void 0},$t=function(r,e){return arguments.length<2?he(wr[r])||he(mr[r]):wr[r]&&wr[r][e]||mr[r]&&mr[r][e]},uo=N,Et=uo({}.isPrototypeOf),vo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",St=I,$r=vo,pe=St.process,be=St.Deno,ye=pe&&pe.versions||be&&be.version,ge=ye&&ye.v8,T,ur;ge&&(T=ge.split("."),ur=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ur&&$r&&(T=$r.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=$r.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var fo=ur,Oe=fo,ho=j,po=I,bo=po.String,Tt=!!Object.getOwnPropertySymbols&&!ho(function(){var r=Symbol();return!bo(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),yo=Tt,It=yo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",go=$t,Oo=P,wo=Et,mo=It,$o=Object,Pt=mo?function(r){return typeof r=="symbol"}:function(r){var e=go("Symbol");return Oo(e)&&wo(e.prototype,$o(r))},Eo=String,Zr=function(r){try{return Eo(r)}catch(e){return"Object"}},So=P,To=Zr,Io=TypeError,re=function(r){if(So(r))return r;throw Io(To(r)+" is not a function")},Po=re,Ro=Xr,ee=function(r,e){var t=r[e];return Ro(t)?void 0:Po(t)},Er=F,Sr=P,Tr=q,_o=TypeError,Ao=function(r,e){var t,n;if(e==="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r))||Sr(t=r.valueOf)&&!Tr(n=Er(t,r))||e!=="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r)))return n;throw _o("Can't convert object to primitive value")},Rt={exports:{}},we=I,jo=Object.defineProperty,Lo=function(r,e){try{jo(we,r,{value:e,configurable:!0,writable:!0})}catch(t){we[r]=e}return e},xo=I,Mo=Lo,me="__core-js_shared__",No=xo[me]||Mo(me,{}),_t=No,$e=_t;(Rt.exports=function(r,e){return $e[r]||($e[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var At=Rt.exports,Co=pt,Fo=Object,jt=function(r){return Fo(Co(r))},Go=N,Do=jt,ko=Go({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return ko(Do(e),t)},Uo=N,Vo=0,Bo=Math.random(),Ko=Uo(1 .toString),Lt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ko(++Vo+Bo,36)},qo=I,Yo=At,Ee=x,zo=Lt,Qo=Tt,Wo=It,U=qo.Symbol,Ir=Yo("wks"),Ho=Wo?U.for||U:U&&U.withoutSetter||zo,L=function(r){return Ee(Ir,r)||(Ir[r]=Qo&&Ee(U,r)?U[r]:Ho("Symbol."+r)),Ir[r]},Xo=F,Se=q,Te=Pt,Jo=ee,Zo=Ao,ra=L,ea=TypeError,ta=ra("toPrimitive"),na=function(r,e){if(!Se(r)||Te(r))return r;var t=Jo(r,ta),n;if(t){if(e===void 0&&(e="default"),n=Xo(t,r,e),!Se(n)||Te(n))return n;throw ea("Can't convert object to primitive value")}return e===void 0&&(e="number"),Zo(r,e)},oa=na,aa=Pt,te=function(r){var e=oa(r,"string");return aa(e)?e:e+""},ia=C,sa=wt,ca=mt,er=z,Ie=te,la=TypeError,Pr=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,Rr="enumerable",_r="configurable",Ar="writable";Y.f=ia?ca?function(e,t,n){if(er(e),t=Ie(t),er(n),typeof e=="function"&&t==="prototype"&&"value"in n&&Ar in n&&!n[Ar]){var o=ua(e,t);o&&o[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:o[_r],enumerable:Rr in n?n[Rr]:o[Rr],writable:!1})}return Pr(e,t,n)}:Pr:function(e,t,n){if(er(e),t=Ie(t),er(n),sa)try{return Pr(e,t,n)}catch(o){}if("get"in n||"set"in n)throw la("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var pr=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},va=C,fa=Y,da=pr,X=va?function(r,e,t){return fa.f(r,e,da(1,t))}:function(r,e,t){return r[e]=t,r},ha=At,pa=Lt,Pe=ha("keys"),ne=function(r){return Pe[r]||(Pe[r]=pa(r))},oe={},ba=Wn,xt=I,ya=q,ga=X,jr=x,Lr=_t,Oa=ne,wa=oe,Re="Object already initialized",Br=xt.TypeError,ma=xt.WeakMap,vr,W,fr,$a=function(r){return fr(r)?W(r):vr(r,{})},Ea=function(r){return function(e){var t;if(!ya(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(ba||Lr.state){var R=Lr.state||(Lr.state=new ma);R.get=R.get,R.has=R.has,R.set=R.set,vr=function(r,e){if(R.has(r))throw Br(Re);return e.facade=r,R.set(r,e),e},W=function(r){return R.get(r)||{}},fr=function(r){return R.has(r)}}else{var G=Oa("state");wa[G]=!0,vr=function(r,e){if(jr(r,G))throw Br(Re);return e.facade=r,ga(r,G,e),e},W=function(r){return jr(r,G)?r[G]:{}},fr=function(r){return jr(r,G)}}var Sa={set:vr,get:W,has:fr,enforce:$a,getterFor:Ea},Ta=hr,Mt=Function.prototype,_e=Mt.apply,Ae=Mt.call,Ia=typeof Reflect=="object"&&Reflect.apply||(Ta?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Pa=Hr,Ra=N,Nt=function(r){if(Pa(r)==="Function")return Ra(r)},Ct={},Ft={},Gt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,_a=Dt&&!Gt.call({1:2},1);Ft.f=_a?function(e){var t=Dt(this,e);return!!t&&t.enumerable}:Gt;var Aa=C,ja=F,La=Ft,xa=pr,Ma=H,Na=te,Ca=x,Fa=wt,je=Object.getOwnPropertyDescriptor;Ct.f=Aa?je:function(e,t){if(e=Ma(e),t=Na(t),Fa)try{return je(e,t)}catch(n){}if(Ca(e,t))return xa(!ja(La.f,e,t),e[t])};var Ga=j,Da=P,ka=/#|\.prototype\./,J=function(r,e){var t=Va[Ua(r)];return t==Ka?!0:t==Ba?!1:Da(e)?Ga(e):!!e},Ua=J.normalize=function(r){return String(r).replace(ka,".").toLowerCase()},Va=J.data={},Ba=J.NATIVE="N",Ka=J.POLYFILL="P",qa=J,Le=Nt,Ya=re,za=hr,Qa=Le(Le.bind),kt=function(r,e){return Ya(r),e===void 0?r:za?Qa(r,e):function(){return r.apply(e,arguments)}},tr=I,Wa=Ia,Ha=Nt,Xa=P,Ja=Ct.f,Za=qa,D=Jr,ri=kt,k=X,xe=x,ei=function(r){var e=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,n)}return new r(t,n,o)}return Wa(r,this,arguments)};return e.prototype=r.prototype,e},Ut=function(r,e){var t=r.target,n=r.global,o=r.stat,a=r.proto,i=n?tr:o?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,c,l,f,u,d,w,E,m,g;for(u in e)c=Za(n?u:t+(o?".":"#")+u,r.forced),l=!c&&i&&xe(i,u),w=s[u],l&&(r.dontCallGetSet?(g=Ja(i,u),E=g&&g.value):E=i[u]),d=l&&E?E:e[u],!(l&&typeof w==typeof d)&&(r.bind&&l?m=ri(d,tr):r.wrap&&l?m=ei(d):a&&Xa(d)?m=Ha(d):m=d,(r.sham||d&&d.sham||w&&w.sham)&&k(m,"sham",!0),k(s,u,m),a&&(f=t+"Prototype",xe(D,f)||k(D,f,{}),k(D[f],u,d),r.real&&v&&(c||!v[u])&&k(v,u,d)))},Kr=C,ti=x,Vt=Function.prototype,ni=Kr&&Object.getOwnPropertyDescriptor,ae=ti(Vt,"name"),oi=ae&&function(){}.name==="something",ai=ae&&(!Kr||Kr&&ni(Vt,"name").configurable),ii={EXISTS:ae,PROPER:oi,CONFIGURABLE:ai},Bt={},si=Math.ceil,ci=Math.floor,li=Math.trunc||function(e){var t=+e;return(t>0?ci:si)(t)},ui=li,Kt=function(r){var e=+r;return e!==e||e===0?0:ui(e)},vi=Kt,fi=Math.max,di=Math.min,hi=function(r,e){var t=vi(r);return t<0?fi(t+e,0):di(t,e)},pi=Kt,bi=Math.min,yi=function(r){return r>0?bi(pi(r),9007199254740991):0},gi=yi,qt=function(r){return gi(r.length)},Oi=H,wi=hi,mi=qt,Me=function(r){return function(e,t,n){var o=Oi(e),a=mi(o),i=wi(n,a),s;if(r&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((r||i in o)&&o[i]===t)return r||i||0;return!r&&-1}},$i={includes:Me(!0),indexOf:Me(!1)},Ei=N,xr=x,Si=H,Ti=$i.indexOf,Ii=oe,Ne=Ei([].push),Pi=function(r,e){var t=Si(r),n=0,o=[],a;for(a in t)!xr(Ii,a)&&xr(t,a)&&Ne(o,a);for(;e.length>n;)xr(t,a=e[n++])&&(~Ti(o,a)||Ne(o,a));return o},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ri=Pi,_i=Yt,Ai=Object.keys||function(e){return Ri(e,_i)},ji=C,Li=mt,xi=Y,Mi=z,Ni=H,Ci=Ai;Bt.f=ji&&!Li?Object.defineProperties:function(e,t){Mi(e);for(var n=Ni(t),o=Ci(t),a=o.length,i=0,s;a>i;)xi.f(e,s=o[i++],n[s]);return e};var Fi=$t,Gi=Fi("document","documentElement"),Di=z,ki=Bt,Ce=Yt,Ui=oe,Vi=Gi,Bi=Ot,Ki=ne,Fe=">",Ge="<",qr="prototype",Yr="script",zt=Ki("IE_PROTO"),Mr=function(){},Qt=function(r){return Ge+Yr+Fe+r+Ge+"/"+Yr+Fe},De=function(r){r.write(Qt("")),r.close();var e=r.parentWindow.Object;return r=null,e},qi=function(){var r=Bi("iframe"),e="java"+Yr+":",t;return r.style.display="none",Vi.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Qt("document.F=Object")),t.close(),t.F},nr,sr=function(){try{nr=new ActiveXObject("htmlfile")}catch(e){}sr=typeof document!="undefined"?document.domain&&nr?De(nr):qi():De(nr);for(var r=Ce.length;r--;)delete sr[qr][Ce[r]];return sr()};Ui[zt]=!0;var Wt=Object.create||function(e,t){var n;return e!==null?(Mr[qr]=Di(e),n=new Mr,Mr[qr]=null,n[zt]=e):n=sr(),t===void 0?n:ki.f(n,t)},Yi=j,zi=!Yi(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Qi=x,Wi=P,Hi=jt,Xi=ne,Ji=zi,ke=Xi("IE_PROTO"),zr=Object,Zi=zr.prototype,Ht=Ji?zr.getPrototypeOf:function(r){var e=Hi(r);if(Qi(e,ke))return e[ke];var t=e.constructor;return Wi(t)&&e instanceof t?t.prototype:e instanceof zr?Zi:null},rs=X,Xt=function(r,e,t,n){return n&&n.enumerable?r[e]=t:rs(r,e,t),r},es=j,ts=P,ns=q,os=Wt,Ue=Ht,as=Xt,is=L,Qr=is("iterator"),Jt=!1,A,Nr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Nr=Ue(Ue(Cr)),Nr!==Object.prototype&&(A=Nr)):Jt=!0);var ss=!ns(A)||es(function(){var r={};return A[Qr].call(r)!==r});ss?A={}:A=os(A);ts(A[Qr])||as(A,Qr,function(){return this});var Zt={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Jt},cs=L,ls=cs("toStringTag"),rn={};rn[ls]="z";var ie=String(rn)==="[object z]",us=ie,vs=P,cr=Hr,fs=L,ds=fs("toStringTag"),hs=Object,ps=cr(function(){return arguments}())=="Arguments",bs=function(r,e){try{return r[e]}catch(t){}},se=us?cr:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=bs(e=hs(r),ds))=="string"?t:ps?cr(e):(n=cr(e))=="Object"&&vs(e.callee)?"Arguments":n},ys=ie,gs=se,Os=ys?{}.toString:function(){return"[object "+gs(this)+"]"},ws=ie,ms=Y.f,$s=X,Es=x,Ss=Os,Ts=L,Ve=Ts("toStringTag"),en=function(r,e,t,n){if(r){var o=t?r:r.prototype;Es(o,Ve)||ms(o,Ve,{configurable:!0,value:e}),n&&!ws&&$s(o,"toString",Ss)}},Is=Zt.IteratorPrototype,Ps=Wt,Rs=pr,_s=en,As=K,js=function(){return this},Ls=function(r,e,t,n){var o=e+" Iterator";return r.prototype=Ps(Is,{next:Rs(+!n,t)}),_s(r,o,!1,!0),As[o]=js,r},xs=Ut,Ms=F,tn=ii,Ns=Ls,Cs=Ht,Fs=en,Be=Xt,Gs=L,Ke=K,nn=Zt,Ds=tn.PROPER;tn.CONFIGURABLE;nn.IteratorPrototype;var or=nn.BUGGY_SAFARI_ITERATORS,Fr=Gs("iterator"),qe="keys",ar="values",Ye="entries",ks=function(){return this},Us=function(r,e,t,n,o,a,i){Ns(t,e,n);var s=function(g){if(g===o&&u)return u;if(!or&&g in l)return l[g];switch(g){case qe:return function(){return new t(this,g)};case ar:return function(){return new t(this,g)};case Ye:return function(){return new t(this,g)}}return function(){return new t(this)}},v=e+" Iterator",c=!1,l=r.prototype,f=l[Fr]||l["@@iterator"]||o&&l[o],u=!or&&f||s(o),d=e=="Array"&&l.entries||f,w,E,m;if(d&&(w=Cs(d.call(new r)),w!==Object.prototype&&w.next&&(Fs(w,v,!0,!0),Ke[v]=ks)),Ds&&o==ar&&f&&f.name!==ar&&(c=!0,u=function(){return Ms(f,this)}),o)if(E={values:s(ar),keys:a?u:s(qe),entries:s(Ye)},i)for(m in E)(or||c||!(m in l))&&Be(l,m,E[m]);else xs({target:e,proto:!0,forced:or||c},E);return i&&l[Fr]!==u&&Be(l,Fr,u,{name:o}),Ke[e]=u,E},Vs=function(r,e){return{value:r,done:e}},Bs=H,ze=K,on=Sa;Y.f;var Ks=Us,ir=Vs,an="Array Iterator",qs=on.set,Ys=on.getterFor(an);Ks(Array,"Array",function(r,e){qs(this,{type:an,target:Bs(r),index:0,kind:e})},function(){var r=Ys(this),e=r.target,t=r.kind,n=r.index++;return!e||n>=e.length?(r.target=void 0,ir(void 0,!0)):t=="keys"?ir(n,!1):t=="values"?ir(e[n],!1):ir([n,e[n]],!1)},"values");ze.Arguments=ze.Array;var zs=L,Qs=K,Ws=zs("iterator"),Hs=Array.prototype,Xs=function(r){return r!==void 0&&(Qs.Array===r||Hs[Ws]===r)},Js=se,Qe=ee,Zs=Xr,rc=K,ec=L,tc=ec("iterator"),sn=function(r){if(!Zs(r))return Qe(r,tc)||Qe(r,"@@iterator")||rc[Js(r)]},nc=F,oc=re,ac=z,ic=Zr,sc=sn,cc=TypeError,lc=function(r,e){var t=arguments.length<2?sc(r):e;if(oc(t))return ac(nc(t,r));throw cc(ic(r)+" is not iterable")},uc=F,We=z,vc=ee,fc=function(r,e,t){var n,o;We(r);try{if(n=vc(r,"return"),!n){if(e==="throw")throw t;return t}n=uc(n,r)}catch(a){o=!0,n=a}if(e==="throw")throw t;if(o)throw n;return We(n),t},dc=kt,hc=F,pc=z,bc=Zr,yc=Xs,gc=qt,He=Et,Oc=lc,wc=sn,Xe=fc,mc=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,$c=function(r,e,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=dc(e,n),c,l,f,u,d,w,E,m=function(O){return c&&Xe(c,"normal",O),new lr(!0,O)},g=function(O){return o?(pc(O),s?v(O[0],O[1],m):v(O[0],O[1])):s?v(O,m):v(O)};if(a)c=r.iterator;else if(i)c=r;else{if(l=wc(r),!l)throw mc(bc(r)+" is not iterable");if(yc(l)){for(f=0,u=gc(r);u>f;f++)if(d=g(r[f]),d&&He(Je,d))return d;return new lr(!1)}c=Oc(r,l)}for(w=a?r.next:c.next;!(E=hc(w,c)).done;){try{d=g(E.value)}catch(O){Xe(c,"throw",O)}if(typeof d=="object"&&d&&He(Je,d))return d}return new lr(!1)},Ec=te,Sc=Y,Tc=pr,Ic=function(r,e,t){var n=Ec(e);n in r?Sc.f(r,n,Tc(0,t)):r[n]=t},Pc=Ut,Rc=$c,_c=Ic;Pc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Rc(e,function(n,o){_c(t,n,o)},{AS_ENTRIES:!0}),t}});var Ac=Jr,jc=Ac.Object.fromEntries,Lc={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},xc=Lc,Mc=I,Nc=se,Cc=X,Ze=K,Fc=L,rt=Fc("toStringTag");for(var Gr in xc){var et=Mc[Gr],Dr=et&&et.prototype;Dr&&Nc(Dr)!==rt&&Cc(Dr,rt,Gr),Ze[Gr]=Ze.Array}var Gc=jc,Dc=Gc,kc=Dc,Uc=kc,Vc=jn(Uc),tt;(function(r){r.Armenian="58",r.Azerbaijani="57",r.Belarusian="114",r.English="3",r.Kazakh="97",r.Portuguese="73",r.Russian="0",r.Spanish="4",r.Ukrainian="1",r.Uzbek="65",r.Vietnamese="75"})(tt||(tt={}));const Bc="vk.com",Nl=async(r,e,t)=>{const n=new URL(`https://${Bc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),r!==void 0&&n.searchParams.set("lang",r);const a=await(await An(n.toString())).json();return Kc(a,t)},Kc=(r,e)=>Vc(Object.entries(r.keys).map(([t,n])=>[t.substring(`${e}_`.length),qc(n)])),qc=r=>Array.isArray(r)?r[0]:r;var nt;(function(r){r.RU="ru",r.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Qc as Logger,y as Observable,ot as Subject,dr as Subscription,Yc as VERSION,tt as VKNumericLanguage,gl as ValueSubject,$ as VideoQuality,el as abortable,Zc as addScript,pl as areQualitiesExact,Jc as assertEmptyArray,V as assertNever,Wc as assertNonNullable,Xc as assertNotEmptyArray,Hc as assertNullable,bl as assertQualityIsExact,Tl as buffer,zc as checkNever,Ol as combine,Il as debounce,sl as detectEmbed,bn as fillWithDefault,Rl as filter,_l as filterChanged,Sl as fromEvent,at as getCurrentBrowser,al as getExponentialDelay,vl as getHighestQuality,nl as getIOSVersion,$l as interval,cl as isHigher,ll as isHigherOrEqual,tl as isIOS,ct as isInvariantQuality,it as isLower,ul as isLowerOrEqual,ol as isMacLike,cn as isNonNullable,ln as isNullable,Nl as loadVKLangPack,Sn as map,jl as mapTo,wl as merge,Q as noop,rl as now,El as observableFrom,Ll as once,xl as pairwise,il as safeStorage,Ml as tap,Pl as throttle,yl as timeCodeToString,ml as timeout,fl as videoHeightToQuality,hl as videoQualityToHeight,dl as videoSizeToQuality};
|
|
6
|
+
const Yc="1.0.32-dev.7bf5a18e.0";class dr{constructor(){this.subscriptions=[]}unsubscribe(){const e=this.subscriptions;this.subscriptions=[],e.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(e){return this.subscriptions.push(e),this}}const V=r=>{throw new Error(`${r} is value of unexpected type`)},zc=r=>{},Q=()=>{};class y{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let o;t?typeof t=="function"?o={next:t,error:Q}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:Q,error:Q};const a=typeof e=="function"?{next:s=>{try{e(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new dr().add(()=>{switch(a.next=Q,a.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...e){return e.reduce((t,n)=>n(t),this)}_subscribe(e){}}class ot extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,e)})}_subscribe(e){const t=this.keyCounter++;return this.subscribers.set(t,e),new dr().add(()=>this.subscribers.delete(t))}}class Qc{constructor(){this.log$=new ot,this.logs=[],this.log=e=>{const t={...e,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>({component:e,...t}))}}function Wc(r,e='Assertion "value is not nullable" failed'){if(r==null)throw new Error(e)}function Hc(r,e='Assertion "value is nullable" failed'){if(r!=null)throw new Error(e)}function cn(r){return typeof r!="undefined"&&r!==null}function ln(r){return r==null}function Xc(r,e){if(!(r!=null&&r.length))throw new Error(e)}function Jc(r,e){if(r!=null&&r.length)throw new Error(e)}const Zc=(r,e,t)=>new Promise((n,o)=>{e.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=r,document.head.appendChild(c)});var br;const rl=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now(),el=(r,e)=>async(...t)=>{var n;const o=e(...t);let a=r.aborted,i;for(;!a&&!r.aborted;){const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i};var _;(function(r){r.Unknown="Unknown",r.Yandex="Yandex",r.Chrome="Chrome",r.Chromium="Chromium",r.Firefox="Firefox",r.Safari="Safari",r.Opera="Opera",r.Edge="Edge",r.Rest="Rest"})(_||(_={}));var p;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Mac="Mac",r.Desktop="Desktop"})(p||(p={}));const at=()=>{const{userAgent:r}=window.navigator,e=/yabrowser/i.test(r)?_.Yandex:void 0,t=/chrome|crios/i.test(r)?_.Chrome:void 0,n=/chromium/i.test(r)?_.Chromium:void 0,o=/firefox|fxios/i.test(r)?_.Firefox:void 0,a=/webkit|safari|khtml/i.test(r)?_.Safari:void 0,i=/opr\//i.test(r)?_.Opera:void 0,s=/edg/i.test(r)?_.Edge:void 0,v=/android/i.test(r)?p.Android:void 0,c=/iphone/i.test(r)?p.iPhone:void 0,l=/ipad/i.test(r)?p.iPad:void 0,f=/ipod/i.test(r)?p.iPod:void 0,u=/mac/i.test(r)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?p.RestMobile:void 0;return{browser:e||o||i||s||t||n||a||_.Rest,device:v||c||l||f||d||u||p.Desktop}},tl=(r=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(at().device);if(!r)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},nl=()=>{const{userAgent:r}=window.navigator,e=r.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;const t=e[1],n=parseFloat(t);return isNaN(n)?null:n},ol=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(at().device),al=(r,{start:e=0,factor:t=2,max:n=1/0,min:o=e,random:a=0}={})=>{let i=e;return i*=t**r,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(r){r[r.LOCAL_STORAGE=0]="LOCAL_STORAGE",r[r.SESSION_STORAGE=1]="SESSION_STORAGE",r[r.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const yr=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(yr,"test"),localStorage.removeItem(yr),M=h.LOCAL_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)try{sessionStorage.getItem(yr),M=h.SESSION_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)M=h.RUNTIME;else throw e}else throw r}return M===h.RUNTIME&&(b=new Map),M},un=()=>B()===h.LOCAL_STORAGE,vn=r=>{var e,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(e=localStorage.getItem(r))!==null&&e!==void 0?e:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(r))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(r);default:V(n)}},fn=(r,e)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(r,e));default:V(t)}},dn=r=>{var e;const t=B();switch(t){case h.LOCAL_STORAGE:return r in localStorage;case h.SESSION_STORAGE:return r in sessionStorage;case h.RUNTIME:return(e=b==null?void 0:b.has(r))!==null&&e!==void 0?e:!1;default:return V(t),!1}},hn=r=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.removeItem(r);case h.SESSION_STORAGE:return sessionStorage.removeItem(r);case h.RUNTIME:return void(b==null?void 0:b.delete(r));default:V(e)}},pn=()=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(r)}};var il=Object.freeze({__proto__:null,clear:pn,get:vn,has:dn,isPersistent:un,remove:hn,set:fn});const sl=()=>{let r,e;try{r=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?r=!0:(r=!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)}const t=e?new URL(e).hostname:void 0;return{isEmbed:r,host:t}};var $;(function(r){r.INVARIANT="Invariant quality",r.Q_144P="144p",r.Q_240P="240p",r.Q_360P="360p",r.Q_480P="480p",r.Q_720P="720p",r.Q_1080P="1080p",r.Q_1440P="1440p",r.Q_2160P="2160p",r.Q_4320P="4320p"})($||($={}));const S={[$.Q_144P]:{width:256,height:144},[$.Q_240P]:{width:428,height:240},[$.Q_360P]:{width:640,height:360},[$.Q_480P]:{width:856,height:480},[$.Q_720P]:{width:1280,height:720},[$.Q_1080P]:{width:1920,height:1080},[$.Q_1440P]:{width:2560,height:1440},[$.Q_2160P]:{width:3840,height:2160},[$.Q_4320P]:{width:7680,height:4320}},cl=(r,e)=>S[r].height>S[e].height,ll=(r,e)=>S[r].height>=S[e].height,it=(r,e)=>S[r].height<S[e].height,ul=(r,e)=>S[r].height<=S[e].height,vl=r=>r.sort((e,t)=>e===t?0:e===$.INVARIANT?1:t===$.INVARIANT?-1:it(e,t)?1:-1)[0],st=Object.keys(S).sort((r,e)=>it(r,e)?-1:1),fl=(r,e=.02)=>[...st].find(n=>S[n].height*(1+e)>=r),dl=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return st.find(o=>{const a=S[o];return a.width>=n&&a.height>=t})},hl=r=>S[r].height,ct=r=>r===$.INVARIANT,pl=r=>r.every(e=>!ct(e));function bl(r){if(ct(r))throw new Error("Expected exact quality")}const bn=(r,e)=>{const t={};for(const n of Object.keys(e)){const o=e[n],a=r[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=bn(a,o):t[n]=n in r?a:o}return t},yl=r=>{let e="";return r>=3600&&(e+=Math.floor(r/3600)+"h",r=r%3600),r>=60&&(e+=Math.floor(r/60)+"m",r=r%60),r>0&&(e+=Math.floor(r)+"s"),e};class gl extends ot{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){const t=super._subscribe(e);return e.next(this.value),t}}function Ol(r){return new y(e=>{const t={};let n=Object.keys(r).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&e.next(t)};return Object.entries(r).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new dr)})}function wl(...r){return new y(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var ml=r=>new y(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),$l=r=>new y(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),El=r=>new y(e=>{r.forEach(t=>e.next(t))}),Sl=(r,e)=>new y(t=>{const n=o=>t.next(o);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function Tl(r){return e=>new y(t=>e.subscribe(new yn(t,r)))}class yn{constructor(e,t){this.destination=e,this.size=t,this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const gn={leading:!1,trailing:!0};function Il(r,e=gn){return t=>new y(n=>t.subscribe(new On(n,r,e)))}class On{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,cn(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(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const wn={leading:!0,trailing:!1};function Pl(r,e=wn){return t=>new y(n=>t.subscribe(new mn(n,r,e)))}class mn{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,ln(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){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Rl(r){return e=>new y(t=>e.subscribe(new $n(t,r)))}class $n{constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function _l(r=(e,t)=>e===t){return e=>new y(t=>e.subscribe(new En(t,r)))}const ce={};class En{constructor(e,t){this.destination=e,this.predicate=t,this.lastValue=ce}next(e){let t;try{t=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Sn(r){return e=>new y(t=>e.subscribe(new Tn(t,r)))}let Tn=class{constructor(e,t){this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(t)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}};function jl(r){return Sn(()=>r)}function Ll(){return r=>new y(e=>{let t=!1,n=!1;const o=r.subscribe(a=>{t||(t=!0,e.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function xl(){return r=>new y(e=>r.subscribe(new In(e)))}class In{constructor(e){this.destination=e,this.hasLast=!1}next(e){const t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Ml(r){return e=>new y(t=>e.subscribe(new Pn(t,r)))}class Pn{constructor(e,t){this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(t){throw this.error(t),t}this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}var le;(function(r){r.NETWORK="network",r.VIDEO_PIPELINE="video_pipeline",r.EXTERNAL_API="external_api",r.PARSER="parser",r.DOM="dom",r.WTF="wtf"})(le||(le={}));class ue{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;const n=this.listeners[e];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,e)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}class lt extends ue{constructor(){super(),this.listeners||ue.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}}class Rn{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=e;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Rn.prototype[Symbol.toStringTag]="AbortController",lt.prototype[Symbol.toStringTag]="AbortSignal");function ut(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function _n(r){typeof r=="function"&&(r={fetch:r});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!ut({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const u=new t(c,l);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},a.prototype=t.prototype);const i=e;return{fetch:(v,c)=>{const l=a&&a.prototype.isPrototypeOf(v)?v.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const u=new Promise((d,w)=>{l.addEventListener("abort",()=>w(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([u,i(v,c)])}return i(v,c)},Request:a}}const Wr=ut({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),vt=Wr?_n({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,An=Wr?vt.fetch:window.fetch;Wr?vt.Request:window.Request;var gr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function jn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j=function(r){try{return!!r()}catch(e){return!0}},Ln=j,hr=!Ln(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),ft=hr,dt=Function.prototype,kr=dt.call,xn=ft&&dt.bind.bind(kr,kr),N=ft?xn:function(r){return function(){return kr.apply(r,arguments)}},ht=N,Mn=ht({}.toString),Nn=ht("".slice),Hr=function(r){return Nn(Mn(r),8,-1)},Cn=N,Fn=j,Gn=Hr,Or=Object,Dn=Cn("".split),kn=Fn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Gn(r)=="String"?Dn(r,""):Or(r)}:Or,Xr=function(r){return r==null},Un=Xr,Vn=TypeError,pt=function(r){if(Un(r))throw Vn("Can't call method on "+r);return r},Bn=kn,Kn=pt,H=function(r){return Bn(Kn(r))},K={},Z=function(r){return r&&r.Math==Math&&r},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof gr=="object"&&gr)||function(){return this}()||gr||Function("return this")(),Ur=typeof document=="object"&&document.all,qn=typeof Ur=="undefined"&&Ur!==void 0,bt={all:Ur,IS_HTMLDDA:qn},yt=bt,Yn=yt.all,P=yt.IS_HTMLDDA?function(r){return typeof r=="function"||r===Yn}:function(r){return typeof r=="function"},zn=I,Qn=P,ve=zn.WeakMap,Wn=Qn(ve)&&/native code/.test(String(ve)),fe=P,gt=bt,Hn=gt.all,q=gt.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:fe(r)||r===Hn}:function(r){return typeof r=="object"?r!==null:fe(r)},Xn=j,C=!Xn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Jn=I,de=q,Vr=Jn.document,Zn=de(Vr)&&de(Vr.createElement),Ot=function(r){return Zn?Vr.createElement(r):{}},ro=C,eo=j,to=Ot,wt=!ro&&!eo(function(){return Object.defineProperty(to("div"),"a",{get:function(){return 7}}).a!=7}),no=C,oo=j,mt=no&&oo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ao=q,io=String,so=TypeError,z=function(r){if(ao(r))return r;throw so(io(r)+" is not an object")},co=hr,rr=Function.prototype.call,F=co?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},wr=Jr,mr=I,lo=P,he=function(r){return lo(r)?r:void 0},$t=function(r,e){return arguments.length<2?he(wr[r])||he(mr[r]):wr[r]&&wr[r][e]||mr[r]&&mr[r][e]},uo=N,Et=uo({}.isPrototypeOf),vo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",St=I,$r=vo,pe=St.process,be=St.Deno,ye=pe&&pe.versions||be&&be.version,ge=ye&&ye.v8,T,ur;ge&&(T=ge.split("."),ur=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ur&&$r&&(T=$r.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=$r.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var fo=ur,Oe=fo,ho=j,po=I,bo=po.String,Tt=!!Object.getOwnPropertySymbols&&!ho(function(){var r=Symbol();return!bo(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),yo=Tt,It=yo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",go=$t,Oo=P,wo=Et,mo=It,$o=Object,Pt=mo?function(r){return typeof r=="symbol"}:function(r){var e=go("Symbol");return Oo(e)&&wo(e.prototype,$o(r))},Eo=String,Zr=function(r){try{return Eo(r)}catch(e){return"Object"}},So=P,To=Zr,Io=TypeError,re=function(r){if(So(r))return r;throw Io(To(r)+" is not a function")},Po=re,Ro=Xr,ee=function(r,e){var t=r[e];return Ro(t)?void 0:Po(t)},Er=F,Sr=P,Tr=q,_o=TypeError,Ao=function(r,e){var t,n;if(e==="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r))||Sr(t=r.valueOf)&&!Tr(n=Er(t,r))||e!=="string"&&Sr(t=r.toString)&&!Tr(n=Er(t,r)))return n;throw _o("Can't convert object to primitive value")},Rt={exports:{}},we=I,jo=Object.defineProperty,Lo=function(r,e){try{jo(we,r,{value:e,configurable:!0,writable:!0})}catch(t){we[r]=e}return e},xo=I,Mo=Lo,me="__core-js_shared__",No=xo[me]||Mo(me,{}),_t=No,$e=_t;(Rt.exports=function(r,e){return $e[r]||($e[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var At=Rt.exports,Co=pt,Fo=Object,jt=function(r){return Fo(Co(r))},Go=N,Do=jt,ko=Go({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return ko(Do(e),t)},Uo=N,Vo=0,Bo=Math.random(),Ko=Uo(1 .toString),Lt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ko(++Vo+Bo,36)},qo=I,Yo=At,Ee=x,zo=Lt,Qo=Tt,Wo=It,U=qo.Symbol,Ir=Yo("wks"),Ho=Wo?U.for||U:U&&U.withoutSetter||zo,L=function(r){return Ee(Ir,r)||(Ir[r]=Qo&&Ee(U,r)?U[r]:Ho("Symbol."+r)),Ir[r]},Xo=F,Se=q,Te=Pt,Jo=ee,Zo=Ao,ra=L,ea=TypeError,ta=ra("toPrimitive"),na=function(r,e){if(!Se(r)||Te(r))return r;var t=Jo(r,ta),n;if(t){if(e===void 0&&(e="default"),n=Xo(t,r,e),!Se(n)||Te(n))return n;throw ea("Can't convert object to primitive value")}return e===void 0&&(e="number"),Zo(r,e)},oa=na,aa=Pt,te=function(r){var e=oa(r,"string");return aa(e)?e:e+""},ia=C,sa=wt,ca=mt,er=z,Ie=te,la=TypeError,Pr=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,Rr="enumerable",_r="configurable",Ar="writable";Y.f=ia?ca?function(e,t,n){if(er(e),t=Ie(t),er(n),typeof e=="function"&&t==="prototype"&&"value"in n&&Ar in n&&!n[Ar]){var o=ua(e,t);o&&o[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:o[_r],enumerable:Rr in n?n[Rr]:o[Rr],writable:!1})}return Pr(e,t,n)}:Pr:function(e,t,n){if(er(e),t=Ie(t),er(n),sa)try{return Pr(e,t,n)}catch(o){}if("get"in n||"set"in n)throw la("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var pr=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},va=C,fa=Y,da=pr,X=va?function(r,e,t){return fa.f(r,e,da(1,t))}:function(r,e,t){return r[e]=t,r},ha=At,pa=Lt,Pe=ha("keys"),ne=function(r){return Pe[r]||(Pe[r]=pa(r))},oe={},ba=Wn,xt=I,ya=q,ga=X,jr=x,Lr=_t,Oa=ne,wa=oe,Re="Object already initialized",Br=xt.TypeError,ma=xt.WeakMap,vr,W,fr,$a=function(r){return fr(r)?W(r):vr(r,{})},Ea=function(r){return function(e){var t;if(!ya(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(ba||Lr.state){var R=Lr.state||(Lr.state=new ma);R.get=R.get,R.has=R.has,R.set=R.set,vr=function(r,e){if(R.has(r))throw Br(Re);return e.facade=r,R.set(r,e),e},W=function(r){return R.get(r)||{}},fr=function(r){return R.has(r)}}else{var G=Oa("state");wa[G]=!0,vr=function(r,e){if(jr(r,G))throw Br(Re);return e.facade=r,ga(r,G,e),e},W=function(r){return jr(r,G)?r[G]:{}},fr=function(r){return jr(r,G)}}var Sa={set:vr,get:W,has:fr,enforce:$a,getterFor:Ea},Ta=hr,Mt=Function.prototype,_e=Mt.apply,Ae=Mt.call,Ia=typeof Reflect=="object"&&Reflect.apply||(Ta?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Pa=Hr,Ra=N,Nt=function(r){if(Pa(r)==="Function")return Ra(r)},Ct={},Ft={},Gt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,_a=Dt&&!Gt.call({1:2},1);Ft.f=_a?function(e){var t=Dt(this,e);return!!t&&t.enumerable}:Gt;var Aa=C,ja=F,La=Ft,xa=pr,Ma=H,Na=te,Ca=x,Fa=wt,je=Object.getOwnPropertyDescriptor;Ct.f=Aa?je:function(e,t){if(e=Ma(e),t=Na(t),Fa)try{return je(e,t)}catch(n){}if(Ca(e,t))return xa(!ja(La.f,e,t),e[t])};var Ga=j,Da=P,ka=/#|\.prototype\./,J=function(r,e){var t=Va[Ua(r)];return t==Ka?!0:t==Ba?!1:Da(e)?Ga(e):!!e},Ua=J.normalize=function(r){return String(r).replace(ka,".").toLowerCase()},Va=J.data={},Ba=J.NATIVE="N",Ka=J.POLYFILL="P",qa=J,Le=Nt,Ya=re,za=hr,Qa=Le(Le.bind),kt=function(r,e){return Ya(r),e===void 0?r:za?Qa(r,e):function(){return r.apply(e,arguments)}},tr=I,Wa=Ia,Ha=Nt,Xa=P,Ja=Ct.f,Za=qa,D=Jr,ri=kt,k=X,xe=x,ei=function(r){var e=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,n)}return new r(t,n,o)}return Wa(r,this,arguments)};return e.prototype=r.prototype,e},Ut=function(r,e){var t=r.target,n=r.global,o=r.stat,a=r.proto,i=n?tr:o?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,c,l,f,u,d,w,E,m,g;for(u in e)c=Za(n?u:t+(o?".":"#")+u,r.forced),l=!c&&i&&xe(i,u),w=s[u],l&&(r.dontCallGetSet?(g=Ja(i,u),E=g&&g.value):E=i[u]),d=l&&E?E:e[u],!(l&&typeof w==typeof d)&&(r.bind&&l?m=ri(d,tr):r.wrap&&l?m=ei(d):a&&Xa(d)?m=Ha(d):m=d,(r.sham||d&&d.sham||w&&w.sham)&&k(m,"sham",!0),k(s,u,m),a&&(f=t+"Prototype",xe(D,f)||k(D,f,{}),k(D[f],u,d),r.real&&v&&(c||!v[u])&&k(v,u,d)))},Kr=C,ti=x,Vt=Function.prototype,ni=Kr&&Object.getOwnPropertyDescriptor,ae=ti(Vt,"name"),oi=ae&&function(){}.name==="something",ai=ae&&(!Kr||Kr&&ni(Vt,"name").configurable),ii={EXISTS:ae,PROPER:oi,CONFIGURABLE:ai},Bt={},si=Math.ceil,ci=Math.floor,li=Math.trunc||function(e){var t=+e;return(t>0?ci:si)(t)},ui=li,Kt=function(r){var e=+r;return e!==e||e===0?0:ui(e)},vi=Kt,fi=Math.max,di=Math.min,hi=function(r,e){var t=vi(r);return t<0?fi(t+e,0):di(t,e)},pi=Kt,bi=Math.min,yi=function(r){return r>0?bi(pi(r),9007199254740991):0},gi=yi,qt=function(r){return gi(r.length)},Oi=H,wi=hi,mi=qt,Me=function(r){return function(e,t,n){var o=Oi(e),a=mi(o),i=wi(n,a),s;if(r&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((r||i in o)&&o[i]===t)return r||i||0;return!r&&-1}},$i={includes:Me(!0),indexOf:Me(!1)},Ei=N,xr=x,Si=H,Ti=$i.indexOf,Ii=oe,Ne=Ei([].push),Pi=function(r,e){var t=Si(r),n=0,o=[],a;for(a in t)!xr(Ii,a)&&xr(t,a)&&Ne(o,a);for(;e.length>n;)xr(t,a=e[n++])&&(~Ti(o,a)||Ne(o,a));return o},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ri=Pi,_i=Yt,Ai=Object.keys||function(e){return Ri(e,_i)},ji=C,Li=mt,xi=Y,Mi=z,Ni=H,Ci=Ai;Bt.f=ji&&!Li?Object.defineProperties:function(e,t){Mi(e);for(var n=Ni(t),o=Ci(t),a=o.length,i=0,s;a>i;)xi.f(e,s=o[i++],n[s]);return e};var Fi=$t,Gi=Fi("document","documentElement"),Di=z,ki=Bt,Ce=Yt,Ui=oe,Vi=Gi,Bi=Ot,Ki=ne,Fe=">",Ge="<",qr="prototype",Yr="script",zt=Ki("IE_PROTO"),Mr=function(){},Qt=function(r){return Ge+Yr+Fe+r+Ge+"/"+Yr+Fe},De=function(r){r.write(Qt("")),r.close();var e=r.parentWindow.Object;return r=null,e},qi=function(){var r=Bi("iframe"),e="java"+Yr+":",t;return r.style.display="none",Vi.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Qt("document.F=Object")),t.close(),t.F},nr,sr=function(){try{nr=new ActiveXObject("htmlfile")}catch(e){}sr=typeof document!="undefined"?document.domain&&nr?De(nr):qi():De(nr);for(var r=Ce.length;r--;)delete sr[qr][Ce[r]];return sr()};Ui[zt]=!0;var Wt=Object.create||function(e,t){var n;return e!==null?(Mr[qr]=Di(e),n=new Mr,Mr[qr]=null,n[zt]=e):n=sr(),t===void 0?n:ki.f(n,t)},Yi=j,zi=!Yi(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Qi=x,Wi=P,Hi=jt,Xi=ne,Ji=zi,ke=Xi("IE_PROTO"),zr=Object,Zi=zr.prototype,Ht=Ji?zr.getPrototypeOf:function(r){var e=Hi(r);if(Qi(e,ke))return e[ke];var t=e.constructor;return Wi(t)&&e instanceof t?t.prototype:e instanceof zr?Zi:null},rs=X,Xt=function(r,e,t,n){return n&&n.enumerable?r[e]=t:rs(r,e,t),r},es=j,ts=P,ns=q,os=Wt,Ue=Ht,as=Xt,is=L,Qr=is("iterator"),Jt=!1,A,Nr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Nr=Ue(Ue(Cr)),Nr!==Object.prototype&&(A=Nr)):Jt=!0);var ss=!ns(A)||es(function(){var r={};return A[Qr].call(r)!==r});ss?A={}:A=os(A);ts(A[Qr])||as(A,Qr,function(){return this});var Zt={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Jt},cs=L,ls=cs("toStringTag"),rn={};rn[ls]="z";var ie=String(rn)==="[object z]",us=ie,vs=P,cr=Hr,fs=L,ds=fs("toStringTag"),hs=Object,ps=cr(function(){return arguments}())=="Arguments",bs=function(r,e){try{return r[e]}catch(t){}},se=us?cr:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=bs(e=hs(r),ds))=="string"?t:ps?cr(e):(n=cr(e))=="Object"&&vs(e.callee)?"Arguments":n},ys=ie,gs=se,Os=ys?{}.toString:function(){return"[object "+gs(this)+"]"},ws=ie,ms=Y.f,$s=X,Es=x,Ss=Os,Ts=L,Ve=Ts("toStringTag"),en=function(r,e,t,n){if(r){var o=t?r:r.prototype;Es(o,Ve)||ms(o,Ve,{configurable:!0,value:e}),n&&!ws&&$s(o,"toString",Ss)}},Is=Zt.IteratorPrototype,Ps=Wt,Rs=pr,_s=en,As=K,js=function(){return this},Ls=function(r,e,t,n){var o=e+" Iterator";return r.prototype=Ps(Is,{next:Rs(+!n,t)}),_s(r,o,!1,!0),As[o]=js,r},xs=Ut,Ms=F,tn=ii,Ns=Ls,Cs=Ht,Fs=en,Be=Xt,Gs=L,Ke=K,nn=Zt,Ds=tn.PROPER;tn.CONFIGURABLE;nn.IteratorPrototype;var or=nn.BUGGY_SAFARI_ITERATORS,Fr=Gs("iterator"),qe="keys",ar="values",Ye="entries",ks=function(){return this},Us=function(r,e,t,n,o,a,i){Ns(t,e,n);var s=function(g){if(g===o&&u)return u;if(!or&&g in l)return l[g];switch(g){case qe:return function(){return new t(this,g)};case ar:return function(){return new t(this,g)};case Ye:return function(){return new t(this,g)}}return function(){return new t(this)}},v=e+" Iterator",c=!1,l=r.prototype,f=l[Fr]||l["@@iterator"]||o&&l[o],u=!or&&f||s(o),d=e=="Array"&&l.entries||f,w,E,m;if(d&&(w=Cs(d.call(new r)),w!==Object.prototype&&w.next&&(Fs(w,v,!0,!0),Ke[v]=ks)),Ds&&o==ar&&f&&f.name!==ar&&(c=!0,u=function(){return Ms(f,this)}),o)if(E={values:s(ar),keys:a?u:s(qe),entries:s(Ye)},i)for(m in E)(or||c||!(m in l))&&Be(l,m,E[m]);else xs({target:e,proto:!0,forced:or||c},E);return i&&l[Fr]!==u&&Be(l,Fr,u,{name:o}),Ke[e]=u,E},Vs=function(r,e){return{value:r,done:e}},Bs=H,ze=K,on=Sa;Y.f;var Ks=Us,ir=Vs,an="Array Iterator",qs=on.set,Ys=on.getterFor(an);Ks(Array,"Array",function(r,e){qs(this,{type:an,target:Bs(r),index:0,kind:e})},function(){var r=Ys(this),e=r.target,t=r.kind,n=r.index++;return!e||n>=e.length?(r.target=void 0,ir(void 0,!0)):t=="keys"?ir(n,!1):t=="values"?ir(e[n],!1):ir([n,e[n]],!1)},"values");ze.Arguments=ze.Array;var zs=L,Qs=K,Ws=zs("iterator"),Hs=Array.prototype,Xs=function(r){return r!==void 0&&(Qs.Array===r||Hs[Ws]===r)},Js=se,Qe=ee,Zs=Xr,rc=K,ec=L,tc=ec("iterator"),sn=function(r){if(!Zs(r))return Qe(r,tc)||Qe(r,"@@iterator")||rc[Js(r)]},nc=F,oc=re,ac=z,ic=Zr,sc=sn,cc=TypeError,lc=function(r,e){var t=arguments.length<2?sc(r):e;if(oc(t))return ac(nc(t,r));throw cc(ic(r)+" is not iterable")},uc=F,We=z,vc=ee,fc=function(r,e,t){var n,o;We(r);try{if(n=vc(r,"return"),!n){if(e==="throw")throw t;return t}n=uc(n,r)}catch(a){o=!0,n=a}if(e==="throw")throw t;if(o)throw n;return We(n),t},dc=kt,hc=F,pc=z,bc=Zr,yc=Xs,gc=qt,He=Et,Oc=lc,wc=sn,Xe=fc,mc=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,$c=function(r,e,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=dc(e,n),c,l,f,u,d,w,E,m=function(O){return c&&Xe(c,"normal",O),new lr(!0,O)},g=function(O){return o?(pc(O),s?v(O[0],O[1],m):v(O[0],O[1])):s?v(O,m):v(O)};if(a)c=r.iterator;else if(i)c=r;else{if(l=wc(r),!l)throw mc(bc(r)+" is not iterable");if(yc(l)){for(f=0,u=gc(r);u>f;f++)if(d=g(r[f]),d&&He(Je,d))return d;return new lr(!1)}c=Oc(r,l)}for(w=a?r.next:c.next;!(E=hc(w,c)).done;){try{d=g(E.value)}catch(O){Xe(c,"throw",O)}if(typeof d=="object"&&d&&He(Je,d))return d}return new lr(!1)},Ec=te,Sc=Y,Tc=pr,Ic=function(r,e,t){var n=Ec(e);n in r?Sc.f(r,n,Tc(0,t)):r[n]=t},Pc=Ut,Rc=$c,_c=Ic;Pc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Rc(e,function(n,o){_c(t,n,o)},{AS_ENTRIES:!0}),t}});var Ac=Jr,jc=Ac.Object.fromEntries,Lc={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},xc=Lc,Mc=I,Nc=se,Cc=X,Ze=K,Fc=L,rt=Fc("toStringTag");for(var Gr in xc){var et=Mc[Gr],Dr=et&&et.prototype;Dr&&Nc(Dr)!==rt&&Cc(Dr,rt,Gr),Ze[Gr]=Ze.Array}var Gc=jc,Dc=Gc,kc=Dc,Uc=kc,Vc=jn(Uc),tt;(function(r){r.Armenian="58",r.Azerbaijani="57",r.Belarusian="114",r.English="3",r.Kazakh="97",r.Portuguese="73",r.Russian="0",r.Spanish="4",r.Ukrainian="1",r.Uzbek="65",r.Vietnamese="75"})(tt||(tt={}));const Bc="vk.com",Nl=async(r,e,t)=>{const n=new URL(`https://${Bc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),r!==void 0&&n.searchParams.set("lang",r);const a=await(await An(n.toString())).json();return Kc(a,t)},Kc=(r,e)=>Vc(Object.entries(r.keys).map(([t,n])=>[t.substring(`${e}_`.length),qc(n)])),qc=r=>Array.isArray(r)?r[0]:r;var nt;(function(r){r.RU="ru",r.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Qc as Logger,y as Observable,ot as Subject,dr as Subscription,Yc as VERSION,tt as VKNumericLanguage,gl as ValueSubject,$ as VideoQuality,el as abortable,Zc as addScript,pl as areQualitiesExact,Jc as assertEmptyArray,V as assertNever,Wc as assertNonNullable,Xc as assertNotEmptyArray,Hc as assertNullable,bl as assertQualityIsExact,Tl as buffer,zc as checkNever,Ol as combine,Il as debounce,sl as detectEmbed,bn as fillWithDefault,Rl as filter,_l as filterChanged,Sl as fromEvent,at as getCurrentBrowser,al as getExponentialDelay,vl as getHighestQuality,nl as getIOSVersion,$l as interval,cl as isHigher,ll as isHigherOrEqual,tl as isIOS,ct as isInvariantQuality,it as isLower,ul as isLowerOrEqual,ol as isMacLike,cn as isNonNullable,ln as isNullable,Nl as loadVKLangPack,Sn as map,jl as mapTo,wl as merge,Q as noop,rl as now,El as observableFrom,Ll as once,xl as pairwise,il as safeStorage,Ml as tap,Pl as throttle,yl as timeCodeToString,ml as timeout,fl as videoHeightToQuality,hl as videoQualityToHeight,dl as videoSizeToQuality};
|
package/esnext.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32-dev.7bf5a18e.0
|
|
3
|
+
* Wed, 07 Feb 2024 09:56:57 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const q="1.0.32-dev.0f82d9ff.0";class v{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=e=>{throw new Error(`${e} is value of unexpected type`)},F=e=>{},m=()=>{};class l{constructor(t){t&&(this._subscribe=t)}subscribe(t,r){let n;r?typeof r=="function"?n={next:r,error:m}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:m,error:m};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(u){n.next(u)}},error:o=>n.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):n.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new v().add(()=>{switch(s.next=m,s.error=m,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return p(i)}})}pipe(...t){return t.reduce((r,n)=>n(r),this)}_subscribe(t){}}class A extends l{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(r=>r.next(t))}error(t){this.subscribers.forEach(r=>r.error?.(t))}_subscribe(t){const r=this.keyCounter++;return this.subscribers.set(r,t),new v().add(()=>this.subscribers.delete(r))}}class U{log$=new A;logs=[];log=t=>{const r={...t,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};createCustomLog(t){return(...r)=>{let n;try{n=t(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(r=>({component:t,...r}))}getAllLogs=()=>this.logs}function G(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function B(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function T(e){return typeof e<"u"&&e!==null}function I(e){return e==null}function z(e,t){if(!e?.length)throw new Error(t)}function H(e,t){if(e?.length)throw new Error(t)}const $=(e,t,r)=>new Promise((n,s)=>{t.addEventListener("abort",()=>{u(),c.remove()});const i=()=>{u(),s()},o=()=>{u(),n()},u=()=>{h&&clearTimeout(h),c.removeEventListener("load",o),c.removeEventListener("error",i)};let h;r&&(h=window.setTimeout(i,r));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),Y=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),W=(e,t)=>async(...r)=>{const n=t(...r);let s=e.aborted,i;for(;!s&&!e.aborted;){const o=await n.next(i);s=o.done??!1,i=o.value}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 x=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,r=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/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,u=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,h=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,f=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,b=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,g=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,S=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||u||r||n||i||exports.CurrentClientBrowser.Rest,device:h||c||f||b||S||g||exports.CurrentClientDevice.Desktop}},K=(e=!1)=>{const r=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device);if(!e)return r;const{userAgent:n,maxTouchPoints:s}=window.navigator;return!!(r||/macintosh/i.test(n)&&s>0)},X=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const r=t[1],n=parseFloat(r);return isNaN(n)?null:n},J=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device),Z=(e,{start:t=0,factor:r=2,max:n=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=r**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,s),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let E,w;const O=`vk-videoplayer-dummy-key-${Math.random()}`,y=()=>{if(w!==void 0)return w;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),w=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),w=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)w=a.RUNTIME;else throw t}else throw e}return w===a.RUNTIME&&(E=new Map),w},ee=()=>y()===a.LOCAL_STORAGE,te=e=>{const t=y();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return E?.get(e);default:p(t)}},re=(e,t)=>{const r=y();switch(r){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void E?.set(e,t);default:p(r)}},ne=e=>{const t=y();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return E?.has(e)??!1;default:return p(t),!1}},ie=e=>{const t=y();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void E?.delete(e);default:p(t)}},se=()=>{const e=y();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return E?.clear();default:p(e)}};var oe=Object.freeze({__proto__:null,clear:se,get:te,has:ne,isPersistent:ee,remove:ie,set:re});const ae=()=>{let e,t;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&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!t&&document.referrer&&(t=document.referrer)}catch(n){console.error(n)}const r=t?new URL(t).hostname:void 0;return{isEmbed:e,host:r}};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 d={[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}},ce=(e,t)=>d[e].height>d[t].height,le=(e,t)=>d[e].height>=d[t].height,C=(e,t)=>d[e].height<d[t].height,ue=(e,t)=>d[e].height<=d[t].height,de=e=>e.sort((t,r)=>t===r?0:t===exports.VideoQuality.INVARIANT?1:r===exports.VideoQuality.INVARIANT?-1:C(t,r)?1:-1)[0],N=Object.keys(d).sort((e,t)=>C(e,t)?-1:1),he=(e,t=.02)=>[...N].find(n=>d[n].height*(1+t)>=e),fe=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return N.find(s=>{const i=d[s];return i.width>=n&&i.height>=r})},be=e=>d[e].height,R=e=>e===exports.VideoQuality.INVARIANT,we=e=>e.every(t=>!R(t));function pe(e){if(R(e))throw new Error("Expected exact quality")}const M=(e,t)=>{const r={};for(const n of Object.keys(t)){const s=t[n],i=e[n];Array.isArray(s)&&Array.isArray(i)?r[n]=i:typeof s=="object"&&typeof i=="object"?r[n]=M(i,s):r[n]=n in e?i:s}return r},ge=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};class me extends A{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 r=super._subscribe(t);return t.next(this.value),r}}function Ee(e){return new l(t=>{const r={};let n=Object.keys(e).length;const s=i=>o=>{i in r||n--,r[i]=o,n===0&&t.next(r)};return Object.entries(e).reduce((i,[o,u])=>i.add(u.subscribe(s(o))),new v)})}function ye(...e){return new l(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new v))}var ve=e=>new l(t=>{const r=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(r)}),Se=e=>new l(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),Oe=e=>new l(t=>{e.forEach(r=>t.next(r))}),Ae=(e,t)=>new l(r=>{const n=s=>r.next(s);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function xe(e){return t=>new l(r=>t.subscribe(new Ce(r,e)))}class Ce{destination;size;lastValues=[];constructor(t,r){this.destination=t,this.size=r}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 Re={leading:!1,trailing:!0};function Le(e,t=Re){return r=>new l(n=>r.subscribe(new _e(n,e,t)))}class _e{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,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(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Pe={leading:!0,trailing:!1};function Te(e,t=Pe){return r=>new l(n=>r.subscribe(new Ie(n,e,t)))}class Ie{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,I(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 Ne(e){return t=>new l(r=>t.subscribe(new Me(r,e)))}class Me{destination;predicate;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.predicate(t)}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Qe(e=(t,r)=>t===r){return t=>new l(r=>t.subscribe(new Ve(r,e)))}const _={};class Ve{destination;predicate;lastValue=_;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===_||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Q(e){return t=>new l(r=>t.subscribe(new De(r,e)))}let De=class{destination;mapper;constructor(t,r){this.destination=t,this.mapper=r}next(t){let r;try{r=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(r)}error(t){this.destination.error?.(t)}};function je(e){return Q(()=>e)}function ke(){return e=>new l(t=>{let r=!1,n=!1;const s=e.subscribe(i=>{r||(r=!0,t.next(i)),n&&s.unsubscribe()},i=>{r=!0,t.error?.(i),n&&s.unsubscribe()});return n=!0,r&&s.unsubscribe(),s})}function qe(){return e=>new l(t=>e.subscribe(new Fe(t)))}class Fe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const r=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,t])}error(t){this.destination.error?.(t)}}function Ue(e){return t=>new l(r=>t.subscribe(new Ge(r,e)))}class Ge{destination;effect;constructor(t,r){this.destination=t,this.effect=r}next(t){try{this.effect(t)}catch(r){throw this.error(r),r}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class P{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,r,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:r,options:n})}removeEventListener(t,r){if(!(t in this.listeners))return;const n=this.listeners[t];for(let s=0,i=n.length;s<i;s++)if(n[s].callback===r){n.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const n=this.listeners[t.type].slice();for(let s=0,i=n.length;s<i;s++){const o=n[s];try{o.callback.call(this,t)}catch(u){Promise.resolve().then(()=>{throw u})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class V extends P{constructor(){super(),this.listeners||P.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 Be{constructor(){Object.defineProperty(this,"signal",{value:new V,writable:!0,configurable:!0})}abort(t){let r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}let n=t;if(n===void 0)if(typeof document>"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(r)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(Be.prototype[Symbol.toStringTag]="AbortController",V.prototype[Symbol.toStringTag]="AbortSignal");function D(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 ze(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!D({fetch:t,Request:r,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=r;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,f){let b;f&&f.signal&&(b=f.signal,delete f.signal);const g=new r(c,f);return b&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:b}),g},i.prototype=r.prototype);const o=t;return{fetch:(h,c)=>{const f=i&&i.prototype.isPrototypeOf(h)?h.signal:c?c.signal:void 0;if(f){let b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(f.aborted)return Promise.reject(b);const g=new Promise((S,k)=>{f.addEventListener("abort",()=>k(b),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([g,o(h,c)])}return o(h,c)},Request:i}}const L=D({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),j=L?ze({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,He=L?j.fetch:window.fetch;L?j.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 $e="vk.com",Ye=async(e,t,r)=>{const n=new URL(`https://${$e}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const i=await(await He(n.toString())).json();return We(i,r)},We=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),Ke(n)])),Ke=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=U;exports.Observable=l;exports.Subject=A;exports.Subscription=v;exports.VERSION=q;exports.ValueSubject=me;exports.abortable=W;exports.addScript=$;exports.areQualitiesExact=we;exports.assertEmptyArray=H;exports.assertNever=p;exports.assertNonNullable=G;exports.assertNotEmptyArray=z;exports.assertNullable=B;exports.assertQualityIsExact=pe;exports.buffer=xe;exports.checkNever=F;exports.combine=Ee;exports.debounce=Le;exports.detectEmbed=ae;exports.fillWithDefault=M;exports.filter=Ne;exports.filterChanged=Qe;exports.fromEvent=Ae;exports.getCurrentBrowser=x;exports.getExponentialDelay=Z;exports.getHighestQuality=de;exports.getIOSVersion=X;exports.interval=Se;exports.isHigher=ce;exports.isHigherOrEqual=le;exports.isIOS=K;exports.isInvariantQuality=R;exports.isLower=C;exports.isLowerOrEqual=ue;exports.isMacLike=J;exports.isNonNullable=T;exports.isNullable=I;exports.loadVKLangPack=Ye;exports.map=Q;exports.mapTo=je;exports.merge=ye;exports.noop=m;exports.now=Y;exports.observableFrom=Oe;exports.once=ke;exports.pairwise=qe;exports.safeStorage=oe;exports.tap=Ue;exports.throttle=Te;exports.timeCodeToString=ge;exports.timeout=ve;exports.videoHeightToQuality=he;exports.videoQualityToHeight=be;exports.videoSizeToQuality=fe;
|
|
6
|
+
"use strict";const q="1.0.32-dev.7bf5a18e.0";class v{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=e=>{throw new Error(`${e} is value of unexpected type`)},F=e=>{},m=()=>{};class l{constructor(t){t&&(this._subscribe=t)}subscribe(t,r){let n;r?typeof r=="function"?n={next:r,error:m}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:m,error:m};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(u){n.next(u)}},error:o=>n.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):n.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new v().add(()=>{switch(s.next=m,s.error=m,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return p(i)}})}pipe(...t){return t.reduce((r,n)=>n(r),this)}_subscribe(t){}}class A extends l{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(r=>r.next(t))}error(t){this.subscribers.forEach(r=>r.error?.(t))}_subscribe(t){const r=this.keyCounter++;return this.subscribers.set(r,t),new v().add(()=>this.subscribers.delete(r))}}class U{log$=new A;logs=[];log=t=>{const r={...t,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};createCustomLog(t){return(...r)=>{let n;try{n=t(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(r=>({component:t,...r}))}getAllLogs=()=>this.logs}function G(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function B(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function T(e){return typeof e<"u"&&e!==null}function I(e){return e==null}function z(e,t){if(!e?.length)throw new Error(t)}function H(e,t){if(e?.length)throw new Error(t)}const $=(e,t,r)=>new Promise((n,s)=>{t.addEventListener("abort",()=>{u(),c.remove()});const i=()=>{u(),s()},o=()=>{u(),n()},u=()=>{h&&clearTimeout(h),c.removeEventListener("load",o),c.removeEventListener("error",i)};let h;r&&(h=window.setTimeout(i,r));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),Y=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),W=(e,t)=>async(...r)=>{const n=t(...r);let s=e.aborted,i;for(;!s&&!e.aborted;){const o=await n.next(i);s=o.done??!1,i=o.value}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 x=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,r=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/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,u=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,h=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,f=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,b=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,g=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,S=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||u||r||n||i||exports.CurrentClientBrowser.Rest,device:h||c||f||b||S||g||exports.CurrentClientDevice.Desktop}},K=(e=!1)=>{const r=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device);if(!e)return r;const{userAgent:n,maxTouchPoints:s}=window.navigator;return!!(r||/macintosh/i.test(n)&&s>0)},X=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const r=t[1],n=parseFloat(r);return isNaN(n)?null:n},J=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device),Z=(e,{start:t=0,factor:r=2,max:n=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=r**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,s),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let E,w;const O=`vk-videoplayer-dummy-key-${Math.random()}`,y=()=>{if(w!==void 0)return w;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),w=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),w=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)w=a.RUNTIME;else throw t}else throw e}return w===a.RUNTIME&&(E=new Map),w},ee=()=>y()===a.LOCAL_STORAGE,te=e=>{const t=y();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return E?.get(e);default:p(t)}},re=(e,t)=>{const r=y();switch(r){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void E?.set(e,t);default:p(r)}},ne=e=>{const t=y();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return E?.has(e)??!1;default:return p(t),!1}},ie=e=>{const t=y();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void E?.delete(e);default:p(t)}},se=()=>{const e=y();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return E?.clear();default:p(e)}};var oe=Object.freeze({__proto__:null,clear:se,get:te,has:ne,isPersistent:ee,remove:ie,set:re});const ae=()=>{let e,t;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&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!t&&document.referrer&&(t=document.referrer)}catch(n){console.error(n)}const r=t?new URL(t).hostname:void 0;return{isEmbed:e,host:r}};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 d={[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}},ce=(e,t)=>d[e].height>d[t].height,le=(e,t)=>d[e].height>=d[t].height,C=(e,t)=>d[e].height<d[t].height,ue=(e,t)=>d[e].height<=d[t].height,de=e=>e.sort((t,r)=>t===r?0:t===exports.VideoQuality.INVARIANT?1:r===exports.VideoQuality.INVARIANT?-1:C(t,r)?1:-1)[0],N=Object.keys(d).sort((e,t)=>C(e,t)?-1:1),he=(e,t=.02)=>[...N].find(n=>d[n].height*(1+t)>=e),fe=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return N.find(s=>{const i=d[s];return i.width>=n&&i.height>=r})},be=e=>d[e].height,R=e=>e===exports.VideoQuality.INVARIANT,we=e=>e.every(t=>!R(t));function pe(e){if(R(e))throw new Error("Expected exact quality")}const M=(e,t)=>{const r={};for(const n of Object.keys(t)){const s=t[n],i=e[n];Array.isArray(s)&&Array.isArray(i)?r[n]=i:typeof s=="object"&&typeof i=="object"?r[n]=M(i,s):r[n]=n in e?i:s}return r},ge=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};class me extends A{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 r=super._subscribe(t);return t.next(this.value),r}}function Ee(e){return new l(t=>{const r={};let n=Object.keys(e).length;const s=i=>o=>{i in r||n--,r[i]=o,n===0&&t.next(r)};return Object.entries(e).reduce((i,[o,u])=>i.add(u.subscribe(s(o))),new v)})}function ye(...e){return new l(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new v))}var ve=e=>new l(t=>{const r=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(r)}),Se=e=>new l(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),Oe=e=>new l(t=>{e.forEach(r=>t.next(r))}),Ae=(e,t)=>new l(r=>{const n=s=>r.next(s);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function xe(e){return t=>new l(r=>t.subscribe(new Ce(r,e)))}class Ce{destination;size;lastValues=[];constructor(t,r){this.destination=t,this.size=r}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 Re={leading:!1,trailing:!0};function Le(e,t=Re){return r=>new l(n=>r.subscribe(new _e(n,e,t)))}class _e{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,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(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Pe={leading:!0,trailing:!1};function Te(e,t=Pe){return r=>new l(n=>r.subscribe(new Ie(n,e,t)))}class Ie{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,I(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 Ne(e){return t=>new l(r=>t.subscribe(new Me(r,e)))}class Me{destination;predicate;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.predicate(t)}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Qe(e=(t,r)=>t===r){return t=>new l(r=>t.subscribe(new Ve(r,e)))}const _={};class Ve{destination;predicate;lastValue=_;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===_||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Q(e){return t=>new l(r=>t.subscribe(new De(r,e)))}let De=class{destination;mapper;constructor(t,r){this.destination=t,this.mapper=r}next(t){let r;try{r=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(r)}error(t){this.destination.error?.(t)}};function je(e){return Q(()=>e)}function ke(){return e=>new l(t=>{let r=!1,n=!1;const s=e.subscribe(i=>{r||(r=!0,t.next(i)),n&&s.unsubscribe()},i=>{r=!0,t.error?.(i),n&&s.unsubscribe()});return n=!0,r&&s.unsubscribe(),s})}function qe(){return e=>new l(t=>e.subscribe(new Fe(t)))}class Fe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const r=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,t])}error(t){this.destination.error?.(t)}}function Ue(e){return t=>new l(r=>t.subscribe(new Ge(r,e)))}class Ge{destination;effect;constructor(t,r){this.destination=t,this.effect=r}next(t){try{this.effect(t)}catch(r){throw this.error(r),r}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class P{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,r,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:r,options:n})}removeEventListener(t,r){if(!(t in this.listeners))return;const n=this.listeners[t];for(let s=0,i=n.length;s<i;s++)if(n[s].callback===r){n.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const n=this.listeners[t.type].slice();for(let s=0,i=n.length;s<i;s++){const o=n[s];try{o.callback.call(this,t)}catch(u){Promise.resolve().then(()=>{throw u})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class V extends P{constructor(){super(),this.listeners||P.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 Be{constructor(){Object.defineProperty(this,"signal",{value:new V,writable:!0,configurable:!0})}abort(t){let r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}let n=t;if(n===void 0)if(typeof document>"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(r)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(Be.prototype[Symbol.toStringTag]="AbortController",V.prototype[Symbol.toStringTag]="AbortSignal");function D(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 ze(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!D({fetch:t,Request:r,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=r;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,f){let b;f&&f.signal&&(b=f.signal,delete f.signal);const g=new r(c,f);return b&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:b}),g},i.prototype=r.prototype);const o=t;return{fetch:(h,c)=>{const f=i&&i.prototype.isPrototypeOf(h)?h.signal:c?c.signal:void 0;if(f){let b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(f.aborted)return Promise.reject(b);const g=new Promise((S,k)=>{f.addEventListener("abort",()=>k(b),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([g,o(h,c)])}return o(h,c)},Request:i}}const L=D({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),j=L?ze({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,He=L?j.fetch:window.fetch;L?j.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 $e="vk.com",Ye=async(e,t,r)=>{const n=new URL(`https://${$e}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const i=await(await He(n.toString())).json();return We(i,r)},We=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),Ke(n)])),Ke=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=U;exports.Observable=l;exports.Subject=A;exports.Subscription=v;exports.VERSION=q;exports.ValueSubject=me;exports.abortable=W;exports.addScript=$;exports.areQualitiesExact=we;exports.assertEmptyArray=H;exports.assertNever=p;exports.assertNonNullable=G;exports.assertNotEmptyArray=z;exports.assertNullable=B;exports.assertQualityIsExact=pe;exports.buffer=xe;exports.checkNever=F;exports.combine=Ee;exports.debounce=Le;exports.detectEmbed=ae;exports.fillWithDefault=M;exports.filter=Ne;exports.filterChanged=Qe;exports.fromEvent=Ae;exports.getCurrentBrowser=x;exports.getExponentialDelay=Z;exports.getHighestQuality=de;exports.getIOSVersion=X;exports.interval=Se;exports.isHigher=ce;exports.isHigherOrEqual=le;exports.isIOS=K;exports.isInvariantQuality=R;exports.isLower=C;exports.isLowerOrEqual=ue;exports.isMacLike=J;exports.isNonNullable=T;exports.isNullable=I;exports.loadVKLangPack=Ye;exports.map=Q;exports.mapTo=je;exports.merge=ye;exports.noop=m;exports.now=Y;exports.observableFrom=Oe;exports.once=ke;exports.pairwise=qe;exports.safeStorage=oe;exports.tap=Ue;exports.throttle=Te;exports.timeCodeToString=ge;exports.timeout=ve;exports.videoHeightToQuality=he;exports.videoQualityToHeight=be;exports.videoSizeToQuality=fe;
|
package/esnext.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32-dev.7bf5a18e.0
|
|
3
|
+
* Wed, 07 Feb 2024 09:56:57 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const be="1.0.32-dev.0f82d9ff.0";class x{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const O=e=>{throw new Error(`${e} is value of unexpected type`)},we=e=>{},y=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,r){let n;r?typeof r=="function"?n={next:r,error:y}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:y,error:y};const i=typeof t=="function"?{next:o=>{try{t(o)}catch(d){n.next(d)}},error:o=>n.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):n.next(o)};let s;try{s=this._subscribe(i)}catch(o){i.error?.(o)}return new x().add(()=>{switch(i.next=y,i.error=y,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return O(s)}})}pipe(...t){return t.reduce((r,n)=>n(r),this)}_subscribe(t){}}class N extends u{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(r=>r.next(t))}error(t){this.subscribers.forEach(r=>r.error?.(t))}_subscribe(t){const r=this.keyCounter++;return this.subscribers.set(r,t),new x().add(()=>this.subscribers.delete(r))}}class pe{log$=new N;logs=[];log=t=>{const r={...t,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};createCustomLog(t){return(...r)=>{let n;try{n=t(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(r=>({component:t,...r}))}getAllLogs=()=>this.logs}function me(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ge(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function V(e){return typeof e<"u"&&e!==null}function D(e){return e==null}function Ee(e,t){if(!e?.length)throw new Error(t)}function Oe(e,t){if(e?.length)throw new Error(t)}const Se=(e,t,r)=>new Promise((n,i)=>{t.addEventListener("abort",()=>{d(),c.remove()});const s=()=>{d(),i()},o=()=>{d(),n()},d=()=>{b&&clearTimeout(b),c.removeEventListener("load",o),c.removeEventListener("error",s)};let b;r&&(b=window.setTimeout(s,r));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",s),c.src=e,document.head.appendChild(c)}),Ae=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),ye=(e,t)=>async(...r)=>{const n=t(...r);let i=e.aborted,s;for(;!i&&!e.aborted;){const o=await n.next(s);i=o.done??!1,s=o.value}return s};var m;(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"})(m||(m={}));var l;(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"})(l||(l={}));const j=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?m.Yandex:void 0,r=/chrome|crios/i.test(e)?m.Chrome:void 0,n=/chromium/i.test(e)?m.Chromium:void 0,i=/firefox|fxios/i.test(e)?m.Firefox:void 0,s=/webkit|safari|khtml/i.test(e)?m.Safari:void 0,o=/opr\//i.test(e)?m.Opera:void 0,d=/edg/i.test(e)?m.Edge:void 0,b=/android/i.test(e)?l.Android:void 0,c=/iphone/i.test(e)?l.iPhone:void 0,w=/ipad/i.test(e)?l.iPad:void 0,p=/ipod/i.test(e)?l.iPod:void 0,E=/mac/i.test(e)?l.Mac:void 0,v=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?l.RestMobile:void 0;return{browser:t||i||o||d||r||n||s||m.Rest,device:b||c||w||p||v||E||l.Desktop}},xe=(e=!1)=>{const r=[l.iPhone,l.iPad,l.iPod].includes(j().device);if(!e)return r;const{userAgent:n,maxTouchPoints:i}=window.navigator;return!!(r||/macintosh/i.test(n)&&i>0)},ve=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const r=t[1],n=parseFloat(r);return isNaN(n)?null:n},Re=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(j().device),_e=(e,{start:t=0,factor:r=2,max:n=1/0,min:i=t,random:s=0}={})=>{let o=t;return o*=r**e,o*=1+(Math.random()*s*2-s),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,i),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let S,g;const R=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(g!==void 0)return g;try{localStorage.setItem(R,"test"),localStorage.removeItem(R),g=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(R),g=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)g=a.RUNTIME;else throw t}else throw e}return g===a.RUNTIME&&(S=new Map),g},z=()=>A()===a.LOCAL_STORAGE,$=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return S?.get(e);default:O(t)}},Y=(e,t)=>{const r=A();switch(r){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void S?.set(e,t);default:O(r)}},H=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return S?.has(e)??!1;default:return O(t),!1}},W=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void S?.delete(e);default:O(t)}},B=()=>{const e=A();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return S?.clear();default:O(e)}};var Pe=Object.freeze({__proto__:null,clear:B,get:$,has:H,isPersistent:z,remove:W,set:Y});const Le=()=>{let e,t;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&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!t&&document.referrer&&(t=document.referrer)}catch(n){console.error(n)}const r=t?new URL(t).hostname:void 0;return{isEmbed:e,host:r}};var h;(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"})(h||(h={}));const f={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},Te=(e,t)=>f[e].height>f[t].height,Ie=(e,t)=>f[e].height>=f[t].height,k=(e,t)=>f[e].height<f[t].height,Me=(e,t)=>f[e].height<=f[t].height,Ne=e=>e.sort((t,r)=>t===r?0:t===h.INVARIANT?1:r===h.INVARIANT?-1:k(t,r)?1:-1)[0],q=Object.keys(f).sort((e,t)=>k(e,t)?-1:1),je=(e,t=.02)=>[...q].find(n=>f[n].height*(1+t)>=e),ke=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return q.find(i=>{const s=f[i];return s.width>=n&&s.height>=r})},qe=e=>f[e].height,F=e=>e===h.INVARIANT,Fe=e=>e.every(t=>!F(t));function Ue(e){if(F(e))throw new Error("Expected exact quality")}const X=(e,t)=>{const r={};for(const n of Object.keys(t)){const i=t[n],s=e[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=X(s,i):r[n]=n in e?s:i}return r},Ce=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};class Qe extends N{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 r=super._subscribe(t);return t.next(this.value),r}}function Ge(e){return new u(t=>{const r={};let n=Object.keys(e).length;const i=s=>o=>{s in r||n--,r[s]=o,n===0&&t.next(r)};return Object.entries(e).reduce((s,[o,d])=>s.add(d.subscribe(i(o))),new x)})}function Ve(...e){return new u(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new x))}var De=e=>new u(t=>{const r=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(r)}),ze=e=>new u(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),$e=e=>new u(t=>{e.forEach(r=>t.next(r))}),Ye=(e,t)=>new u(r=>{const n=i=>r.next(i);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function He(e){return t=>new u(r=>t.subscribe(new J(r,e)))}class J{destination;size;lastValues=[];constructor(t,r){this.destination=t,this.size=r}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 Z={leading:!1,trailing:!0};function We(e,t=Z){return r=>new u(n=>r.subscribe(new K(n,e,t)))}class K{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,V(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(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const ee={leading:!0,trailing:!1};function Be(e,t=ee){return r=>new u(n=>r.subscribe(new te(n,e,t)))}class te{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,D(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 Xe(e){return t=>new u(r=>t.subscribe(new re(r,e)))}class re{destination;predicate;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.predicate(t)}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Je(e=(t,r)=>t===r){return t=>new u(r=>t.subscribe(new ne(r,e)))}const P={};class ne{destination;predicate;lastValue=P;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===P||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function se(e){return t=>new u(r=>t.subscribe(new ie(r,e)))}let ie=class{destination;mapper;constructor(t,r){this.destination=t,this.mapper=r}next(t){let r;try{r=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(r)}error(t){this.destination.error?.(t)}};function Ke(e){return se(()=>e)}function et(){return e=>new u(t=>{let r=!1,n=!1;const i=e.subscribe(s=>{r||(r=!0,t.next(s)),n&&i.unsubscribe()},s=>{r=!0,t.error?.(s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function tt(){return e=>new u(t=>e.subscribe(new oe(t)))}class oe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const r=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,t])}error(t){this.destination.error?.(t)}}function rt(e){return t=>new u(r=>t.subscribe(new ae(r,e)))}class ae{destination;effect;constructor(t,r){this.destination=t,this.effect=r}next(t){try{this.effect(t)}catch(r){throw this.error(r),r}this.destination.next(t)}error(t){this.destination.error?.(t)}}var L;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(L||(L={}));class T{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,r,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:r,options:n})}removeEventListener(t,r){if(!(t in this.listeners))return;const n=this.listeners[t];for(let i=0,s=n.length;i<s;i++)if(n[i].callback===r){n.splice(i,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const n=this.listeners[t.type].slice();for(let i=0,s=n.length;i<s;i++){const o=n[i];try{o.callback.call(this,t)}catch(d){Promise.resolve().then(()=>{throw d})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class U extends T{constructor(){super(),this.listeners||T.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 ce{constructor(){Object.defineProperty(this,"signal",{value:new U,writable:!0,configurable:!0})}abort(t){let r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}let n=t;if(n===void 0)if(typeof document>"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(r)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ce.prototype[Symbol.toStringTag]="AbortController",U.prototype[Symbol.toStringTag]="AbortSignal");function C(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:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!C({fetch:t,Request:r,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:s};let s=r;(s&&!s.prototype.hasOwnProperty("signal")||i)&&(s=function(c,w){let p;w&&w.signal&&(p=w.signal,delete w.signal);const E=new r(c,w);return p&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),E},s.prototype=r.prototype);const o=t;return{fetch:(b,c)=>{const w=s&&s.prototype.isPrototypeOf(b)?b.signal:c?c.signal:void 0;if(w){let p;try{p=new DOMException("Aborted","AbortError")}catch{p=new Error("Aborted"),p.name="AbortError"}if(w.aborted)return Promise.reject(p);const E=new Promise((v,G)=>{w.addEventListener("abort",()=>G(p),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(b,c)])}return o(b,c)},Request:s}}const _=C({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Q=_?le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ue=_?Q.fetch:window.fetch;_?Q.Request:window.Request;var I;(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"})(I||(I={}));const he="vk.com",nt=async(e,t,r)=>{const n=new URL(`https://${he}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const s=await(await ue(n.toString())).json();return de(s,r)},de=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),fe(n)])),fe=e=>Array.isArray(e)?e[0]:e;var M;(function(e){e.RU="ru",e.EN="en"})(M||(M={}));export{m as CurrentClientBrowser,l as CurrentClientDevice,L as ErrorCategory,M as InterfaceLanguage,pe as Logger,u as Observable,N as Subject,x as Subscription,be as VERSION,I as VKNumericLanguage,Qe as ValueSubject,h as VideoQuality,ye as abortable,Se as addScript,Fe as areQualitiesExact,Oe as assertEmptyArray,O as assertNever,me as assertNonNullable,Ee as assertNotEmptyArray,ge as assertNullable,Ue as assertQualityIsExact,He as buffer,we as checkNever,Ge as combine,We as debounce,Le as detectEmbed,X as fillWithDefault,Xe as filter,Je as filterChanged,Ye as fromEvent,j as getCurrentBrowser,_e as getExponentialDelay,Ne as getHighestQuality,ve as getIOSVersion,ze as interval,Te as isHigher,Ie as isHigherOrEqual,xe as isIOS,F as isInvariantQuality,k as isLower,Me as isLowerOrEqual,Re as isMacLike,V as isNonNullable,D as isNullable,nt as loadVKLangPack,se as map,Ke as mapTo,Ve as merge,y as noop,Ae as now,$e as observableFrom,et as once,tt as pairwise,Pe as safeStorage,rt as tap,Be as throttle,Ce as timeCodeToString,De as timeout,je as videoHeightToQuality,qe as videoQualityToHeight,ke as videoSizeToQuality};
|
|
6
|
+
const be="1.0.32-dev.7bf5a18e.0";class x{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const O=e=>{throw new Error(`${e} is value of unexpected type`)},we=e=>{},y=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,r){let n;r?typeof r=="function"?n={next:r,error:y}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:y,error:y};const i=typeof t=="function"?{next:o=>{try{t(o)}catch(d){n.next(d)}},error:o=>n.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):n.next(o)};let s;try{s=this._subscribe(i)}catch(o){i.error?.(o)}return new x().add(()=>{switch(i.next=y,i.error=y,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return O(s)}})}pipe(...t){return t.reduce((r,n)=>n(r),this)}_subscribe(t){}}class N extends u{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(r=>r.next(t))}error(t){this.subscribers.forEach(r=>r.error?.(t))}_subscribe(t){const r=this.keyCounter++;return this.subscribers.set(r,t),new x().add(()=>this.subscribers.delete(r))}}class pe{log$=new N;logs=[];log=t=>{const r={...t,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};createCustomLog(t){return(...r)=>{let n;try{n=t(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(r=>({component:t,...r}))}getAllLogs=()=>this.logs}function me(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ge(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function V(e){return typeof e<"u"&&e!==null}function D(e){return e==null}function Ee(e,t){if(!e?.length)throw new Error(t)}function Oe(e,t){if(e?.length)throw new Error(t)}const Se=(e,t,r)=>new Promise((n,i)=>{t.addEventListener("abort",()=>{d(),c.remove()});const s=()=>{d(),i()},o=()=>{d(),n()},d=()=>{b&&clearTimeout(b),c.removeEventListener("load",o),c.removeEventListener("error",s)};let b;r&&(b=window.setTimeout(s,r));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",s),c.src=e,document.head.appendChild(c)}),Ae=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),ye=(e,t)=>async(...r)=>{const n=t(...r);let i=e.aborted,s;for(;!i&&!e.aborted;){const o=await n.next(s);i=o.done??!1,s=o.value}return s};var m;(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"})(m||(m={}));var l;(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"})(l||(l={}));const j=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?m.Yandex:void 0,r=/chrome|crios/i.test(e)?m.Chrome:void 0,n=/chromium/i.test(e)?m.Chromium:void 0,i=/firefox|fxios/i.test(e)?m.Firefox:void 0,s=/webkit|safari|khtml/i.test(e)?m.Safari:void 0,o=/opr\//i.test(e)?m.Opera:void 0,d=/edg/i.test(e)?m.Edge:void 0,b=/android/i.test(e)?l.Android:void 0,c=/iphone/i.test(e)?l.iPhone:void 0,w=/ipad/i.test(e)?l.iPad:void 0,p=/ipod/i.test(e)?l.iPod:void 0,E=/mac/i.test(e)?l.Mac:void 0,v=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?l.RestMobile:void 0;return{browser:t||i||o||d||r||n||s||m.Rest,device:b||c||w||p||v||E||l.Desktop}},xe=(e=!1)=>{const r=[l.iPhone,l.iPad,l.iPod].includes(j().device);if(!e)return r;const{userAgent:n,maxTouchPoints:i}=window.navigator;return!!(r||/macintosh/i.test(n)&&i>0)},ve=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const r=t[1],n=parseFloat(r);return isNaN(n)?null:n},Re=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(j().device),_e=(e,{start:t=0,factor:r=2,max:n=1/0,min:i=t,random:s=0}={})=>{let o=t;return o*=r**e,o*=1+(Math.random()*s*2-s),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,i),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let S,g;const R=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(g!==void 0)return g;try{localStorage.setItem(R,"test"),localStorage.removeItem(R),g=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(R),g=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)g=a.RUNTIME;else throw t}else throw e}return g===a.RUNTIME&&(S=new Map),g},z=()=>A()===a.LOCAL_STORAGE,$=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return S?.get(e);default:O(t)}},Y=(e,t)=>{const r=A();switch(r){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void S?.set(e,t);default:O(r)}},H=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return S?.has(e)??!1;default:return O(t),!1}},W=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void S?.delete(e);default:O(t)}},B=()=>{const e=A();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return S?.clear();default:O(e)}};var Pe=Object.freeze({__proto__:null,clear:B,get:$,has:H,isPersistent:z,remove:W,set:Y});const Le=()=>{let e,t;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&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!t&&document.referrer&&(t=document.referrer)}catch(n){console.error(n)}const r=t?new URL(t).hostname:void 0;return{isEmbed:e,host:r}};var h;(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"})(h||(h={}));const f={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},Te=(e,t)=>f[e].height>f[t].height,Ie=(e,t)=>f[e].height>=f[t].height,k=(e,t)=>f[e].height<f[t].height,Me=(e,t)=>f[e].height<=f[t].height,Ne=e=>e.sort((t,r)=>t===r?0:t===h.INVARIANT?1:r===h.INVARIANT?-1:k(t,r)?1:-1)[0],q=Object.keys(f).sort((e,t)=>k(e,t)?-1:1),je=(e,t=.02)=>[...q].find(n=>f[n].height*(1+t)>=e),ke=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return q.find(i=>{const s=f[i];return s.width>=n&&s.height>=r})},qe=e=>f[e].height,F=e=>e===h.INVARIANT,Fe=e=>e.every(t=>!F(t));function Ue(e){if(F(e))throw new Error("Expected exact quality")}const X=(e,t)=>{const r={};for(const n of Object.keys(t)){const i=t[n],s=e[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=X(s,i):r[n]=n in e?s:i}return r},Ce=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};class Qe extends N{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 r=super._subscribe(t);return t.next(this.value),r}}function Ge(e){return new u(t=>{const r={};let n=Object.keys(e).length;const i=s=>o=>{s in r||n--,r[s]=o,n===0&&t.next(r)};return Object.entries(e).reduce((s,[o,d])=>s.add(d.subscribe(i(o))),new x)})}function Ve(...e){return new u(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new x))}var De=e=>new u(t=>{const r=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(r)}),ze=e=>new u(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),$e=e=>new u(t=>{e.forEach(r=>t.next(r))}),Ye=(e,t)=>new u(r=>{const n=i=>r.next(i);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function He(e){return t=>new u(r=>t.subscribe(new J(r,e)))}class J{destination;size;lastValues=[];constructor(t,r){this.destination=t,this.size=r}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 Z={leading:!1,trailing:!0};function We(e,t=Z){return r=>new u(n=>r.subscribe(new K(n,e,t)))}class K{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,V(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(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const ee={leading:!0,trailing:!1};function Be(e,t=ee){return r=>new u(n=>r.subscribe(new te(n,e,t)))}class te{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,D(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 Xe(e){return t=>new u(r=>t.subscribe(new re(r,e)))}class re{destination;predicate;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.predicate(t)}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Je(e=(t,r)=>t===r){return t=>new u(r=>t.subscribe(new ne(r,e)))}const P={};class ne{destination;predicate;lastValue=P;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===P||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function se(e){return t=>new u(r=>t.subscribe(new ie(r,e)))}let ie=class{destination;mapper;constructor(t,r){this.destination=t,this.mapper=r}next(t){let r;try{r=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(r)}error(t){this.destination.error?.(t)}};function Ke(e){return se(()=>e)}function et(){return e=>new u(t=>{let r=!1,n=!1;const i=e.subscribe(s=>{r||(r=!0,t.next(s)),n&&i.unsubscribe()},s=>{r=!0,t.error?.(s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function tt(){return e=>new u(t=>e.subscribe(new oe(t)))}class oe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const r=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,t])}error(t){this.destination.error?.(t)}}function rt(e){return t=>new u(r=>t.subscribe(new ae(r,e)))}class ae{destination;effect;constructor(t,r){this.destination=t,this.effect=r}next(t){try{this.effect(t)}catch(r){throw this.error(r),r}this.destination.next(t)}error(t){this.destination.error?.(t)}}var L;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(L||(L={}));class T{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,r,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:r,options:n})}removeEventListener(t,r){if(!(t in this.listeners))return;const n=this.listeners[t];for(let i=0,s=n.length;i<s;i++)if(n[i].callback===r){n.splice(i,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const n=this.listeners[t.type].slice();for(let i=0,s=n.length;i<s;i++){const o=n[i];try{o.callback.call(this,t)}catch(d){Promise.resolve().then(()=>{throw d})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class U extends T{constructor(){super(),this.listeners||T.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 ce{constructor(){Object.defineProperty(this,"signal",{value:new U,writable:!0,configurable:!0})}abort(t){let r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}let n=t;if(n===void 0)if(typeof document>"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(r)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ce.prototype[Symbol.toStringTag]="AbortController",U.prototype[Symbol.toStringTag]="AbortSignal");function C(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:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!C({fetch:t,Request:r,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:s};let s=r;(s&&!s.prototype.hasOwnProperty("signal")||i)&&(s=function(c,w){let p;w&&w.signal&&(p=w.signal,delete w.signal);const E=new r(c,w);return p&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),E},s.prototype=r.prototype);const o=t;return{fetch:(b,c)=>{const w=s&&s.prototype.isPrototypeOf(b)?b.signal:c?c.signal:void 0;if(w){let p;try{p=new DOMException("Aborted","AbortError")}catch{p=new Error("Aborted"),p.name="AbortError"}if(w.aborted)return Promise.reject(p);const E=new Promise((v,G)=>{w.addEventListener("abort",()=>G(p),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(b,c)])}return o(b,c)},Request:s}}const _=C({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Q=_?le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ue=_?Q.fetch:window.fetch;_?Q.Request:window.Request;var I;(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"})(I||(I={}));const he="vk.com",nt=async(e,t,r)=>{const n=new URL(`https://${he}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const s=await(await ue(n.toString())).json();return de(s,r)},de=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),fe(n)])),fe=e=>Array.isArray(e)?e[0]:e;var M;(function(e){e.RU="ru",e.EN="en"})(M||(M={}));export{m as CurrentClientBrowser,l as CurrentClientDevice,L as ErrorCategory,M as InterfaceLanguage,pe as Logger,u as Observable,N as Subject,x as Subscription,be as VERSION,I as VKNumericLanguage,Qe as ValueSubject,h as VideoQuality,ye as abortable,Se as addScript,Fe as areQualitiesExact,Oe as assertEmptyArray,O as assertNever,me as assertNonNullable,Ee as assertNotEmptyArray,ge as assertNullable,Ue as assertQualityIsExact,He as buffer,we as checkNever,Ge as combine,We as debounce,Le as detectEmbed,X as fillWithDefault,Xe as filter,Je as filterChanged,Ye as fromEvent,j as getCurrentBrowser,_e as getExponentialDelay,Ne as getHighestQuality,ve as getIOSVersion,ze as interval,Te as isHigher,Ie as isHigherOrEqual,xe as isIOS,F as isInvariantQuality,k as isLower,Me as isLowerOrEqual,Re as isMacLike,V as isNonNullable,D as isNullable,nt as loadVKLangPack,se as map,Ke as mapTo,Ve as merge,y as noop,Ae as now,$e as observableFrom,et as once,tt as pairwise,Pe as safeStorage,rt as tap,Be as throttle,Ce as timeCodeToString,De as timeout,je as videoHeightToQuality,qe as videoQualityToHeight,ke as videoSizeToQuality};
|
package/evergreen.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32-dev.7bf5a18e.0
|
|
3
|
+
* Wed, 07 Feb 2024 09:56:57 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const re="1.0.32-dev.0f82d9ff.0";class x{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 b=e=>{throw new Error(`${e} is value of unexpected type`)},oe=e=>{},S=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let s;n?typeof n=="function"?s={next:n,error:S}:s={next:r=>n.next(r),error:r=>n.error?.(r)}:s={next:S,error:S};const o=typeof t=="function"?{next:r=>{try{t(r)}catch(f){s.next(f)}},error:r=>s.next(r)}:{next:r=>t.next(r),error:r=>t.error?t.error(r):s.next(r)};let i;try{i=this._subscribe(o)}catch(r){o.error?.(r)}return new x().add(()=>{switch(o.next=S,o.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return b(i)}})}pipe(...t){return t.reduce((n,s)=>s(n),this)}_subscribe(t){}}class y extends u{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 x().add(()=>this.subscribers.delete(n))}}class ae{log$=new y;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let s;try{s=t(...n)}catch{s={message:"error in `createCustomLog`",component:"Logger"}}this.log(s)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function ce(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ue(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function Q(e){return typeof e<"u"&&e!==null}function j(e){return e==null}function he(e,t){if(!e?.length)throw new Error(t)}function de(e,t){if(e?.length)throw new Error(t)}const le=(e,t,n)=>new Promise((s,o)=>{t.addEventListener("abort",()=>{f(),w.remove()});const i=()=>{f(),o()},r=()=>{f(),s()},f=()=>{E&&clearTimeout(E),w.removeEventListener("load",r),w.removeEventListener("error",i)};let E;n&&(E=window.setTimeout(i,n));const w=document.createElement("script");w.addEventListener("load",r),w.addEventListener("error",i),w.src=e,document.head.appendChild(w)}),fe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),we=(e,t)=>async(...n)=>{const s=t(...n);let o=e.aborted,i;for(;!o&&!e.aborted;){const r=await s.next(i);o=r.done??!1,i=r.value}return i};var l;(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"})(l||(l={}));var c;(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"})(c||(c={}));const I=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?l.Yandex:void 0,n=/chrome|crios/i.test(e)?l.Chrome:void 0,s=/chromium/i.test(e)?l.Chromium:void 0,o=/firefox|fxios/i.test(e)?l.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?l.Safari:void 0,r=/opr\//i.test(e)?l.Opera:void 0,f=/edg/i.test(e)?l.Edge:void 0,E=/android/i.test(e)?c.Android:void 0,w=/iphone/i.test(e)?c.iPhone:void 0,L=/ipad/i.test(e)?c.iPad:void 0,N=/ipod/i.test(e)?c.iPod:void 0,U=/mac/i.test(e)?c.Mac:void 0,k=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?c.RestMobile:void 0;return{browser:t||o||r||f||n||s||i||l.Rest,device:E||w||L||N||k||U||c.Desktop}},me=(e=!1)=>{const n=[c.iPhone,c.iPad,c.iPod].includes(I().device);if(!e)return n;const{userAgent:s,maxTouchPoints:o}=window.navigator;return!!(n||/macintosh/i.test(s)&&o>0)},be=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],s=parseFloat(n);return isNaN(s)?null:s},pe=()=>[c.Mac,c.iPhone,c.iPad,c.iPod].includes(I().device),ge=(e,{start:t=0,factor:n=2,max:s=1/0,min:o=t,random:i=0}={})=>{let r=t;return r*=n**e,r*=1+(Math.random()*i*2-i),r=Math.round(r),r=Math.min(r,s),r=Math.max(r,o),r};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let p,m;const O=`vk-videoplayer-dummy-key-${Math.random()}`,g=()=>{if(m!==void 0)return m;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),m=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),m=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)m=a.RUNTIME;else throw t}else throw e}return m===a.RUNTIME&&(p=new Map),m},G=()=>g()===a.LOCAL_STORAGE,V=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return p?.get(e);default:b(t)}},D=(e,t)=>{const n=g();switch(n){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(s){if(s instanceof DOMException)console.error(s);else throw s}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(s){if(s instanceof DOMException)console.error(s);else throw s}break;case a.RUNTIME:return void p?.set(e,t);default:b(n)}},F=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return p?.has(e)??!1;default:return b(t),!1}},z=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void p?.delete(e);default:b(t)}},$=()=>{const e=g();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return p?.clear();default:b(e)}};var Ee=Object.freeze({__proto__:null,clear:$,get:V,has:F,isPersistent:G,remove:z,set:D});const Se=()=>{let e,t;try{e=window.self!==window.top}catch(s){s instanceof DOMException&&s.name==="SecurityError"?e=!0:(e=!1,console.error(s))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(s){console.error(s)}try{!t&&document.referrer&&(t=document.referrer)}catch(s){console.error(s)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var h;(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"})(h||(h={}));const d={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},xe=(e,t)=>d[e].height>d[t].height,Oe=(e,t)=>d[e].height>=d[t].height,T=(e,t)=>d[e].height<d[t].height,Ae=(e,t)=>d[e].height<=d[t].height,ve=e=>e.sort((t,n)=>t===n?0:t===h.INVARIANT?1:n===h.INVARIANT?-1:T(t,n)?1:-1)[0],R=Object.keys(d).sort((e,t)=>T(e,t)?-1:1),_e=(e,t=.02)=>[...R].find(s=>d[s].height*(1+t)>=e),Pe=({width:e,height:t})=>{const n=Math.min(e,t),s=Math.max(e,t);return R.find(o=>{const i=d[o];return i.width>=s&&i.height>=n})},ye=e=>d[e].height,M=e=>e===h.INVARIANT,Ie=e=>e.every(t=>!M(t));function Te(e){if(M(e))throw new Error("Expected exact quality")}const q=(e,t)=>{const n={};for(const s of Object.keys(t)){const o=t[s],i=e[s];Array.isArray(o)&&Array.isArray(i)?n[s]=i:typeof o=="object"&&typeof i=="object"?n[s]=q(i,o):n[s]=s in e?i:o}return n},Re=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};class Me extends y{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 Le(e){return new u(t=>{const n={};let s=Object.keys(e).length;const o=i=>r=>{i in n||s--,n[i]=r,s===0&&t.next(n)};return Object.entries(e).reduce((i,[r,f])=>i.add(f.subscribe(o(r))),new x)})}function Ne(...e){return new u(t=>e.reduce((n,s)=>n.add(s.subscribe(t)),new x))}var Ue=e=>new u(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(s){if(t.error)t.error(s);else throw s}},e);return()=>window.clearTimeout(n)}),ke=e=>new u(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),Qe=e=>new u(t=>{e.forEach(n=>t.next(n))}),je=(e,t)=>new u(n=>{const s=o=>n.next(o);return e.addEventListener(t,s),()=>e.removeEventListener(t,s)});function Ge(e){return t=>new u(n=>t.subscribe(new H(n,e)))}class H{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 Y={leading:!1,trailing:!0};function Ve(e,t=Y){return n=>new u(s=>n.subscribe(new W(s,e,t)))}class W{destination;time;config;lastValue;timeout;constructor(t,n,s){this.destination=t,this.time=n,this.config=s}next(t){this.lastValue=t,Q(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 C={leading:!0,trailing:!1};function De(e,t=C){return n=>new u(s=>n.subscribe(new X(s,e,t)))}class X{destination;time;config;lastValue;timeout;constructor(t,n,s){this.destination=t,this.time=n,this.config=s}next(t){this.lastValue=t,j(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 Fe(e){return t=>new u(n=>t.subscribe(new J(n,e)))}class J{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(s){throw this.error(s),s}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function ze(e=(t,n)=>t===n){return t=>new u(n=>t.subscribe(new Z(n,e)))}const A={};class Z{destination;predicate;lastValue=A;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(s){throw this.error(s),s}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function B(e){return t=>new u(n=>t.subscribe(new K(n,e)))}let K=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(s){throw this.error(s),s}this.destination.next(n)}error(t){this.destination.error?.(t)}};function qe(e){return B(()=>e)}function He(){return e=>new u(t=>{let n=!1,s=!1;const o=e.subscribe(i=>{n||(n=!0,t.next(i)),s&&o.unsubscribe()},i=>{n=!0,t.error?.(i),s&&o.unsubscribe()});return s=!0,n&&o.unsubscribe(),o})}function Ye(){return e=>new u(t=>e.subscribe(new ee(t)))}class ee{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 We(e){return t=>new u(n=>t.subscribe(new te(n,e)))}class te{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"})(v||(v={}));var _;(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"})(_||(_={}));const ne="vk.com",Ce=async(e,t,n)=>{const s=new URL(`https://${ne}/js/lang-pack.js`);s.searchParams.set("format","json"),s.searchParams.set("name",t),e!==void 0&&s.searchParams.set("lang",e);const i=await(await fetch(s.toString())).json();return se(i,n)},se=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,s])=>[n.substring(`${t}_`.length),ie(s)])),ie=e=>Array.isArray(e)?e[0]:e;var P;(function(e){e.RU="ru",e.EN="en"})(P||(P={}));export{l as CurrentClientBrowser,c as CurrentClientDevice,v as ErrorCategory,P as InterfaceLanguage,ae as Logger,u as Observable,y as Subject,x as Subscription,re as VERSION,_ as VKNumericLanguage,Me as ValueSubject,h as VideoQuality,we as abortable,le as addScript,Ie as areQualitiesExact,de as assertEmptyArray,b as assertNever,ce as assertNonNullable,he as assertNotEmptyArray,ue as assertNullable,Te as assertQualityIsExact,Ge as buffer,oe as checkNever,Le as combine,Ve as debounce,Se as detectEmbed,q as fillWithDefault,Fe as filter,ze as filterChanged,je as fromEvent,I as getCurrentBrowser,ge as getExponentialDelay,ve as getHighestQuality,be as getIOSVersion,ke as interval,xe as isHigher,Oe as isHigherOrEqual,me as isIOS,M as isInvariantQuality,T as isLower,Ae as isLowerOrEqual,pe as isMacLike,Q as isNonNullable,j as isNullable,Ce as loadVKLangPack,B as map,qe as mapTo,Ne as merge,S as noop,fe as now,Qe as observableFrom,He as once,Ye as pairwise,Ee as safeStorage,We as tap,De as throttle,Re as timeCodeToString,Ue as timeout,_e as videoHeightToQuality,ye as videoQualityToHeight,Pe as videoSizeToQuality};
|
|
6
|
+
const re="1.0.32-dev.7bf5a18e.0";class x{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 b=e=>{throw new Error(`${e} is value of unexpected type`)},oe=e=>{},S=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let s;n?typeof n=="function"?s={next:n,error:S}:s={next:r=>n.next(r),error:r=>n.error?.(r)}:s={next:S,error:S};const o=typeof t=="function"?{next:r=>{try{t(r)}catch(f){s.next(f)}},error:r=>s.next(r)}:{next:r=>t.next(r),error:r=>t.error?t.error(r):s.next(r)};let i;try{i=this._subscribe(o)}catch(r){o.error?.(r)}return new x().add(()=>{switch(o.next=S,o.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return b(i)}})}pipe(...t){return t.reduce((n,s)=>s(n),this)}_subscribe(t){}}class y extends u{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 x().add(()=>this.subscribers.delete(n))}}class ae{log$=new y;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let s;try{s=t(...n)}catch{s={message:"error in `createCustomLog`",component:"Logger"}}this.log(s)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function ce(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ue(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function Q(e){return typeof e<"u"&&e!==null}function j(e){return e==null}function he(e,t){if(!e?.length)throw new Error(t)}function de(e,t){if(e?.length)throw new Error(t)}const le=(e,t,n)=>new Promise((s,o)=>{t.addEventListener("abort",()=>{f(),w.remove()});const i=()=>{f(),o()},r=()=>{f(),s()},f=()=>{E&&clearTimeout(E),w.removeEventListener("load",r),w.removeEventListener("error",i)};let E;n&&(E=window.setTimeout(i,n));const w=document.createElement("script");w.addEventListener("load",r),w.addEventListener("error",i),w.src=e,document.head.appendChild(w)}),fe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),we=(e,t)=>async(...n)=>{const s=t(...n);let o=e.aborted,i;for(;!o&&!e.aborted;){const r=await s.next(i);o=r.done??!1,i=r.value}return i};var l;(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"})(l||(l={}));var c;(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"})(c||(c={}));const I=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?l.Yandex:void 0,n=/chrome|crios/i.test(e)?l.Chrome:void 0,s=/chromium/i.test(e)?l.Chromium:void 0,o=/firefox|fxios/i.test(e)?l.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?l.Safari:void 0,r=/opr\//i.test(e)?l.Opera:void 0,f=/edg/i.test(e)?l.Edge:void 0,E=/android/i.test(e)?c.Android:void 0,w=/iphone/i.test(e)?c.iPhone:void 0,L=/ipad/i.test(e)?c.iPad:void 0,N=/ipod/i.test(e)?c.iPod:void 0,U=/mac/i.test(e)?c.Mac:void 0,k=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?c.RestMobile:void 0;return{browser:t||o||r||f||n||s||i||l.Rest,device:E||w||L||N||k||U||c.Desktop}},me=(e=!1)=>{const n=[c.iPhone,c.iPad,c.iPod].includes(I().device);if(!e)return n;const{userAgent:s,maxTouchPoints:o}=window.navigator;return!!(n||/macintosh/i.test(s)&&o>0)},be=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],s=parseFloat(n);return isNaN(s)?null:s},pe=()=>[c.Mac,c.iPhone,c.iPad,c.iPod].includes(I().device),ge=(e,{start:t=0,factor:n=2,max:s=1/0,min:o=t,random:i=0}={})=>{let r=t;return r*=n**e,r*=1+(Math.random()*i*2-i),r=Math.round(r),r=Math.min(r,s),r=Math.max(r,o),r};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let p,m;const O=`vk-videoplayer-dummy-key-${Math.random()}`,g=()=>{if(m!==void 0)return m;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),m=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),m=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)m=a.RUNTIME;else throw t}else throw e}return m===a.RUNTIME&&(p=new Map),m},G=()=>g()===a.LOCAL_STORAGE,V=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return p?.get(e);default:b(t)}},D=(e,t)=>{const n=g();switch(n){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(s){if(s instanceof DOMException)console.error(s);else throw s}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(s){if(s instanceof DOMException)console.error(s);else throw s}break;case a.RUNTIME:return void p?.set(e,t);default:b(n)}},F=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return p?.has(e)??!1;default:return b(t),!1}},z=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void p?.delete(e);default:b(t)}},$=()=>{const e=g();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return p?.clear();default:b(e)}};var Ee=Object.freeze({__proto__:null,clear:$,get:V,has:F,isPersistent:G,remove:z,set:D});const Se=()=>{let e,t;try{e=window.self!==window.top}catch(s){s instanceof DOMException&&s.name==="SecurityError"?e=!0:(e=!1,console.error(s))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(s){console.error(s)}try{!t&&document.referrer&&(t=document.referrer)}catch(s){console.error(s)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var h;(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"})(h||(h={}));const d={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},xe=(e,t)=>d[e].height>d[t].height,Oe=(e,t)=>d[e].height>=d[t].height,T=(e,t)=>d[e].height<d[t].height,Ae=(e,t)=>d[e].height<=d[t].height,ve=e=>e.sort((t,n)=>t===n?0:t===h.INVARIANT?1:n===h.INVARIANT?-1:T(t,n)?1:-1)[0],R=Object.keys(d).sort((e,t)=>T(e,t)?-1:1),_e=(e,t=.02)=>[...R].find(s=>d[s].height*(1+t)>=e),Pe=({width:e,height:t})=>{const n=Math.min(e,t),s=Math.max(e,t);return R.find(o=>{const i=d[o];return i.width>=s&&i.height>=n})},ye=e=>d[e].height,M=e=>e===h.INVARIANT,Ie=e=>e.every(t=>!M(t));function Te(e){if(M(e))throw new Error("Expected exact quality")}const q=(e,t)=>{const n={};for(const s of Object.keys(t)){const o=t[s],i=e[s];Array.isArray(o)&&Array.isArray(i)?n[s]=i:typeof o=="object"&&typeof i=="object"?n[s]=q(i,o):n[s]=s in e?i:o}return n},Re=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};class Me extends y{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 Le(e){return new u(t=>{const n={};let s=Object.keys(e).length;const o=i=>r=>{i in n||s--,n[i]=r,s===0&&t.next(n)};return Object.entries(e).reduce((i,[r,f])=>i.add(f.subscribe(o(r))),new x)})}function Ne(...e){return new u(t=>e.reduce((n,s)=>n.add(s.subscribe(t)),new x))}var Ue=e=>new u(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(s){if(t.error)t.error(s);else throw s}},e);return()=>window.clearTimeout(n)}),ke=e=>new u(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),Qe=e=>new u(t=>{e.forEach(n=>t.next(n))}),je=(e,t)=>new u(n=>{const s=o=>n.next(o);return e.addEventListener(t,s),()=>e.removeEventListener(t,s)});function Ge(e){return t=>new u(n=>t.subscribe(new H(n,e)))}class H{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 Y={leading:!1,trailing:!0};function Ve(e,t=Y){return n=>new u(s=>n.subscribe(new W(s,e,t)))}class W{destination;time;config;lastValue;timeout;constructor(t,n,s){this.destination=t,this.time=n,this.config=s}next(t){this.lastValue=t,Q(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 C={leading:!0,trailing:!1};function De(e,t=C){return n=>new u(s=>n.subscribe(new X(s,e,t)))}class X{destination;time;config;lastValue;timeout;constructor(t,n,s){this.destination=t,this.time=n,this.config=s}next(t){this.lastValue=t,j(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 Fe(e){return t=>new u(n=>t.subscribe(new J(n,e)))}class J{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(s){throw this.error(s),s}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function ze(e=(t,n)=>t===n){return t=>new u(n=>t.subscribe(new Z(n,e)))}const A={};class Z{destination;predicate;lastValue=A;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(s){throw this.error(s),s}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function B(e){return t=>new u(n=>t.subscribe(new K(n,e)))}let K=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(s){throw this.error(s),s}this.destination.next(n)}error(t){this.destination.error?.(t)}};function qe(e){return B(()=>e)}function He(){return e=>new u(t=>{let n=!1,s=!1;const o=e.subscribe(i=>{n||(n=!0,t.next(i)),s&&o.unsubscribe()},i=>{n=!0,t.error?.(i),s&&o.unsubscribe()});return s=!0,n&&o.unsubscribe(),o})}function Ye(){return e=>new u(t=>e.subscribe(new ee(t)))}class ee{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 We(e){return t=>new u(n=>t.subscribe(new te(n,e)))}class te{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"})(v||(v={}));var _;(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"})(_||(_={}));const ne="vk.com",Ce=async(e,t,n)=>{const s=new URL(`https://${ne}/js/lang-pack.js`);s.searchParams.set("format","json"),s.searchParams.set("name",t),e!==void 0&&s.searchParams.set("lang",e);const i=await(await fetch(s.toString())).json();return se(i,n)},se=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,s])=>[n.substring(`${t}_`.length),ie(s)])),ie=e=>Array.isArray(e)?e[0]:e;var P;(function(e){e.RU="ru",e.EN="en"})(P||(P={}));export{l as CurrentClientBrowser,c as CurrentClientDevice,v as ErrorCategory,P as InterfaceLanguage,ae as Logger,u as Observable,y as Subject,x as Subscription,re as VERSION,_ as VKNumericLanguage,Me as ValueSubject,h as VideoQuality,we as abortable,le as addScript,Ie as areQualitiesExact,de as assertEmptyArray,b as assertNever,ce as assertNonNullable,he as assertNotEmptyArray,ue as assertNullable,Te as assertQualityIsExact,Ge as buffer,oe as checkNever,Le as combine,Ve as debounce,Se as detectEmbed,q as fillWithDefault,Fe as filter,ze as filterChanged,je as fromEvent,I as getCurrentBrowser,ge as getExponentialDelay,ve as getHighestQuality,be as getIOSVersion,ke as interval,xe as isHigher,Oe as isHigherOrEqual,me as isIOS,M as isInvariantQuality,T as isLower,Ae as isLowerOrEqual,pe as isMacLike,Q as isNonNullable,j as isNullable,Ce as loadVKLangPack,B as map,qe as mapTo,Ne as merge,S as noop,fe as now,Qe as observableFrom,He as once,Ye as pairwise,Ee as safeStorage,We as tap,De as throttle,Re as timeCodeToString,Ue as timeout,_e as videoHeightToQuality,ye as videoQualityToHeight,Pe as videoSizeToQuality};
|