@vkontakte/videoplayer-shared 1.0.28 → 1.0.29-beta.1
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 +4 -4
- package/es2015.esm.js +4 -4
- package/es2018.cjs.js +4 -4
- package/es2018.esm.js +4 -4
- package/esnext.cjs.js +4 -4
- package/esnext.esm.js +4 -4
- package/evergreen.esm.js +4 -4
- package/index.d.ts +3 -1
- package/package.json +1 -1
package/es2015.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.29-beta.1
|
|
3
|
+
* Wed, 06 Sep 2023 16:19:06 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-29/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const sn="1.0.28";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 L=e=>{throw new Error(`${e} is value of unexpected type`)},ln=e=>{},G=()=>{};class b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let a;t?typeof t=="function"?a={next:t,error:G}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:G,error:G};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new Y().add(()=>{switch(o.next=G,o.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return L(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends b{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 cn{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(a){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 rt(e){return typeof e!="undefined"&&e!==null}function tt(e){return e==null}const fn=(e,r,t)=>new Promise((n,a)=>{r.addEventListener("abort",()=>{s(),c.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",o),c.src=e,document.head.appendChild(c)});var de;const dn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now();function nt(e,r,t,n){function a(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function s(l){try{c(n.next(l))}catch(u){i(u)}}function v(l){try{c(n.throw(l))}catch(u){i(u)}}function c(l){l.done?o(l.value):a(l.value).then(s,v)}c((n=n.apply(e,r||[])).next())})}const hn=(e,r)=>(...t)=>nt(void 0,void 0,void 0,function*(){var n;const a=r(...t);let o=e.aborted,i;for(;!o&&!e.aborted;){const s=yield a.next(i);o=(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.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const at=()=>{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,a=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,o=/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,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,l=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,u=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||a||i||s||t||n||o||exports.CurrentClientBrowser.Rest,device:v||c||l||u||f||exports.CurrentClientDevice.Desktop}},bn=()=>[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(at().device),pn=(e,{start:r=0,factor:t=2,max:n=1/0,min:a=r,random:o=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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 p,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&&(p=new Map),j},yn=()=>k()===h.LOCAL_STORAGE,gn=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 p==null?void 0:p.get(e);default:L(n)}},On=(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(p==null?void 0:p.set(e,r));default:L(t)}},wn=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=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return L(t),!1}},$n=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(p==null?void 0:p.delete(e));default:L(r)}},mn=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:L(e)}};var En=Object.freeze({__proto__:null,clear:mn,get:gn,has:wn,isPersistent:yn,remove:$n,set:On});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 m={[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}},Sn=(e,r)=>m[e].height>m[r].height,Tn=(e,r)=>m[e].height>=m[r].height,Ye=(e,r)=>m[e].height<m[r].height,In=(e,r)=>m[e].height<=m[r].height,Rn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ye(r,t)?1:-1)[0],ot=Object.keys(m).sort((e,r)=>Ye(e,r)?-1:1),_n=(e,r=.02)=>[...ot].find(n=>m[n].height*(1+r)>=e),Pn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ot.find(a=>{const o=m[a];return o.width>=n&&o.height>=t})},An=e=>m[e].height,He=e=>e===exports.VideoQuality.INVARIANT,jn=e=>e.every(r=>!He(r));function Ln(e){if(He(e))throw new Error("Expected exact quality")}const it=(e,r)=>{const t={};for(const n of Object.keys(r)){const a=r[n],o=e[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=it(o,a):t[n]=n in e?o:a}return t};class Cn 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 xn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&r.next(t)};return Object.entries(e).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new Y)})}function Nn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Mn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Dn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Fn=e=>new b(r=>{e.forEach(t=>r.next(t))}),Gn=(e,r)=>new b(t=>{const n=a=>t.next(a);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Vn(e){return r=>new b(t=>r.subscribe(new kn(t,e)))}class kn{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 Bn={leading:!1,trailing:!0};function Un(e,r=Bn){return t=>new b(n=>t.subscribe(new Qn(n,e,r)))}class Qn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,rt(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 Kn={leading:!0,trailing:!1};function qn(e,r=Kn){return t=>new b(n=>t.subscribe(new Yn(n,e,r)))}class Yn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(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 Hn(e){return r=>new b(t=>r.subscribe(new zn(t,e)))}class zn{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 Wn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Xn(t,e)))}const lr={};class Xn{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 b(t=>r.subscribe(new Jn(t,e)))}let Jn=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 Zn(e){return st(()=>e)}function ea(){return e=>new b(r=>{let t=!1,n=!1;const a=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function ra(){return e=>new b(r=>e.subscribe(new ta(r)))}class ta{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 na(e){return r=>new b(t=>r.subscribe(new aa(t,e)))}class aa{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 cr{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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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 lt extends cr{constructor(){super(),this.listeners||cr.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 oa{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(a){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(a){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&&(oa.prototype[Symbol.toStringTag]="AbortController",lt.prototype[Symbol.toStringTag]="AbortSignal");function ct(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 ia(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=e;if(!ct({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=function(c,l){let u;l&&l.signal&&(u=l.signal,delete l.signal);const f=new t(c,l);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},o.prototype=t.prototype);const i=r;return{fetch:(v,c)=>{const l=o&&o.prototype.isPrototypeOf(v)?v.signal:c?c.signal:void 0;if(l){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(l.aborted)return Promise.reject(u);const f=new Promise((d,O)=>{l.addEventListener("abort",()=>O(u),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(v,c)])}return i(v,c)},Request:o}}const ze=ct({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ut=ze?ia({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,sa=ze?ut.fetch:window.fetch;ze?ut.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function la(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _=function(e){try{return!!e()}catch(r){return!0}},ca=_,ve=!ca(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),vt=ve,ft=Function.prototype,De=ft.call,ua=vt&&ft.bind.bind(De,De),C=vt?ua:function(e){return function(){return De.apply(e,arguments)}},dt=C,va=dt({}.toString),fa=dt("".slice),We=function(e){return fa(va(e),8,-1)},da=C,ha=_,ba=We,pe=Object,pa=da("".split),ya=ha(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return ba(e)=="String"?pa(e,""):pe(e)}:pe,Xe=function(e){return e==null},ga=Xe,Oa=TypeError,ht=function(e){if(ga(e))throw Oa("Can't call method on "+e);return e},wa=ya,$a=ht,H=function(e){return wa($a(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 be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,ma=typeof Fe=="undefined"&&Fe!==void 0,bt={all:Fe,IS_HTMLDDA:ma},pt=bt,Ea=pt.all,T=pt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Ea}:function(e){return typeof e=="function"},Sa=S,Ta=T,ur=Sa.WeakMap,Ia=Ta(ur)&&/native code/.test(String(ur)),vr=T,yt=bt,Ra=yt.all,U=yt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:vr(e)||e===Ra}:function(e){return typeof e=="object"?e!==null:vr(e)},_a=_,x=!_a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Pa=S,fr=U,Ge=Pa.document,Aa=fr(Ge)&&fr(Ge.createElement),gt=function(e){return Aa?Ge.createElement(e):{}},ja=x,La=_,Ca=gt,Ot=!ja&&!La(function(){return Object.defineProperty(Ca("div"),"a",{get:function(){return 7}}).a!=7}),xa=x,Na=_,wt=xa&&Na(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Ma=U,Da=String,Fa=TypeError,K=function(e){if(Ma(e))return e;throw Fa(Da(e)+" is not an object")},Ga=ve,J=Function.prototype.call,N=Ga?J.bind(J):function(){return J.apply(J,arguments)},Je={},ye=Je,ge=S,Va=T,dr=function(e){return Va(e)?e:void 0},$t=function(e,r){return arguments.length<2?dr(ye[e])||dr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},ka=C,mt=ka({}.isPrototypeOf),Ba=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=S,Oe=Ba,hr=Et.process,br=Et.Deno,pr=hr&&hr.versions||br&&br.version,yr=pr&&pr.v8,E,le;yr&&(E=yr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var Ua=le,gr=Ua,Qa=_,Ka=S,qa=Ka.String,St=!!Object.getOwnPropertySymbols&&!Qa(function(){var e=Symbol();return!qa(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&gr&&gr<41}),Ya=St,Tt=Ya&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ha=$t,za=T,Wa=mt,Xa=Tt,Ja=Object,It=Xa?function(e){return typeof e=="symbol"}:function(e){var r=Ha("Symbol");return za(r)&&Wa(r.prototype,Ja(e))},Za=String,Ze=function(e){try{return Za(e)}catch(r){return"Object"}},eo=T,ro=Ze,to=TypeError,er=function(e){if(eo(e))return e;throw to(ro(e)+" is not a function")},no=er,ao=Xe,rr=function(e,r){var t=e[r];return ao(t)?void 0:no(t)},we=N,$e=T,me=U,oo=TypeError,io=function(e,r){var t,n;if(r==="string"&&$e(t=e.toString)&&!me(n=we(t,e))||$e(t=e.valueOf)&&!me(n=we(t,e))||r!=="string"&&$e(t=e.toString)&&!me(n=we(t,e)))return n;throw oo("Can't convert object to primitive value")},Rt={exports:{}},Or=S,so=Object.defineProperty,lo=function(e,r){try{so(Or,e,{value:r,configurable:!0,writable:!0})}catch(t){Or[e]=r}return r},co=S,uo=lo,wr="__core-js_shared__",vo=co[wr]||uo(wr,{}),_t=vo,$r=_t;(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 Pt=Rt.exports,fo=ht,ho=Object,At=function(e){return ho(fo(e))},bo=C,po=At,yo=bo({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return yo(po(r),t)},go=C,Oo=0,wo=Math.random(),$o=go(1 .toString),jt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+$o(++Oo+wo,36)},mo=S,Eo=Pt,mr=A,So=jt,To=St,Io=Tt,V=mo.Symbol,Ee=Eo("wks"),Ro=Io?V.for||V:V&&V.withoutSetter||So,P=function(e){return mr(Ee,e)||(Ee[e]=To&&mr(V,e)?V[e]:Ro("Symbol."+e)),Ee[e]},_o=N,Er=U,Sr=It,Po=rr,Ao=io,jo=P,Lo=TypeError,Co=jo("toPrimitive"),xo=function(e,r){if(!Er(e)||Sr(e))return e;var t=Po(e,Co),n;if(t){if(r===void 0&&(r="default"),n=_o(t,e,r),!Er(n)||Sr(n))return n;throw Lo("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ao(e,r)},No=xo,Mo=It,tr=function(e){var r=No(e,"string");return Mo(r)?r:r+""},Do=x,Fo=Ot,Go=wt,Z=K,Tr=tr,Vo=TypeError,Se=Object.defineProperty,ko=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Re="writable";Q.f=Do?Go?function(r,t,n){if(Z(r),t=Tr(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Re in n&&!n[Re]){var a=ko(r,t);a&&a[Re]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:a[Ie],enumerable:Te in n?n[Te]:a[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Tr(t),Z(n),Fo)try{return Se(r,t,n)}catch(a){}if("get"in n||"set"in n)throw Vo("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}},Bo=x,Uo=Q,Qo=fe,z=Bo?function(e,r,t){return Uo.f(e,r,Qo(1,t))}:function(e,r,t){return e[r]=t,e},Ko=Pt,qo=jt,Ir=Ko("keys"),nr=function(e){return Ir[e]||(Ir[e]=qo(e))},ar={},Yo=Ia,Lt=S,Ho=U,zo=z,_e=A,Pe=_t,Wo=nr,Xo=ar,Rr="Object already initialized",Ve=Lt.TypeError,Jo=Lt.WeakMap,ce,q,ue,Zo=function(e){return ue(e)?q(e):ce(e,{})},ei=function(e){return function(r){var t;if(!Ho(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Yo||Pe.state){var I=Pe.state||(Pe.state=new Jo);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=Wo("state");Xo[M]=!0,ce=function(e,r){if(_e(e,M))throw Ve(Rr);return r.facade=e,zo(e,M,r),r},q=function(e){return _e(e,M)?e[M]:{}},ue=function(e){return _e(e,M)}}var ri={set:ce,get:q,has:ue,enforce:Zo,getterFor:ei},ti=ve,Ct=Function.prototype,_r=Ct.apply,Pr=Ct.call,ni=typeof Reflect=="object"&&Reflect.apply||(ti?Pr.bind(_r):function(){return Pr.apply(_r,arguments)}),ai=We,oi=C,xt=function(e){if(ai(e)==="Function")return oi(e)},Nt={},Mt={},Dt={}.propertyIsEnumerable,Ft=Object.getOwnPropertyDescriptor,ii=Ft&&!Dt.call({1:2},1);Mt.f=ii?function(r){var t=Ft(this,r);return!!t&&t.enumerable}:Dt;var si=x,li=N,ci=Mt,ui=fe,vi=H,fi=tr,di=A,hi=Ot,Ar=Object.getOwnPropertyDescriptor;Nt.f=si?Ar:function(r,t){if(r=vi(r),t=fi(t),hi)try{return Ar(r,t)}catch(n){}if(di(r,t))return ui(!li(ci.f,r,t),r[t])};var bi=_,pi=T,yi=/#|\.prototype\./,W=function(e,r){var t=Oi[gi(e)];return t==$i?!0:t==wi?!1:pi(r)?bi(r):!!r},gi=W.normalize=function(e){return String(e).replace(yi,".").toLowerCase()},Oi=W.data={},wi=W.NATIVE="N",$i=W.POLYFILL="P",mi=W,jr=xt,Ei=er,Si=ve,Ti=jr(jr.bind),Gt=function(e,r){return Ei(e),r===void 0?e:Si?Ti(e,r):function(){return e.apply(r,arguments)}},ee=S,Ii=ni,Ri=xt,_i=T,Pi=Nt.f,Ai=mi,D=Je,ji=Gt,F=z,Lr=A,Li=function(e){var r=function(t,n,a){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,a)}return Ii(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,a=e.stat,o=e.proto,i=n?ee:a?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,c,l,u,f,d,O,$,w,y;for(f in r)c=Ai(n?f:t+(a?".":"#")+f,e.forced),l=!c&&i&&Lr(i,f),O=s[f],l&&(e.dontCallGetSet?(y=Pi(i,f),$=y&&y.value):$=i[f]),d=l&&$?$:r[f],!(l&&typeof O==typeof d)&&(e.bind&&l?w=ji(d,ee):e.wrap&&l?w=Li(d):o&&_i(d)?w=Ri(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,f,w),o&&(u=t+"Prototype",Lr(D,u)||F(D,u,{}),F(D[u],f,d),e.real&&v&&(c||!v[f])&&F(v,f,d)))},ke=x,Ci=A,kt=Function.prototype,xi=ke&&Object.getOwnPropertyDescriptor,or=Ci(kt,"name"),Ni=or&&function(){}.name==="something",Mi=or&&(!ke||ke&&xi(kt,"name").configurable),Di={EXISTS:or,PROPER:Ni,CONFIGURABLE:Mi},Bt={},Fi=Math.ceil,Gi=Math.floor,Vi=Math.trunc||function(r){var t=+r;return(t>0?Gi:Fi)(t)},ki=Vi,Ut=function(e){var r=+e;return r!==r||r===0?0:ki(r)},Bi=Ut,Ui=Math.max,Qi=Math.min,Ki=function(e,r){var t=Bi(e);return t<0?Ui(t+r,0):Qi(t,r)},qi=Ut,Yi=Math.min,Hi=function(e){return e>0?Yi(qi(e),9007199254740991):0},zi=Hi,Qt=function(e){return zi(e.length)},Wi=H,Xi=Ki,Ji=Qt,Cr=function(e){return function(r,t,n){var a=Wi(r),o=Ji(a),i=Xi(n,o),s;if(e&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===t)return e||i||0;return!e&&-1}},Zi={includes:Cr(!0),indexOf:Cr(!1)},es=C,Ae=A,rs=H,ts=Zi.indexOf,ns=ar,xr=es([].push),as=function(e,r){var t=rs(e),n=0,a=[],o;for(o in t)!Ae(ns,o)&&Ae(t,o)&&xr(a,o);for(;r.length>n;)Ae(t,o=r[n++])&&(~ts(a,o)||xr(a,o));return a},Kt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],os=as,is=Kt,ss=Object.keys||function(r){return os(r,is)},ls=x,cs=wt,us=Q,vs=K,fs=H,ds=ss;Bt.f=ls&&!cs?Object.defineProperties:function(r,t){vs(r);for(var n=fs(t),a=ds(t),o=a.length,i=0,s;o>i;)us.f(r,s=a[i++],n[s]);return r};var hs=$t,bs=hs("document","documentElement"),ps=K,ys=Bt,Nr=Kt,gs=ar,Os=bs,ws=gt,$s=nr,Mr=">",Dr="<",Be="prototype",Ue="script",qt=$s("IE_PROTO"),je=function(){},Yt=function(e){return Dr+Ue+Mr+e+Dr+"/"+Ue+Mr},Fr=function(e){e.write(Yt("")),e.close();var r=e.parentWindow.Object;return e=null,r},ms=function(){var e=ws("iframe"),r="java"+Ue+":",t;return e.style.display="none",Os.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Yt("document.F=Object")),t.close(),t.F},re,oe=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}oe=typeof document!="undefined"?document.domain&&re?Fr(re):ms():Fr(re);for(var e=Nr.length;e--;)delete oe[Be][Nr[e]];return oe()};gs[qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(je[Be]=ps(r),n=new je,je[Be]=null,n[qt]=r):n=oe(),t===void 0?n:ys.f(n,t)},Es=_,Ss=!Es(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ts=A,Is=T,Rs=At,_s=nr,Ps=Ss,Gr=_s("IE_PROTO"),Qe=Object,As=Qe.prototype,zt=Ps?Qe.getPrototypeOf:function(e){var r=Rs(e);if(Ts(r,Gr))return r[Gr];var t=r.constructor;return Is(t)&&r instanceof t?t.prototype:r instanceof Qe?As:null},js=z,Wt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:js(e,r,t),e},Ls=_,Cs=T,xs=U,Ns=Ht,Vr=zt,Ms=Wt,Ds=P,Ke=Ds("iterator"),Xt=!1,R,Le,Ce;[].keys&&(Ce=[].keys(),"next"in Ce?(Le=Vr(Vr(Ce)),Le!==Object.prototype&&(R=Le)):Xt=!0);var Fs=!xs(R)||Ls(function(){var e={};return R[Ke].call(e)!==e});Fs?R={}:R=Ns(R);Cs(R[Ke])||Ms(R,Ke,function(){return this});var Jt={IteratorPrototype:R,BUGGY_SAFARI_ITERATORS:Xt},Gs=P,Vs=Gs("toStringTag"),Zt={};Zt[Vs]="z";var ir=String(Zt)==="[object z]",ks=ir,Bs=T,ie=We,Us=P,Qs=Us("toStringTag"),Ks=Object,qs=ie(function(){return arguments}())=="Arguments",Ys=function(e,r){try{return e[r]}catch(t){}},sr=ks?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Ys(r=Ks(e),Qs))=="string"?t:qs?ie(r):(n=ie(r))=="Object"&&Bs(r.callee)?"Arguments":n},Hs=ir,zs=sr,Ws=Hs?{}.toString:function(){return"[object "+zs(this)+"]"},Xs=ir,Js=Q.f,Zs=z,el=A,rl=Ws,tl=P,kr=tl("toStringTag"),en=function(e,r,t,n){if(e){var a=t?e:e.prototype;el(a,kr)||Js(a,kr,{configurable:!0,value:r}),n&&!Xs&&Zs(a,"toString",rl)}},nl=Jt.IteratorPrototype,al=Ht,ol=fe,il=en,sl=B,ll=function(){return this},cl=function(e,r,t,n){var a=r+" Iterator";return e.prototype=al(nl,{next:ol(+!n,t)}),il(e,a,!1,!0),sl[a]=ll,e},ul=Vt,vl=N,rn=Di,fl=cl,dl=zt,hl=en,Br=Wt,bl=P,Ur=B,tn=Jt,pl=rn.PROPER;rn.CONFIGURABLE;tn.IteratorPrototype;var te=tn.BUGGY_SAFARI_ITERATORS,xe=bl("iterator"),Qr="keys",ne="values",Kr="entries",yl=function(){return this},gl=function(e,r,t,n,a,o,i){fl(t,r,n);var s=function(y){if(y===a&&f)return f;if(!te&&y in l)return l[y];switch(y){case Qr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case Kr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",c=!1,l=e.prototype,u=l[xe]||l["@@iterator"]||a&&l[a],f=!te&&u||s(a),d=r=="Array"&&l.entries||u,O,$,w;if(d&&(O=dl(d.call(new e)),O!==Object.prototype&&O.next&&(hl(O,v,!0,!0),Ur[v]=yl)),pl&&a==ne&&u&&u.name!==ne&&(c=!0,f=function(){return vl(u,this)}),a)if($={values:s(ne),keys:o?f:s(Qr),entries:s(Kr)},i)for(w in $)(te||c||!(w in l))&&Br(l,w,$[w]);else ul({target:r,proto:!0,forced:te||c},$);return i&&l[xe]!==f&&Br(l,xe,f,{name:a}),Ur[r]=f,$},Ol=function(e,r){return{value:e,done:r}},wl=H,qr=B,nn=ri;Q.f;var $l=gl,ae=Ol,an="Array Iterator",ml=nn.set,El=nn.getterFor(an);$l(Array,"Array",function(e,r){ml(this,{type:an,target:wl(e),index:0,kind:r})},function(){var e=El(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ae(void 0,!0)):t=="keys"?ae(n,!1):t=="values"?ae(r[n],!1):ae([n,r[n]],!1)},"values");qr.Arguments=qr.Array;var Sl=P,Tl=B,Il=Sl("iterator"),Rl=Array.prototype,_l=function(e){return e!==void 0&&(Tl.Array===e||Rl[Il]===e)},Pl=sr,Yr=rr,Al=Xe,jl=B,Ll=P,Cl=Ll("iterator"),on=function(e){if(!Al(e))return Yr(e,Cl)||Yr(e,"@@iterator")||jl[Pl(e)]},xl=N,Nl=er,Ml=K,Dl=Ze,Fl=on,Gl=TypeError,Vl=function(e,r){var t=arguments.length<2?Fl(e):r;if(Nl(t))return Ml(xl(t,e));throw Gl(Dl(e)+" is not iterable")},kl=N,Hr=K,Bl=rr,Ul=function(e,r,t){var n,a;Hr(e);try{if(n=Bl(e,"return"),!n){if(r==="throw")throw t;return t}n=kl(n,e)}catch(o){a=!0,n=o}if(r==="throw")throw t;if(a)throw n;return Hr(n),t},Ql=Gt,Kl=N,ql=K,Yl=Ze,Hl=_l,zl=Qt,zr=mt,Wl=Vl,Xl=on,Wr=Ul,Jl=TypeError,se=function(e,r){this.stopped=e,this.result=r},Xr=se.prototype,Zl=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Ql(r,n),c,l,u,f,d,O,$,w=function(g){return c&&Wr(c,"normal",g),new se(!0,g)},y=function(g){return a?(ql(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(o)c=e.iterator;else if(i)c=e;else{if(l=Xl(e),!l)throw Jl(Yl(e)+" is not iterable");if(Hl(l)){for(u=0,f=zl(e);f>u;u++)if(d=y(e[u]),d&&zr(Xr,d))return d;return new se(!1)}c=Wl(e,l)}for(O=o?e.next:c.next;!($=Kl(O,c)).done;){try{d=y($.value)}catch(g){Wr(c,"throw",g)}if(typeof d=="object"&&d&&zr(Xr,d))return d}return new se(!1)},ec=tr,rc=Q,tc=fe,nc=function(e,r,t){var n=ec(r);n in e?rc.f(e,n,tc(0,t)):e[n]=t},ac=Vt,oc=Zl,ic=nc;ac({target:"Object",stat:!0},{fromEntries:function(r){var t={};return oc(r,function(n,a){ic(t,n,a)},{AS_ENTRIES:!0}),t}});var sc=Je,lc=sc.Object.fromEntries,cc={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},uc=cc,vc=S,fc=sr,dc=z,Jr=B,hc=P,Zr=hc("toStringTag");for(var Ne in uc){var et=vc[Ne],Me=et&&et.prototype;Me&&fc(Me)!==Zr&&dc(Me,Zr,Ne),Jr[Ne]=Jr.Array}var bc=lc,pc=bc,yc=pc,gc=yc,Oc=la(gc);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 wc="vk.com",$c=(e,r,t)=>nt(void 0,void 0,void 0,function*(){const n=new URL(`https://${wc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const o=yield(yield sa(n.toString())).json();return mc(o,t)}),mc=(e,r)=>Oc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Ec(n)])),Ec=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=cn;exports.Observable=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=sn;exports.ValueSubject=Cn;exports.abortable=hn;exports.addScript=fn;exports.areQualitiesExact=jn;exports.assertNever=L;exports.assertNonNullable=un;exports.assertNullable=vn;exports.assertQualityIsExact=Ln;exports.buffer=Vn;exports.checkNever=ln;exports.combine=xn;exports.debounce=Un;exports.fillWithDefault=it;exports.filter=Hn;exports.filterChanged=Wn;exports.fromEvent=Gn;exports.getCurrentBrowser=at;exports.getExponentialDelay=pn;exports.getHighestQuality=Rn;exports.interval=Dn;exports.isHigher=Sn;exports.isHigherOrEqual=Tn;exports.isIOS=bn;exports.isInvariantQuality=He;exports.isLower=Ye;exports.isLowerOrEqual=In;exports.isNonNullable=rt;exports.isNullable=tt;exports.loadVKLangPack=$c;exports.map=st;exports.mapTo=Zn;exports.merge=Nn;exports.noop=G;exports.now=dn;exports.observableFrom=Fn;exports.once=ea;exports.pairwise=ra;exports.safeStorage=En;exports.tap=na;exports.throttle=qn;exports.timeout=Mn;exports.videoHeightToQuality=_n;exports.videoQualityToHeight=An;exports.videoSizeToQuality=Pn;
|
|
6
|
+
"use strict";const sn="1.0.29-beta.1";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`)},ln=e=>{},G=()=>{};class b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let a;t?typeof t=="function"?a={next:t,error:G}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:G,error:G};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new Y().add(()=>{switch(o.next=G,o.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 b{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 cn{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(a){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}const fn=(e,r,t)=>new Promise((n,a)=>{r.addEventListener("abort",()=>{s(),c.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",o),c.src=e,document.head.appendChild(c)});var de;const dn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now();function at(e,r,t,n){function a(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function s(l){try{c(n.next(l))}catch(u){i(u)}}function v(l){try{c(n.throw(l))}catch(u){i(u)}}function c(l){l.done?o(l.value):a(l.value).then(s,v)}c((n=n.apply(e,r||[])).next())})}const hn=(e,r)=>(...t)=>at(void 0,void 0,void 0,function*(){var n;const a=r(...t);let o=e.aborted,i;for(;!o&&!e.aborted;){const s=yield a.next(i);o=(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,a=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,o=/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,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,l=/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||a||i||s||t||n||o||exports.CurrentClientBrowser.Rest,device:v||c||l||u||d||f||exports.CurrentClientDevice.Desktop}},bn=()=>[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),pn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),yn=(e,{start:r=0,factor:t=2,max:n=1/0,min:a=r,random:o=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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 p,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&&(p=new Map),j},gn=()=>k()===h.LOCAL_STORAGE,On=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 p==null?void 0:p.get(e);default:C(n)}},wn=(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(p==null?void 0:p.set(e,r));default:C(t)}},$n=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=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},mn=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(p==null?void 0:p.delete(e));default:C(r)}},En=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:C(e)}};var Sn=Object.freeze({__proto__:null,clear:En,get:On,has:$n,isPersistent:gn,remove:mn,set:wn});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 m={[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}},Tn=(e,r)=>m[e].height>m[r].height,In=(e,r)=>m[e].height>=m[r].height,He=(e,r)=>m[e].height<m[r].height,Rn=(e,r)=>m[e].height<=m[r].height,Pn=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(m).sort((e,r)=>He(e,r)?-1:1),_n=(e,r=.02)=>[...ot].find(n=>m[n].height*(1+r)>=e),An=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ot.find(a=>{const o=m[a];return o.width>=n&&o.height>=t})},jn=e=>m[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Cn=e=>e.every(r=>!ze(r));function Ln(e){if(ze(e))throw new Error("Expected exact quality")}const it=(e,r)=>{const t={};for(const n of Object.keys(r)){const a=r[n],o=e[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=it(o,a):t[n]=n in e?o:a}return t};class xn 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 Nn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&r.next(t)};return Object.entries(e).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new Y)})}function Mn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Dn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Fn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Gn=e=>new b(r=>{e.forEach(t=>r.next(t))}),Vn=(e,r)=>new b(t=>{const n=a=>t.next(a);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function kn(e){return r=>new b(t=>r.subscribe(new Bn(t,e)))}class Bn{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 Un={leading:!1,trailing:!0};function Qn(e,r=Un){return t=>new b(n=>t.subscribe(new Kn(n,e,r)))}class Kn{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 qn={leading:!0,trailing:!1};function Yn(e,r=qn){return t=>new b(n=>t.subscribe(new Hn(n,e,r)))}class Hn{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 b(t=>r.subscribe(new Wn(t,e)))}class Wn{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 Xn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Jn(t,e)))}const cr={};class Jn{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 st(e){return r=>new b(t=>r.subscribe(new Zn(t,e)))}let Zn=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 ea(e){return st(()=>e)}function ra(){return e=>new b(r=>{let t=!1,n=!1;const a=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function ta(){return e=>new b(r=>e.subscribe(new na(r)))}class na{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 aa(e){return r=>new b(t=>r.subscribe(new oa(t,e)))}class oa{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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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 lt 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 ia{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(a){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(a){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&&(ia.prototype[Symbol.toStringTag]="AbortController",lt.prototype[Symbol.toStringTag]="AbortSignal");function ct(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 sa(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=e;if(!ct({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=function(c,l){let u;l&&l.signal&&(u=l.signal,delete l.signal);const f=new t(c,l);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},o.prototype=t.prototype);const i=r;return{fetch:(v,c)=>{const l=o&&o.prototype.isPrototypeOf(v)?v.signal:c?c.signal:void 0;if(l){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(l.aborted)return Promise.reject(u);const f=new Promise((d,O)=>{l.addEventListener("abort",()=>O(u),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(v,c)])}return i(v,c)},Request:o}}const We=ct({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ut=We?sa({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,la=We?ut.fetch:window.fetch;We?ut.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ca(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}},ua=P,ve=!ua(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),vt=ve,ft=Function.prototype,De=ft.call,va=vt&&ft.bind.bind(De,De),L=vt?va:function(e){return function(){return De.apply(e,arguments)}},dt=L,fa=dt({}.toString),da=dt("".slice),Xe=function(e){return da(fa(e),8,-1)},ha=L,ba=P,pa=Xe,pe=Object,ya=ha("".split),ga=ba(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return pa(e)=="String"?ya(e,""):pe(e)}:pe,Je=function(e){return e==null},Oa=Je,wa=TypeError,ht=function(e){if(Oa(e))throw wa("Can't call method on "+e);return e},$a=ga,ma=ht,H=function(e){return $a(ma(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 be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,Ea=typeof Fe=="undefined"&&Fe!==void 0,bt={all:Fe,IS_HTMLDDA:Ea},pt=bt,Sa=pt.all,T=pt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Sa}:function(e){return typeof e=="function"},Ta=S,Ia=T,vr=Ta.WeakMap,Ra=Ia(vr)&&/native code/.test(String(vr)),fr=T,yt=bt,Pa=yt.all,U=yt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Pa}:function(e){return typeof e=="object"?e!==null:fr(e)},_a=P,x=!_a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Aa=S,dr=U,Ge=Aa.document,ja=dr(Ge)&&dr(Ge.createElement),gt=function(e){return ja?Ge.createElement(e):{}},Ca=x,La=P,xa=gt,Ot=!Ca&&!La(function(){return Object.defineProperty(xa("div"),"a",{get:function(){return 7}}).a!=7}),Na=x,Ma=P,wt=Na&&Ma(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Da=U,Fa=String,Ga=TypeError,K=function(e){if(Da(e))return e;throw Ga(Fa(e)+" is not an object")},Va=ve,J=Function.prototype.call,N=Va?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,ka=T,hr=function(e){return ka(e)?e:void 0},$t=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Ba=L,mt=Ba({}.isPrototypeOf),Ua=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=S,Oe=Ua,br=Et.process,pr=Et.Deno,yr=br&&br.versions||pr&&pr.version,gr=yr&&yr.v8,E,le;gr&&(E=gr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var Qa=le,Or=Qa,Ka=P,qa=S,Ya=qa.String,St=!!Object.getOwnPropertySymbols&&!Ka(function(){var e=Symbol();return!Ya(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),Ha=St,Tt=Ha&&!Symbol.sham&&typeof Symbol.iterator=="symbol",za=$t,Wa=T,Xa=mt,Ja=Tt,Za=Object,It=Ja?function(e){return typeof e=="symbol"}:function(e){var r=za("Symbol");return Wa(r)&&Xa(r.prototype,Za(e))},eo=String,er=function(e){try{return eo(e)}catch(r){return"Object"}},ro=T,to=er,no=TypeError,rr=function(e){if(ro(e))return e;throw no(to(e)+" is not a function")},ao=rr,oo=Je,tr=function(e,r){var t=e[r];return oo(t)?void 0:ao(t)},we=N,$e=T,me=U,io=TypeError,so=function(e,r){var t,n;if(r==="string"&&$e(t=e.toString)&&!me(n=we(t,e))||$e(t=e.valueOf)&&!me(n=we(t,e))||r!=="string"&&$e(t=e.toString)&&!me(n=we(t,e)))return n;throw io("Can't convert object to primitive value")},Rt={exports:{}},wr=S,lo=Object.defineProperty,co=function(e,r){try{lo(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},uo=S,vo=co,$r="__core-js_shared__",fo=uo[$r]||vo($r,{}),Pt=fo,mr=Pt;(Rt.exports=function(e,r){return mr[e]||(mr[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,ho=ht,bo=Object,At=function(e){return bo(ho(e))},po=L,yo=At,go=po({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return go(yo(r),t)},Oo=L,wo=0,$o=Math.random(),mo=Oo(1 .toString),jt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+mo(++wo+$o,36)},Eo=S,So=_t,Er=A,To=jt,Io=St,Ro=Tt,V=Eo.Symbol,Ee=So("wks"),Po=Ro?V.for||V:V&&V.withoutSetter||To,_=function(e){return Er(Ee,e)||(Ee[e]=Io&&Er(V,e)?V[e]:Po("Symbol."+e)),Ee[e]},_o=N,Sr=U,Tr=It,Ao=tr,jo=so,Co=_,Lo=TypeError,xo=Co("toPrimitive"),No=function(e,r){if(!Sr(e)||Tr(e))return e;var t=Ao(e,xo),n;if(t){if(r===void 0&&(r="default"),n=_o(t,e,r),!Sr(n)||Tr(n))return n;throw Lo("Can't convert object to primitive value")}return r===void 0&&(r="number"),jo(e,r)},Mo=No,Do=It,nr=function(e){var r=Mo(e,"string");return Do(r)?r:r+""},Fo=x,Go=Ot,Vo=wt,Z=K,Ir=nr,ko=TypeError,Se=Object.defineProperty,Bo=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Re="writable";Q.f=Fo?Vo?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 a=Bo(r,t);a&&a[Re]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:a[Ie],enumerable:Te in n?n[Te]:a[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Go)try{return Se(r,t,n)}catch(a){}if("get"in n||"set"in n)throw ko("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}},Uo=x,Qo=Q,Ko=fe,z=Uo?function(e,r,t){return Qo.f(e,r,Ko(1,t))}:function(e,r,t){return e[r]=t,e},qo=_t,Yo=jt,Rr=qo("keys"),ar=function(e){return Rr[e]||(Rr[e]=Yo(e))},or={},Ho=Ra,Ct=S,zo=U,Wo=z,Pe=A,_e=Pt,Xo=ar,Jo=or,Pr="Object already initialized",Ve=Ct.TypeError,Zo=Ct.WeakMap,ce,q,ue,ei=function(e){return ue(e)?q(e):ce(e,{})},ri=function(e){return function(r){var t;if(!zo(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Ho||_e.state){var I=_e.state||(_e.state=new Zo);I.get=I.get,I.has=I.has,I.set=I.set,ce=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=Xo("state");Jo[M]=!0,ce=function(e,r){if(Pe(e,M))throw Ve(Pr);return r.facade=e,Wo(e,M,r),r},q=function(e){return Pe(e,M)?e[M]:{}},ue=function(e){return Pe(e,M)}}var ti={set:ce,get:q,has:ue,enforce:ei,getterFor:ri},ni=ve,Lt=Function.prototype,_r=Lt.apply,Ar=Lt.call,ai=typeof Reflect=="object"&&Reflect.apply||(ni?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),oi=Xe,ii=L,xt=function(e){if(oi(e)==="Function")return ii(e)},Nt={},Mt={},Dt={}.propertyIsEnumerable,Ft=Object.getOwnPropertyDescriptor,si=Ft&&!Dt.call({1:2},1);Mt.f=si?function(r){var t=Ft(this,r);return!!t&&t.enumerable}:Dt;var li=x,ci=N,ui=Mt,vi=fe,fi=H,di=nr,hi=A,bi=Ot,jr=Object.getOwnPropertyDescriptor;Nt.f=li?jr:function(r,t){if(r=fi(r),t=di(t),bi)try{return jr(r,t)}catch(n){}if(hi(r,t))return vi(!ci(ui.f,r,t),r[t])};var pi=P,yi=T,gi=/#|\.prototype\./,W=function(e,r){var t=wi[Oi(e)];return t==mi?!0:t==$i?!1:yi(r)?pi(r):!!r},Oi=W.normalize=function(e){return String(e).replace(gi,".").toLowerCase()},wi=W.data={},$i=W.NATIVE="N",mi=W.POLYFILL="P",Ei=W,Cr=xt,Si=rr,Ti=ve,Ii=Cr(Cr.bind),Gt=function(e,r){return Si(e),r===void 0?e:Ti?Ii(e,r):function(){return e.apply(r,arguments)}},ee=S,Ri=ai,Pi=xt,_i=T,Ai=Nt.f,ji=Ei,D=Ze,Ci=Gt,F=z,Lr=A,Li=function(e){var r=function(t,n,a){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,a)}return Ri(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,a=e.stat,o=e.proto,i=n?ee:a?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,c,l,u,f,d,O,$,w,y;for(f in r)c=ji(n?f:t+(a?".":"#")+f,e.forced),l=!c&&i&&Lr(i,f),O=s[f],l&&(e.dontCallGetSet?(y=Ai(i,f),$=y&&y.value):$=i[f]),d=l&&$?$:r[f],!(l&&typeof O==typeof d)&&(e.bind&&l?w=Ci(d,ee):e.wrap&&l?w=Li(d):o&&_i(d)?w=Pi(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,f,w),o&&(u=t+"Prototype",Lr(D,u)||F(D,u,{}),F(D[u],f,d),e.real&&v&&(c||!v[f])&&F(v,f,d)))},ke=x,xi=A,kt=Function.prototype,Ni=ke&&Object.getOwnPropertyDescriptor,ir=xi(kt,"name"),Mi=ir&&function(){}.name==="something",Di=ir&&(!ke||ke&&Ni(kt,"name").configurable),Fi={EXISTS:ir,PROPER:Mi,CONFIGURABLE:Di},Bt={},Gi=Math.ceil,Vi=Math.floor,ki=Math.trunc||function(r){var t=+r;return(t>0?Vi:Gi)(t)},Bi=ki,Ut=function(e){var r=+e;return r!==r||r===0?0:Bi(r)},Ui=Ut,Qi=Math.max,Ki=Math.min,qi=function(e,r){var t=Ui(e);return t<0?Qi(t+r,0):Ki(t,r)},Yi=Ut,Hi=Math.min,zi=function(e){return e>0?Hi(Yi(e),9007199254740991):0},Wi=zi,Qt=function(e){return Wi(e.length)},Xi=H,Ji=qi,Zi=Qt,xr=function(e){return function(r,t,n){var a=Xi(r),o=Zi(a),i=Ji(n,o),s;if(e&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===t)return e||i||0;return!e&&-1}},es={includes:xr(!0),indexOf:xr(!1)},rs=L,Ae=A,ts=H,ns=es.indexOf,as=or,Nr=rs([].push),os=function(e,r){var t=ts(e),n=0,a=[],o;for(o in t)!Ae(as,o)&&Ae(t,o)&&Nr(a,o);for(;r.length>n;)Ae(t,o=r[n++])&&(~ns(a,o)||Nr(a,o));return a},Kt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],is=os,ss=Kt,ls=Object.keys||function(r){return is(r,ss)},cs=x,us=wt,vs=Q,fs=K,ds=H,hs=ls;Bt.f=cs&&!us?Object.defineProperties:function(r,t){fs(r);for(var n=ds(t),a=hs(t),o=a.length,i=0,s;o>i;)vs.f(r,s=a[i++],n[s]);return r};var bs=$t,ps=bs("document","documentElement"),ys=K,gs=Bt,Mr=Kt,Os=or,ws=ps,$s=gt,ms=ar,Dr=">",Fr="<",Be="prototype",Ue="script",qt=ms("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},Es=function(){var e=$s("iframe"),r="java"+Ue+":",t;return e.style.display="none",ws.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Yt("document.F=Object")),t.close(),t.F},re,oe=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}oe=typeof document!="undefined"?document.domain&&re?Gr(re):Es():Gr(re);for(var e=Mr.length;e--;)delete oe[Be][Mr[e]];return oe()};Os[qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(je[Be]=ys(r),n=new je,je[Be]=null,n[qt]=r):n=oe(),t===void 0?n:gs.f(n,t)},Ss=P,Ts=!Ss(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Is=A,Rs=T,Ps=At,_s=ar,As=Ts,Vr=_s("IE_PROTO"),Qe=Object,js=Qe.prototype,zt=As?Qe.getPrototypeOf:function(e){var r=Ps(e);if(Is(r,Vr))return r[Vr];var t=r.constructor;return Rs(t)&&r instanceof t?t.prototype:r instanceof Qe?js:null},Cs=z,Wt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Cs(e,r,t),e},Ls=P,xs=T,Ns=U,Ms=Ht,kr=zt,Ds=Wt,Fs=_,Ke=Fs("iterator"),Xt=!1,R,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(R=Ce)):Xt=!0);var Gs=!Ns(R)||Ls(function(){var e={};return R[Ke].call(e)!==e});Gs?R={}:R=Ms(R);xs(R[Ke])||Ds(R,Ke,function(){return this});var Jt={IteratorPrototype:R,BUGGY_SAFARI_ITERATORS:Xt},Vs=_,ks=Vs("toStringTag"),Zt={};Zt[ks]="z";var sr=String(Zt)==="[object z]",Bs=sr,Us=T,ie=Xe,Qs=_,Ks=Qs("toStringTag"),qs=Object,Ys=ie(function(){return arguments}())=="Arguments",Hs=function(e,r){try{return e[r]}catch(t){}},lr=Bs?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Hs(r=qs(e),Ks))=="string"?t:Ys?ie(r):(n=ie(r))=="Object"&&Us(r.callee)?"Arguments":n},zs=sr,Ws=lr,Xs=zs?{}.toString:function(){return"[object "+Ws(this)+"]"},Js=sr,Zs=Q.f,el=z,rl=A,tl=Xs,nl=_,Br=nl("toStringTag"),en=function(e,r,t,n){if(e){var a=t?e:e.prototype;rl(a,Br)||Zs(a,Br,{configurable:!0,value:r}),n&&!Js&&el(a,"toString",tl)}},al=Jt.IteratorPrototype,ol=Ht,il=fe,sl=en,ll=B,cl=function(){return this},ul=function(e,r,t,n){var a=r+" Iterator";return e.prototype=ol(al,{next:il(+!n,t)}),sl(e,a,!1,!0),ll[a]=cl,e},vl=Vt,fl=N,rn=Fi,dl=ul,hl=zt,bl=en,Ur=Wt,pl=_,Qr=B,tn=Jt,yl=rn.PROPER;rn.CONFIGURABLE;tn.IteratorPrototype;var te=tn.BUGGY_SAFARI_ITERATORS,xe=pl("iterator"),Kr="keys",ne="values",qr="entries",gl=function(){return this},Ol=function(e,r,t,n,a,o,i){dl(t,r,n);var s=function(y){if(y===a&&f)return f;if(!te&&y in l)return l[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",c=!1,l=e.prototype,u=l[xe]||l["@@iterator"]||a&&l[a],f=!te&&u||s(a),d=r=="Array"&&l.entries||u,O,$,w;if(d&&(O=hl(d.call(new e)),O!==Object.prototype&&O.next&&(bl(O,v,!0,!0),Qr[v]=gl)),yl&&a==ne&&u&&u.name!==ne&&(c=!0,f=function(){return fl(u,this)}),a)if($={values:s(ne),keys:o?f:s(Kr),entries:s(qr)},i)for(w in $)(te||c||!(w in l))&&Ur(l,w,$[w]);else vl({target:r,proto:!0,forced:te||c},$);return i&&l[xe]!==f&&Ur(l,xe,f,{name:a}),Qr[r]=f,$},wl=function(e,r){return{value:e,done:r}},$l=H,Yr=B,nn=ti;Q.f;var ml=Ol,ae=wl,an="Array Iterator",El=nn.set,Sl=nn.getterFor(an);ml(Array,"Array",function(e,r){El(this,{type:an,target:$l(e),index:0,kind:r})},function(){var e=Sl(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ae(void 0,!0)):t=="keys"?ae(n,!1):t=="values"?ae(r[n],!1):ae([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Tl=_,Il=B,Rl=Tl("iterator"),Pl=Array.prototype,_l=function(e){return e!==void 0&&(Il.Array===e||Pl[Rl]===e)},Al=lr,Hr=tr,jl=Je,Cl=B,Ll=_,xl=Ll("iterator"),on=function(e){if(!jl(e))return Hr(e,xl)||Hr(e,"@@iterator")||Cl[Al(e)]},Nl=N,Ml=rr,Dl=K,Fl=er,Gl=on,Vl=TypeError,kl=function(e,r){var t=arguments.length<2?Gl(e):r;if(Ml(t))return Dl(Nl(t,e));throw Vl(Fl(e)+" is not iterable")},Bl=N,zr=K,Ul=tr,Ql=function(e,r,t){var n,a;zr(e);try{if(n=Ul(e,"return"),!n){if(r==="throw")throw t;return t}n=Bl(n,e)}catch(o){a=!0,n=o}if(r==="throw")throw t;if(a)throw n;return zr(n),t},Kl=Gt,ql=N,Yl=K,Hl=er,zl=_l,Wl=Qt,Wr=mt,Xl=kl,Jl=on,Xr=Ql,Zl=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,ec=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Kl(r,n),c,l,u,f,d,O,$,w=function(g){return c&&Xr(c,"normal",g),new se(!0,g)},y=function(g){return a?(Yl(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(o)c=e.iterator;else if(i)c=e;else{if(l=Jl(e),!l)throw Zl(Hl(e)+" is not iterable");if(zl(l)){for(u=0,f=Wl(e);f>u;u++)if(d=y(e[u]),d&&Wr(Jr,d))return d;return new se(!1)}c=Xl(e,l)}for(O=o?e.next:c.next;!($=ql(O,c)).done;){try{d=y($.value)}catch(g){Xr(c,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},rc=nr,tc=Q,nc=fe,ac=function(e,r,t){var n=rc(r);n in e?tc.f(e,n,nc(0,t)):e[n]=t},oc=Vt,ic=ec,sc=ac;oc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return ic(r,function(n,a){sc(t,n,a)},{AS_ENTRIES:!0}),t}});var lc=Ze,cc=lc.Object.fromEntries,uc={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},vc=uc,fc=S,dc=lr,hc=z,Zr=B,bc=_,et=bc("toStringTag");for(var Ne in vc){var rt=fc[Ne],Me=rt&&rt.prototype;Me&&dc(Me)!==et&&hc(Me,et,Ne),Zr[Ne]=Zr.Array}var pc=cc,yc=pc,gc=yc,Oc=gc,wc=ca(Oc);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 $c="vk.com",mc=(e,r,t)=>at(void 0,void 0,void 0,function*(){const n=new URL(`https://${$c}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const o=yield(yield la(n.toString())).json();return Ec(o,t)}),Ec=(e,r)=>wc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Sc(n)])),Sc=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=cn;exports.Observable=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=sn;exports.ValueSubject=xn;exports.abortable=hn;exports.addScript=fn;exports.areQualitiesExact=Cn;exports.assertNever=C;exports.assertNonNullable=un;exports.assertNullable=vn;exports.assertQualityIsExact=Ln;exports.buffer=kn;exports.checkNever=ln;exports.combine=Nn;exports.debounce=Qn;exports.fillWithDefault=it;exports.filter=zn;exports.filterChanged=Xn;exports.fromEvent=Vn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=yn;exports.getHighestQuality=Pn;exports.interval=Fn;exports.isHigher=Tn;exports.isHigherOrEqual=In;exports.isIOS=bn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=Rn;exports.isMacLike=pn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=mc;exports.map=st;exports.mapTo=ea;exports.merge=Mn;exports.noop=G;exports.now=dn;exports.observableFrom=Gn;exports.once=ra;exports.pairwise=ta;exports.safeStorage=Sn;exports.tap=aa;exports.throttle=Yn;exports.timeout=Dn;exports.videoHeightToQuality=_n;exports.videoQualityToHeight=jn;exports.videoSizeToQuality=An;
|
package/es2015.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.29-beta.1
|
|
3
|
+
* Wed, 06 Sep 2023 16:19:06 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-29/doc/
|
|
5
5
|
*/
|
|
6
|
-
const zc="1.0.28";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 b{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let a;t?typeof t=="function"?a={next:t,error:Q}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:Q,error:Q};const o=typeof e=="function"?{next:s=>{try{e(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new dr().add(()=>{switch(o.next=Q,o.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 at extends b{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 at,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(a){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 cn(r){return typeof r!="undefined"&&r!==null}function ln(r){return r==null}const Jc=(r,e,t)=>new Promise((n,a)=>{e.addEventListener("abort",()=>{s(),l.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",o),l.src=r,document.head.appendChild(l)});var br;const Zc=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now();function ot(r,e,t,n){function a(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,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?o(c.value):a(c.value).then(s,v)}l((n=n.apply(r,e||[])).next())})}const rl=(r,e)=>(...t)=>ot(void 0,void 0,void 0,function*(){var n;const a=e(...t);let o=r.aborted,i;for(;!o&&!r.aborted;){const s=yield a.next(i);o=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});var P;(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"})(P||(P={}));var S;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Desktop="Desktop"})(S||(S={}));const un=()=>{const{userAgent:r}=window.navigator,e=/yabrowser/i.test(r)?P.Yandex:void 0,t=/chrome|crios/i.test(r)?P.Chrome:void 0,n=/chromium/i.test(r)?P.Chromium:void 0,a=/firefox|fxios/i.test(r)?P.Firefox:void 0,o=/webkit|safari|khtml/i.test(r)?P.Safari:void 0,i=/opr\//i.test(r)?P.Opera:void 0,s=/edg/i.test(r)?P.Edge:void 0,v=/android/i.test(r)?S.Android:void 0,l=/iphone/i.test(r)?S.iPhone:void 0,c=/ipad/i.test(r)?S.iPad:void 0,u=/ipod/i.test(r)?S.iPod:void 0,f=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?S.RestMobile:void 0;return{browser:e||a||i||s||t||n||o||P.Rest,device:v||l||c||u||f||S.Desktop}},el=()=>[S.iPhone,S.iPad,S.iPod].includes(un().device),tl=(r,{start:e=0,factor:t=2,max:n=1/0,min:a=e,random:o=0}={})=>{let i=e;return i*=Math.pow(t,r),i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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 p,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&&(p=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 p==null?void 0:p.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(p==null?void 0:p.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=p==null?void 0:p.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(p==null?void 0:p.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 p==null?void 0:p.clear();default:V(r)}};var nl=Object.freeze({__proto__:null,clear:bn,get:fn,has:hn,isPersistent:vn,remove:pn,set:dn}),m;(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"})(m||(m={}));const E={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},al=(r,e)=>E[r].height>E[e].height,ol=(r,e)=>E[r].height>=E[e].height,it=(r,e)=>E[r].height<E[e].height,il=(r,e)=>E[r].height<=E[e].height,sl=r=>r.sort((e,t)=>e===t?0:e===m.INVARIANT?1:t===m.INVARIANT?-1:it(e,t)?1:-1)[0],st=Object.keys(E).sort((r,e)=>it(r,e)?-1:1),cl=(r,e=.02)=>[...st].find(n=>E[n].height*(1+e)>=r),ll=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return st.find(a=>{const o=E[a];return o.width>=n&&o.height>=t})},ul=r=>E[r].height,ct=r=>r===m.INVARIANT,vl=r=>r.every(e=>!ct(e));function fl(r){if(ct(r))throw new Error("Expected exact quality")}const yn=(r,e)=>{const t={};for(const n of Object.keys(e)){const a=e[n],o=r[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=yn(o,a):t[n]=n in r?o:a}return t};class dl extends at{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 hl(r){return new b(e=>{const t={};let n=Object.keys(r).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&e.next(t)};return Object.entries(r).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new dr)})}function pl(...r){return new b(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var bl=r=>new b(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),yl=r=>new b(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),gl=r=>new b(e=>{r.forEach(t=>e.next(t))}),Ol=(r,e)=>new b(t=>{const n=a=>t.next(a);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function $l(r){return e=>new b(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 ml(r,e=On){return t=>new b(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,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 mn={leading:!0,trailing:!1};function wl(r,e=mn){return t=>new b(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)&&(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 El(r){return e=>new b(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 Sl(r=(e,t)=>e===t){return e=>new b(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 b(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 Il(r){return Tn(()=>r)}function Rl(){return r=>new b(e=>{let t=!1,n=!1;const a=r.subscribe(o=>{t||(t=!0,e.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function _l(){return r=>new b(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 Pl(r){return e=>new b(t=>e.subscribe(new _n(t,r)))}class _n{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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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 Pn{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(a){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(a){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&&(Pn.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 An(r){typeof r=="function"&&(r={fetch:r});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=r;if(!ut({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:e,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=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},o.prototype=t.prototype);const i=e;return{fetch:(v,l)=>{const c=o&&o.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:o}}const Wr=ut({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),vt=Wr?An({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,jn=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 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")}),ft=hr,dt=Function.prototype,kr=dt.call,Mn=ft&&dt.bind.bind(kr,kr),N=ft?Mn:function(r){return function(){return kr.apply(r,arguments)}},ht=N,Nn=ht({}.toString),Cn=ht("".slice),Hr=function(r){return Cn(Nn(r),8,-1)},Gn=N,Fn=j,Dn=Hr,Or=Object,kn=Gn("".split),Un=Fn(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,pt=function(r){if(Vn(r))throw Bn("Can't call method on "+r);return r},Kn=Un,qn=pt,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,bt={all:Ur,IS_HTMLDDA:Yn},yt=bt,zn=yt.all,R=yt.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,gt=bt,Xn=gt.all,q=gt.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,ra=de(Vr)&&de(Vr.createElement),Ot=function(r){return ra?Vr.createElement(r):{}},ea=C,ta=j,na=Ot,$t=!ea&&!ta(function(){return Object.defineProperty(na("div"),"a",{get:function(){return 7}}).a!=7}),aa=C,oa=j,mt=aa&&oa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ia=q,sa=String,ca=TypeError,z=function(r){if(ia(r))return r;throw ca(sa(r)+" is not an object")},la=hr,rr=Function.prototype.call,G=la?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},$r=Jr,mr=I,ua=R,he=function(r){return ua(r)?r:void 0},wt=function(r,e){return arguments.length<2?he($r[r])||he(mr[r]):$r[r]&&$r[r][e]||mr[r]&&mr[r][e]},va=N,Et=va({}.isPrototypeOf),fa=typeof navigator!="undefined"&&String(navigator.userAgent)||"",St=I,wr=fa,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&&wr&&(T=wr.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=wr.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var da=ur,Oe=da,ha=j,pa=I,ba=pa.String,Tt=!!Object.getOwnPropertySymbols&&!ha(function(){var r=Symbol();return!ba(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),ya=Tt,It=ya&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ga=wt,Oa=R,$a=Et,ma=It,wa=Object,Rt=ma?function(r){return typeof r=="symbol"}:function(r){var e=ga("Symbol");return Oa(e)&&$a(e.prototype,wa(r))},Ea=String,Zr=function(r){try{return Ea(r)}catch(e){return"Object"}},Sa=R,Ta=Zr,Ia=TypeError,re=function(r){if(Sa(r))return r;throw Ia(Ta(r)+" is not a function")},Ra=re,_a=Xr,ee=function(r,e){var t=r[e];return _a(t)?void 0:Ra(t)},Er=G,Sr=R,Tr=q,Pa=TypeError,Aa=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 Pa("Can't convert object to primitive value")},_t={exports:{}},$e=I,ja=Object.defineProperty,La=function(r,e){try{ja($e,r,{value:e,configurable:!0,writable:!0})}catch(t){$e[r]=e}return e},xa=I,Ma=La,me="__core-js_shared__",Na=xa[me]||Ma(me,{}),Pt=Na,we=Pt;(_t.exports=function(r,e){return we[r]||(we[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=_t.exports,Ca=pt,Ga=Object,jt=function(r){return Ga(Ca(r))},Fa=N,Da=jt,ka=Fa({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return ka(Da(e),t)},Ua=N,Va=0,Ba=Math.random(),Ka=Ua(1 .toString),Lt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ka(++Va+Ba,36)},qa=I,Ya=At,Ee=x,za=Lt,Qa=Tt,Wa=It,U=qa.Symbol,Ir=Ya("wks"),Ha=Wa?U.for||U:U&&U.withoutSetter||za,L=function(r){return Ee(Ir,r)||(Ir[r]=Qa&&Ee(U,r)?U[r]:Ha("Symbol."+r)),Ir[r]},Xa=G,Se=q,Te=Rt,Ja=ee,Za=Aa,ro=L,eo=TypeError,to=ro("toPrimitive"),no=function(r,e){if(!Se(r)||Te(r))return r;var t=Ja(r,to),n;if(t){if(e===void 0&&(e="default"),n=Xa(t,r,e),!Se(n)||Te(n))return n;throw eo("Can't convert object to primitive value")}return e===void 0&&(e="number"),Za(r,e)},ao=no,oo=Rt,te=function(r){var e=ao(r,"string");return oo(e)?e:e+""},io=C,so=$t,co=mt,er=z,Ie=te,lo=TypeError,Rr=Object.defineProperty,uo=Object.getOwnPropertyDescriptor,_r="enumerable",Pr="configurable",Ar="writable";Y.f=io?co?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 a=uo(e,t);a&&a[Ar]&&(e[t]=n.value,n={configurable:Pr in n?n[Pr]:a[Pr],enumerable:_r in n?n[_r]:a[_r],writable:!1})}return Rr(e,t,n)}:Rr:function(e,t,n){if(er(e),t=Ie(t),er(n),so)try{return Rr(e,t,n)}catch(a){}if("get"in n||"set"in n)throw lo("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}},vo=C,fo=Y,ho=pr,X=vo?function(r,e,t){return fo.f(r,e,ho(1,t))}:function(r,e,t){return r[e]=t,r},po=At,bo=Lt,Re=po("keys"),ne=function(r){return Re[r]||(Re[r]=bo(r))},ae={},yo=Hn,xt=I,go=q,Oo=X,jr=x,Lr=Pt,$o=ne,mo=ae,_e="Object already initialized",Br=xt.TypeError,wo=xt.WeakMap,vr,W,fr,Eo=function(r){return fr(r)?W(r):vr(r,{})},So=function(r){return function(e){var t;if(!go(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(yo||Lr.state){var _=Lr.state||(Lr.state=new wo);_.get=_.get,_.has=_.has,_.set=_.set,vr=function(r,e){if(_.has(r))throw Br(_e);return e.facade=r,_.set(r,e),e},W=function(r){return _.get(r)||{}},fr=function(r){return _.has(r)}}else{var F=$o("state");mo[F]=!0,vr=function(r,e){if(jr(r,F))throw Br(_e);return e.facade=r,Oo(r,F,e),e},W=function(r){return jr(r,F)?r[F]:{}},fr=function(r){return jr(r,F)}}var To={set:vr,get:W,has:fr,enforce:Eo,getterFor:So},Io=hr,Mt=Function.prototype,Pe=Mt.apply,Ae=Mt.call,Ro=typeof Reflect=="object"&&Reflect.apply||(Io?Ae.bind(Pe):function(){return Ae.apply(Pe,arguments)}),_o=Hr,Po=N,Nt=function(r){if(_o(r)==="Function")return Po(r)},Ct={},Gt={},Ft={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,Ao=Dt&&!Ft.call({1:2},1);Gt.f=Ao?function(e){var t=Dt(this,e);return!!t&&t.enumerable}:Ft;var jo=C,Lo=G,xo=Gt,Mo=pr,No=H,Co=te,Go=x,Fo=$t,je=Object.getOwnPropertyDescriptor;Ct.f=jo?je:function(e,t){if(e=No(e),t=Co(t),Fo)try{return je(e,t)}catch(n){}if(Go(e,t))return Mo(!Lo(xo.f,e,t),e[t])};var Do=j,ko=R,Uo=/#|\.prototype\./,J=function(r,e){var t=Bo[Vo(r)];return t==qo?!0:t==Ko?!1:ko(e)?Do(e):!!e},Vo=J.normalize=function(r){return String(r).replace(Uo,".").toLowerCase()},Bo=J.data={},Ko=J.NATIVE="N",qo=J.POLYFILL="P",Yo=J,Le=Nt,zo=re,Qo=hr,Wo=Le(Le.bind),kt=function(r,e){return zo(r),e===void 0?r:Qo?Wo(r,e):function(){return r.apply(e,arguments)}},tr=I,Ho=Ro,Xo=Nt,Jo=R,Zo=Ct.f,ri=Yo,D=Jr,ei=kt,k=X,xe=x,ti=function(r){var e=function(t,n,a){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,a)}return Ho(r,this,arguments)};return e.prototype=r.prototype,e},Ut=function(r,e){var t=r.target,n=r.global,a=r.stat,o=r.proto,i=n?tr:a?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,l,c,u,f,d,O,w,$,y;for(f in e)l=ri(n?f:t+(a?".":"#")+f,r.forced),c=!l&&i&&xe(i,f),O=s[f],c&&(r.dontCallGetSet?(y=Zo(i,f),w=y&&y.value):w=i[f]),d=c&&w?w:e[f],!(c&&typeof O==typeof d)&&(r.bind&&c?$=ei(d,tr):r.wrap&&c?$=ti(d):o&&Jo(d)?$=Xo(d):$=d,(r.sham||d&&d.sham||O&&O.sham)&&k($,"sham",!0),k(s,f,$),o&&(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,Vt=Function.prototype,ai=Kr&&Object.getOwnPropertyDescriptor,oe=ni(Vt,"name"),oi=oe&&function(){}.name==="something",ii=oe&&(!Kr||Kr&&ai(Vt,"name").configurable),si={EXISTS:oe,PROPER:oi,CONFIGURABLE:ii},Bt={},ci=Math.ceil,li=Math.floor,ui=Math.trunc||function(e){var t=+e;return(t>0?li:ci)(t)},vi=ui,Kt=function(r){var e=+r;return e!==e||e===0?0:vi(e)},fi=Kt,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=Kt,yi=Math.min,gi=function(r){return r>0?yi(bi(r),9007199254740991):0},Oi=gi,qt=function(r){return Oi(r.length)},$i=H,mi=pi,wi=qt,Me=function(r){return function(e,t,n){var a=$i(e),o=wi(a),i=mi(n,o),s;if(r&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((r||i in a)&&a[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=ae,Ne=Si([].push),_i=function(r,e){var t=Ti(r),n=0,a=[],o;for(o in t)!xr(Ri,o)&&xr(t,o)&&Ne(a,o);for(;e.length>n;)xr(t,o=e[n++])&&(~Ii(a,o)||Ne(a,o));return a},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pi=_i,Ai=Yt,ji=Object.keys||function(e){return Pi(e,Ai)},Li=C,xi=mt,Mi=Y,Ni=z,Ci=H,Gi=ji;Bt.f=Li&&!xi?Object.defineProperties:function(e,t){Ni(e);for(var n=Ci(t),a=Gi(t),o=a.length,i=0,s;o>i;)Mi.f(e,s=a[i++],n[s]);return e};var Fi=wt,Di=Fi("document","documentElement"),ki=z,Ui=Bt,Ce=Yt,Vi=ae,Bi=Di,Ki=Ot,qi=ne,Ge=">",Fe="<",qr="prototype",Yr="script",zt=qi("IE_PROTO"),Mr=function(){},Qt=function(r){return Fe+Yr+Ge+r+Fe+"/"+Yr+Ge},De=function(r){r.write(Qt("")),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(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):Yi():De(nr);for(var r=Ce.length;r--;)delete sr[qr][Ce[r]];return sr()};Vi[zt]=!0;var Wt=Object.create||function(e,t){var n;return e!==null?(Mr[qr]=ki(e),n=new Mr,Mr[qr]=null,n[zt]=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=jt,Ji=ne,Zi=Qi,ke=Ji("IE_PROTO"),zr=Object,rs=zr.prototype,Ht=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,Xt=function(r,e,t,n){return n&&n.enumerable?r[e]=t:es(r,e,t),r},ts=j,ns=R,as=q,os=Wt,Ue=Ht,is=Xt,ss=L,Qr=ss("iterator"),Jt=!1,A,Nr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Nr=Ue(Ue(Cr)),Nr!==Object.prototype&&(A=Nr)):Jt=!0);var cs=!as(A)||ts(function(){var r={};return A[Qr].call(r)!==r});cs?A={}:A=os(A);ns(A[Qr])||is(A,Qr,function(){return this});var Zt={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Jt},ls=L,us=ls("toStringTag"),rn={};rn[us]="z";var ie=String(rn)==="[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,$s=gs?{}.toString:function(){return"[object "+Os(this)+"]"},ms=ie,ws=Y.f,Es=X,Ss=x,Ts=$s,Is=L,Ve=Is("toStringTag"),en=function(r,e,t,n){if(r){var a=t?r:r.prototype;Ss(a,Ve)||ws(a,Ve,{configurable:!0,value:e}),n&&!ms&&Es(a,"toString",Ts)}},Rs=Zt.IteratorPrototype,_s=Wt,Ps=pr,As=en,js=K,Ls=function(){return this},xs=function(r,e,t,n){var a=e+" Iterator";return r.prototype=_s(Rs,{next:Ps(+!n,t)}),As(r,a,!1,!0),js[a]=Ls,r},Ms=Ut,Ns=G,tn=si,Cs=xs,Gs=Ht,Fs=en,Be=Xt,Ds=L,Ke=K,nn=Zt,ks=tn.PROPER;tn.CONFIGURABLE;nn.IteratorPrototype;var ar=nn.BUGGY_SAFARI_ITERATORS,Gr=Ds("iterator"),qe="keys",or="values",Ye="entries",Us=function(){return this},Vs=function(r,e,t,n,a,o,i){Cs(t,e,n);var s=function(y){if(y===a&&f)return f;if(!ar&&y in c)return c[y];switch(y){case qe:return function(){return new t(this,y)};case or:return function(){return new t(this,y)};case Ye:return function(){return new t(this,y)}}return function(){return new t(this)}},v=e+" Iterator",l=!1,c=r.prototype,u=c[Gr]||c["@@iterator"]||a&&c[a],f=!ar&&u||s(a),d=e=="Array"&&c.entries||u,O,w,$;if(d&&(O=Gs(d.call(new r)),O!==Object.prototype&&O.next&&(Fs(O,v,!0,!0),Ke[v]=Us)),ks&&a==or&&u&&u.name!==or&&(l=!0,f=function(){return Ns(u,this)}),a)if(w={values:s(or),keys:o?f:s(qe),entries:s(Ye)},i)for($ in w)(ar||l||!($ in c))&&Be(c,$,w[$]);else Ms({target:e,proto:!0,forced:ar||l},w);return i&&c[Gr]!==f&&Be(c,Gr,f,{name:a}),Ke[e]=f,w},Bs=function(r,e){return{value:r,done:e}},Ks=H,ze=K,an=To;Y.f;var qs=Vs,ir=Bs,on="Array Iterator",Ys=an.set,zs=an.getterFor(on);qs(Array,"Array",function(r,e){Ys(this,{type:on,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"),sn=function(r){if(!rc(r))return Qe(r,nc)||Qe(r,"@@iterator")||ec[Zs(r)]},ac=G,oc=re,ic=z,sc=Zr,cc=sn,lc=TypeError,uc=function(r,e){var t=arguments.length<2?cc(r):e;if(oc(t))return ic(ac(t,r));throw lc(sc(r)+" is not iterable")},vc=G,We=z,fc=ee,dc=function(r,e,t){var n,a;We(r);try{if(n=fc(r,"return"),!n){if(e==="throw")throw t;return t}n=vc(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return We(n),t},hc=kt,pc=G,bc=z,yc=Zr,gc=Js,Oc=qt,He=Et,$c=uc,mc=sn,Xe=dc,wc=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,Ec=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=hc(e,n),l,c,u,f,d,O,w,$=function(g){return l&&Xe(l,"normal",g),new lr(!0,g)},y=function(g){return a?(bc(g),s?v(g[0],g[1],$):v(g[0],g[1])):s?v(g,$):v(g)};if(o)l=r.iterator;else if(i)l=r;else{if(c=mc(r),!c)throw wc(yc(r)+" is not iterable");if(gc(c)){for(u=0,f=Oc(r);f>u;u++)if(d=y(r[u]),d&&He(Je,d))return d;return new lr(!1)}l=$c(r,c)}for(O=o?r.next:l.next;!(w=pc(O,l)).done;){try{d=y(w.value)}catch(g){Xe(l,"throw",g)}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},_c=Ut,Pc=Ec,Ac=Rc;_c({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Pc(e,function(n,a){Ac(t,n,a)},{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,Gc=X,Ze=K,Fc=L,rt=Fc("toStringTag");for(var Fr in Mc){var et=Nc[Fr],Dr=et&&et.prototype;Dr&&Cc(Dr)!==rt&&Gc(Dr,rt,Fr),Ze[Fr]=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",Al=(r,e,t)=>ot(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 o=yield(yield jn(n.toString())).json();return qc(o,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{P as CurrentClientBrowser,S as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Wc as Logger,b as Observable,at as Subject,dr as Subscription,zc as VERSION,tt as VKNumericLanguage,dl as ValueSubject,m as VideoQuality,rl as abortable,Jc as addScript,vl as areQualitiesExact,V as assertNever,Hc as assertNonNullable,Xc as assertNullable,fl as assertQualityIsExact,$l as buffer,Qc as checkNever,hl as combine,ml as debounce,yn as fillWithDefault,El as filter,Sl as filterChanged,Ol as fromEvent,un as getCurrentBrowser,tl as getExponentialDelay,sl as getHighestQuality,yl as interval,al as isHigher,ol as isHigherOrEqual,el as isIOS,ct as isInvariantQuality,it as isLower,il as isLowerOrEqual,cn as isNonNullable,ln as isNullable,Al as loadVKLangPack,Tn as map,Il as mapTo,pl as merge,Q as noop,Zc as now,gl as observableFrom,Rl as once,_l as pairwise,nl as safeStorage,Pl as tap,wl as throttle,bl as timeout,cl as videoHeightToQuality,ul as videoQualityToHeight,ll as videoSizeToQuality};
|
|
6
|
+
const zc="1.0.29-beta.1";class de{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 V=e=>{throw new Error(`${e} is value of unexpected type`)},Qc=e=>{},Q=()=>{};class y{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let a;t?typeof t=="function"?a={next:t,error:Q}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:Q,error:Q};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new de().add(()=>{switch(o.next=Q,o.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class at extends y{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 de().add(()=>this.subscribers.delete(t))}}class Wc{constructor(){this.log$=new at,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(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function Hc(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function Xc(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ln(e){return typeof e!="undefined"&&e!==null}function un(e){return e==null}const Jc=(e,r,t)=>new Promise((n,a)=>{r.addEventListener("abort",()=>{s(),l.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",o),l.src=e,document.head.appendChild(l)});var be;const Zc=typeof((be=window.performance)===null||be===void 0?void 0:be.now)=="function"?()=>window.performance.now():()=>Date.now();function ot(e,r,t,n){function a(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,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?o(c.value):a(c.value).then(s,v)}l((n=n.apply(e,r||[])).next())})}const el=(e,r)=>(...t)=>ot(void 0,void 0,void 0,function*(){var n;const a=r(...t);let o=e.aborted,i;for(;!o&&!e.aborted;){const s=yield a.next(i);o=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});var _;(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"})(_||(_={}));var p;(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"})(p||(p={}));const it=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?_.Yandex:void 0,t=/chrome|crios/i.test(e)?_.Chrome:void 0,n=/chromium/i.test(e)?_.Chromium:void 0,a=/firefox|fxios/i.test(e)?_.Firefox:void 0,o=/webkit|safari|khtml/i.test(e)?_.Safari:void 0,i=/opr\//i.test(e)?_.Opera:void 0,s=/edg/i.test(e)?_.Edge:void 0,v=/android/i.test(e)?p.Android:void 0,l=/iphone/i.test(e)?p.iPhone:void 0,c=/ipad/i.test(e)?p.iPad:void 0,u=/ipod/i.test(e)?p.iPod:void 0,f=/mac/i.test(e)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?p.RestMobile:void 0;return{browser:r||a||i||s||t||n||o||_.Rest,device:v||l||c||u||d||f||p.Desktop}},rl=()=>[p.iPhone,p.iPad,p.iPod].includes(it().device),tl=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(it().device),nl=(e,{start:r=0,factor:t=2,max:n=1/0,min:a=r,random:o=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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,M;const ye=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(ye,"test"),localStorage.removeItem(ye),M=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(ye),M=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)M=h.RUNTIME;else throw r}else throw e}return M===h.RUNTIME&&(b=new Map),M},vn=()=>B()===h.LOCAL_STORAGE,fn=e=>{var r,t;const n=B();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:V(n)}},dn=(e,r)=>{const t=B();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:V(t)}},hn=e=>{var r;const t=B();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 V(t),!1}},pn=e=>{const r=B();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:V(r)}},bn=()=>{const e=B();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:V(e)}};var al=Object.freeze({__proto__:null,clear:bn,get:fn,has:hn,isPersistent:vn,remove:pn,set:dn}),m;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(m||(m={}));const S={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},ol=(e,r)=>S[e].height>S[r].height,il=(e,r)=>S[e].height>=S[r].height,st=(e,r)=>S[e].height<S[r].height,sl=(e,r)=>S[e].height<=S[r].height,cl=e=>e.sort((r,t)=>r===t?0:r===m.INVARIANT?1:t===m.INVARIANT?-1:st(r,t)?1:-1)[0],ct=Object.keys(S).sort((e,r)=>st(e,r)?-1:1),ll=(e,r=.02)=>[...ct].find(n=>S[n].height*(1+r)>=e),ul=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ct.find(a=>{const o=S[a];return o.width>=n&&o.height>=t})},vl=e=>S[e].height,lt=e=>e===m.INVARIANT,fl=e=>e.every(r=>!lt(r));function dl(e){if(lt(e))throw new Error("Expected exact quality")}const yn=(e,r)=>{const t={};for(const n of Object.keys(r)){const a=r[n],o=e[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=yn(o,a):t[n]=n in e?o:a}return t};class hl extends at{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 pl(e){return new y(r=>{const t={};let n=Object.keys(e).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&r.next(t)};return Object.entries(e).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new de)})}function bl(...e){return new y(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new de))}var yl=e=>new y(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),gl=e=>new y(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Ol=e=>new y(r=>{e.forEach(t=>r.next(t))}),$l=(e,r)=>new y(t=>{const n=a=>t.next(a);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function wl(e){return r=>new y(t=>r.subscribe(new gn(t,e)))}class gn{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 On={leading:!1,trailing:!0};function ml(e,r=On){return t=>new y(n=>t.subscribe(new $n(n,e,r)))}class $n{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ln(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 El(e,r=wn){return t=>new y(n=>t.subscribe(new mn(n,e,r)))}class mn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,un(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 Sl(e){return r=>new y(t=>r.subscribe(new En(t,e)))}class En{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 Tl(e=(r,t)=>r===t){return r=>new y(t=>r.subscribe(new Sn(t,e)))}const cr={};class Sn{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 Tn(e){return r=>new y(t=>r.subscribe(new In(t,e)))}let In=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 Rl(e){return Tn(()=>e)}function Pl(){return e=>new y(r=>{let t=!1,n=!1;const a=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function _l(){return e=>new y(r=>e.subscribe(new Rn(r)))}class Rn{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 Al(e){return r=>new y(t=>r.subscribe(new Pn(t,e)))}class Pn{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)}}var lr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(lr||(lr={}));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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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 ut 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 _n{constructor(){Object.defineProperty(this,"signal",{value:new ut,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(a){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(a){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(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 An(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=e;if(!vt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=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},o.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=o&&o.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,$)=>{c.addEventListener("abort",()=>$(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:o}}const We=vt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ft=We?An({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,jn=We?ft.fetch:window.fetch;We?ft.Request:window.Request;var ge=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=function(e){try{return!!e()}catch(r){return!0}},xn=j,he=!xn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),dt=he,ht=Function.prototype,ke=ht.call,Mn=dt&&ht.bind.bind(ke,ke),N=dt?Mn:function(e){return function(){return ke.apply(e,arguments)}},pt=N,Nn=pt({}.toString),Cn=pt("".slice),He=function(e){return Cn(Nn(e),8,-1)},Gn=N,Fn=j,Dn=He,Oe=Object,kn=Gn("".split),Un=Fn(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return Dn(e)=="String"?kn(e,""):Oe(e)}:Oe,Xe=function(e){return e==null},Vn=Xe,Bn=TypeError,bt=function(e){if(Vn(e))throw Bn("Can't call method on "+e);return e},Kn=Un,qn=bt,H=function(e){return Kn(qn(e))},K={},Z=function(e){return e&&e.Math==Math&&e},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof ge=="object"&&ge)||function(){return this}()||ge||Function("return this")(),Ue=typeof document=="object"&&document.all,Yn=typeof Ue=="undefined"&&Ue!==void 0,yt={all:Ue,IS_HTMLDDA:Yn},gt=yt,zn=gt.all,R=gt.IS_HTMLDDA?function(e){return typeof e=="function"||e===zn}:function(e){return typeof e=="function"},Qn=I,Wn=R,vr=Qn.WeakMap,Hn=Wn(vr)&&/native code/.test(String(vr)),fr=R,Ot=yt,Xn=Ot.all,q=Ot.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Xn}:function(e){return typeof e=="object"?e!==null:fr(e)},Jn=j,C=!Jn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Zn=I,dr=q,Ve=Zn.document,ea=dr(Ve)&&dr(Ve.createElement),$t=function(e){return ea?Ve.createElement(e):{}},ra=C,ta=j,na=$t,wt=!ra&&!ta(function(){return Object.defineProperty(na("div"),"a",{get:function(){return 7}}).a!=7}),aa=C,oa=j,mt=aa&&oa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ia=q,sa=String,ca=TypeError,z=function(e){if(ia(e))return e;throw ca(sa(e)+" is not an object")},la=he,ee=Function.prototype.call,G=la?ee.bind(ee):function(){return ee.apply(ee,arguments)},Je={},$e=Je,we=I,ua=R,hr=function(e){return ua(e)?e:void 0},Et=function(e,r){return arguments.length<2?hr($e[e])||hr(we[e]):$e[e]&&$e[e][r]||we[e]&&we[e][r]},va=N,St=va({}.isPrototypeOf),fa=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Tt=I,me=fa,pr=Tt.process,br=Tt.Deno,yr=pr&&pr.versions||br&&br.version,gr=yr&&yr.v8,T,ue;gr&&(T=gr.split("."),ue=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ue&&me&&(T=me.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=me.match(/Chrome\/(\d+)/),T&&(ue=+T[1])));var da=ue,Or=da,ha=j,pa=I,ba=pa.String,It=!!Object.getOwnPropertySymbols&&!ha(function(){var e=Symbol();return!ba(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),ya=It,Rt=ya&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ga=Et,Oa=R,$a=St,wa=Rt,ma=Object,Pt=wa?function(e){return typeof e=="symbol"}:function(e){var r=ga("Symbol");return Oa(r)&&$a(r.prototype,ma(e))},Ea=String,Ze=function(e){try{return Ea(e)}catch(r){return"Object"}},Sa=R,Ta=Ze,Ia=TypeError,er=function(e){if(Sa(e))return e;throw Ia(Ta(e)+" is not a function")},Ra=er,Pa=Xe,rr=function(e,r){var t=e[r];return Pa(t)?void 0:Ra(t)},Ee=G,Se=R,Te=q,_a=TypeError,Aa=function(e,r){var t,n;if(r==="string"&&Se(t=e.toString)&&!Te(n=Ee(t,e))||Se(t=e.valueOf)&&!Te(n=Ee(t,e))||r!=="string"&&Se(t=e.toString)&&!Te(n=Ee(t,e)))return n;throw _a("Can't convert object to primitive value")},_t={exports:{}},$r=I,ja=Object.defineProperty,La=function(e,r){try{ja($r,e,{value:r,configurable:!0,writable:!0})}catch(t){$r[e]=r}return r},xa=I,Ma=La,wr="__core-js_shared__",Na=xa[wr]||Ma(wr,{}),At=Na,mr=At;(_t.exports=function(e,r){return mr[e]||(mr[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 jt=_t.exports,Ca=bt,Ga=Object,Lt=function(e){return Ga(Ca(e))},Fa=N,Da=Lt,ka=Fa({}.hasOwnProperty),x=Object.hasOwn||function(r,t){return ka(Da(r),t)},Ua=N,Va=0,Ba=Math.random(),Ka=Ua(1 .toString),xt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ka(++Va+Ba,36)},qa=I,Ya=jt,Er=x,za=xt,Qa=It,Wa=Rt,U=qa.Symbol,Ie=Ya("wks"),Ha=Wa?U.for||U:U&&U.withoutSetter||za,L=function(e){return Er(Ie,e)||(Ie[e]=Qa&&Er(U,e)?U[e]:Ha("Symbol."+e)),Ie[e]},Xa=G,Sr=q,Tr=Pt,Ja=rr,Za=Aa,eo=L,ro=TypeError,to=eo("toPrimitive"),no=function(e,r){if(!Sr(e)||Tr(e))return e;var t=Ja(e,to),n;if(t){if(r===void 0&&(r="default"),n=Xa(t,e,r),!Sr(n)||Tr(n))return n;throw ro("Can't convert object to primitive value")}return r===void 0&&(r="number"),Za(e,r)},ao=no,oo=Pt,tr=function(e){var r=ao(e,"string");return oo(r)?r:r+""},io=C,so=wt,co=mt,re=z,Ir=tr,lo=TypeError,Re=Object.defineProperty,uo=Object.getOwnPropertyDescriptor,Pe="enumerable",_e="configurable",Ae="writable";Y.f=io?co?function(r,t,n){if(re(r),t=Ir(t),re(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ae in n&&!n[Ae]){var a=uo(r,t);a&&a[Ae]&&(r[t]=n.value,n={configurable:_e in n?n[_e]:a[_e],enumerable:Pe in n?n[Pe]:a[Pe],writable:!1})}return Re(r,t,n)}:Re:function(r,t,n){if(re(r),t=Ir(t),re(n),so)try{return Re(r,t,n)}catch(a){}if("get"in n||"set"in n)throw lo("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var pe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},vo=C,fo=Y,ho=pe,X=vo?function(e,r,t){return fo.f(e,r,ho(1,t))}:function(e,r,t){return e[r]=t,e},po=jt,bo=xt,Rr=po("keys"),nr=function(e){return Rr[e]||(Rr[e]=bo(e))},ar={},yo=Hn,Mt=I,go=q,Oo=X,je=x,Le=At,$o=nr,wo=ar,Pr="Object already initialized",Be=Mt.TypeError,mo=Mt.WeakMap,ve,W,fe,Eo=function(e){return fe(e)?W(e):ve(e,{})},So=function(e){return function(r){var t;if(!go(r)||(t=W(r)).type!==e)throw Be("Incompatible receiver, "+e+" required");return t}};if(yo||Le.state){var P=Le.state||(Le.state=new mo);P.get=P.get,P.has=P.has,P.set=P.set,ve=function(e,r){if(P.has(e))throw Be(Pr);return r.facade=e,P.set(e,r),r},W=function(e){return P.get(e)||{}},fe=function(e){return P.has(e)}}else{var F=$o("state");wo[F]=!0,ve=function(e,r){if(je(e,F))throw Be(Pr);return r.facade=e,Oo(e,F,r),r},W=function(e){return je(e,F)?e[F]:{}},fe=function(e){return je(e,F)}}var To={set:ve,get:W,has:fe,enforce:Eo,getterFor:So},Io=he,Nt=Function.prototype,_r=Nt.apply,Ar=Nt.call,Ro=typeof Reflect=="object"&&Reflect.apply||(Io?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),Po=He,_o=N,Ct=function(e){if(Po(e)==="Function")return _o(e)},Gt={},Ft={},Dt={}.propertyIsEnumerable,kt=Object.getOwnPropertyDescriptor,Ao=kt&&!Dt.call({1:2},1);Ft.f=Ao?function(r){var t=kt(this,r);return!!t&&t.enumerable}:Dt;var jo=C,Lo=G,xo=Ft,Mo=pe,No=H,Co=tr,Go=x,Fo=wt,jr=Object.getOwnPropertyDescriptor;Gt.f=jo?jr:function(r,t){if(r=No(r),t=Co(t),Fo)try{return jr(r,t)}catch(n){}if(Go(r,t))return Mo(!Lo(xo.f,r,t),r[t])};var Do=j,ko=R,Uo=/#|\.prototype\./,J=function(e,r){var t=Bo[Vo(e)];return t==qo?!0:t==Ko?!1:ko(r)?Do(r):!!r},Vo=J.normalize=function(e){return String(e).replace(Uo,".").toLowerCase()},Bo=J.data={},Ko=J.NATIVE="N",qo=J.POLYFILL="P",Yo=J,Lr=Ct,zo=er,Qo=he,Wo=Lr(Lr.bind),Ut=function(e,r){return zo(e),r===void 0?e:Qo?Wo(e,r):function(){return e.apply(r,arguments)}},te=I,Ho=Ro,Xo=Ct,Jo=R,Zo=Gt.f,ei=Yo,D=Je,ri=Ut,k=X,xr=x,ti=function(e){var r=function(t,n,a){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,a)}return Ho(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,a=e.stat,o=e.proto,i=n?te:a?te[t]:(te[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,l,c,u,f,d,$,E,w,g;for(f in r)l=ei(n?f:t+(a?".":"#")+f,e.forced),c=!l&&i&&xr(i,f),$=s[f],c&&(e.dontCallGetSet?(g=Zo(i,f),E=g&&g.value):E=i[f]),d=c&&E?E:r[f],!(c&&typeof $==typeof d)&&(e.bind&&c?w=ri(d,te):e.wrap&&c?w=ti(d):o&&Jo(d)?w=Xo(d):w=d,(e.sham||d&&d.sham||$&&$.sham)&&k(w,"sham",!0),k(s,f,w),o&&(u=t+"Prototype",xr(D,u)||k(D,u,{}),k(D[u],f,d),e.real&&v&&(l||!v[f])&&k(v,f,d)))},Ke=C,ni=x,Bt=Function.prototype,ai=Ke&&Object.getOwnPropertyDescriptor,or=ni(Bt,"name"),oi=or&&function(){}.name==="something",ii=or&&(!Ke||Ke&&ai(Bt,"name").configurable),si={EXISTS:or,PROPER:oi,CONFIGURABLE:ii},Kt={},ci=Math.ceil,li=Math.floor,ui=Math.trunc||function(r){var t=+r;return(t>0?li:ci)(t)},vi=ui,qt=function(e){var r=+e;return r!==r||r===0?0:vi(r)},fi=qt,di=Math.max,hi=Math.min,pi=function(e,r){var t=fi(e);return t<0?di(t+r,0):hi(t,r)},bi=qt,yi=Math.min,gi=function(e){return e>0?yi(bi(e),9007199254740991):0},Oi=gi,Yt=function(e){return Oi(e.length)},$i=H,wi=pi,mi=Yt,Mr=function(e){return function(r,t,n){var a=$i(r),o=mi(a),i=wi(n,o),s;if(e&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===t)return e||i||0;return!e&&-1}},Ei={includes:Mr(!0),indexOf:Mr(!1)},Si=N,xe=x,Ti=H,Ii=Ei.indexOf,Ri=ar,Nr=Si([].push),Pi=function(e,r){var t=Ti(e),n=0,a=[],o;for(o in t)!xe(Ri,o)&&xe(t,o)&&Nr(a,o);for(;r.length>n;)xe(t,o=r[n++])&&(~Ii(a,o)||Nr(a,o));return a},zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_i=Pi,Ai=zt,ji=Object.keys||function(r){return _i(r,Ai)},Li=C,xi=mt,Mi=Y,Ni=z,Ci=H,Gi=ji;Kt.f=Li&&!xi?Object.defineProperties:function(r,t){Ni(r);for(var n=Ci(t),a=Gi(t),o=a.length,i=0,s;o>i;)Mi.f(r,s=a[i++],n[s]);return r};var Fi=Et,Di=Fi("document","documentElement"),ki=z,Ui=Kt,Cr=zt,Vi=ar,Bi=Di,Ki=$t,qi=nr,Gr=">",Fr="<",qe="prototype",Ye="script",Qt=qi("IE_PROTO"),Me=function(){},Wt=function(e){return Fr+Ye+Gr+e+Fr+"/"+Ye+Gr},Dr=function(e){e.write(Wt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Yi=function(){var e=Ki("iframe"),r="java"+Ye+":",t;return e.style.display="none",Bi.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Wt("document.F=Object")),t.close(),t.F},ne,se=function(){try{ne=new ActiveXObject("htmlfile")}catch(r){}se=typeof document!="undefined"?document.domain&&ne?Dr(ne):Yi():Dr(ne);for(var e=Cr.length;e--;)delete se[qe][Cr[e]];return se()};Vi[Qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(Me[qe]=ki(r),n=new Me,Me[qe]=null,n[Qt]=r):n=se(),t===void 0?n:Ui.f(n,t)},zi=j,Qi=!zi(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Wi=x,Hi=R,Xi=Lt,Ji=nr,Zi=Qi,kr=Ji("IE_PROTO"),ze=Object,es=ze.prototype,Xt=Zi?ze.getPrototypeOf:function(e){var r=Xi(e);if(Wi(r,kr))return r[kr];var t=r.constructor;return Hi(t)&&r instanceof t?t.prototype:r instanceof ze?es:null},rs=X,Jt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:rs(e,r,t),e},ts=j,ns=R,as=q,os=Ht,Ur=Xt,is=Jt,ss=L,Qe=ss("iterator"),Zt=!1,A,Ne,Ce;[].keys&&(Ce=[].keys(),"next"in Ce?(Ne=Ur(Ur(Ce)),Ne!==Object.prototype&&(A=Ne)):Zt=!0);var cs=!as(A)||ts(function(){var e={};return A[Qe].call(e)!==e});cs?A={}:A=os(A);ns(A[Qe])||is(A,Qe,function(){return this});var en={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Zt},ls=L,us=ls("toStringTag"),rn={};rn[us]="z";var ir=String(rn)==="[object z]",vs=ir,fs=R,ce=He,ds=L,hs=ds("toStringTag"),ps=Object,bs=ce(function(){return arguments}())=="Arguments",ys=function(e,r){try{return e[r]}catch(t){}},sr=vs?ce:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=ys(r=ps(e),hs))=="string"?t:bs?ce(r):(n=ce(r))=="Object"&&fs(r.callee)?"Arguments":n},gs=ir,Os=sr,$s=gs?{}.toString:function(){return"[object "+Os(this)+"]"},ws=ir,ms=Y.f,Es=X,Ss=x,Ts=$s,Is=L,Vr=Is("toStringTag"),tn=function(e,r,t,n){if(e){var a=t?e:e.prototype;Ss(a,Vr)||ms(a,Vr,{configurable:!0,value:r}),n&&!ws&&Es(a,"toString",Ts)}},Rs=en.IteratorPrototype,Ps=Ht,_s=pe,As=tn,js=K,Ls=function(){return this},xs=function(e,r,t,n){var a=r+" Iterator";return e.prototype=Ps(Rs,{next:_s(+!n,t)}),As(e,a,!1,!0),js[a]=Ls,e},Ms=Vt,Ns=G,nn=si,Cs=xs,Gs=Xt,Fs=tn,Br=Jt,Ds=L,Kr=K,an=en,ks=nn.PROPER;nn.CONFIGURABLE;an.IteratorPrototype;var ae=an.BUGGY_SAFARI_ITERATORS,Ge=Ds("iterator"),qr="keys",oe="values",Yr="entries",Us=function(){return this},Vs=function(e,r,t,n,a,o,i){Cs(t,r,n);var s=function(g){if(g===a&&f)return f;if(!ae&&g in c)return c[g];switch(g){case qr:return function(){return new t(this,g)};case oe:return function(){return new t(this,g)};case Yr:return function(){return new t(this,g)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,u=c[Ge]||c["@@iterator"]||a&&c[a],f=!ae&&u||s(a),d=r=="Array"&&c.entries||u,$,E,w;if(d&&($=Gs(d.call(new e)),$!==Object.prototype&&$.next&&(Fs($,v,!0,!0),Kr[v]=Us)),ks&&a==oe&&u&&u.name!==oe&&(l=!0,f=function(){return Ns(u,this)}),a)if(E={values:s(oe),keys:o?f:s(qr),entries:s(Yr)},i)for(w in E)(ae||l||!(w in c))&&Br(c,w,E[w]);else Ms({target:r,proto:!0,forced:ae||l},E);return i&&c[Ge]!==f&&Br(c,Ge,f,{name:a}),Kr[r]=f,E},Bs=function(e,r){return{value:e,done:r}},Ks=H,zr=K,on=To;Y.f;var qs=Vs,ie=Bs,sn="Array Iterator",Ys=on.set,zs=on.getterFor(sn);qs(Array,"Array",function(e,r){Ys(this,{type:sn,target:Ks(e),index:0,kind:r})},function(){var e=zs(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ie(void 0,!0)):t=="keys"?ie(n,!1):t=="values"?ie(r[n],!1):ie([n,r[n]],!1)},"values");zr.Arguments=zr.Array;var Qs=L,Ws=K,Hs=Qs("iterator"),Xs=Array.prototype,Js=function(e){return e!==void 0&&(Ws.Array===e||Xs[Hs]===e)},Zs=sr,Qr=rr,ec=Xe,rc=K,tc=L,nc=tc("iterator"),cn=function(e){if(!ec(e))return Qr(e,nc)||Qr(e,"@@iterator")||rc[Zs(e)]},ac=G,oc=er,ic=z,sc=Ze,cc=cn,lc=TypeError,uc=function(e,r){var t=arguments.length<2?cc(e):r;if(oc(t))return ic(ac(t,e));throw lc(sc(e)+" is not iterable")},vc=G,Wr=z,fc=rr,dc=function(e,r,t){var n,a;Wr(e);try{if(n=fc(e,"return"),!n){if(r==="throw")throw t;return t}n=vc(n,e)}catch(o){a=!0,n=o}if(r==="throw")throw t;if(a)throw n;return Wr(n),t},hc=Ut,pc=G,bc=z,yc=Ze,gc=Js,Oc=Yt,Hr=St,$c=uc,wc=cn,Xr=dc,mc=TypeError,le=function(e,r){this.stopped=e,this.result=r},Jr=le.prototype,Ec=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=hc(r,n),l,c,u,f,d,$,E,w=function(O){return l&&Xr(l,"normal",O),new le(!0,O)},g=function(O){return a?(bc(O),s?v(O[0],O[1],w):v(O[0],O[1])):s?v(O,w):v(O)};if(o)l=e.iterator;else if(i)l=e;else{if(c=wc(e),!c)throw mc(yc(e)+" is not iterable");if(gc(c)){for(u=0,f=Oc(e);f>u;u++)if(d=g(e[u]),d&&Hr(Jr,d))return d;return new le(!1)}l=$c(e,c)}for($=o?e.next:l.next;!(E=pc($,l)).done;){try{d=g(E.value)}catch(O){Xr(l,"throw",O)}if(typeof d=="object"&&d&&Hr(Jr,d))return d}return new le(!1)},Sc=tr,Tc=Y,Ic=pe,Rc=function(e,r,t){var n=Sc(r);n in e?Tc.f(e,n,Ic(0,t)):e[n]=t},Pc=Vt,_c=Ec,Ac=Rc;Pc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return _c(r,function(n,a){Ac(t,n,a)},{AS_ENTRIES:!0}),t}});var jc=Je,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=sr,Gc=X,Zr=K,Fc=L,et=Fc("toStringTag");for(var Fe in Mc){var rt=Nc[Fe],De=rt&&rt.prototype;De&&Cc(De)!==et&&Gc(De,et,Fe),Zr[Fe]=Zr.Array}var Dc=Lc,kc=Dc,Uc=kc,Vc=Uc,Bc=Ln(Vc),tt;(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"})(tt||(tt={}));const Kc="vk.com",jl=(e,r,t)=>ot(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",r),e!==void 0&&n.searchParams.set("lang",e);const o=yield(yield jn(n.toString())).json();return qc(o,t)}),qc=(e,r)=>Bc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Yc(n)])),Yc=e=>Array.isArray(e)?e[0]:e;var nt;(function(e){e.RU="ru",e.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,lr as ErrorCategory,nt as InterfaceLanguage,Wc as Logger,y as Observable,at as Subject,de as Subscription,zc as VERSION,tt as VKNumericLanguage,hl as ValueSubject,m as VideoQuality,el as abortable,Jc as addScript,fl as areQualitiesExact,V as assertNever,Hc as assertNonNullable,Xc as assertNullable,dl as assertQualityIsExact,wl as buffer,Qc as checkNever,pl as combine,ml as debounce,yn as fillWithDefault,Sl as filter,Tl as filterChanged,$l as fromEvent,it as getCurrentBrowser,nl as getExponentialDelay,cl as getHighestQuality,gl as interval,ol as isHigher,il as isHigherOrEqual,rl as isIOS,lt as isInvariantQuality,st as isLower,sl as isLowerOrEqual,tl as isMacLike,ln as isNonNullable,un as isNullable,jl as loadVKLangPack,Tn as map,Rl as mapTo,bl as merge,Q as noop,Zc as now,Ol as observableFrom,Pl as once,_l as pairwise,al as safeStorage,Al as tap,El as throttle,yl as timeout,ll as videoHeightToQuality,vl as videoQualityToHeight,ul as videoSizeToQuality};
|
package/es2018.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.29-beta.1
|
|
3
|
+
* Wed, 06 Sep 2023 16:19:06 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-29/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const on="1.0.28";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 L=e=>{throw new Error(`${e} is value of unexpected type`)},sn=e=>{},G=()=>{};class b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let a;t?typeof t=="function"?a={next:t,error:G}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:G,error:G};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new Y().add(()=>{switch(o.next=G,o.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return L(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends b{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(a){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 rt(e){return typeof e!="undefined"&&e!==null}function tt(e){return e==null}const vn=(e,r,t)=>new Promise((n,a)=>{r.addEventListener("abort",()=>{s(),l.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",o),l.src=e,document.head.appendChild(l)});var de;const fn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now(),dn=(e,r)=>async(...t)=>{var n;const a=r(...t);let o=e.aborted,i;for(;!o&&!e.aborted;){const s=await a.next(i);o=(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.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const nt=()=>{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,a=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,o=/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=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||a||i||s||t||n||o||exports.CurrentClientBrowser.Rest,device:v||l||c||f||u||exports.CurrentClientDevice.Desktop}},hn=()=>[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(nt().device),bn=(e,{start:r=0,factor:t=2,max:n=1/0,min:a=r,random:o=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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 p,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&&(p=new Map),j},pn=()=>k()===h.LOCAL_STORAGE,yn=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 p==null?void 0:p.get(e);default:L(n)}},gn=(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(p==null?void 0:p.set(e,r));default:L(t)}},On=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=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return L(t),!1}},wn=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(p==null?void 0:p.delete(e));default:L(r)}},$n=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:L(e)}};var mn=Object.freeze({__proto__:null,clear:$n,get:yn,has:On,isPersistent:pn,remove:wn,set:gn});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 m={[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}},En=(e,r)=>m[e].height>m[r].height,Sn=(e,r)=>m[e].height>=m[r].height,Ye=(e,r)=>m[e].height<m[r].height,Tn=(e,r)=>m[e].height<=m[r].height,In=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ye(r,t)?1:-1)[0],at=Object.keys(m).sort((e,r)=>Ye(e,r)?-1:1),Rn=(e,r=.02)=>[...at].find(n=>m[n].height*(1+r)>=e),Pn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(a=>{const o=m[a];return o.width>=n&&o.height>=t})},_n=e=>m[e].height,He=e=>e===exports.VideoQuality.INVARIANT,An=e=>e.every(r=>!He(r));function jn(e){if(He(e))throw new Error("Expected exact quality")}const ot=(e,r)=>{const t={};for(const n of Object.keys(r)){const a=r[n],o=e[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=ot(o,a):t[n]=n in e?o:a}return t};class Ln 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 Cn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&r.next(t)};return Object.entries(e).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new Y)})}function xn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Nn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Mn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Dn=e=>new b(r=>{e.forEach(t=>r.next(t))}),Fn=(e,r)=>new b(t=>{const n=a=>t.next(a);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Gn(e){return r=>new b(t=>r.subscribe(new Vn(t,e)))}class Vn{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 kn={leading:!1,trailing:!0};function Bn(e,r=kn){return t=>new b(n=>t.subscribe(new Un(n,e,r)))}class Un{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,rt(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 Qn={leading:!0,trailing:!1};function Kn(e,r=Qn){return t=>new b(n=>t.subscribe(new qn(n,e,r)))}class qn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(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 Yn(e){return r=>new b(t=>r.subscribe(new Hn(t,e)))}class Hn{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 zn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Wn(t,e)))}const lr={};class Wn{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 it(e){return r=>new b(t=>r.subscribe(new Xn(t,e)))}let Xn=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 Jn(e){return it(()=>e)}function Zn(){return e=>new b(r=>{let t=!1,n=!1;const a=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function ea(){return e=>new b(r=>e.subscribe(new ra(r)))}class ra{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 ta(e){return r=>new b(t=>r.subscribe(new na(t,e)))}class na{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 cr{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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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 cr{constructor(){super(),this.listeners||cr.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 aa{constructor(){Object.defineProperty(this,"signal",{value:new st,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(a){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(a){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&&(aa.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 oa(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=e;if(!lt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=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},o.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=o&&o.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,O)=>{c.addEventListener("abort",()=>O(f),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([u,i(v,l)])}return i(v,l)},Request:o}}const ze=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ct=ze?oa({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ia=ze?ct.fetch:window.fetch;ze?ct.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function sa(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}},la=P,ve=!la(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ut=ve,vt=Function.prototype,De=vt.call,ca=ut&&vt.bind.bind(De,De),C=ut?ca:function(e){return function(){return De.apply(e,arguments)}},ft=C,ua=ft({}.toString),va=ft("".slice),We=function(e){return va(ua(e),8,-1)},fa=C,da=P,ha=We,pe=Object,ba=fa("".split),pa=da(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return ha(e)=="String"?ba(e,""):pe(e)}:pe,Xe=function(e){return e==null},ya=Xe,ga=TypeError,dt=function(e){if(ya(e))throw ga("Can't call method on "+e);return e},Oa=pa,wa=dt,H=function(e){return Oa(wa(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 be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,$a=typeof Fe=="undefined"&&Fe!==void 0,ht={all:Fe,IS_HTMLDDA:$a},bt=ht,ma=bt.all,T=bt.IS_HTMLDDA?function(e){return typeof e=="function"||e===ma}:function(e){return typeof e=="function"},Ea=S,Sa=T,ur=Ea.WeakMap,Ta=Sa(ur)&&/native code/.test(String(ur)),vr=T,pt=ht,Ia=pt.all,U=pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:vr(e)||e===Ia}:function(e){return typeof e=="object"?e!==null:vr(e)},Ra=P,x=!Ra(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Pa=S,fr=U,Ge=Pa.document,_a=fr(Ge)&&fr(Ge.createElement),yt=function(e){return _a?Ge.createElement(e):{}},Aa=x,ja=P,La=yt,gt=!Aa&&!ja(function(){return Object.defineProperty(La("div"),"a",{get:function(){return 7}}).a!=7}),Ca=x,xa=P,Ot=Ca&&xa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Na=U,Ma=String,Da=TypeError,K=function(e){if(Na(e))return e;throw Da(Ma(e)+" is not an object")},Fa=ve,J=Function.prototype.call,N=Fa?J.bind(J):function(){return J.apply(J,arguments)},Je={},ye=Je,ge=S,Ga=T,dr=function(e){return Ga(e)?e:void 0},wt=function(e,r){return arguments.length<2?dr(ye[e])||dr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Va=C,$t=Va({}.isPrototypeOf),ka=typeof navigator!="undefined"&&String(navigator.userAgent)||"",mt=S,Oe=ka,hr=mt.process,br=mt.Deno,pr=hr&&hr.versions||br&&br.version,yr=pr&&pr.v8,E,le;yr&&(E=yr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var Ba=le,gr=Ba,Ua=P,Qa=S,Ka=Qa.String,Et=!!Object.getOwnPropertySymbols&&!Ua(function(){var e=Symbol();return!Ka(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&gr&&gr<41}),qa=Et,St=qa&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ya=wt,Ha=T,za=$t,Wa=St,Xa=Object,Tt=Wa?function(e){return typeof e=="symbol"}:function(e){var r=Ya("Symbol");return Ha(r)&&za(r.prototype,Xa(e))},Ja=String,Ze=function(e){try{return Ja(e)}catch(r){return"Object"}},Za=T,eo=Ze,ro=TypeError,er=function(e){if(Za(e))return e;throw ro(eo(e)+" is not a function")},to=er,no=Xe,rr=function(e,r){var t=e[r];return no(t)?void 0:to(t)},we=N,$e=T,me=U,ao=TypeError,oo=function(e,r){var t,n;if(r==="string"&&$e(t=e.toString)&&!me(n=we(t,e))||$e(t=e.valueOf)&&!me(n=we(t,e))||r!=="string"&&$e(t=e.toString)&&!me(n=we(t,e)))return n;throw ao("Can't convert object to primitive value")},It={exports:{}},Or=S,io=Object.defineProperty,so=function(e,r){try{io(Or,e,{value:r,configurable:!0,writable:!0})}catch(t){Or[e]=r}return r},lo=S,co=so,wr="__core-js_shared__",uo=lo[wr]||co(wr,{}),Rt=uo,$r=Rt;(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 Pt=It.exports,vo=dt,fo=Object,_t=function(e){return fo(vo(e))},ho=C,bo=_t,po=ho({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return po(bo(r),t)},yo=C,go=0,Oo=Math.random(),wo=yo(1 .toString),At=function(e){return"Symbol("+(e===void 0?"":e)+")_"+wo(++go+Oo,36)},$o=S,mo=Pt,mr=A,Eo=At,So=Et,To=St,V=$o.Symbol,Ee=mo("wks"),Io=To?V.for||V:V&&V.withoutSetter||Eo,_=function(e){return mr(Ee,e)||(Ee[e]=So&&mr(V,e)?V[e]:Io("Symbol."+e)),Ee[e]},Ro=N,Er=U,Sr=Tt,Po=rr,_o=oo,Ao=_,jo=TypeError,Lo=Ao("toPrimitive"),Co=function(e,r){if(!Er(e)||Sr(e))return e;var t=Po(e,Lo),n;if(t){if(r===void 0&&(r="default"),n=Ro(t,e,r),!Er(n)||Sr(n))return n;throw jo("Can't convert object to primitive value")}return r===void 0&&(r="number"),_o(e,r)},xo=Co,No=Tt,tr=function(e){var r=xo(e,"string");return No(r)?r:r+""},Mo=x,Do=gt,Fo=Ot,Z=K,Tr=tr,Go=TypeError,Se=Object.defineProperty,Vo=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Re="writable";Q.f=Mo?Fo?function(r,t,n){if(Z(r),t=Tr(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Re in n&&!n[Re]){var a=Vo(r,t);a&&a[Re]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:a[Ie],enumerable:Te in n?n[Te]:a[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Tr(t),Z(n),Do)try{return Se(r,t,n)}catch(a){}if("get"in n||"set"in n)throw Go("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}},ko=x,Bo=Q,Uo=fe,z=ko?function(e,r,t){return Bo.f(e,r,Uo(1,t))}:function(e,r,t){return e[r]=t,e},Qo=Pt,Ko=At,Ir=Qo("keys"),nr=function(e){return Ir[e]||(Ir[e]=Ko(e))},ar={},qo=Ta,jt=S,Yo=U,Ho=z,Pe=A,_e=Rt,zo=nr,Wo=ar,Rr="Object already initialized",Ve=jt.TypeError,Xo=jt.WeakMap,ce,q,ue,Jo=function(e){return ue(e)?q(e):ce(e,{})},Zo=function(e){return function(r){var t;if(!Yo(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(qo||_e.state){var I=_e.state||(_e.state=new Xo);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=zo("state");Wo[M]=!0,ce=function(e,r){if(Pe(e,M))throw Ve(Rr);return r.facade=e,Ho(e,M,r),r},q=function(e){return Pe(e,M)?e[M]:{}},ue=function(e){return Pe(e,M)}}var ei={set:ce,get:q,has:ue,enforce:Jo,getterFor:Zo},ri=ve,Lt=Function.prototype,Pr=Lt.apply,_r=Lt.call,ti=typeof Reflect=="object"&&Reflect.apply||(ri?_r.bind(Pr):function(){return _r.apply(Pr,arguments)}),ni=We,ai=C,Ct=function(e){if(ni(e)==="Function")return ai(e)},xt={},Nt={},Mt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,oi=Dt&&!Mt.call({1:2},1);Nt.f=oi?function(r){var t=Dt(this,r);return!!t&&t.enumerable}:Mt;var ii=x,si=N,li=Nt,ci=fe,ui=H,vi=tr,fi=A,di=gt,Ar=Object.getOwnPropertyDescriptor;xt.f=ii?Ar:function(r,t){if(r=ui(r),t=vi(t),di)try{return Ar(r,t)}catch(n){}if(fi(r,t))return ci(!si(li.f,r,t),r[t])};var hi=P,bi=T,pi=/#|\.prototype\./,W=function(e,r){var t=gi[yi(e)];return t==wi?!0:t==Oi?!1:bi(r)?hi(r):!!r},yi=W.normalize=function(e){return String(e).replace(pi,".").toLowerCase()},gi=W.data={},Oi=W.NATIVE="N",wi=W.POLYFILL="P",$i=W,jr=Ct,mi=er,Ei=ve,Si=jr(jr.bind),Ft=function(e,r){return mi(e),r===void 0?e:Ei?Si(e,r):function(){return e.apply(r,arguments)}},ee=S,Ti=ti,Ii=Ct,Ri=T,Pi=xt.f,_i=$i,D=Je,Ai=Ft,F=z,Lr=A,ji=function(e){var r=function(t,n,a){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,a)}return Ti(e,this,arguments)};return r.prototype=e.prototype,r},Gt=function(e,r){var t=e.target,n=e.global,a=e.stat,o=e.proto,i=n?ee:a?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,f,u,d,O,$,w,y;for(u in r)l=_i(n?u:t+(a?".":"#")+u,e.forced),c=!l&&i&&Lr(i,u),O=s[u],c&&(e.dontCallGetSet?(y=Pi(i,u),$=y&&y.value):$=i[u]),d=c&&$?$:r[u],!(c&&typeof O==typeof d)&&(e.bind&&c?w=Ai(d,ee):e.wrap&&c?w=ji(d):o&&Ri(d)?w=Ii(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,u,w),o&&(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,Li=A,Vt=Function.prototype,Ci=ke&&Object.getOwnPropertyDescriptor,or=Li(Vt,"name"),xi=or&&function(){}.name==="something",Ni=or&&(!ke||ke&&Ci(Vt,"name").configurable),Mi={EXISTS:or,PROPER:xi,CONFIGURABLE:Ni},kt={},Di=Math.ceil,Fi=Math.floor,Gi=Math.trunc||function(r){var t=+r;return(t>0?Fi:Di)(t)},Vi=Gi,Bt=function(e){var r=+e;return r!==r||r===0?0:Vi(r)},ki=Bt,Bi=Math.max,Ui=Math.min,Qi=function(e,r){var t=ki(e);return t<0?Bi(t+r,0):Ui(t,r)},Ki=Bt,qi=Math.min,Yi=function(e){return e>0?qi(Ki(e),9007199254740991):0},Hi=Yi,Ut=function(e){return Hi(e.length)},zi=H,Wi=Qi,Xi=Ut,Cr=function(e){return function(r,t,n){var a=zi(r),o=Xi(a),i=Wi(n,o),s;if(e&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===t)return e||i||0;return!e&&-1}},Ji={includes:Cr(!0),indexOf:Cr(!1)},Zi=C,Ae=A,es=H,rs=Ji.indexOf,ts=ar,xr=Zi([].push),ns=function(e,r){var t=es(e),n=0,a=[],o;for(o in t)!Ae(ts,o)&&Ae(t,o)&&xr(a,o);for(;r.length>n;)Ae(t,o=r[n++])&&(~rs(a,o)||xr(a,o));return a},Qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],as=ns,os=Qt,is=Object.keys||function(r){return as(r,os)},ss=x,ls=Ot,cs=Q,us=K,vs=H,fs=is;kt.f=ss&&!ls?Object.defineProperties:function(r,t){us(r);for(var n=vs(t),a=fs(t),o=a.length,i=0,s;o>i;)cs.f(r,s=a[i++],n[s]);return r};var ds=wt,hs=ds("document","documentElement"),bs=K,ps=kt,Nr=Qt,ys=ar,gs=hs,Os=yt,ws=nr,Mr=">",Dr="<",Be="prototype",Ue="script",Kt=ws("IE_PROTO"),je=function(){},qt=function(e){return Dr+Ue+Mr+e+Dr+"/"+Ue+Mr},Fr=function(e){e.write(qt("")),e.close();var r=e.parentWindow.Object;return e=null,r},$s=function(){var e=Os("iframe"),r="java"+Ue+":",t;return e.style.display="none",gs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(qt("document.F=Object")),t.close(),t.F},re,oe=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}oe=typeof document!="undefined"?document.domain&&re?Fr(re):$s():Fr(re);for(var e=Nr.length;e--;)delete oe[Be][Nr[e]];return oe()};ys[Kt]=!0;var Yt=Object.create||function(r,t){var n;return r!==null?(je[Be]=bs(r),n=new je,je[Be]=null,n[Kt]=r):n=oe(),t===void 0?n:ps.f(n,t)},ms=P,Es=!ms(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ss=A,Ts=T,Is=_t,Rs=nr,Ps=Es,Gr=Rs("IE_PROTO"),Qe=Object,_s=Qe.prototype,Ht=Ps?Qe.getPrototypeOf:function(e){var r=Is(e);if(Ss(r,Gr))return r[Gr];var t=r.constructor;return Ts(t)&&r instanceof t?t.prototype:r instanceof Qe?_s:null},As=z,zt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:As(e,r,t),e},js=P,Ls=T,Cs=U,xs=Yt,Vr=Ht,Ns=zt,Ms=_,Ke=Ms("iterator"),Wt=!1,R,Le,Ce;[].keys&&(Ce=[].keys(),"next"in Ce?(Le=Vr(Vr(Ce)),Le!==Object.prototype&&(R=Le)):Wt=!0);var Ds=!Cs(R)||js(function(){var e={};return R[Ke].call(e)!==e});Ds?R={}:R=xs(R);Ls(R[Ke])||Ns(R,Ke,function(){return this});var Xt={IteratorPrototype:R,BUGGY_SAFARI_ITERATORS:Wt},Fs=_,Gs=Fs("toStringTag"),Jt={};Jt[Gs]="z";var ir=String(Jt)==="[object z]",Vs=ir,ks=T,ie=We,Bs=_,Us=Bs("toStringTag"),Qs=Object,Ks=ie(function(){return arguments}())=="Arguments",qs=function(e,r){try{return e[r]}catch(t){}},sr=Vs?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=qs(r=Qs(e),Us))=="string"?t:Ks?ie(r):(n=ie(r))=="Object"&&ks(r.callee)?"Arguments":n},Ys=ir,Hs=sr,zs=Ys?{}.toString:function(){return"[object "+Hs(this)+"]"},Ws=ir,Xs=Q.f,Js=z,Zs=A,el=zs,rl=_,kr=rl("toStringTag"),Zt=function(e,r,t,n){if(e){var a=t?e:e.prototype;Zs(a,kr)||Xs(a,kr,{configurable:!0,value:r}),n&&!Ws&&Js(a,"toString",el)}},tl=Xt.IteratorPrototype,nl=Yt,al=fe,ol=Zt,il=B,sl=function(){return this},ll=function(e,r,t,n){var a=r+" Iterator";return e.prototype=nl(tl,{next:al(+!n,t)}),ol(e,a,!1,!0),il[a]=sl,e},cl=Gt,ul=N,en=Mi,vl=ll,fl=Ht,dl=Zt,Br=zt,hl=_,Ur=B,rn=Xt,bl=en.PROPER;en.CONFIGURABLE;rn.IteratorPrototype;var te=rn.BUGGY_SAFARI_ITERATORS,xe=hl("iterator"),Qr="keys",ne="values",Kr="entries",pl=function(){return this},yl=function(e,r,t,n,a,o,i){vl(t,r,n);var s=function(y){if(y===a&&u)return u;if(!te&&y in c)return c[y];switch(y){case Qr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case Kr: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"]||a&&c[a],u=!te&&f||s(a),d=r=="Array"&&c.entries||f,O,$,w;if(d&&(O=fl(d.call(new e)),O!==Object.prototype&&O.next&&(dl(O,v,!0,!0),Ur[v]=pl)),bl&&a==ne&&f&&f.name!==ne&&(l=!0,u=function(){return ul(f,this)}),a)if($={values:s(ne),keys:o?u:s(Qr),entries:s(Kr)},i)for(w in $)(te||l||!(w in c))&&Br(c,w,$[w]);else cl({target:r,proto:!0,forced:te||l},$);return i&&c[xe]!==u&&Br(c,xe,u,{name:a}),Ur[r]=u,$},gl=function(e,r){return{value:e,done:r}},Ol=H,qr=B,tn=ei;Q.f;var wl=yl,ae=gl,nn="Array Iterator",$l=tn.set,ml=tn.getterFor(nn);wl(Array,"Array",function(e,r){$l(this,{type:nn,target:Ol(e),index:0,kind:r})},function(){var e=ml(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ae(void 0,!0)):t=="keys"?ae(n,!1):t=="values"?ae(r[n],!1):ae([n,r[n]],!1)},"values");qr.Arguments=qr.Array;var El=_,Sl=B,Tl=El("iterator"),Il=Array.prototype,Rl=function(e){return e!==void 0&&(Sl.Array===e||Il[Tl]===e)},Pl=sr,Yr=rr,_l=Xe,Al=B,jl=_,Ll=jl("iterator"),an=function(e){if(!_l(e))return Yr(e,Ll)||Yr(e,"@@iterator")||Al[Pl(e)]},Cl=N,xl=er,Nl=K,Ml=Ze,Dl=an,Fl=TypeError,Gl=function(e,r){var t=arguments.length<2?Dl(e):r;if(xl(t))return Nl(Cl(t,e));throw Fl(Ml(e)+" is not iterable")},Vl=N,Hr=K,kl=rr,Bl=function(e,r,t){var n,a;Hr(e);try{if(n=kl(e,"return"),!n){if(r==="throw")throw t;return t}n=Vl(n,e)}catch(o){a=!0,n=o}if(r==="throw")throw t;if(a)throw n;return Hr(n),t},Ul=Ft,Ql=N,Kl=K,ql=Ze,Yl=Rl,Hl=Ut,zr=$t,zl=Gl,Wl=an,Wr=Bl,Xl=TypeError,se=function(e,r){this.stopped=e,this.result=r},Xr=se.prototype,Jl=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Ul(r,n),l,c,f,u,d,O,$,w=function(g){return l&&Wr(l,"normal",g),new se(!0,g)},y=function(g){return a?(Kl(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(o)l=e.iterator;else if(i)l=e;else{if(c=Wl(e),!c)throw Xl(ql(e)+" is not iterable");if(Yl(c)){for(f=0,u=Hl(e);u>f;f++)if(d=y(e[f]),d&&zr(Xr,d))return d;return new se(!1)}l=zl(e,c)}for(O=o?e.next:l.next;!($=Ql(O,l)).done;){try{d=y($.value)}catch(g){Wr(l,"throw",g)}if(typeof d=="object"&&d&&zr(Xr,d))return d}return new se(!1)},Zl=tr,ec=Q,rc=fe,tc=function(e,r,t){var n=Zl(r);n in e?ec.f(e,n,rc(0,t)):e[n]=t},nc=Gt,ac=Jl,oc=tc;nc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return ac(r,function(n,a){oc(t,n,a)},{AS_ENTRIES:!0}),t}});var ic=Je,sc=ic.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},cc=lc,uc=S,vc=sr,fc=z,Jr=B,dc=_,Zr=dc("toStringTag");for(var Ne in cc){var et=uc[Ne],Me=et&&et.prototype;Me&&vc(Me)!==Zr&&fc(Me,Zr,Ne),Jr[Ne]=Jr.Array}var hc=sc,bc=hc,pc=bc,yc=pc,gc=sa(yc);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 Oc="vk.com",wc=async(e,r,t)=>{const n=new URL(`https://${Oc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const o=await(await ia(n.toString())).json();return $c(o,t)},$c=(e,r)=>gc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),mc(n)])),mc=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=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=on;exports.ValueSubject=Ln;exports.abortable=dn;exports.addScript=vn;exports.areQualitiesExact=An;exports.assertNever=L;exports.assertNonNullable=cn;exports.assertNullable=un;exports.assertQualityIsExact=jn;exports.buffer=Gn;exports.checkNever=sn;exports.combine=Cn;exports.debounce=Bn;exports.fillWithDefault=ot;exports.filter=Yn;exports.filterChanged=zn;exports.fromEvent=Fn;exports.getCurrentBrowser=nt;exports.getExponentialDelay=bn;exports.getHighestQuality=In;exports.interval=Mn;exports.isHigher=En;exports.isHigherOrEqual=Sn;exports.isIOS=hn;exports.isInvariantQuality=He;exports.isLower=Ye;exports.isLowerOrEqual=Tn;exports.isNonNullable=rt;exports.isNullable=tt;exports.loadVKLangPack=wc;exports.map=it;exports.mapTo=Jn;exports.merge=xn;exports.noop=G;exports.now=fn;exports.observableFrom=Dn;exports.once=Zn;exports.pairwise=ea;exports.safeStorage=mn;exports.tap=ta;exports.throttle=Kn;exports.timeout=Nn;exports.videoHeightToQuality=Rn;exports.videoQualityToHeight=_n;exports.videoSizeToQuality=Pn;
|
|
6
|
+
"use strict";const on="1.0.29-beta.1";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 b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let a;t?typeof t=="function"?a={next:t,error:G}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:G,error:G};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new Y().add(()=>{switch(o.next=G,o.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 b{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(a){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}const vn=(e,r,t)=>new Promise((n,a)=>{r.addEventListener("abort",()=>{s(),l.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",o),l.src=e,document.head.appendChild(l)});var de;const fn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now(),dn=(e,r)=>async(...t)=>{var n;const a=r(...t);let o=e.aborted,i;for(;!o&&!e.aborted;){const s=await a.next(i);o=(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,a=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,o=/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||a||i||s||t||n||o||exports.CurrentClientBrowser.Rest,device:v||l||c||f||d||u||exports.CurrentClientDevice.Desktop}},hn=()=>[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),bn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),pn=(e,{start:r=0,factor:t=2,max:n=1/0,min:a=r,random:o=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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 p,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&&(p=new Map),j},yn=()=>k()===h.LOCAL_STORAGE,gn=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 p==null?void 0:p.get(e);default:C(n)}},On=(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(p==null?void 0:p.set(e,r));default:C(t)}},wn=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=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},$n=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(p==null?void 0:p.delete(e));default:C(r)}},mn=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:C(e)}};var En=Object.freeze({__proto__:null,clear:mn,get:gn,has:wn,isPersistent:yn,remove:$n,set:On});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 m={[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}},Sn=(e,r)=>m[e].height>m[r].height,Tn=(e,r)=>m[e].height>=m[r].height,He=(e,r)=>m[e].height<m[r].height,In=(e,r)=>m[e].height<=m[r].height,Pn=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(m).sort((e,r)=>He(e,r)?-1:1),Rn=(e,r=.02)=>[...at].find(n=>m[n].height*(1+r)>=e),_n=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(a=>{const o=m[a];return o.width>=n&&o.height>=t})},An=e=>m[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,jn=e=>e.every(r=>!ze(r));function Cn(e){if(ze(e))throw new Error("Expected exact quality")}const ot=(e,r)=>{const t={};for(const n of Object.keys(r)){const a=r[n],o=e[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=ot(o,a):t[n]=n in e?o:a}return t};class Ln 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 xn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&r.next(t)};return Object.entries(e).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new Y)})}function Nn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Mn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Dn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Fn=e=>new b(r=>{e.forEach(t=>r.next(t))}),Gn=(e,r)=>new b(t=>{const n=a=>t.next(a);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Vn(e){return r=>new b(t=>r.subscribe(new kn(t,e)))}class kn{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 Bn={leading:!1,trailing:!0};function Un(e,r=Bn){return t=>new b(n=>t.subscribe(new Qn(n,e,r)))}class Qn{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 Kn={leading:!0,trailing:!1};function qn(e,r=Kn){return t=>new b(n=>t.subscribe(new Yn(n,e,r)))}class Yn{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 Hn(e){return r=>new b(t=>r.subscribe(new zn(t,e)))}class zn{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 Wn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Xn(t,e)))}const cr={};class Xn{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 b(t=>r.subscribe(new Jn(t,e)))}let Jn=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 Zn(e){return it(()=>e)}function ea(){return e=>new b(r=>{let t=!1,n=!1;const a=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function ra(){return e=>new b(r=>e.subscribe(new ta(r)))}class ta{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 na(e){return r=>new b(t=>r.subscribe(new aa(t,e)))}class aa{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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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 oa{constructor(){Object.defineProperty(this,"signal",{value:new st,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(a){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(a){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&&(oa.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 ia(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=e;if(!lt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=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},o.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=o&&o.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,O)=>{c.addEventListener("abort",()=>O(f),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([u,i(v,l)])}return i(v,l)},Request:o}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ct=We?ia({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,sa=We?ct.fetch:window.fetch;We?ct.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function la(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}},ca=R,ve=!ca(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ut=ve,vt=Function.prototype,De=vt.call,ua=ut&&vt.bind.bind(De,De),L=ut?ua:function(e){return function(){return De.apply(e,arguments)}},ft=L,va=ft({}.toString),fa=ft("".slice),Xe=function(e){return fa(va(e),8,-1)},da=L,ha=R,ba=Xe,pe=Object,pa=da("".split),ya=ha(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return ba(e)=="String"?pa(e,""):pe(e)}:pe,Je=function(e){return e==null},ga=Je,Oa=TypeError,dt=function(e){if(ga(e))throw Oa("Can't call method on "+e);return e},wa=ya,$a=dt,H=function(e){return wa($a(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 be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,ma=typeof Fe=="undefined"&&Fe!==void 0,ht={all:Fe,IS_HTMLDDA:ma},bt=ht,Ea=bt.all,T=bt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Ea}:function(e){return typeof e=="function"},Sa=S,Ta=T,vr=Sa.WeakMap,Ia=Ta(vr)&&/native code/.test(String(vr)),fr=T,pt=ht,Pa=pt.all,U=pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Pa}:function(e){return typeof e=="object"?e!==null:fr(e)},Ra=R,x=!Ra(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},_a=S,dr=U,Ge=_a.document,Aa=dr(Ge)&&dr(Ge.createElement),yt=function(e){return Aa?Ge.createElement(e):{}},ja=x,Ca=R,La=yt,gt=!ja&&!Ca(function(){return Object.defineProperty(La("div"),"a",{get:function(){return 7}}).a!=7}),xa=x,Na=R,Ot=xa&&Na(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Ma=U,Da=String,Fa=TypeError,K=function(e){if(Ma(e))return e;throw Fa(Da(e)+" is not an object")},Ga=ve,J=Function.prototype.call,N=Ga?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,Va=T,hr=function(e){return Va(e)?e:void 0},wt=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},ka=L,$t=ka({}.isPrototypeOf),Ba=typeof navigator!="undefined"&&String(navigator.userAgent)||"",mt=S,Oe=Ba,br=mt.process,pr=mt.Deno,yr=br&&br.versions||pr&&pr.version,gr=yr&&yr.v8,E,le;gr&&(E=gr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var Ua=le,Or=Ua,Qa=R,Ka=S,qa=Ka.String,Et=!!Object.getOwnPropertySymbols&&!Qa(function(){var e=Symbol();return!qa(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),Ya=Et,St=Ya&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ha=wt,za=T,Wa=$t,Xa=St,Ja=Object,Tt=Xa?function(e){return typeof e=="symbol"}:function(e){var r=Ha("Symbol");return za(r)&&Wa(r.prototype,Ja(e))},Za=String,er=function(e){try{return Za(e)}catch(r){return"Object"}},eo=T,ro=er,to=TypeError,rr=function(e){if(eo(e))return e;throw to(ro(e)+" is not a function")},no=rr,ao=Je,tr=function(e,r){var t=e[r];return ao(t)?void 0:no(t)},we=N,$e=T,me=U,oo=TypeError,io=function(e,r){var t,n;if(r==="string"&&$e(t=e.toString)&&!me(n=we(t,e))||$e(t=e.valueOf)&&!me(n=we(t,e))||r!=="string"&&$e(t=e.toString)&&!me(n=we(t,e)))return n;throw oo("Can't convert object to primitive value")},It={exports:{}},wr=S,so=Object.defineProperty,lo=function(e,r){try{so(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},co=S,uo=lo,$r="__core-js_shared__",vo=co[$r]||uo($r,{}),Pt=vo,mr=Pt;(It.exports=function(e,r){return mr[e]||(mr[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,fo=dt,ho=Object,_t=function(e){return ho(fo(e))},bo=L,po=_t,yo=bo({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return yo(po(r),t)},go=L,Oo=0,wo=Math.random(),$o=go(1 .toString),At=function(e){return"Symbol("+(e===void 0?"":e)+")_"+$o(++Oo+wo,36)},mo=S,Eo=Rt,Er=A,So=At,To=Et,Io=St,V=mo.Symbol,Ee=Eo("wks"),Po=Io?V.for||V:V&&V.withoutSetter||So,_=function(e){return Er(Ee,e)||(Ee[e]=To&&Er(V,e)?V[e]:Po("Symbol."+e)),Ee[e]},Ro=N,Sr=U,Tr=Tt,_o=tr,Ao=io,jo=_,Co=TypeError,Lo=jo("toPrimitive"),xo=function(e,r){if(!Sr(e)||Tr(e))return e;var t=_o(e,Lo),n;if(t){if(r===void 0&&(r="default"),n=Ro(t,e,r),!Sr(n)||Tr(n))return n;throw Co("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ao(e,r)},No=xo,Mo=Tt,nr=function(e){var r=No(e,"string");return Mo(r)?r:r+""},Do=x,Fo=gt,Go=Ot,Z=K,Ir=nr,Vo=TypeError,Se=Object.defineProperty,ko=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Pe="writable";Q.f=Do?Go?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 a=ko(r,t);a&&a[Pe]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:a[Ie],enumerable:Te in n?n[Te]:a[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Fo)try{return Se(r,t,n)}catch(a){}if("get"in n||"set"in n)throw Vo("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}},Bo=x,Uo=Q,Qo=fe,z=Bo?function(e,r,t){return Uo.f(e,r,Qo(1,t))}:function(e,r,t){return e[r]=t,e},Ko=Rt,qo=At,Pr=Ko("keys"),ar=function(e){return Pr[e]||(Pr[e]=qo(e))},or={},Yo=Ia,jt=S,Ho=U,zo=z,Re=A,_e=Pt,Wo=ar,Xo=or,Rr="Object already initialized",Ve=jt.TypeError,Jo=jt.WeakMap,ce,q,ue,Zo=function(e){return ue(e)?q(e):ce(e,{})},ei=function(e){return function(r){var t;if(!Ho(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Yo||_e.state){var I=_e.state||(_e.state=new Jo);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=Wo("state");Xo[M]=!0,ce=function(e,r){if(Re(e,M))throw Ve(Rr);return r.facade=e,zo(e,M,r),r},q=function(e){return Re(e,M)?e[M]:{}},ue=function(e){return Re(e,M)}}var ri={set:ce,get:q,has:ue,enforce:Zo,getterFor:ei},ti=ve,Ct=Function.prototype,_r=Ct.apply,Ar=Ct.call,ni=typeof Reflect=="object"&&Reflect.apply||(ti?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),ai=Xe,oi=L,Lt=function(e){if(ai(e)==="Function")return oi(e)},xt={},Nt={},Mt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,ii=Dt&&!Mt.call({1:2},1);Nt.f=ii?function(r){var t=Dt(this,r);return!!t&&t.enumerable}:Mt;var si=x,li=N,ci=Nt,ui=fe,vi=H,fi=nr,di=A,hi=gt,jr=Object.getOwnPropertyDescriptor;xt.f=si?jr:function(r,t){if(r=vi(r),t=fi(t),hi)try{return jr(r,t)}catch(n){}if(di(r,t))return ui(!li(ci.f,r,t),r[t])};var bi=R,pi=T,yi=/#|\.prototype\./,W=function(e,r){var t=Oi[gi(e)];return t==$i?!0:t==wi?!1:pi(r)?bi(r):!!r},gi=W.normalize=function(e){return String(e).replace(yi,".").toLowerCase()},Oi=W.data={},wi=W.NATIVE="N",$i=W.POLYFILL="P",mi=W,Cr=Lt,Ei=rr,Si=ve,Ti=Cr(Cr.bind),Ft=function(e,r){return Ei(e),r===void 0?e:Si?Ti(e,r):function(){return e.apply(r,arguments)}},ee=S,Ii=ni,Pi=Lt,Ri=T,_i=xt.f,Ai=mi,D=Ze,ji=Ft,F=z,Lr=A,Ci=function(e){var r=function(t,n,a){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,a)}return Ii(e,this,arguments)};return r.prototype=e.prototype,r},Gt=function(e,r){var t=e.target,n=e.global,a=e.stat,o=e.proto,i=n?ee:a?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,f,u,d,O,$,w,y;for(u in r)l=Ai(n?u:t+(a?".":"#")+u,e.forced),c=!l&&i&&Lr(i,u),O=s[u],c&&(e.dontCallGetSet?(y=_i(i,u),$=y&&y.value):$=i[u]),d=c&&$?$:r[u],!(c&&typeof O==typeof d)&&(e.bind&&c?w=ji(d,ee):e.wrap&&c?w=Ci(d):o&&Ri(d)?w=Pi(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,u,w),o&&(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,Li=A,Vt=Function.prototype,xi=ke&&Object.getOwnPropertyDescriptor,ir=Li(Vt,"name"),Ni=ir&&function(){}.name==="something",Mi=ir&&(!ke||ke&&xi(Vt,"name").configurable),Di={EXISTS:ir,PROPER:Ni,CONFIGURABLE:Mi},kt={},Fi=Math.ceil,Gi=Math.floor,Vi=Math.trunc||function(r){var t=+r;return(t>0?Gi:Fi)(t)},ki=Vi,Bt=function(e){var r=+e;return r!==r||r===0?0:ki(r)},Bi=Bt,Ui=Math.max,Qi=Math.min,Ki=function(e,r){var t=Bi(e);return t<0?Ui(t+r,0):Qi(t,r)},qi=Bt,Yi=Math.min,Hi=function(e){return e>0?Yi(qi(e),9007199254740991):0},zi=Hi,Ut=function(e){return zi(e.length)},Wi=H,Xi=Ki,Ji=Ut,xr=function(e){return function(r,t,n){var a=Wi(r),o=Ji(a),i=Xi(n,o),s;if(e&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===t)return e||i||0;return!e&&-1}},Zi={includes:xr(!0),indexOf:xr(!1)},es=L,Ae=A,rs=H,ts=Zi.indexOf,ns=or,Nr=es([].push),as=function(e,r){var t=rs(e),n=0,a=[],o;for(o in t)!Ae(ns,o)&&Ae(t,o)&&Nr(a,o);for(;r.length>n;)Ae(t,o=r[n++])&&(~ts(a,o)||Nr(a,o));return a},Qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],os=as,is=Qt,ss=Object.keys||function(r){return os(r,is)},ls=x,cs=Ot,us=Q,vs=K,fs=H,ds=ss;kt.f=ls&&!cs?Object.defineProperties:function(r,t){vs(r);for(var n=fs(t),a=ds(t),o=a.length,i=0,s;o>i;)us.f(r,s=a[i++],n[s]);return r};var hs=wt,bs=hs("document","documentElement"),ps=K,ys=kt,Mr=Qt,gs=or,Os=bs,ws=yt,$s=ar,Dr=">",Fr="<",Be="prototype",Ue="script",Kt=$s("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},ms=function(){var e=ws("iframe"),r="java"+Ue+":",t;return e.style.display="none",Os.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(qt("document.F=Object")),t.close(),t.F},re,oe=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}oe=typeof document!="undefined"?document.domain&&re?Gr(re):ms():Gr(re);for(var e=Mr.length;e--;)delete oe[Be][Mr[e]];return oe()};gs[Kt]=!0;var Yt=Object.create||function(r,t){var n;return r!==null?(je[Be]=ps(r),n=new je,je[Be]=null,n[Kt]=r):n=oe(),t===void 0?n:ys.f(n,t)},Es=R,Ss=!Es(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ts=A,Is=T,Ps=_t,Rs=ar,_s=Ss,Vr=Rs("IE_PROTO"),Qe=Object,As=Qe.prototype,Ht=_s?Qe.getPrototypeOf:function(e){var r=Ps(e);if(Ts(r,Vr))return r[Vr];var t=r.constructor;return Is(t)&&r instanceof t?t.prototype:r instanceof Qe?As:null},js=z,zt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:js(e,r,t),e},Cs=R,Ls=T,xs=U,Ns=Yt,kr=Ht,Ms=zt,Ds=_,Ke=Ds("iterator"),Wt=!1,P,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(P=Ce)):Wt=!0);var Fs=!xs(P)||Cs(function(){var e={};return P[Ke].call(e)!==e});Fs?P={}:P=Ns(P);Ls(P[Ke])||Ms(P,Ke,function(){return this});var Xt={IteratorPrototype:P,BUGGY_SAFARI_ITERATORS:Wt},Gs=_,Vs=Gs("toStringTag"),Jt={};Jt[Vs]="z";var sr=String(Jt)==="[object z]",ks=sr,Bs=T,ie=Xe,Us=_,Qs=Us("toStringTag"),Ks=Object,qs=ie(function(){return arguments}())=="Arguments",Ys=function(e,r){try{return e[r]}catch(t){}},lr=ks?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Ys(r=Ks(e),Qs))=="string"?t:qs?ie(r):(n=ie(r))=="Object"&&Bs(r.callee)?"Arguments":n},Hs=sr,zs=lr,Ws=Hs?{}.toString:function(){return"[object "+zs(this)+"]"},Xs=sr,Js=Q.f,Zs=z,el=A,rl=Ws,tl=_,Br=tl("toStringTag"),Zt=function(e,r,t,n){if(e){var a=t?e:e.prototype;el(a,Br)||Js(a,Br,{configurable:!0,value:r}),n&&!Xs&&Zs(a,"toString",rl)}},nl=Xt.IteratorPrototype,al=Yt,ol=fe,il=Zt,sl=B,ll=function(){return this},cl=function(e,r,t,n){var a=r+" Iterator";return e.prototype=al(nl,{next:ol(+!n,t)}),il(e,a,!1,!0),sl[a]=ll,e},ul=Gt,vl=N,en=Di,fl=cl,dl=Ht,hl=Zt,Ur=zt,bl=_,Qr=B,rn=Xt,pl=en.PROPER;en.CONFIGURABLE;rn.IteratorPrototype;var te=rn.BUGGY_SAFARI_ITERATORS,xe=bl("iterator"),Kr="keys",ne="values",qr="entries",yl=function(){return this},gl=function(e,r,t,n,a,o,i){fl(t,r,n);var s=function(y){if(y===a&&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"]||a&&c[a],u=!te&&f||s(a),d=r=="Array"&&c.entries||f,O,$,w;if(d&&(O=dl(d.call(new e)),O!==Object.prototype&&O.next&&(hl(O,v,!0,!0),Qr[v]=yl)),pl&&a==ne&&f&&f.name!==ne&&(l=!0,u=function(){return vl(f,this)}),a)if($={values:s(ne),keys:o?u:s(Kr),entries:s(qr)},i)for(w in $)(te||l||!(w in c))&&Ur(c,w,$[w]);else ul({target:r,proto:!0,forced:te||l},$);return i&&c[xe]!==u&&Ur(c,xe,u,{name:a}),Qr[r]=u,$},Ol=function(e,r){return{value:e,done:r}},wl=H,Yr=B,tn=ri;Q.f;var $l=gl,ae=Ol,nn="Array Iterator",ml=tn.set,El=tn.getterFor(nn);$l(Array,"Array",function(e,r){ml(this,{type:nn,target:wl(e),index:0,kind:r})},function(){var e=El(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ae(void 0,!0)):t=="keys"?ae(n,!1):t=="values"?ae(r[n],!1):ae([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Sl=_,Tl=B,Il=Sl("iterator"),Pl=Array.prototype,Rl=function(e){return e!==void 0&&(Tl.Array===e||Pl[Il]===e)},_l=lr,Hr=tr,Al=Je,jl=B,Cl=_,Ll=Cl("iterator"),an=function(e){if(!Al(e))return Hr(e,Ll)||Hr(e,"@@iterator")||jl[_l(e)]},xl=N,Nl=rr,Ml=K,Dl=er,Fl=an,Gl=TypeError,Vl=function(e,r){var t=arguments.length<2?Fl(e):r;if(Nl(t))return Ml(xl(t,e));throw Gl(Dl(e)+" is not iterable")},kl=N,zr=K,Bl=tr,Ul=function(e,r,t){var n,a;zr(e);try{if(n=Bl(e,"return"),!n){if(r==="throw")throw t;return t}n=kl(n,e)}catch(o){a=!0,n=o}if(r==="throw")throw t;if(a)throw n;return zr(n),t},Ql=Ft,Kl=N,ql=K,Yl=er,Hl=Rl,zl=Ut,Wr=$t,Wl=Vl,Xl=an,Xr=Ul,Jl=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,Zl=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Ql(r,n),l,c,f,u,d,O,$,w=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return a?(ql(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(o)l=e.iterator;else if(i)l=e;else{if(c=Xl(e),!c)throw Jl(Yl(e)+" is not iterable");if(Hl(c)){for(f=0,u=zl(e);u>f;f++)if(d=y(e[f]),d&&Wr(Jr,d))return d;return new se(!1)}l=Wl(e,c)}for(O=o?e.next:l.next;!($=Kl(O,l)).done;){try{d=y($.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},ec=nr,rc=Q,tc=fe,nc=function(e,r,t){var n=ec(r);n in e?rc.f(e,n,tc(0,t)):e[n]=t},ac=Gt,oc=Zl,ic=nc;ac({target:"Object",stat:!0},{fromEntries:function(r){var t={};return oc(r,function(n,a){ic(t,n,a)},{AS_ENTRIES:!0}),t}});var sc=Ze,lc=sc.Object.fromEntries,cc={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},uc=cc,vc=S,fc=lr,dc=z,Zr=B,hc=_,et=hc("toStringTag");for(var Ne in uc){var rt=vc[Ne],Me=rt&&rt.prototype;Me&&fc(Me)!==et&&dc(Me,et,Ne),Zr[Ne]=Zr.Array}var bc=lc,pc=bc,yc=pc,gc=yc,Oc=la(gc);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 wc="vk.com",$c=async(e,r,t)=>{const n=new URL(`https://${wc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const o=await(await sa(n.toString())).json();return mc(o,t)},mc=(e,r)=>Oc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Ec(n)])),Ec=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=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=on;exports.ValueSubject=Ln;exports.abortable=dn;exports.addScript=vn;exports.areQualitiesExact=jn;exports.assertNever=C;exports.assertNonNullable=cn;exports.assertNullable=un;exports.assertQualityIsExact=Cn;exports.buffer=Vn;exports.checkNever=sn;exports.combine=xn;exports.debounce=Un;exports.fillWithDefault=ot;exports.filter=Hn;exports.filterChanged=Wn;exports.fromEvent=Gn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=pn;exports.getHighestQuality=Pn;exports.interval=Dn;exports.isHigher=Sn;exports.isHigherOrEqual=Tn;exports.isIOS=hn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=In;exports.isMacLike=bn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=$c;exports.map=it;exports.mapTo=Zn;exports.merge=Nn;exports.noop=G;exports.now=fn;exports.observableFrom=Fn;exports.once=ea;exports.pairwise=ra;exports.safeStorage=En;exports.tap=na;exports.throttle=qn;exports.timeout=Mn;exports.videoHeightToQuality=Rn;exports.videoQualityToHeight=An;exports.videoSizeToQuality=_n;
|
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.29-beta.1
|
|
3
|
+
* Wed, 06 Sep 2023 16:19:06 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-29/doc/
|
|
5
5
|
*/
|
|
6
|
-
const Yc="1.0.28";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 b{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let a;t?typeof t=="function"?a={next:t,error:Q}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:Q,error:Q};const o=typeof e=="function"?{next:s=>{try{e(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new dr().add(()=>{switch(o.next=Q,o.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 at extends b{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 at,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(a){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 sn(r){return typeof r!="undefined"&&r!==null}function cn(r){return r==null}const Xc=(r,e,t)=>new Promise((n,a)=>{e.addEventListener("abort",()=>{s(),c.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",o),c.src=r,document.head.appendChild(c)});var br;const Jc=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now(),Zc=(r,e)=>async(...t)=>{var n;const a=e(...t);let o=r.aborted,i;for(;!o&&!r.aborted;){const s=await a.next(i);o=(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 S;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Desktop="Desktop"})(S||(S={}));const ln=()=>{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,a=/firefox|fxios/i.test(r)?_.Firefox:void 0,o=/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)?S.Android:void 0,c=/iphone/i.test(r)?S.iPhone:void 0,l=/ipad/i.test(r)?S.iPad:void 0,f=/ipod/i.test(r)?S.iPod:void 0,u=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?S.RestMobile:void 0;return{browser:e||a||i||s||t||n||o||_.Rest,device:v||c||l||f||u||S.Desktop}},rl=()=>[S.iPhone,S.iPad,S.iPod].includes(ln().device),el=(r,{start:e=0,factor:t=2,max:n=1/0,min:a=e,random:o=0}={})=>{let i=e;return i*=t**r,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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 p,N;const yr=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(N!==void 0)return N;try{localStorage.setItem(yr,"test"),localStorage.removeItem(yr),N=h.LOCAL_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)try{sessionStorage.getItem(yr),N=h.SESSION_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)N=h.RUNTIME;else throw e}else throw r}return N===h.RUNTIME&&(p=new Map),N},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 p==null?void 0:p.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(p==null?void 0:p.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=p==null?void 0:p.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(p==null?void 0:p.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 p==null?void 0:p.clear();default:V(r)}};var tl=Object.freeze({__proto__:null,clear:pn,get:vn,has:dn,isPersistent:un,remove:hn,set:fn}),m;(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"})(m||(m={}));const E={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},nl=(r,e)=>E[r].height>E[e].height,al=(r,e)=>E[r].height>=E[e].height,ot=(r,e)=>E[r].height<E[e].height,ol=(r,e)=>E[r].height<=E[e].height,il=r=>r.sort((e,t)=>e===t?0:e===m.INVARIANT?1:t===m.INVARIANT?-1:ot(e,t)?1:-1)[0],it=Object.keys(E).sort((r,e)=>ot(r,e)?-1:1),sl=(r,e=.02)=>[...it].find(n=>E[n].height*(1+e)>=r),cl=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return it.find(a=>{const o=E[a];return o.width>=n&&o.height>=t})},ll=r=>E[r].height,st=r=>r===m.INVARIANT,ul=r=>r.every(e=>!st(e));function vl(r){if(st(r))throw new Error("Expected exact quality")}const bn=(r,e)=>{const t={};for(const n of Object.keys(e)){const a=e[n],o=r[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=bn(o,a):t[n]=n in r?o:a}return t};class fl extends at{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 dl(r){return new b(e=>{const t={};let n=Object.keys(r).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&e.next(t)};return Object.entries(r).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new dr)})}function hl(...r){return new b(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var pl=r=>new b(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),bl=r=>new b(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),yl=r=>new b(e=>{r.forEach(t=>e.next(t))}),gl=(r,e)=>new b(t=>{const n=a=>t.next(a);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function Ol(r){return e=>new b(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 $l(r,e=gn){return t=>new b(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,sn(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 $n={leading:!0,trailing:!1};function ml(r,e=$n){return t=>new b(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,cn(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 wl(r){return e=>new b(t=>e.subscribe(new wn(t,r)))}class wn{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 El(r=(e,t)=>e===t){return e=>new b(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 b(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 Tl(r){return Sn(()=>r)}function Il(){return r=>new b(e=>{let t=!1,n=!1;const a=r.subscribe(o=>{t||(t=!0,e.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function Rl(){return r=>new b(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 Pl(r){return e=>new b(t=>e.subscribe(new Rn(t,r)))}class Rn{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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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 ct 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 Pn{constructor(){Object.defineProperty(this,"signal",{value:new ct,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(a){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(a){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&&(Pn.prototype[Symbol.toStringTag]="AbortController",ct.prototype[Symbol.toStringTag]="AbortSignal");function lt(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:a=!1}=r;if(!lt({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:e,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=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},o.prototype=t.prototype);const i=e;return{fetch:(v,c)=>{const l=o&&o.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,O)=>{l.addEventListener("abort",()=>O(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([u,i(v,c)])}return i(v,c)},Request:o}}const Wr=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ut=Wr?_n({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,An=Wr?ut.fetch:window.fetch;Wr?ut.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")}),vt=hr,ft=Function.prototype,kr=ft.call,xn=vt&&ft.bind.bind(kr,kr),M=vt?xn:function(r){return function(){return kr.apply(r,arguments)}},dt=M,Nn=dt({}.toString),Mn=dt("".slice),Hr=function(r){return Mn(Nn(r),8,-1)},Cn=M,Gn=j,Fn=Hr,Or=Object,Dn=Cn("".split),kn=Gn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Fn(r)=="String"?Dn(r,""):Or(r)}:Or,Xr=function(r){return r==null},Un=Xr,Vn=TypeError,ht=function(r){if(Un(r))throw Vn("Can't call method on "+r);return r},Bn=kn,Kn=ht,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,pt={all:Ur,IS_HTMLDDA:qn},bt=pt,Yn=bt.all,R=bt.IS_HTMLDDA?function(r){return typeof r=="function"||r===Yn}:function(r){return typeof r=="function"},zn=I,Qn=R,ve=zn.WeakMap,Wn=Qn(ve)&&/native code/.test(String(ve)),fe=R,yt=pt,Hn=yt.all,q=yt.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),gt=function(r){return Zn?Vr.createElement(r):{}},ra=C,ea=j,ta=gt,Ot=!ra&&!ea(function(){return Object.defineProperty(ta("div"),"a",{get:function(){return 7}}).a!=7}),na=C,aa=j,$t=na&&aa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),oa=q,ia=String,sa=TypeError,z=function(r){if(oa(r))return r;throw sa(ia(r)+" is not an object")},ca=hr,rr=Function.prototype.call,G=ca?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},$r=Jr,mr=I,la=R,he=function(r){return la(r)?r:void 0},mt=function(r,e){return arguments.length<2?he($r[r])||he(mr[r]):$r[r]&&$r[r][e]||mr[r]&&mr[r][e]},ua=M,wt=ua({}.isPrototypeOf),va=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=I,wr=va,pe=Et.process,be=Et.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&&wr&&(T=wr.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=wr.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var fa=ur,Oe=fa,da=j,ha=I,pa=ha.String,St=!!Object.getOwnPropertySymbols&&!da(function(){var r=Symbol();return!pa(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),ba=St,Tt=ba&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ya=mt,ga=R,Oa=wt,$a=Tt,ma=Object,It=$a?function(r){return typeof r=="symbol"}:function(r){var e=ya("Symbol");return ga(e)&&Oa(e.prototype,ma(r))},wa=String,Zr=function(r){try{return wa(r)}catch(e){return"Object"}},Ea=R,Sa=Zr,Ta=TypeError,re=function(r){if(Ea(r))return r;throw Ta(Sa(r)+" is not a function")},Ia=re,Ra=Xr,ee=function(r,e){var t=r[e];return Ra(t)?void 0:Ia(t)},Er=G,Sr=R,Tr=q,Pa=TypeError,_a=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 Pa("Can't convert object to primitive value")},Rt={exports:{}},$e=I,Aa=Object.defineProperty,ja=function(r,e){try{Aa($e,r,{value:e,configurable:!0,writable:!0})}catch(t){$e[r]=e}return e},La=I,xa=ja,me="__core-js_shared__",Na=La[me]||xa(me,{}),Pt=Na,we=Pt;(Rt.exports=function(r,e){return we[r]||(we[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 _t=Rt.exports,Ma=ht,Ca=Object,At=function(r){return Ca(Ma(r))},Ga=M,Fa=At,Da=Ga({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return Da(Fa(e),t)},ka=M,Ua=0,Va=Math.random(),Ba=ka(1 .toString),jt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ba(++Ua+Va,36)},Ka=I,qa=_t,Ee=x,Ya=jt,za=St,Qa=Tt,U=Ka.Symbol,Ir=qa("wks"),Wa=Qa?U.for||U:U&&U.withoutSetter||Ya,L=function(r){return Ee(Ir,r)||(Ir[r]=za&&Ee(U,r)?U[r]:Wa("Symbol."+r)),Ir[r]},Ha=G,Se=q,Te=It,Xa=ee,Ja=_a,Za=L,ro=TypeError,eo=Za("toPrimitive"),to=function(r,e){if(!Se(r)||Te(r))return r;var t=Xa(r,eo),n;if(t){if(e===void 0&&(e="default"),n=Ha(t,r,e),!Se(n)||Te(n))return n;throw ro("Can't convert object to primitive value")}return e===void 0&&(e="number"),Ja(r,e)},no=to,ao=It,te=function(r){var e=no(r,"string");return ao(e)?e:e+""},oo=C,io=Ot,so=$t,er=z,Ie=te,co=TypeError,Rr=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,Pr="enumerable",_r="configurable",Ar="writable";Y.f=oo?so?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 a=lo(e,t);a&&a[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:a[_r],enumerable:Pr in n?n[Pr]:a[Pr],writable:!1})}return Rr(e,t,n)}:Rr:function(e,t,n){if(er(e),t=Ie(t),er(n),io)try{return Rr(e,t,n)}catch(a){}if("get"in n||"set"in n)throw co("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}},uo=C,vo=Y,fo=pr,X=uo?function(r,e,t){return vo.f(r,e,fo(1,t))}:function(r,e,t){return r[e]=t,r},ho=_t,po=jt,Re=ho("keys"),ne=function(r){return Re[r]||(Re[r]=po(r))},ae={},bo=Wn,Lt=I,yo=q,go=X,jr=x,Lr=Pt,Oo=ne,$o=ae,Pe="Object already initialized",Br=Lt.TypeError,mo=Lt.WeakMap,vr,W,fr,wo=function(r){return fr(r)?W(r):vr(r,{})},Eo=function(r){return function(e){var t;if(!yo(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(bo||Lr.state){var P=Lr.state||(Lr.state=new mo);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 F=Oo("state");$o[F]=!0,vr=function(r,e){if(jr(r,F))throw Br(Pe);return e.facade=r,go(r,F,e),e},W=function(r){return jr(r,F)?r[F]:{}},fr=function(r){return jr(r,F)}}var So={set:vr,get:W,has:fr,enforce:wo,getterFor:Eo},To=hr,xt=Function.prototype,_e=xt.apply,Ae=xt.call,Io=typeof Reflect=="object"&&Reflect.apply||(To?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Ro=Hr,Po=M,Nt=function(r){if(Ro(r)==="Function")return Po(r)},Mt={},Ct={},Gt={}.propertyIsEnumerable,Ft=Object.getOwnPropertyDescriptor,_o=Ft&&!Gt.call({1:2},1);Ct.f=_o?function(e){var t=Ft(this,e);return!!t&&t.enumerable}:Gt;var Ao=C,jo=G,Lo=Ct,xo=pr,No=H,Mo=te,Co=x,Go=Ot,je=Object.getOwnPropertyDescriptor;Mt.f=Ao?je:function(e,t){if(e=No(e),t=Mo(t),Go)try{return je(e,t)}catch(n){}if(Co(e,t))return xo(!jo(Lo.f,e,t),e[t])};var Fo=j,Do=R,ko=/#|\.prototype\./,J=function(r,e){var t=Vo[Uo(r)];return t==Ko?!0:t==Bo?!1:Do(e)?Fo(e):!!e},Uo=J.normalize=function(r){return String(r).replace(ko,".").toLowerCase()},Vo=J.data={},Bo=J.NATIVE="N",Ko=J.POLYFILL="P",qo=J,Le=Nt,Yo=re,zo=hr,Qo=Le(Le.bind),Dt=function(r,e){return Yo(r),e===void 0?r:zo?Qo(r,e):function(){return r.apply(e,arguments)}},tr=I,Wo=Io,Ho=Nt,Xo=R,Jo=Mt.f,Zo=qo,D=Jr,ri=Dt,k=X,xe=x,ei=function(r){var e=function(t,n,a){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,a)}return Wo(r,this,arguments)};return e.prototype=r.prototype,e},kt=function(r,e){var t=r.target,n=r.global,a=r.stat,o=r.proto,i=n?tr:a?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,c,l,f,u,d,O,w,$,y;for(u in e)c=Zo(n?u:t+(a?".":"#")+u,r.forced),l=!c&&i&&xe(i,u),O=s[u],l&&(r.dontCallGetSet?(y=Jo(i,u),w=y&&y.value):w=i[u]),d=l&&w?w:e[u],!(l&&typeof O==typeof d)&&(r.bind&&l?$=ri(d,tr):r.wrap&&l?$=ei(d):o&&Xo(d)?$=Ho(d):$=d,(r.sham||d&&d.sham||O&&O.sham)&&k($,"sham",!0),k(s,u,$),o&&(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,Ut=Function.prototype,ni=Kr&&Object.getOwnPropertyDescriptor,oe=ti(Ut,"name"),ai=oe&&function(){}.name==="something",oi=oe&&(!Kr||Kr&&ni(Ut,"name").configurable),ii={EXISTS:oe,PROPER:ai,CONFIGURABLE:oi},Vt={},si=Math.ceil,ci=Math.floor,li=Math.trunc||function(e){var t=+e;return(t>0?ci:si)(t)},ui=li,Bt=function(r){var e=+r;return e!==e||e===0?0:ui(e)},vi=Bt,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=Bt,bi=Math.min,yi=function(r){return r>0?bi(pi(r),9007199254740991):0},gi=yi,Kt=function(r){return gi(r.length)},Oi=H,$i=hi,mi=Kt,Ne=function(r){return function(e,t,n){var a=Oi(e),o=mi(a),i=$i(n,o),s;if(r&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},wi={includes:Ne(!0),indexOf:Ne(!1)},Ei=M,xr=x,Si=H,Ti=wi.indexOf,Ii=ae,Me=Ei([].push),Ri=function(r,e){var t=Si(r),n=0,a=[],o;for(o in t)!xr(Ii,o)&&xr(t,o)&&Me(a,o);for(;e.length>n;)xr(t,o=e[n++])&&(~Ti(a,o)||Me(a,o));return a},qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pi=Ri,_i=qt,Ai=Object.keys||function(e){return Pi(e,_i)},ji=C,Li=$t,xi=Y,Ni=z,Mi=H,Ci=Ai;Vt.f=ji&&!Li?Object.defineProperties:function(e,t){Ni(e);for(var n=Mi(t),a=Ci(t),o=a.length,i=0,s;o>i;)xi.f(e,s=a[i++],n[s]);return e};var Gi=mt,Fi=Gi("document","documentElement"),Di=z,ki=Vt,Ce=qt,Ui=ae,Vi=Fi,Bi=gt,Ki=ne,Ge=">",Fe="<",qr="prototype",Yr="script",Yt=Ki("IE_PROTO"),Nr=function(){},zt=function(r){return Fe+Yr+Ge+r+Fe+"/"+Yr+Ge},De=function(r){r.write(zt("")),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(zt("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[Yt]=!0;var Qt=Object.create||function(e,t){var n;return e!==null?(Nr[qr]=Di(e),n=new Nr,Nr[qr]=null,n[Yt]=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=R,Hi=At,Xi=ne,Ji=zi,ke=Xi("IE_PROTO"),zr=Object,Zi=zr.prototype,Wt=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,Ht=function(r,e,t,n){return n&&n.enumerable?r[e]=t:rs(r,e,t),r},es=j,ts=R,ns=q,as=Qt,Ue=Wt,os=Ht,is=L,Qr=is("iterator"),Xt=!1,A,Mr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Mr=Ue(Ue(Cr)),Mr!==Object.prototype&&(A=Mr)):Xt=!0);var ss=!ns(A)||es(function(){var r={};return A[Qr].call(r)!==r});ss?A={}:A=as(A);ts(A[Qr])||os(A,Qr,function(){return this});var Jt={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Xt},cs=L,ls=cs("toStringTag"),Zt={};Zt[ls]="z";var ie=String(Zt)==="[object z]",us=ie,vs=R,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)+"]"},$s=ie,ms=Y.f,ws=X,Es=x,Ss=Os,Ts=L,Ve=Ts("toStringTag"),rn=function(r,e,t,n){if(r){var a=t?r:r.prototype;Es(a,Ve)||ms(a,Ve,{configurable:!0,value:e}),n&&!$s&&ws(a,"toString",Ss)}},Is=Jt.IteratorPrototype,Rs=Qt,Ps=pr,_s=rn,As=K,js=function(){return this},Ls=function(r,e,t,n){var a=e+" Iterator";return r.prototype=Rs(Is,{next:Ps(+!n,t)}),_s(r,a,!1,!0),As[a]=js,r},xs=kt,Ns=G,en=ii,Ms=Ls,Cs=Wt,Gs=rn,Be=Ht,Fs=L,Ke=K,tn=Jt,Ds=en.PROPER;en.CONFIGURABLE;tn.IteratorPrototype;var ar=tn.BUGGY_SAFARI_ITERATORS,Gr=Fs("iterator"),qe="keys",or="values",Ye="entries",ks=function(){return this},Us=function(r,e,t,n,a,o,i){Ms(t,e,n);var s=function(y){if(y===a&&u)return u;if(!ar&&y in l)return l[y];switch(y){case qe:return function(){return new t(this,y)};case or:return function(){return new t(this,y)};case Ye:return function(){return new t(this,y)}}return function(){return new t(this)}},v=e+" Iterator",c=!1,l=r.prototype,f=l[Gr]||l["@@iterator"]||a&&l[a],u=!ar&&f||s(a),d=e=="Array"&&l.entries||f,O,w,$;if(d&&(O=Cs(d.call(new r)),O!==Object.prototype&&O.next&&(Gs(O,v,!0,!0),Ke[v]=ks)),Ds&&a==or&&f&&f.name!==or&&(c=!0,u=function(){return Ns(f,this)}),a)if(w={values:s(or),keys:o?u:s(qe),entries:s(Ye)},i)for($ in w)(ar||c||!($ in l))&&Be(l,$,w[$]);else xs({target:e,proto:!0,forced:ar||c},w);return i&&l[Gr]!==u&&Be(l,Gr,u,{name:a}),Ke[e]=u,w},Vs=function(r,e){return{value:r,done:e}},Bs=H,ze=K,nn=So;Y.f;var Ks=Us,ir=Vs,an="Array Iterator",qs=nn.set,Ys=nn.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"),on=function(r){if(!Zs(r))return Qe(r,tc)||Qe(r,"@@iterator")||rc[Js(r)]},nc=G,ac=re,oc=z,ic=Zr,sc=on,cc=TypeError,lc=function(r,e){var t=arguments.length<2?sc(r):e;if(ac(t))return oc(nc(t,r));throw cc(ic(r)+" is not iterable")},uc=G,We=z,vc=ee,fc=function(r,e,t){var n,a;We(r);try{if(n=vc(r,"return"),!n){if(e==="throw")throw t;return t}n=uc(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return We(n),t},dc=Dt,hc=G,pc=z,bc=Zr,yc=Xs,gc=Kt,He=wt,Oc=lc,$c=on,Xe=fc,mc=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,wc=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=dc(e,n),c,l,f,u,d,O,w,$=function(g){return c&&Xe(c,"normal",g),new lr(!0,g)},y=function(g){return a?(pc(g),s?v(g[0],g[1],$):v(g[0],g[1])):s?v(g,$):v(g)};if(o)c=r.iterator;else if(i)c=r;else{if(l=$c(r),!l)throw mc(bc(r)+" is not iterable");if(yc(l)){for(f=0,u=gc(r);u>f;f++)if(d=y(r[f]),d&&He(Je,d))return d;return new lr(!1)}c=Oc(r,l)}for(O=o?r.next:c.next;!(w=hc(O,c)).done;){try{d=y(w.value)}catch(g){Xe(c,"throw",g)}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},Rc=kt,Pc=wc,_c=Ic;Rc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Pc(e,function(n,a){_c(t,n,a)},{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,Nc=I,Mc=se,Cc=X,Ze=K,Gc=L,rt=Gc("toStringTag");for(var Fr in xc){var et=Nc[Fr],Dr=et&&et.prototype;Dr&&Mc(Dr)!==rt&&Cc(Dr,rt,Fr),Ze[Fr]=Ze.Array}var Fc=jc,Dc=Fc,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",_l=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 o=await(await An(n.toString())).json();return Kc(o,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,S as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Qc as Logger,b as Observable,at as Subject,dr as Subscription,Yc as VERSION,tt as VKNumericLanguage,fl as ValueSubject,m as VideoQuality,Zc as abortable,Xc as addScript,ul as areQualitiesExact,V as assertNever,Wc as assertNonNullable,Hc as assertNullable,vl as assertQualityIsExact,Ol as buffer,zc as checkNever,dl as combine,$l as debounce,bn as fillWithDefault,wl as filter,El as filterChanged,gl as fromEvent,ln as getCurrentBrowser,el as getExponentialDelay,il as getHighestQuality,bl as interval,nl as isHigher,al as isHigherOrEqual,rl as isIOS,st as isInvariantQuality,ot as isLower,ol as isLowerOrEqual,sn as isNonNullable,cn as isNullable,_l as loadVKLangPack,Sn as map,Tl as mapTo,hl as merge,Q as noop,Jc as now,yl as observableFrom,Il as once,Rl as pairwise,tl as safeStorage,Pl as tap,ml as throttle,pl as timeout,sl as videoHeightToQuality,ll as videoQualityToHeight,cl as videoSizeToQuality};
|
|
6
|
+
const Yc="1.0.29-beta.1";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 a;t?typeof t=="function"?a={next:t,error:Q}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:Q,error:Q};const o=typeof e=="function"?{next:s=>{try{e(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new dr().add(()=>{switch(o.next=Q,o.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 at 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 at,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(a){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}const Xc=(r,e,t)=>new Promise((n,a)=>{e.addEventListener("abort",()=>{s(),c.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",o),c.src=r,document.head.appendChild(c)});var br;const Jc=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now(),Zc=(r,e)=>async(...t)=>{var n;const a=e(...t);let o=r.aborted,i;for(;!o&&!r.aborted;){const s=await a.next(i);o=(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 ot=()=>{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,a=/firefox|fxios/i.test(r)?_.Firefox:void 0,o=/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||a||i||s||t||n||o||_.Rest,device:v||c||l||f||d||u||p.Desktop}},rl=()=>[p.iPhone,p.iPad,p.iPod].includes(ot().device),el=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(ot().device),tl=(r,{start:e=0,factor:t=2,max:n=1/0,min:a=e,random:o=0}={})=>{let i=e;return i*=t**r,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),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 nl=Object.freeze({__proto__:null,clear:pn,get:vn,has:dn,isPersistent:un,remove:hn,set:fn}),w;(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"})(w||(w={}));const S={[w.Q_144P]:{width:256,height:144},[w.Q_240P]:{width:428,height:240},[w.Q_360P]:{width:640,height:360},[w.Q_480P]:{width:856,height:480},[w.Q_720P]:{width:1280,height:720},[w.Q_1080P]:{width:1920,height:1080},[w.Q_1440P]:{width:2560,height:1440},[w.Q_2160P]:{width:3840,height:2160},[w.Q_4320P]:{width:7680,height:4320}},al=(r,e)=>S[r].height>S[e].height,ol=(r,e)=>S[r].height>=S[e].height,it=(r,e)=>S[r].height<S[e].height,il=(r,e)=>S[r].height<=S[e].height,sl=r=>r.sort((e,t)=>e===t?0:e===w.INVARIANT?1:t===w.INVARIANT?-1:it(e,t)?1:-1)[0],st=Object.keys(S).sort((r,e)=>it(r,e)?-1:1),cl=(r,e=.02)=>[...st].find(n=>S[n].height*(1+e)>=r),ll=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return st.find(a=>{const o=S[a];return o.width>=n&&o.height>=t})},ul=r=>S[r].height,ct=r=>r===w.INVARIANT,vl=r=>r.every(e=>!ct(e));function fl(r){if(ct(r))throw new Error("Expected exact quality")}const bn=(r,e)=>{const t={};for(const n of Object.keys(e)){const a=e[n],o=r[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=bn(o,a):t[n]=n in r?o:a}return t};class dl extends at{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 hl(r){return new y(e=>{const t={};let n=Object.keys(r).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&e.next(t)};return Object.entries(r).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new dr)})}function pl(...r){return new y(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var bl=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)}),yl=r=>new y(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),gl=r=>new y(e=>{r.forEach(t=>e.next(t))}),Ol=(r,e)=>new y(t=>{const n=a=>t.next(a);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function $l(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 ml(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 $n={leading:!0,trailing:!1};function wl(r,e=$n){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 El(r){return e=>new y(t=>e.subscribe(new wn(t,r)))}class wn{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 Sl(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 Il(r){return Sn(()=>r)}function Pl(){return r=>new y(e=>{let t=!1,n=!1;const a=r.subscribe(o=>{t||(t=!0,e.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function Rl(){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 _l(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 a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];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(a){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(a){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:a=!1}=r;if(!ut({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:e,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=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},o.prototype=t.prototype);const i=e;return{fetch:(v,c)=>{const l=o&&o.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,$)=>{l.addEventListener("abort",()=>$(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([u,i(v,c)])}return i(v,c)},Request:o}}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,Gn=j,Fn=Hr,Or=Object,Dn=Cn("".split),kn=Gn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Fn(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):{}},ra=C,ea=j,ta=Ot,$t=!ra&&!ea(function(){return Object.defineProperty(ta("div"),"a",{get:function(){return 7}}).a!=7}),na=C,aa=j,mt=na&&aa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),oa=q,ia=String,sa=TypeError,z=function(r){if(oa(r))return r;throw sa(ia(r)+" is not an object")},ca=hr,rr=Function.prototype.call,G=ca?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},$r=Jr,mr=I,la=P,he=function(r){return la(r)?r:void 0},wt=function(r,e){return arguments.length<2?he($r[r])||he(mr[r]):$r[r]&&$r[r][e]||mr[r]&&mr[r][e]},ua=N,Et=ua({}.isPrototypeOf),va=typeof navigator!="undefined"&&String(navigator.userAgent)||"",St=I,wr=va,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&&wr&&(T=wr.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=wr.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var fa=ur,Oe=fa,da=j,ha=I,pa=ha.String,Tt=!!Object.getOwnPropertySymbols&&!da(function(){var r=Symbol();return!pa(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),ba=Tt,It=ba&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ya=wt,ga=P,Oa=Et,$a=It,ma=Object,Pt=$a?function(r){return typeof r=="symbol"}:function(r){var e=ya("Symbol");return ga(e)&&Oa(e.prototype,ma(r))},wa=String,Zr=function(r){try{return wa(r)}catch(e){return"Object"}},Ea=P,Sa=Zr,Ta=TypeError,re=function(r){if(Ea(r))return r;throw Ta(Sa(r)+" is not a function")},Ia=re,Pa=Xr,ee=function(r,e){var t=r[e];return Pa(t)?void 0:Ia(t)},Er=G,Sr=P,Tr=q,Ra=TypeError,_a=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 Ra("Can't convert object to primitive value")},Rt={exports:{}},$e=I,Aa=Object.defineProperty,ja=function(r,e){try{Aa($e,r,{value:e,configurable:!0,writable:!0})}catch(t){$e[r]=e}return e},La=I,xa=ja,me="__core-js_shared__",Ma=La[me]||xa(me,{}),_t=Ma,we=_t;(Rt.exports=function(r,e){return we[r]||(we[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,Na=pt,Ca=Object,jt=function(r){return Ca(Na(r))},Ga=N,Fa=jt,Da=Ga({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return Da(Fa(e),t)},ka=N,Ua=0,Va=Math.random(),Ba=ka(1 .toString),Lt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ba(++Ua+Va,36)},Ka=I,qa=At,Ee=x,Ya=Lt,za=Tt,Qa=It,U=Ka.Symbol,Ir=qa("wks"),Wa=Qa?U.for||U:U&&U.withoutSetter||Ya,L=function(r){return Ee(Ir,r)||(Ir[r]=za&&Ee(U,r)?U[r]:Wa("Symbol."+r)),Ir[r]},Ha=G,Se=q,Te=Pt,Xa=ee,Ja=_a,Za=L,ro=TypeError,eo=Za("toPrimitive"),to=function(r,e){if(!Se(r)||Te(r))return r;var t=Xa(r,eo),n;if(t){if(e===void 0&&(e="default"),n=Ha(t,r,e),!Se(n)||Te(n))return n;throw ro("Can't convert object to primitive value")}return e===void 0&&(e="number"),Ja(r,e)},no=to,ao=Pt,te=function(r){var e=no(r,"string");return ao(e)?e:e+""},oo=C,io=$t,so=mt,er=z,Ie=te,co=TypeError,Pr=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,Rr="enumerable",_r="configurable",Ar="writable";Y.f=oo?so?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 a=lo(e,t);a&&a[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:a[_r],enumerable:Rr in n?n[Rr]:a[Rr],writable:!1})}return Pr(e,t,n)}:Pr:function(e,t,n){if(er(e),t=Ie(t),er(n),io)try{return Pr(e,t,n)}catch(a){}if("get"in n||"set"in n)throw co("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}},uo=C,vo=Y,fo=pr,X=uo?function(r,e,t){return vo.f(r,e,fo(1,t))}:function(r,e,t){return r[e]=t,r},ho=At,po=Lt,Pe=ho("keys"),ne=function(r){return Pe[r]||(Pe[r]=po(r))},ae={},bo=Wn,xt=I,yo=q,go=X,jr=x,Lr=_t,Oo=ne,$o=ae,Re="Object already initialized",Br=xt.TypeError,mo=xt.WeakMap,vr,W,fr,wo=function(r){return fr(r)?W(r):vr(r,{})},Eo=function(r){return function(e){var t;if(!yo(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(bo||Lr.state){var R=Lr.state||(Lr.state=new mo);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 F=Oo("state");$o[F]=!0,vr=function(r,e){if(jr(r,F))throw Br(Re);return e.facade=r,go(r,F,e),e},W=function(r){return jr(r,F)?r[F]:{}},fr=function(r){return jr(r,F)}}var So={set:vr,get:W,has:fr,enforce:wo,getterFor:Eo},To=hr,Mt=Function.prototype,_e=Mt.apply,Ae=Mt.call,Io=typeof Reflect=="object"&&Reflect.apply||(To?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Po=Hr,Ro=N,Nt=function(r){if(Po(r)==="Function")return Ro(r)},Ct={},Gt={},Ft={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,_o=Dt&&!Ft.call({1:2},1);Gt.f=_o?function(e){var t=Dt(this,e);return!!t&&t.enumerable}:Ft;var Ao=C,jo=G,Lo=Gt,xo=pr,Mo=H,No=te,Co=x,Go=$t,je=Object.getOwnPropertyDescriptor;Ct.f=Ao?je:function(e,t){if(e=Mo(e),t=No(t),Go)try{return je(e,t)}catch(n){}if(Co(e,t))return xo(!jo(Lo.f,e,t),e[t])};var Fo=j,Do=P,ko=/#|\.prototype\./,J=function(r,e){var t=Vo[Uo(r)];return t==Ko?!0:t==Bo?!1:Do(e)?Fo(e):!!e},Uo=J.normalize=function(r){return String(r).replace(ko,".").toLowerCase()},Vo=J.data={},Bo=J.NATIVE="N",Ko=J.POLYFILL="P",qo=J,Le=Nt,Yo=re,zo=hr,Qo=Le(Le.bind),kt=function(r,e){return Yo(r),e===void 0?r:zo?Qo(r,e):function(){return r.apply(e,arguments)}},tr=I,Wo=Io,Ho=Nt,Xo=P,Jo=Ct.f,Zo=qo,D=Jr,ri=kt,k=X,xe=x,ei=function(r){var e=function(t,n,a){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,a)}return Wo(r,this,arguments)};return e.prototype=r.prototype,e},Ut=function(r,e){var t=r.target,n=r.global,a=r.stat,o=r.proto,i=n?tr:a?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,c,l,f,u,d,$,E,m,g;for(u in e)c=Zo(n?u:t+(a?".":"#")+u,r.forced),l=!c&&i&&xe(i,u),$=s[u],l&&(r.dontCallGetSet?(g=Jo(i,u),E=g&&g.value):E=i[u]),d=l&&E?E:e[u],!(l&&typeof $==typeof d)&&(r.bind&&l?m=ri(d,tr):r.wrap&&l?m=ei(d):o&&Xo(d)?m=Ho(d):m=d,(r.sham||d&&d.sham||$&&$.sham)&&k(m,"sham",!0),k(s,u,m),o&&(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,oe=ti(Vt,"name"),ai=oe&&function(){}.name==="something",oi=oe&&(!Kr||Kr&&ni(Vt,"name").configurable),ii={EXISTS:oe,PROPER:ai,CONFIGURABLE:oi},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,$i=hi,mi=qt,Me=function(r){return function(e,t,n){var a=Oi(e),o=mi(a),i=$i(n,o),s;if(r&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},wi={includes:Me(!0),indexOf:Me(!1)},Ei=N,xr=x,Si=H,Ti=wi.indexOf,Ii=ae,Ne=Ei([].push),Pi=function(r,e){var t=Si(r),n=0,a=[],o;for(o in t)!xr(Ii,o)&&xr(t,o)&&Ne(a,o);for(;e.length>n;)xr(t,o=e[n++])&&(~Ti(a,o)||Ne(a,o));return a},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),a=Ci(t),o=a.length,i=0,s;o>i;)xi.f(e,s=a[i++],n[s]);return e};var Gi=wt,Fi=Gi("document","documentElement"),Di=z,ki=Bt,Ce=Yt,Ui=ae,Vi=Fi,Bi=Ot,Ki=ne,Ge=">",Fe="<",qr="prototype",Yr="script",zt=Ki("IE_PROTO"),Mr=function(){},Qt=function(r){return Fe+Yr+Ge+r+Fe+"/"+Yr+Ge},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,as=Wt,Ue=Ht,os=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=as(A);ts(A[Qr])||os(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)+"]"},$s=ie,ms=Y.f,ws=X,Es=x,Ss=Os,Ts=L,Ve=Ts("toStringTag"),en=function(r,e,t,n){if(r){var a=t?r:r.prototype;Es(a,Ve)||ms(a,Ve,{configurable:!0,value:e}),n&&!$s&&ws(a,"toString",Ss)}},Is=Zt.IteratorPrototype,Ps=Wt,Rs=pr,_s=en,As=K,js=function(){return this},Ls=function(r,e,t,n){var a=e+" Iterator";return r.prototype=Ps(Is,{next:Rs(+!n,t)}),_s(r,a,!1,!0),As[a]=js,r},xs=Ut,Ms=G,tn=ii,Ns=Ls,Cs=Ht,Gs=en,Be=Xt,Fs=L,Ke=K,nn=Zt,Ds=tn.PROPER;tn.CONFIGURABLE;nn.IteratorPrototype;var ar=nn.BUGGY_SAFARI_ITERATORS,Gr=Fs("iterator"),qe="keys",or="values",Ye="entries",ks=function(){return this},Us=function(r,e,t,n,a,o,i){Ns(t,e,n);var s=function(g){if(g===a&&u)return u;if(!ar&&g in l)return l[g];switch(g){case qe:return function(){return new t(this,g)};case or: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[Gr]||l["@@iterator"]||a&&l[a],u=!ar&&f||s(a),d=e=="Array"&&l.entries||f,$,E,m;if(d&&($=Cs(d.call(new r)),$!==Object.prototype&&$.next&&(Gs($,v,!0,!0),Ke[v]=ks)),Ds&&a==or&&f&&f.name!==or&&(c=!0,u=function(){return Ms(f,this)}),a)if(E={values:s(or),keys:o?u:s(qe),entries:s(Ye)},i)for(m in E)(ar||c||!(m in l))&&Be(l,m,E[m]);else xs({target:e,proto:!0,forced:ar||c},E);return i&&l[Gr]!==u&&Be(l,Gr,u,{name:a}),Ke[e]=u,E},Vs=function(r,e){return{value:r,done:e}},Bs=H,ze=K,an=So;Y.f;var Ks=Us,ir=Vs,on="Array Iterator",qs=an.set,Ys=an.getterFor(on);Ks(Array,"Array",function(r,e){qs(this,{type:on,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=G,ac=re,oc=z,ic=Zr,sc=sn,cc=TypeError,lc=function(r,e){var t=arguments.length<2?sc(r):e;if(ac(t))return oc(nc(t,r));throw cc(ic(r)+" is not iterable")},uc=G,We=z,vc=ee,fc=function(r,e,t){var n,a;We(r);try{if(n=vc(r,"return"),!n){if(e==="throw")throw t;return t}n=uc(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return We(n),t},dc=kt,hc=G,pc=z,bc=Zr,yc=Xs,gc=qt,He=Et,Oc=lc,$c=sn,Xe=fc,mc=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,wc=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=dc(e,n),c,l,f,u,d,$,E,m=function(O){return c&&Xe(c,"normal",O),new lr(!0,O)},g=function(O){return a?(pc(O),s?v(O[0],O[1],m):v(O[0],O[1])):s?v(O,m):v(O)};if(o)c=r.iterator;else if(i)c=r;else{if(l=$c(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($=o?r.next:c.next;!(E=hc($,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=wc,_c=Ic;Pc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Rc(e,function(n,a){_c(t,n,a)},{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,Gc=L,rt=Gc("toStringTag");for(var Fr in xc){var et=Mc[Fr],Dr=et&&et.prototype;Dr&&Nc(Dr)!==rt&&Cc(Dr,rt,Fr),Ze[Fr]=Ze.Array}var Fc=jc,Dc=Fc,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",Al=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 o=await(await An(n.toString())).json();return Kc(o,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,at as Subject,dr as Subscription,Yc as VERSION,tt as VKNumericLanguage,dl as ValueSubject,w as VideoQuality,Zc as abortable,Xc as addScript,vl as areQualitiesExact,V as assertNever,Wc as assertNonNullable,Hc as assertNullable,fl as assertQualityIsExact,$l as buffer,zc as checkNever,hl as combine,ml as debounce,bn as fillWithDefault,El as filter,Sl as filterChanged,Ol as fromEvent,ot as getCurrentBrowser,tl as getExponentialDelay,sl as getHighestQuality,yl as interval,al as isHigher,ol as isHigherOrEqual,rl as isIOS,ct as isInvariantQuality,it as isLower,il as isLowerOrEqual,el as isMacLike,cn as isNonNullable,ln as isNullable,Al as loadVKLangPack,Sn as map,Il as mapTo,pl as merge,Q as noop,Jc as now,gl as observableFrom,Pl as once,Rl as pairwise,nl as safeStorage,_l as tap,wl as throttle,bl as timeout,cl as videoHeightToQuality,ul as videoQualityToHeight,ll as videoSizeToQuality};
|
package/esnext.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.29-beta.1
|
|
3
|
+
* Wed, 06 Sep 2023 16:19:06 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-29/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const q="1.0.28";class S{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 S().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 v 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 S().add(()=>this.subscribers.delete(r))}}class U{log$=new v;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 C(e){return typeof e<"u"&&e!==null}function P(e){return e==null}const z=(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)}),H=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),$=(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.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const T=()=>{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=/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||g||exports.CurrentClientDevice.Desktop}},Y=()=>[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(T().device),W=(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},K=()=>y()===a.LOCAL_STORAGE,X=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)}},J=(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)}},Z=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}},ee=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)}},te=()=>{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 re=Object.freeze({__proto__:null,clear:te,get:X,has:Z,isPersistent:K,remove:ee,set:J});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}},ne=(e,t)=>d[e].height>d[t].height,ie=(e,t)=>d[e].height>=d[t].height,A=(e,t)=>d[e].height<d[t].height,se=(e,t)=>d[e].height<=d[t].height,oe=e=>e.sort((t,r)=>t===r?0:t===exports.VideoQuality.INVARIANT?1:r===exports.VideoQuality.INVARIANT?-1:A(t,r)?1:-1)[0],I=Object.keys(d).sort((e,t)=>A(e,t)?-1:1),ae=(e,t=.02)=>[...I].find(n=>d[n].height*(1+t)>=e),ce=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return I.find(s=>{const i=d[s];return i.width>=n&&i.height>=r})},le=e=>d[e].height,x=e=>e===exports.VideoQuality.INVARIANT,ue=e=>e.every(t=>!x(t));function de(e){if(x(e))throw new Error("Expected exact quality")}const N=(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]=N(i,s):r[n]=n in e?i:s}return r};class he extends v{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 fe(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 S)})}function be(...e){return new l(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new S))}var we=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)}),pe=e=>new l(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),ge=e=>new l(t=>{e.forEach(r=>t.next(r))}),me=(e,t)=>new l(r=>{const n=s=>r.next(s);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function Ee(e){return t=>new l(r=>t.subscribe(new ye(r,e)))}class ye{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 Se={leading:!1,trailing:!0};function Oe(e,t=Se){return r=>new l(n=>r.subscribe(new ve(n,e,t)))}class ve{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,C(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 Ae={leading:!0,trailing:!1};function xe(e,t=Ae){return r=>new l(n=>r.subscribe(new Re(n,e,t)))}class Re{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,P(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 Le(e){return t=>new l(r=>t.subscribe(new _e(r,e)))}class _e{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 Ce(e=(t,r)=>t===r){return t=>new l(r=>t.subscribe(new Pe(r,e)))}const L={};class Pe{destination;predicate;lastValue=L;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===L||!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 Te(r,e)))}let Te=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 Ie(e){return Q(()=>e)}function Ne(){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 Me(t)))}class Me{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 Ve(e){return t=>new l(r=>t.subscribe(new je(r,e)))}class je{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 _{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 M extends _{constructor(){super(),this.listeners||_.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 ke{constructor(){Object.defineProperty(this,"signal",{value:new M,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&&(ke.prototype[Symbol.toStringTag]="AbortController",M.prototype[Symbol.toStringTag]="AbortSignal");function V(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 De(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!V({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((k,D)=>{f.addEventListener("abort",()=>D(b),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([g,o(h,c)])}return o(h,c)},Request:i}}const R=V({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),j=R?De({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,qe=R?j.fetch:window.fetch;R?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 Fe="vk.com",Ue=async(e,t,r)=>{const n=new URL(`https://${Fe}/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 qe(n.toString())).json();return Ge(i,r)},Ge=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),Be(n)])),Be=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=v;exports.Subscription=S;exports.VERSION=q;exports.ValueSubject=he;exports.abortable=$;exports.addScript=z;exports.areQualitiesExact=ue;exports.assertNever=p;exports.assertNonNullable=G;exports.assertNullable=B;exports.assertQualityIsExact=de;exports.buffer=Ee;exports.checkNever=F;exports.combine=fe;exports.debounce=Oe;exports.fillWithDefault=N;exports.filter=Le;exports.filterChanged=Ce;exports.fromEvent=me;exports.getCurrentBrowser=T;exports.getExponentialDelay=W;exports.getHighestQuality=oe;exports.interval=pe;exports.isHigher=ne;exports.isHigherOrEqual=ie;exports.isIOS=Y;exports.isInvariantQuality=x;exports.isLower=A;exports.isLowerOrEqual=se;exports.isNonNullable=C;exports.isNullable=P;exports.loadVKLangPack=Ue;exports.map=Q;exports.mapTo=Ie;exports.merge=be;exports.noop=m;exports.now=H;exports.observableFrom=ge;exports.once=Ne;exports.pairwise=Qe;exports.safeStorage=re;exports.tap=Ve;exports.throttle=xe;exports.timeout=we;exports.videoHeightToQuality=ae;exports.videoQualityToHeight=le;exports.videoSizeToQuality=ce;
|
|
6
|
+
"use strict";const q="1.0.29-beta.1";class S{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 S().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 S().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}const z=(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)}),H=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),$=(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,v=/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||v||g||exports.CurrentClientDevice.Desktop}},Y=()=>[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device),W=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device),K=(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},X=()=>y()===a.LOCAL_STORAGE,J=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)}},Z=(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)}},ee=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}},te=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)}},re=()=>{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 ne=Object.freeze({__proto__:null,clear:re,get:J,has:ee,isPersistent:X,remove:te,set:Z});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}},ie=(e,t)=>d[e].height>d[t].height,se=(e,t)=>d[e].height>=d[t].height,R=(e,t)=>d[e].height<d[t].height,oe=(e,t)=>d[e].height<=d[t].height,ae=e=>e.sort((t,r)=>t===r?0:t===exports.VideoQuality.INVARIANT?1:r===exports.VideoQuality.INVARIANT?-1:R(t,r)?1:-1)[0],N=Object.keys(d).sort((e,t)=>R(e,t)?-1:1),ce=(e,t=.02)=>[...N].find(n=>d[n].height*(1+t)>=e),le=({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})},ue=e=>d[e].height,C=e=>e===exports.VideoQuality.INVARIANT,de=e=>e.every(t=>!C(t));function he(e){if(C(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};class fe 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 be(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 S)})}function we(...e){return new l(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new S))}var pe=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)}),ge=e=>new l(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),me=e=>new l(t=>{e.forEach(r=>t.next(r))}),Ee=(e,t)=>new l(r=>{const n=s=>r.next(s);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function ye(e){return t=>new l(r=>t.subscribe(new Se(r,e)))}class Se{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 ve={leading:!1,trailing:!0};function Oe(e,t=ve){return r=>new l(n=>r.subscribe(new Ae(n,e,t)))}class Ae{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 xe={leading:!0,trailing:!1};function Re(e,t=xe){return r=>new l(n=>r.subscribe(new Ce(n,e,t)))}class Ce{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 Le(e){return t=>new l(r=>t.subscribe(new _e(r,e)))}class _e{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 Pe(e=(t,r)=>t===r){return t=>new l(r=>t.subscribe(new Te(r,e)))}const _={};class Te{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 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 Ne(e){return Q(()=>e)}function Me(){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 Ve(t)))}class Ve{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 De(e){return t=>new l(r=>t.subscribe(new je(r,e)))}class je{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 ke{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&&(ke.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 qe(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((v,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?qe({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Fe=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 Ue="vk.com",Ge=async(e,t,r)=>{const n=new URL(`https://${Ue}/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 Fe(n.toString())).json();return Be(i,r)},Be=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),ze(n)])),ze=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=S;exports.VERSION=q;exports.ValueSubject=fe;exports.abortable=$;exports.addScript=z;exports.areQualitiesExact=de;exports.assertNever=p;exports.assertNonNullable=G;exports.assertNullable=B;exports.assertQualityIsExact=he;exports.buffer=ye;exports.checkNever=F;exports.combine=be;exports.debounce=Oe;exports.fillWithDefault=M;exports.filter=Le;exports.filterChanged=Pe;exports.fromEvent=Ee;exports.getCurrentBrowser=x;exports.getExponentialDelay=K;exports.getHighestQuality=ae;exports.interval=ge;exports.isHigher=ie;exports.isHigherOrEqual=se;exports.isIOS=Y;exports.isInvariantQuality=C;exports.isLower=R;exports.isLowerOrEqual=oe;exports.isMacLike=W;exports.isNonNullable=T;exports.isNullable=I;exports.loadVKLangPack=Ge;exports.map=Q;exports.mapTo=Ne;exports.merge=we;exports.noop=m;exports.now=H;exports.observableFrom=me;exports.once=Me;exports.pairwise=Qe;exports.safeStorage=ne;exports.tap=De;exports.throttle=Re;exports.timeout=pe;exports.videoHeightToQuality=ce;exports.videoQualityToHeight=ue;exports.videoSizeToQuality=le;
|
package/esnext.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.29-beta.1
|
|
3
|
+
* Wed, 06 Sep 2023 16:19:06 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-29/doc/
|
|
5
5
|
*/
|
|
6
|
-
const be="1.0.28";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`)},pe=e=>{},y=()=>{};class l{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(h){n.next(h)}},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 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 x().add(()=>this.subscribers.delete(r))}}class we{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 G(e){return typeof e<"u"&&e!==null}function V(e){return e==null}const Ee=(e,t,r)=>new Promise((n,i)=>{t.addEventListener("abort",()=>{h(),c.remove()});const s=()=>{h(),i()},o=()=>{h(),n()},h=()=>{f&&clearTimeout(f),c.removeEventListener("load",o),c.removeEventListener("error",s)};let f;r&&(f=window.setTimeout(s,r));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",s),c.src=e,document.head.appendChild(c)}),Oe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Se=(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 w;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Desktop="Desktop"})(w||(w={}));const D=()=>{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,h=/edg/i.test(e)?m.Edge:void 0,f=/android/i.test(e)?w.Android:void 0,c=/iphone/i.test(e)?w.iPhone:void 0,b=/ipad/i.test(e)?w.iPad:void 0,p=/ipod/i.test(e)?w.iPod:void 0,E=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?w.RestMobile:void 0;return{browser:t||i||o||h||r||n||s||m.Rest,device:f||c||b||p||E||w.Desktop}},Ae=()=>[w.iPhone,w.iPad,w.iPod].includes(D().device),ye=(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 xe=Object.freeze({__proto__:null,clear:B,get:$,has:H,isPersistent:z,remove:W,set:Y}),u;(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"})(u||(u={}));const d={[u.Q_144P]:{width:256,height:144},[u.Q_240P]:{width:428,height:240},[u.Q_360P]:{width:640,height:360},[u.Q_480P]:{width:856,height:480},[u.Q_720P]:{width:1280,height:720},[u.Q_1080P]:{width:1920,height:1080},[u.Q_1440P]:{width:2560,height:1440},[u.Q_2160P]:{width:3840,height:2160},[u.Q_4320P]:{width:7680,height:4320}},Re=(e,t)=>d[e].height>d[t].height,_e=(e,t)=>d[e].height>=d[t].height,M=(e,t)=>d[e].height<d[t].height,ve=(e,t)=>d[e].height<=d[t].height,Le=e=>e.sort((t,r)=>t===r?0:t===u.INVARIANT?1:r===u.INVARIANT?-1:M(t,r)?1:-1)[0],j=Object.keys(d).sort((e,t)=>M(e,t)?-1:1),Pe=(e,t=.02)=>[...j].find(n=>d[n].height*(1+t)>=e),Te=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return j.find(i=>{const s=d[i];return s.width>=n&&s.height>=r})},Ie=e=>d[e].height,k=e=>e===u.INVARIANT,Ne=e=>e.every(t=>!k(t));function Me(e){if(k(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};class je 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 ke(e){return new l(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,h])=>s.add(h.subscribe(i(o))),new x)})}function qe(...e){return new l(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new x))}var Ce=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)}),Fe=e=>new l(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),Qe=e=>new l(t=>{e.forEach(r=>t.next(r))}),Ue=(e,t)=>new l(r=>{const n=i=>r.next(i);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function Ge(e){return t=>new l(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 Ve(e,t=Z){return r=>new l(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,G(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 De(e,t=ee){return r=>new l(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,V(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 ze(e){return t=>new l(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 $e(e=(t,r)=>t===r){return t=>new l(r=>t.subscribe(new ne(r,e)))}const v={};class ne{destination;predicate;lastValue=v;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===v||!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 l(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 He(e){return se(()=>e)}function We(){return e=>new l(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 Be(){return e=>new l(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 Xe(e){return t=>new l(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 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 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(h){Promise.resolve().then(()=>{throw h})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class q 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 ce{constructor(){Object.defineProperty(this,"signal",{value:new q,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",q.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,b){let p;b&&b.signal&&(p=b.signal,delete b.signal);const E=new r(c,b);return p&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),E},s.prototype=r.prototype);const o=t;return{fetch:(f,c)=>{const b=s&&s.prototype.isPrototypeOf(f)?f.signal:c?c.signal:void 0;if(b){let p;try{p=new DOMException("Aborted","AbortError")}catch{p=new Error("Aborted"),p.name="AbortError"}if(b.aborted)return Promise.reject(p);const E=new Promise((Q,U)=>{b.addEventListener("abort",()=>U(p),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(f,c)])}return o(f,c)},Request:s}}const _=C({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),F=_?le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ue=_?F.fetch:window.fetch;_?F.Request:window.Request;var T;(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"})(T||(T={}));const he="vk.com",Je=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 I;(function(e){e.RU="ru",e.EN="en"})(I||(I={}));export{m as CurrentClientBrowser,w as CurrentClientDevice,L as ErrorCategory,I as InterfaceLanguage,we as Logger,l as Observable,N as Subject,x as Subscription,be as VERSION,T as VKNumericLanguage,je as ValueSubject,u as VideoQuality,Se as abortable,Ee as addScript,Ne as areQualitiesExact,O as assertNever,me as assertNonNullable,ge as assertNullable,Me as assertQualityIsExact,Ge as buffer,pe as checkNever,ke as combine,Ve as debounce,X as fillWithDefault,ze as filter,$e as filterChanged,Ue as fromEvent,D as getCurrentBrowser,ye as getExponentialDelay,Le as getHighestQuality,Fe as interval,Re as isHigher,_e as isHigherOrEqual,Ae as isIOS,k as isInvariantQuality,M as isLower,ve as isLowerOrEqual,G as isNonNullable,V as isNullable,Je as loadVKLangPack,se as map,He as mapTo,qe as merge,y as noop,Oe as now,Qe as observableFrom,We as once,Be as pairwise,xe as safeStorage,Xe as tap,De as throttle,Ce as timeout,Pe as videoHeightToQuality,Ie as videoQualityToHeight,Te as videoSizeToQuality};
|
|
6
|
+
const be="1.0.29-beta.1";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`)},pe=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 we{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}const Ee=(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)}),Oe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Se=(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,p=/ipad/i.test(e)?l.iPad:void 0,w=/ipod/i.test(e)?l.iPod:void 0,E=/mac/i.test(e)?l.Mac:void 0,R=/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||p||w||R||E||l.Desktop}},Ae=()=>[l.iPhone,l.iPad,l.iPod].includes(j().device),ye=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(j().device),xe=(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 _=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(g!==void 0)return g;try{localStorage.setItem(_,"test"),localStorage.removeItem(_),g=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(_),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 Re=Object.freeze({__proto__:null,clear:B,get:$,has:H,isPersistent:z,remove:W,set:Y}),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}},_e=(e,t)=>f[e].height>f[t].height,ve=(e,t)=>f[e].height>=f[t].height,k=(e,t)=>f[e].height<f[t].height,Pe=(e,t)=>f[e].height<=f[t].height,Le=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),Te=(e,t=.02)=>[...q].find(n=>f[n].height*(1+t)>=e),Ie=({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})},Me=e=>f[e].height,F=e=>e===h.INVARIANT,Ne=e=>e.every(t=>!F(t));function je(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};class ke 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 qe(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 Fe(...e){return new u(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new x))}var Ce=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)}),Qe=e=>new u(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),Ue=e=>new u(t=>{e.forEach(r=>t.next(r))}),Ge=(e,t)=>new u(r=>{const n=i=>r.next(i);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function Ve(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 De(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 ze(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 $e(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 Ye(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 We(e){return se(()=>e)}function Be(){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 Xe(){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 Je(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 C 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 C,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",C.prototype[Symbol.toStringTag]="AbortSignal");function Q(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(!Q({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,p){let w;p&&p.signal&&(w=p.signal,delete p.signal);const E=new r(c,p);return w&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:w}),E},s.prototype=r.prototype);const o=t;return{fetch:(b,c)=>{const p=s&&s.prototype.isPrototypeOf(b)?b.signal:c?c.signal:void 0;if(p){let w;try{w=new DOMException("Aborted","AbortError")}catch{w=new Error("Aborted"),w.name="AbortError"}if(p.aborted)return Promise.reject(w);const E=new Promise((R,G)=>{p.addEventListener("abort",()=>G(w),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(b,c)])}return o(b,c)},Request:s}}const v=Q({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),U=v?le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ue=v?U.fetch:window.fetch;v?U.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",Ze=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,we as Logger,u as Observable,N as Subject,x as Subscription,be as VERSION,I as VKNumericLanguage,ke as ValueSubject,h as VideoQuality,Se as abortable,Ee as addScript,Ne as areQualitiesExact,O as assertNever,me as assertNonNullable,ge as assertNullable,je as assertQualityIsExact,Ve as buffer,pe as checkNever,qe as combine,De as debounce,X as fillWithDefault,$e as filter,Ye as filterChanged,Ge as fromEvent,j as getCurrentBrowser,xe as getExponentialDelay,Le as getHighestQuality,Qe as interval,_e as isHigher,ve as isHigherOrEqual,Ae as isIOS,F as isInvariantQuality,k as isLower,Pe as isLowerOrEqual,ye as isMacLike,V as isNonNullable,D as isNullable,Ze as loadVKLangPack,se as map,We as mapTo,Fe as merge,y as noop,Oe as now,Ue as observableFrom,Be as once,Xe as pairwise,Re as safeStorage,Je as tap,ze as throttle,Ce as timeout,Te as videoHeightToQuality,Me as videoQualityToHeight,Ie as videoSizeToQuality};
|
package/evergreen.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.29-beta.1
|
|
3
|
+
* Wed, 06 Sep 2023 16:19:06 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-29/doc/
|
|
5
5
|
*/
|
|
6
|
-
const ie="1.0.28";class x{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(s=>typeof s=="function"?s():s.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const m=e=>{throw new Error(`${e} is value of unexpected type`)},re=e=>{},S=()=>{};class c{constructor(t){t&&(this._subscribe=t)}subscribe(t,s){let n;s?typeof s=="function"?n={next:s,error:S}:n={next:r=>s.next(r),error:r=>s.error?.(r)}:n={next:S,error:S};const o=typeof t=="function"?{next:r=>{try{t(r)}catch(f){n.next(f)}},error:r=>n.next(r)}:{next:r=>t.next(r),error:r=>t.error?t.error(r):n.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 m(i)}})}pipe(...t){return t.reduce((s,n)=>n(s),this)}_subscribe(t){}}class R extends c{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(s=>s.next(t))}error(t){this.subscribers.forEach(s=>s.error?.(t))}_subscribe(t){const s=this.keyCounter++;return this.subscribers.set(s,t),new x().add(()=>this.subscribers.delete(s))}}class oe{log$=new R;logs=[];log=t=>{const s={...t,timestamp:Date.now()};this.logs.push(s),this.log$.next(s)};createCustomLog(t){return(...s)=>{let n;try{n=t(...s)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(s=>({component:t,...s}))}getAllLogs=()=>this.logs}function ae(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ce(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function k(e){return typeof e<"u"&&e!==null}function Q(e){return e==null}const ue=(e,t,s)=>new Promise((n,o)=>{t.addEventListener("abort",()=>{f(),b.remove()});const i=()=>{f(),o()},r=()=>{f(),n()},f=()=>{E&&clearTimeout(E),b.removeEventListener("load",r),b.removeEventListener("error",i)};let E;s&&(E=window.setTimeout(i,s));const b=document.createElement("script");b.addEventListener("load",r),b.addEventListener("error",i),b.src=e,document.head.appendChild(b)}),he=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),de=(e,t)=>async(...s)=>{const n=t(...s);let o=e.aborted,i;for(;!o&&!e.aborted;){const r=await n.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 d;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Desktop="Desktop"})(d||(d={}));const U=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?l.Yandex:void 0,s=/chrome|crios/i.test(e)?l.Chrome:void 0,n=/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)?d.Android:void 0,b=/iphone/i.test(e)?d.iPhone:void 0,L=/ipad/i.test(e)?d.iPad:void 0,M=/ipod/i.test(e)?d.iPod:void 0,N=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?d.RestMobile:void 0;return{browser:t||o||r||f||s||n||i||l.Rest,device:E||b||L||M||N||d.Desktop}},le=()=>[d.iPhone,d.iPad,d.iPod].includes(U().device),fe=(e,{start:t=0,factor:s=2,max:n=1/0,min:o=t,random:i=0}={})=>{let r=t;return r*=s**e,r*=1+(Math.random()*i*2-i),r=Math.round(r),r=Math.min(r,n),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 w,p;const O=`vk-videoplayer-dummy-key-${Math.random()}`,g=()=>{if(p!==void 0)return p;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),p=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),p=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)p=a.RUNTIME;else throw t}else throw e}return p===a.RUNTIME&&(w=new Map),p},j=()=>g()===a.LOCAL_STORAGE,G=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 w?.get(e);default:m(t)}},V=(e,t)=>{const s=g();switch(s){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 w?.set(e,t);default:m(s)}},z=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 w?.has(e)??!1;default:return m(t),!1}},D=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 w?.delete(e);default:m(t)}},F=()=>{const e=g();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return w?.clear();default:m(e)}};var be=Object.freeze({__proto__:null,clear:F,get:G,has:z,isPersistent:j,remove:D,set:V}),u;(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"})(u||(u={}));const h={[u.Q_144P]:{width:256,height:144},[u.Q_240P]:{width:428,height:240},[u.Q_360P]:{width:640,height:360},[u.Q_480P]:{width:856,height:480},[u.Q_720P]:{width:1280,height:720},[u.Q_1080P]:{width:1920,height:1080},[u.Q_1440P]:{width:2560,height:1440},[u.Q_2160P]:{width:3840,height:2160},[u.Q_4320P]:{width:7680,height:4320}},pe=(e,t)=>h[e].height>h[t].height,me=(e,t)=>h[e].height>=h[t].height,T=(e,t)=>h[e].height<h[t].height,we=(e,t)=>h[e].height<=h[t].height,ge=e=>e.sort((t,s)=>t===s?0:t===u.INVARIANT?1:s===u.INVARIANT?-1:T(t,s)?1:-1)[0],P=Object.keys(h).sort((e,t)=>T(e,t)?-1:1),Ee=(e,t=.02)=>[...P].find(n=>h[n].height*(1+t)>=e),Se=({width:e,height:t})=>{const s=Math.min(e,t),n=Math.max(e,t);return P.find(o=>{const i=h[o];return i.width>=n&&i.height>=s})},xe=e=>h[e].height,y=e=>e===u.INVARIANT,Oe=e=>e.every(t=>!y(t));function Ae(e){if(y(e))throw new Error("Expected exact quality")}const $=(e,t)=>{const s={};for(const n of Object.keys(t)){const o=t[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?s[n]=i:typeof o=="object"&&typeof i=="object"?s[n]=$(i,o):s[n]=n in e?i:o}return s};class _e extends R{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 s=super._subscribe(t);return t.next(this.value),s}}function Ie(e){return new c(t=>{const s={};let n=Object.keys(e).length;const o=i=>r=>{i in s||n--,s[i]=r,n===0&&t.next(s)};return Object.entries(e).reduce((i,[r,f])=>i.add(f.subscribe(o(r))),new x)})}function ve(...e){return new c(t=>e.reduce((s,n)=>s.add(n.subscribe(t)),new x))}var Re=e=>new c(t=>{const s=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(s)}),Te=e=>new c(t=>{const s=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(s)}),Pe=e=>new c(t=>{e.forEach(s=>t.next(s))}),ye=(e,t)=>new c(s=>{const n=o=>s.next(o);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function Le(e){return t=>new c(s=>t.subscribe(new q(s,e)))}class q{destination;size;lastValues=[];constructor(t,s){this.destination=t,this.size=s}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 H={leading:!1,trailing:!0};function Me(e,t=H){return s=>new c(n=>s.subscribe(new Y(n,e,t)))}class Y{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}next(t){this.lastValue=t,k(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(s){if(this.destination.error)this.destination.error(s);else throw s}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const W={leading:!0,trailing:!1};function Ne(e,t=W){return s=>new c(n=>s.subscribe(new C(n,e,t)))}class C{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}next(t){this.lastValue=t,Q(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 ke(e){return t=>new c(s=>t.subscribe(new X(s,e)))}class X{destination;predicate;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.predicate(t)}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Qe(e=(t,s)=>t===s){return t=>new c(s=>t.subscribe(new J(s,e)))}const A={};class J{destination;predicate;lastValue=A;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Z(e){return t=>new c(s=>t.subscribe(new B(s,e)))}let B=class{destination;mapper;constructor(t,s){this.destination=t,this.mapper=s}next(t){let s;try{s=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(s)}error(t){this.destination.error?.(t)}};function je(e){return Z(()=>e)}function Ge(){return e=>new c(t=>{let s=!1,n=!1;const o=e.subscribe(i=>{s||(s=!0,t.next(i)),n&&o.unsubscribe()},i=>{s=!0,t.error?.(i),n&&o.unsubscribe()});return n=!0,s&&o.unsubscribe(),o})}function Ve(){return e=>new c(t=>e.subscribe(new K(t)))}class K{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const s=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([s,t])}error(t){this.destination.error?.(t)}}function ze(e){return t=>new c(s=>t.subscribe(new ee(s,e)))}class ee{destination;effect;constructor(t,s){this.destination=t,this.effect=s}next(t){try{this.effect(t)}catch(s){throw this.error(s),s}this.destination.next(t)}error(t){this.destination.error?.(t)}}var _;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(_||(_={}));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 te="vk.com",De=async(e,t,s)=>{const n=new URL(`https://${te}/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 fetch(n.toString())).json();return se(i,s)},se=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([s,n])=>[s.substring(`${t}_`.length),ne(n)])),ne=e=>Array.isArray(e)?e[0]:e;var v;(function(e){e.RU="ru",e.EN="en"})(v||(v={}));export{l as CurrentClientBrowser,d as CurrentClientDevice,_ as ErrorCategory,v as InterfaceLanguage,oe as Logger,c as Observable,R as Subject,x as Subscription,ie as VERSION,I as VKNumericLanguage,_e as ValueSubject,u as VideoQuality,de as abortable,ue as addScript,Oe as areQualitiesExact,m as assertNever,ae as assertNonNullable,ce as assertNullable,Ae as assertQualityIsExact,Le as buffer,re as checkNever,Ie as combine,Me as debounce,$ as fillWithDefault,ke as filter,Qe as filterChanged,ye as fromEvent,U as getCurrentBrowser,fe as getExponentialDelay,ge as getHighestQuality,Te as interval,pe as isHigher,me as isHigherOrEqual,le as isIOS,y as isInvariantQuality,T as isLower,we as isLowerOrEqual,k as isNonNullable,Q as isNullable,De as loadVKLangPack,Z as map,je as mapTo,ve as merge,S as noop,he as now,Pe as observableFrom,Ge as once,Ve as pairwise,be as safeStorage,ze as tap,Ne as throttle,Re as timeout,Ee as videoHeightToQuality,xe as videoQualityToHeight,Se as videoSizeToQuality};
|
|
6
|
+
const re="1.0.29-beta.1";class x{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(s=>typeof s=="function"?s():s.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=e=>{throw new Error(`${e} is value of unexpected type`)},oe=e=>{},S=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,s){let n;s?typeof s=="function"?n={next:s,error:S}:n={next:r=>s.next(r),error:r=>s.error?.(r)}:n={next:S,error:S};const o=typeof t=="function"?{next:r=>{try{t(r)}catch(f){n.next(f)}},error:r=>n.next(r)}:{next:r=>t.next(r),error:r=>t.error?t.error(r):n.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 p(i)}})}pipe(...t){return t.reduce((s,n)=>n(s),this)}_subscribe(t){}}class v extends u{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(s=>s.next(t))}error(t){this.subscribers.forEach(s=>s.error?.(t))}_subscribe(t){const s=this.keyCounter++;return this.subscribers.set(s,t),new x().add(()=>this.subscribers.delete(s))}}class ae{log$=new v;logs=[];log=t=>{const s={...t,timestamp:Date.now()};this.logs.push(s),this.log$.next(s)};createCustomLog(t){return(...s)=>{let n;try{n=t(...s)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(s=>({component:t,...s}))}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 U(e){return typeof e<"u"&&e!==null}function j(e){return e==null}const he=(e,t,s)=>new Promise((n,o)=>{t.addEventListener("abort",()=>{f(),b.remove()});const i=()=>{f(),o()},r=()=>{f(),n()},f=()=>{E&&clearTimeout(E),b.removeEventListener("load",r),b.removeEventListener("error",i)};let E;s&&(E=window.setTimeout(i,s));const b=document.createElement("script");b.addEventListener("load",r),b.addEventListener("error",i),b.src=e,document.head.appendChild(b)}),de=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),le=(e,t)=>async(...s)=>{const n=t(...s);let o=e.aborted,i;for(;!o&&!e.aborted;){const r=await n.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 R=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?l.Yandex:void 0,s=/chrome|crios/i.test(e)?l.Chrome:void 0,n=/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,b=/iphone/i.test(e)?c.iPhone:void 0,M=/ipad/i.test(e)?c.iPad:void 0,N=/ipod/i.test(e)?c.iPod:void 0,k=/mac/i.test(e)?c.Mac:void 0,Q=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?c.RestMobile:void 0;return{browser:t||o||r||f||s||n||i||l.Rest,device:E||b||M||N||Q||k||c.Desktop}},fe=()=>[c.iPhone,c.iPad,c.iPod].includes(R().device),be=()=>[c.Mac,c.iPhone,c.iPad,c.iPod].includes(R().device),me=(e,{start:t=0,factor:s=2,max:n=1/0,min:o=t,random:i=0}={})=>{let r=t;return r*=s**e,r*=1+(Math.random()*i*2-i),r=Math.round(r),r=Math.min(r,n),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 w,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&&(w=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 w?.get(e);default:p(t)}},z=(e,t)=>{const s=g();switch(s){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 w?.set(e,t);default:p(s)}},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 w?.has(e)??!1;default:return p(t),!1}},D=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 w?.delete(e);default:p(t)}},$=()=>{const e=g();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return w?.clear();default:p(e)}};var pe=Object.freeze({__proto__:null,clear:$,get:V,has:F,isPersistent:G,remove:D,set:z}),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}},we=(e,t)=>d[e].height>d[t].height,ge=(e,t)=>d[e].height>=d[t].height,T=(e,t)=>d[e].height<d[t].height,Ee=(e,t)=>d[e].height<=d[t].height,Se=e=>e.sort((t,s)=>t===s?0:t===h.INVARIANT?1:s===h.INVARIANT?-1:T(t,s)?1:-1)[0],y=Object.keys(d).sort((e,t)=>T(e,t)?-1:1),xe=(e,t=.02)=>[...y].find(n=>d[n].height*(1+t)>=e),Oe=({width:e,height:t})=>{const s=Math.min(e,t),n=Math.max(e,t);return y.find(o=>{const i=d[o];return i.width>=n&&i.height>=s})},Ae=e=>d[e].height,L=e=>e===h.INVARIANT,_e=e=>e.every(t=>!L(t));function Pe(e){if(L(e))throw new Error("Expected exact quality")}const q=(e,t)=>{const s={};for(const n of Object.keys(t)){const o=t[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?s[n]=i:typeof o=="object"&&typeof i=="object"?s[n]=q(i,o):s[n]=n in e?i:o}return s};class Ie extends v{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 s=super._subscribe(t);return t.next(this.value),s}}function ve(e){return new u(t=>{const s={};let n=Object.keys(e).length;const o=i=>r=>{i in s||n--,s[i]=r,n===0&&t.next(s)};return Object.entries(e).reduce((i,[r,f])=>i.add(f.subscribe(o(r))),new x)})}function Re(...e){return new u(t=>e.reduce((s,n)=>s.add(n.subscribe(t)),new x))}var Te=e=>new u(t=>{const s=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(s)}),ye=e=>new u(t=>{const s=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(s)}),Le=e=>new u(t=>{e.forEach(s=>t.next(s))}),Me=(e,t)=>new u(s=>{const n=o=>s.next(o);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function Ne(e){return t=>new u(s=>t.subscribe(new H(s,e)))}class H{destination;size;lastValues=[];constructor(t,s){this.destination=t,this.size=s}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 ke(e,t=Y){return s=>new u(n=>s.subscribe(new W(n,e,t)))}class W{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}next(t){this.lastValue=t,U(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(s){if(this.destination.error)this.destination.error(s);else throw s}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const X={leading:!0,trailing:!1};function Qe(e,t=X){return s=>new u(n=>s.subscribe(new C(n,e,t)))}class C{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}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 Ue(e){return t=>new u(s=>t.subscribe(new J(s,e)))}class J{destination;predicate;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.predicate(t)}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function je(e=(t,s)=>t===s){return t=>new u(s=>t.subscribe(new Z(s,e)))}const A={};class Z{destination;predicate;lastValue=A;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function B(e){return t=>new u(s=>t.subscribe(new K(s,e)))}let K=class{destination;mapper;constructor(t,s){this.destination=t,this.mapper=s}next(t){let s;try{s=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(s)}error(t){this.destination.error?.(t)}};function Ve(e){return B(()=>e)}function ze(){return e=>new u(t=>{let s=!1,n=!1;const o=e.subscribe(i=>{s||(s=!0,t.next(i)),n&&o.unsubscribe()},i=>{s=!0,t.error?.(i),n&&o.unsubscribe()});return n=!0,s&&o.unsubscribe(),o})}function Fe(){return e=>new u(t=>e.subscribe(new ee(t)))}class ee{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const s=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([s,t])}error(t){this.destination.error?.(t)}}function De(e){return t=>new u(s=>t.subscribe(new te(s,e)))}class te{destination;effect;constructor(t,s){this.destination=t,this.effect=s}next(t){try{this.effect(t)}catch(s){throw this.error(s),s}this.destination.next(t)}error(t){this.destination.error?.(t)}}var _;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(_||(_={}));var P;(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"})(P||(P={}));const se="vk.com",$e=async(e,t,s)=>{const n=new URL(`https://${se}/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 fetch(n.toString())).json();return ne(i,s)},ne=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([s,n])=>[s.substring(`${t}_`.length),ie(n)])),ie=e=>Array.isArray(e)?e[0]:e;var I;(function(e){e.RU="ru",e.EN="en"})(I||(I={}));export{l as CurrentClientBrowser,c as CurrentClientDevice,_ as ErrorCategory,I as InterfaceLanguage,ae as Logger,u as Observable,v as Subject,x as Subscription,re as VERSION,P as VKNumericLanguage,Ie as ValueSubject,h as VideoQuality,le as abortable,he as addScript,_e as areQualitiesExact,p as assertNever,ce as assertNonNullable,ue as assertNullable,Pe as assertQualityIsExact,Ne as buffer,oe as checkNever,ve as combine,ke as debounce,q as fillWithDefault,Ue as filter,je as filterChanged,Me as fromEvent,R as getCurrentBrowser,me as getExponentialDelay,Se as getHighestQuality,ye as interval,we as isHigher,ge as isHigherOrEqual,fe as isIOS,L as isInvariantQuality,T as isLower,Ee as isLowerOrEqual,be as isMacLike,U as isNonNullable,j as isNullable,$e as loadVKLangPack,B as map,Ve as mapTo,Re as merge,S as noop,de as now,Le as observableFrom,ze as once,Fe as pairwise,pe as safeStorage,De as tap,Qe as throttle,Te as timeout,xe as videoHeightToQuality,Ae as videoQualityToHeight,Oe as videoSizeToQuality};
|
package/index.d.ts
CHANGED
|
@@ -128,6 +128,7 @@ declare enum CurrentClientDevice {
|
|
|
128
128
|
iPad = "iPad",
|
|
129
129
|
iPod = "iPod",
|
|
130
130
|
RestMobile = "RestMobile",
|
|
131
|
+
Mac = "Mac",
|
|
131
132
|
Desktop = "Desktop"
|
|
132
133
|
}
|
|
133
134
|
type ICurrentBrowserInfo = {
|
|
@@ -136,6 +137,7 @@ type ICurrentBrowserInfo = {
|
|
|
136
137
|
};
|
|
137
138
|
declare const getCurrentBrowser: () => ICurrentBrowserInfo;
|
|
138
139
|
declare const isIOS: () => boolean;
|
|
140
|
+
declare const isMacLike: () => boolean;
|
|
139
141
|
|
|
140
142
|
type ExponentialBackoffConfig = Partial<{
|
|
141
143
|
start: Milliseconds;
|
|
@@ -370,4 +372,4 @@ declare enum VKNumericLanguage {
|
|
|
370
372
|
type VKLanguage = VKNumericLanguage | string;
|
|
371
373
|
declare const loadVKLangPack: <T extends StringRecord>(language: VKLanguage, packName: string, packPrefix: string) => Promise<T>;
|
|
372
374
|
|
|
373
|
-
export { Byte, CurrentClientBrowser, CurrentClientDevice, ErrorCategory, ExactVideoQuality, ExponentialBackoffConfig, IComponentLogEntry, IComponentLogger, ICurrentBrowserInfo, IEmitter, IError, IListener, ILogEntry, ILogInputEntry, ILogger, IObservable, IOperator, IRange, IRectangle, ISubject, ISubscription, IUnsubscriber, IValue, IValueObservable, IValueSubject, IWarning, InterfaceLanguage, Kbps, Logger, Mbps, Milliseconds, Observable, Percentage, QualityLimits, RecursivePartial, Seconds, StringRecord, Subject, Subscription, VERSION, VKLanguage, VKNumericLanguage, ValueSubject, VideoQuality, abortable, addScript, areQualitiesExact, assertNever, assertNonNullable, assertNullable, assertQualityIsExact, bps, buffer, checkNever, combine, debounce, fillWithDefault, filter, filterChanged, _default as fromEvent, getCurrentBrowser, getExponentialDelay, getHighestQuality, _default$2 as interval, isHigher, isHigherOrEqual, isIOS, isInvariantQuality, isLower, isLowerOrEqual, isNonNullable, isNullable, loadVKLangPack, map, mapTo, merge, noop, now, _default$1 as observableFrom, once, pairwise, iframeSafeStorage_d as safeStorage, tap, throttle, _default$3 as timeout, videoHeightToQuality, videoQualityToHeight, videoSizeToQuality };
|
|
375
|
+
export { Byte, CurrentClientBrowser, CurrentClientDevice, ErrorCategory, ExactVideoQuality, ExponentialBackoffConfig, IComponentLogEntry, IComponentLogger, ICurrentBrowserInfo, IEmitter, IError, IListener, ILogEntry, ILogInputEntry, ILogger, IObservable, IOperator, IRange, IRectangle, ISubject, ISubscription, IUnsubscriber, IValue, IValueObservable, IValueSubject, IWarning, InterfaceLanguage, Kbps, Logger, Mbps, Milliseconds, Observable, Percentage, QualityLimits, RecursivePartial, Seconds, StringRecord, Subject, Subscription, VERSION, VKLanguage, VKNumericLanguage, ValueSubject, VideoQuality, abortable, addScript, areQualitiesExact, assertNever, assertNonNullable, assertNullable, assertQualityIsExact, bps, buffer, checkNever, combine, debounce, fillWithDefault, filter, filterChanged, _default as fromEvent, getCurrentBrowser, getExponentialDelay, getHighestQuality, _default$2 as interval, isHigher, isHigherOrEqual, isIOS, isInvariantQuality, isLower, isLowerOrEqual, isMacLike, isNonNullable, isNullable, loadVKLangPack, map, mapTo, merge, noop, now, _default$1 as observableFrom, once, pairwise, iframeSafeStorage_d as safeStorage, tap, throttle, _default$3 as timeout, videoHeightToQuality, videoQualityToHeight, videoSizeToQuality };
|