@vkontakte/videoplayer-shared 1.0.22 → 1.0.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.22
3
- * Fri, 24 Mar 2023 11:20:56 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-22/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.23
3
+ * Fri, 14 Apr 2023 14:20:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-23/doc/
5
5
  */
6
6
  "use strict";class f{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(e=>typeof e=="function"?e():e.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const m=i=>{throw new Error(`${i} is value of unexpected type`)},E=i=>{},h=()=>{};class c{constructor(t){t&&(this._subscribe=t)}subscribe(t,e){var n;let a;e?typeof e=="function"?a={next:e,error:h}:a={next:o=>e.next(o),error:o=>{var u;return(u=e.error)===null||u===void 0?void 0:u.call(e,o)}}:a={next:h,error:h};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(u){a.next(u)}},error:o=>a.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):a.next(o)};let r;try{r=this._subscribe(s)}catch(o){(n=s.error)===null||n===void 0||n.call(s,o)}return new f().add(()=>{switch(s.next=h,s.error=h,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return m(r)}})}pipe(...t){return t.reduce((e,n)=>n(e),this)}_subscribe(t){}}class v extends c{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach(e=>e.next(t))}error(t){this.subscribers.forEach(e=>{var n;return(n=e.error)===null||n===void 0?void 0:n.call(e,t)})}_subscribe(t){const e=this.keyCounter++;return this.subscribers.set(e,t),new f().add(()=>this.subscribers.delete(e))}}class L{constructor(){this.log$=new v,this.logs=[],this.log=t=>{const e=Object.assign(Object.assign({},t),{timestamp:Date.now()});this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let n;try{n=t(...e)}catch(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(e=>Object.assign({component:t},e))}}function y(i,t='Assertion "value is not nullable" failed'){if(i==null)throw new Error(t)}function V(i,t='Assertion "value is nullable" failed'){if(i!=null)throw new Error(t)}function x(i){return typeof i!="undefined"&&i!==null}function g(i){return i==null}const N=(i,t,e)=>new Promise((n,a)=>{t.addEventListener("abort",()=>{o(),l.remove()});const s=()=>{o(),a()},r=()=>{o(),n()},o=()=>{u&&clearTimeout(u),l.removeEventListener("load",r),l.removeEventListener("error",s)};let u;e&&(u=window.setTimeout(s,e));const l=document.createElement("script");l.addEventListener("load",r),l.addEventListener("error",s),l.src=i,document.head.appendChild(l)});var w;const T=typeof((w=window.performance)===null||w===void 0?void 0:w.now)=="function"?()=>window.performance.now():()=>Date.now();function A(i,t,e,n){function a(s){return s instanceof e?s:new e(function(r){r(s)})}return new(e||(e=Promise))(function(s,r){function o(d){try{l(n.next(d))}catch(b){r(b)}}function u(d){try{l(n.throw(d))}catch(b){r(b)}}function l(d){d.done?s(d.value):a(d.value).then(o,u)}l((n=n.apply(i,t||[])).next())})}const C=(i,t)=>(...e)=>A(void 0,void 0,void 0,function*(){var n;const a=t(...e);let s=i.aborted,r;for(;!s&&!i.aborted;){const o=yield a.next(r);s=(n=o.done)!==null&&n!==void 0?n:!1,r=o.value}return r}),I=(i,{start:t=0,factor:e=2,max:n=1/0,min:a=t,random:s=0}={})=>{let r=t;return r*=Math.pow(e,i),r*=1+(Math.random()*s*2-s),r=Math.round(r),r=Math.min(r,n),r=Math.max(r,a),r};class D extends v{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 e=super._subscribe(t);return t.next(this.value),e}}function O(i){return new c(t=>{const e={};let n=Object.keys(i).length;const a=s=>r=>{s in e||n--,e[s]=r,n===0&&t.next(e)};return Object.entries(i).reduce((s,[r,o])=>s.add(o.subscribe(a(r))),new f)})}function j(...i){return new c(t=>i.reduce((e,n)=>e.add(n.subscribe(t)),new f))}var M=i=>new c(t=>{const e=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},i);return()=>window.clearTimeout(e)}),S=i=>new c(t=>{const e=window.setInterval(()=>t.next(),i);return()=>window.clearInterval(e)}),F=i=>new c(t=>{i.forEach(e=>t.next(e))}),k=(i,t)=>new c(e=>{const n=a=>e.next(a);return i.addEventListener(t,n),()=>i.removeEventListener(t,n)});function R(i){return t=>new c(e=>t.subscribe(new $(e,i)))}class ${constructor(t,e){this.destination=t,this.size=e,this.lastValues=[]}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}const P={leading:!1,trailing:!0};function z(i,t=P){return e=>new c(n=>e.subscribe(new K(n,i,t)))}class K{constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,x(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(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}const W={leading:!0,trailing:!1};function Y(i,t=W){return e=>new c(n=>e.subscribe(new B(n,i,t)))}class B{constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,g(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){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function U(i){return t=>new c(e=>t.subscribe(new X(e,i)))}class X{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(n){throw this.error(n),n}e&&this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function q(i=(t,e)=>t===e){return t=>new c(e=>t.subscribe(new G(e,i)))}const p={};class G{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=p}next(t){let e;try{e=this.lastValue===p||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}e&&this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function _(i){return t=>new c(e=>t.subscribe(new H(e,i)))}let H=class{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(e)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}};function J(i){return _(()=>i)}function Q(){return i=>new c(t=>{let e=!1,n=!1;const a=i.subscribe(s=>{e||(e=!0,t.next(s)),n&&a.unsubscribe()},s=>{var r;e=!0,(r=t.error)===null||r===void 0||r.call(t,s),n&&a.unsubscribe()});return n=!0,e&&a.unsubscribe(),a})}function Z(){return i=>new c(t=>i.subscribe(new tt(t)))}class tt{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([e,t])}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function et(i){return t=>new c(e=>t.subscribe(new nt(e,i)))}class nt{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(e){throw this.error(e),e}this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}exports.ErrorCategory=void 0;(function(i){i.NETWORK="network",i.VIDEO_PIPELINE="video_pipeline",i.EXTERNAL_API="external_api",i.PARSER="parser",i.DOM="dom",i.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));const it=5;exports.ACTIVE_LIVE_VALID_DELAY=it;exports.Logger=L;exports.Observable=c;exports.Subject=v;exports.Subscription=f;exports.ValueSubject=D;exports.abortable=C;exports.addScript=N;exports.assertNever=m;exports.assertNonNullable=y;exports.assertNullable=V;exports.buffer=R;exports.checkNever=E;exports.combine=O;exports.debounce=z;exports.filter=U;exports.filterChanged=q;exports.fromEvent=k;exports.getExponentialDelay=I;exports.interval=S;exports.isNonNullable=x;exports.isNullable=g;exports.map=_;exports.mapTo=J;exports.merge=j;exports.noop=h;exports.now=T;exports.observableFrom=F;exports.once=Q;exports.pairwise=Z;exports.tap=et;exports.throttle=Y;exports.timeout=M;
package/es2015.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.22
3
- * Fri, 24 Mar 2023 11:20:56 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-22/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.23
3
+ * Fri, 14 Apr 2023 14:20:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-23/doc/
5
5
  */
6
6
  class f{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(e=>typeof e=="function"?e():e.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=i=>{throw new Error(`${i} is value of unexpected type`)},D=i=>{},d=()=>{};class c{constructor(t){t&&(this._subscribe=t)}subscribe(t,e){var n;let a;e?typeof e=="function"?a={next:e,error:d}:a={next:o=>e.next(o),error:o=>{var u;return(u=e.error)===null||u===void 0?void 0:u.call(e,o)}}:a={next:d,error:d};const r=typeof t=="function"?{next:o=>{try{t(o)}catch(u){a.next(u)}},error:o=>a.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):a.next(o)};let s;try{s=this._subscribe(r)}catch(o){(n=r.error)===null||n===void 0||n.call(r,o)}return new f().add(()=>{switch(r.next=d,r.error=d,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return x(s)}})}pipe(...t){return t.reduce((e,n)=>n(e),this)}_subscribe(t){}}class m extends c{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach(e=>e.next(t))}error(t){this.subscribers.forEach(e=>{var n;return(n=e.error)===null||n===void 0?void 0:n.call(e,t)})}_subscribe(t){const e=this.keyCounter++;return this.subscribers.set(e,t),new f().add(()=>this.subscribers.delete(e))}}class F{constructor(){this.log$=new m,this.logs=[],this.log=t=>{const e=Object.assign(Object.assign({},t),{timestamp:Date.now()});this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let n;try{n=t(...e)}catch(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(e=>Object.assign({component:t},e))}}function S(i,t='Assertion "value is not nullable" failed'){if(i==null)throw new Error(t)}function k(i,t='Assertion "value is nullable" failed'){if(i!=null)throw new Error(t)}function _(i){return typeof i!="undefined"&&i!==null}function g(i){return i==null}const R=(i,t,e)=>new Promise((n,a)=>{t.addEventListener("abort",()=>{o(),l.remove()});const r=()=>{o(),a()},s=()=>{o(),n()},o=()=>{u&&clearTimeout(u),l.removeEventListener("load",s),l.removeEventListener("error",r)};let u;e&&(u=window.setTimeout(r,e));const l=document.createElement("script");l.addEventListener("load",s),l.addEventListener("error",r),l.src=i,document.head.appendChild(l)});var w;const $=typeof((w=window.performance)===null||w===void 0?void 0:w.now)=="function"?()=>window.performance.now():()=>Date.now();function E(i,t,e,n){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function o(h){try{l(n.next(h))}catch(b){s(b)}}function u(h){try{l(n.throw(h))}catch(b){s(b)}}function l(h){h.done?r(h.value):a(h.value).then(o,u)}l((n=n.apply(i,t||[])).next())})}const P=(i,t)=>(...e)=>E(void 0,void 0,void 0,function*(){var n;const a=t(...e);let r=i.aborted,s;for(;!r&&!i.aborted;){const o=yield a.next(s);r=(n=o.done)!==null&&n!==void 0?n:!1,s=o.value}return s}),z=(i,{start:t=0,factor:e=2,max:n=1/0,min:a=t,random:r=0}={})=>{let s=t;return s*=Math.pow(e,i),s*=1+(Math.random()*r*2-r),s=Math.round(s),s=Math.min(s,n),s=Math.max(s,a),s};class K extends m{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function W(i){return new c(t=>{const e={};let n=Object.keys(i).length;const a=r=>s=>{r in e||n--,e[r]=s,n===0&&t.next(e)};return Object.entries(i).reduce((r,[s,o])=>r.add(o.subscribe(a(s))),new f)})}function B(...i){return new c(t=>i.reduce((e,n)=>e.add(n.subscribe(t)),new f))}var U=i=>new c(t=>{const e=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},i);return()=>window.clearTimeout(e)}),X=i=>new c(t=>{const e=window.setInterval(()=>t.next(),i);return()=>window.clearInterval(e)}),Y=i=>new c(t=>{i.forEach(e=>t.next(e))}),q=(i,t)=>new c(e=>{const n=a=>e.next(a);return i.addEventListener(t,n),()=>i.removeEventListener(t,n)});function G(i){return t=>new c(e=>t.subscribe(new L(e,i)))}class L{constructor(t,e){this.destination=t,this.size=e,this.lastValues=[]}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}const y={leading:!1,trailing:!0};function H(i,t=y){return e=>new c(n=>e.subscribe(new V(n,i,t)))}class V{constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,_(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}const T={leading:!0,trailing:!1};function J(i,t=T){return e=>new c(n=>e.subscribe(new N(n,i,t)))}class N{constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,g(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){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function Q(i){return t=>new c(e=>t.subscribe(new A(e,i)))}class A{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(n){throw this.error(n),n}e&&this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function Z(i=(t,e)=>t===e){return t=>new c(e=>t.subscribe(new I(e,i)))}const v={};class I{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=v}next(t){let e;try{e=this.lastValue===v||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}e&&this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function M(i){return t=>new c(e=>t.subscribe(new O(e,i)))}let O=class{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(e)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}};function et(i){return M(()=>i)}function nt(){return i=>new c(t=>{let e=!1,n=!1;const a=i.subscribe(r=>{e||(e=!0,t.next(r)),n&&a.unsubscribe()},r=>{var s;e=!0,(s=t.error)===null||s===void 0||s.call(t,r),n&&a.unsubscribe()});return n=!0,e&&a.unsubscribe(),a})}function it(){return i=>new c(t=>i.subscribe(new C(t)))}class C{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([e,t])}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function st(i){return t=>new c(e=>t.subscribe(new j(e,i)))}class j{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(e){throw this.error(e),e}this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}var p;(function(i){i.NETWORK="network",i.VIDEO_PIPELINE="video_pipeline",i.EXTERNAL_API="external_api",i.PARSER="parser",i.DOM="dom",i.WTF="wtf"})(p||(p={}));const rt=5;export{rt as ACTIVE_LIVE_VALID_DELAY,p as ErrorCategory,F as Logger,c as Observable,m as Subject,f as Subscription,K as ValueSubject,P as abortable,R as addScript,x as assertNever,S as assertNonNullable,k as assertNullable,G as buffer,D as checkNever,W as combine,H as debounce,Q as filter,Z as filterChanged,q as fromEvent,z as getExponentialDelay,X as interval,_ as isNonNullable,g as isNullable,M as map,et as mapTo,B as merge,d as noop,$ as now,Y as observableFrom,nt as once,it as pairwise,st as tap,J as throttle,U as timeout};
package/es2018.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.22
3
- * Fri, 24 Mar 2023 11:20:56 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-22/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.23
3
+ * Fri, 14 Apr 2023 14:20:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-23/doc/
5
5
  */
6
6
  "use strict";class d{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(e=>typeof e=="function"?e():e.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const v=n=>{throw new Error(`${n} is value of unexpected type`)},g=n=>{},h=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,e){var r;let a;e?typeof e=="function"?a={next:e,error:h}:a={next:o=>e.next(o),error:o=>{var c;return(c=e.error)===null||c===void 0?void 0:c.call(e,o)}}:a={next:h,error:h};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(c){a.next(c)}},error:o=>a.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):a.next(o)};let i;try{i=this._subscribe(s)}catch(o){(r=s.error)===null||r===void 0||r.call(s,o)}return new d().add(()=>{switch(s.next=h,s.error=h,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return v(i)}})}pipe(...t){return t.reduce((e,r)=>r(e),this)}_subscribe(t){}}class f extends u{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach(e=>e.next(t))}error(t){this.subscribers.forEach(e=>{var r;return(r=e.error)===null||r===void 0?void 0:r.call(e,t)})}_subscribe(t){const e=this.keyCounter++;return this.subscribers.set(e,t),new d().add(()=>this.subscribers.delete(e))}}class _{constructor(){this.log$=new f,this.logs=[],this.log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(a){r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(e=>({component:t,...e}))}}function E(n,t='Assertion "value is not nullable" failed'){if(n==null)throw new Error(t)}function L(n,t='Assertion "value is nullable" failed'){if(n!=null)throw new Error(t)}function p(n){return typeof n!="undefined"&&n!==null}function m(n){return n==null}const y=(n,t,e)=>new Promise((r,a)=>{t.addEventListener("abort",()=>{o(),l.remove()});const s=()=>{o(),a()},i=()=>{o(),r()},o=()=>{c&&clearTimeout(c),l.removeEventListener("load",i),l.removeEventListener("error",s)};let c;e&&(c=window.setTimeout(s,e));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",s),l.src=n,document.head.appendChild(l)});var b;const V=typeof((b=window.performance)===null||b===void 0?void 0:b.now)=="function"?()=>window.performance.now():()=>Date.now(),N=(n,t)=>async(...e)=>{var r;const a=t(...e);let s=n.aborted,i;for(;!s&&!n.aborted;){const o=await a.next(i);s=(r=o.done)!==null&&r!==void 0?r:!1,i=o.value}return i},T=(n,{start:t=0,factor:e=2,max:r=1/0,min:a=t,random:s=0}={})=>{let i=t;return i*=e**n,i*=1+(Math.random()*s*2-s),i=Math.round(i),i=Math.min(i,r),i=Math.max(i,a),i};class A extends f{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 e=super._subscribe(t);return t.next(this.value),e}}function C(n){return new u(t=>{const e={};let r=Object.keys(n).length;const a=s=>i=>{s in e||r--,e[s]=i,r===0&&t.next(e)};return Object.entries(n).reduce((s,[i,o])=>s.add(o.subscribe(a(i))),new d)})}function I(...n){return new u(t=>n.reduce((e,r)=>e.add(r.subscribe(t)),new d))}var D=n=>new u(t=>{const e=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},n);return()=>window.clearTimeout(e)}),S=n=>new u(t=>{const e=window.setInterval(()=>t.next(),n);return()=>window.clearInterval(e)}),M=n=>new u(t=>{n.forEach(e=>t.next(e))}),O=(n,t)=>new u(e=>{const r=a=>e.next(a);return n.addEventListener(t,r),()=>n.removeEventListener(t,r)});function j(n){return t=>new u(e=>t.subscribe(new F(e,n)))}class F{constructor(t,e){this.destination=t,this.size=e,this.lastValues=[]}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}}const k={leading:!1,trailing:!0};function P(n,t=k){return e=>new u(r=>e.subscribe(new R(r,n,t)))}class R{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,p(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(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(t){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}}const $={leading:!0,trailing:!1};function z(n,t=$){return e=>new u(r=>e.subscribe(new K(r,n,t)))}class K{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,m(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){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}}function W(n){return t=>new u(e=>t.subscribe(new Y(e,n)))}class Y{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(r){throw this.error(r),r}e&&this.destination.next(t)}error(t){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}}function B(n=(t,e)=>t===e){return t=>new u(e=>t.subscribe(new U(e,n)))}const w={};class U{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=w}next(t){let e;try{e=this.lastValue===w||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}e&&this.destination.next(t)}error(t){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}}function x(n){return t=>new u(e=>t.subscribe(new X(e,n)))}let X=class{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(e)}error(t){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}};function q(n){return x(()=>n)}function G(){return n=>new u(t=>{let e=!1,r=!1;const a=n.subscribe(s=>{e||(e=!0,t.next(s)),r&&a.unsubscribe()},s=>{var i;e=!0,(i=t.error)===null||i===void 0||i.call(t,s),r&&a.unsubscribe()});return r=!0,e&&a.unsubscribe(),a})}function H(){return n=>new u(t=>n.subscribe(new J(t)))}class J{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([e,t])}error(t){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}}function Q(n){return t=>new u(e=>t.subscribe(new Z(e,n)))}class Z{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(e){throw this.error(e),e}this.destination.next(t)}error(t){var e,r;(r=(e=this.destination).error)===null||r===void 0||r.call(e,t)}}exports.ErrorCategory=void 0;(function(n){n.NETWORK="network",n.VIDEO_PIPELINE="video_pipeline",n.EXTERNAL_API="external_api",n.PARSER="parser",n.DOM="dom",n.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));const tt=5;exports.ACTIVE_LIVE_VALID_DELAY=tt;exports.Logger=_;exports.Observable=u;exports.Subject=f;exports.Subscription=d;exports.ValueSubject=A;exports.abortable=N;exports.addScript=y;exports.assertNever=v;exports.assertNonNullable=E;exports.assertNullable=L;exports.buffer=j;exports.checkNever=g;exports.combine=C;exports.debounce=P;exports.filter=W;exports.filterChanged=B;exports.fromEvent=O;exports.getExponentialDelay=T;exports.interval=S;exports.isNonNullable=p;exports.isNullable=m;exports.map=x;exports.mapTo=q;exports.merge=I;exports.noop=h;exports.now=V;exports.observableFrom=M;exports.once=G;exports.pairwise=H;exports.tap=Q;exports.throttle=z;exports.timeout=D;
package/es2018.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.22
3
- * Fri, 24 Mar 2023 11:20:56 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-22/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.23
3
+ * Fri, 14 Apr 2023 14:20:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-23/doc/
5
5
  */
6
6
  class d{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(e=>typeof e=="function"?e():e.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=i=>{throw new Error(`${i} is value of unexpected type`)},M=i=>{},h=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,e){var n;let a;e?typeof e=="function"?a={next:e,error:h}:a={next:o=>e.next(o),error:o=>{var c;return(c=e.error)===null||c===void 0?void 0:c.call(e,o)}}:a={next:h,error:h};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(c){a.next(c)}},error:o=>a.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):a.next(o)};let r;try{r=this._subscribe(s)}catch(o){(n=s.error)===null||n===void 0||n.call(s,o)}return new d().add(()=>{switch(s.next=h,s.error=h,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return p(r)}})}pipe(...t){return t.reduce((e,n)=>n(e),this)}_subscribe(t){}}class v extends u{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach(e=>e.next(t))}error(t){this.subscribers.forEach(e=>{var n;return(n=e.error)===null||n===void 0?void 0:n.call(e,t)})}_subscribe(t){const e=this.keyCounter++;return this.subscribers.set(e,t),new d().add(()=>this.subscribers.delete(e))}}class D{constructor(){this.log$=new v,this.logs=[],this.log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let n;try{n=t(...e)}catch(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(e=>({component:t,...e}))}}function O(i,t='Assertion "value is not nullable" failed'){if(i==null)throw new Error(t)}function F(i,t='Assertion "value is nullable" failed'){if(i!=null)throw new Error(t)}function m(i){return typeof i!="undefined"&&i!==null}function x(i){return i==null}const P=(i,t,e)=>new Promise((n,a)=>{t.addEventListener("abort",()=>{o(),l.remove()});const s=()=>{o(),a()},r=()=>{o(),n()},o=()=>{c&&clearTimeout(c),l.removeEventListener("load",r),l.removeEventListener("error",s)};let c;e&&(c=window.setTimeout(s,e));const l=document.createElement("script");l.addEventListener("load",r),l.addEventListener("error",s),l.src=i,document.head.appendChild(l)});var f;const S=typeof((f=window.performance)===null||f===void 0?void 0:f.now)=="function"?()=>window.performance.now():()=>Date.now(),j=(i,t)=>async(...e)=>{var n;const a=t(...e);let s=i.aborted,r;for(;!s&&!i.aborted;){const o=await a.next(r);s=(n=o.done)!==null&&n!==void 0?n:!1,r=o.value}return r},k=(i,{start:t=0,factor:e=2,max:n=1/0,min:a=t,random:s=0}={})=>{let r=t;return r*=e**i,r*=1+(Math.random()*s*2-s),r=Math.round(r),r=Math.min(r,n),r=Math.max(r,a),r};class R extends v{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 e=super._subscribe(t);return t.next(this.value),e}}function $(i){return new u(t=>{const e={};let n=Object.keys(i).length;const a=s=>r=>{s in e||n--,e[s]=r,n===0&&t.next(e)};return Object.entries(i).reduce((s,[r,o])=>s.add(o.subscribe(a(r))),new d)})}function z(...i){return new u(t=>i.reduce((e,n)=>e.add(n.subscribe(t)),new d))}var K=i=>new u(t=>{const e=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},i);return()=>window.clearTimeout(e)}),W=i=>new u(t=>{const e=window.setInterval(()=>t.next(),i);return()=>window.clearInterval(e)}),B=i=>new u(t=>{i.forEach(e=>t.next(e))}),U=(i,t)=>new u(e=>{const n=a=>e.next(a);return i.addEventListener(t,n),()=>i.removeEventListener(t,n)});function X(i){return t=>new u(e=>t.subscribe(new _(e,i)))}class _{constructor(t,e){this.destination=t,this.size=e,this.lastValues=[]}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}const g={leading:!1,trailing:!0};function Y(i,t=g){return e=>new u(n=>e.subscribe(new E(n,i,t)))}class E{constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,m(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(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}const L={leading:!0,trailing:!1};function q(i,t=L){return e=>new u(n=>e.subscribe(new y(n,i,t)))}class y{constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,x(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){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function G(i){return t=>new u(e=>t.subscribe(new V(e,i)))}class V{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(n){throw this.error(n),n}e&&this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function H(i=(t,e)=>t===e){return t=>new u(e=>t.subscribe(new T(e,i)))}const b={};class T{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=b}next(t){let e;try{e=this.lastValue===b||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}e&&this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function N(i){return t=>new u(e=>t.subscribe(new A(e,i)))}let A=class{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(e)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}};function Q(i){return N(()=>i)}function Z(){return i=>new u(t=>{let e=!1,n=!1;const a=i.subscribe(s=>{e||(e=!0,t.next(s)),n&&a.unsubscribe()},s=>{var r;e=!0,(r=t.error)===null||r===void 0||r.call(t,s),n&&a.unsubscribe()});return n=!0,e&&a.unsubscribe(),a})}function tt(){return i=>new u(t=>i.subscribe(new I(t)))}class I{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([e,t])}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}function et(i){return t=>new u(e=>t.subscribe(new C(e,i)))}class C{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(e){throw this.error(e),e}this.destination.next(t)}error(t){var e,n;(n=(e=this.destination).error)===null||n===void 0||n.call(e,t)}}var w;(function(i){i.NETWORK="network",i.VIDEO_PIPELINE="video_pipeline",i.EXTERNAL_API="external_api",i.PARSER="parser",i.DOM="dom",i.WTF="wtf"})(w||(w={}));const nt=5;export{nt as ACTIVE_LIVE_VALID_DELAY,w as ErrorCategory,D as Logger,u as Observable,v as Subject,d as Subscription,R as ValueSubject,j as abortable,P as addScript,p as assertNever,O as assertNonNullable,F as assertNullable,X as buffer,M as checkNever,$ as combine,Y as debounce,G as filter,H as filterChanged,U as fromEvent,k as getExponentialDelay,W as interval,m as isNonNullable,x as isNullable,N as map,Q as mapTo,z as merge,h as noop,S as now,B as observableFrom,Z as once,tt as pairwise,et as tap,q as throttle,K as timeout};
package/esnext.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.22
3
- * Fri, 24 Mar 2023 11:20:56 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-22/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.23
3
+ * Fri, 14 Apr 2023 14:20:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-23/doc/
5
5
  */
6
6
  "use strict";class h{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 w=n=>{throw new Error(`${n} is value of unexpected type`)},g=n=>{},l=()=>{};class a{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){let s;t?typeof t=="function"?s={next:t,error:l}:s={next:r=>t.next(r),error:r=>t.error?.(r)}:s={next:l,error:l};const o=typeof e=="function"?{next:r=>{try{e(r)}catch(u){s.next(u)}},error:r=>s.next(r)}:{next:r=>e.next(r),error:r=>e.error?e.error(r):s.next(r)};let i;try{i=this._subscribe(o)}catch(r){o.error?.(r)}return new h().add(()=>{switch(o.next=l,o.error=l,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return w(i)}})}pipe(...e){return e.reduce((t,s)=>s(t),this)}_subscribe(e){}}class f extends a{keyCounter=0;subscribers=new Map;constructor(){super()}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.(e))}_subscribe(e){const t=this.keyCounter++;return this.subscribers.set(t,e),new h().add(()=>this.subscribers.delete(t))}}class E{log$=new f;logs=[];log=e=>{const t={...e,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)};createCustomLog(e){return(...t)=>{let s;try{s=e(...t)}catch{s={message:"error in `createCustomLog`",component:"Logger"}}this.log(s)}}createComponentLog(e){return this.createCustomLog(t=>({component:e,...t}))}getAllLogs=()=>this.logs}function v(n,e='Assertion "value is not nullable" failed'){if(n==null)throw new Error(e)}function L(n,e='Assertion "value is nullable" failed'){if(n!=null)throw new Error(e)}function p(n){return typeof n<"u"&&n!==null}function m(n){return n==null}const V=(n,e,t)=>new Promise((s,o)=>{e.addEventListener("abort",()=>{u(),c.remove()});const i=()=>{u(),o()},r=()=>{u(),s()},u=()=>{d&&clearTimeout(d),c.removeEventListener("load",r),c.removeEventListener("error",i)};let d;t&&(d=window.setTimeout(i,t));const c=document.createElement("script");c.addEventListener("load",r),c.addEventListener("error",i),c.src=n,document.head.appendChild(c)}),y=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),N=(n,e)=>async(...t)=>{const s=e(...t);let o=n.aborted,i;for(;!o&&!n.aborted;){const r=await s.next(i);o=r.done??!1,i=r.value}return i},_=(n,{start:e=0,factor:t=2,max:s=1/0,min:o=e,random:i=0}={})=>{let r=e;return r*=t**n,r*=1+(Math.random()*i*2-i),r=Math.round(r),r=Math.min(r,s),r=Math.max(r,o),r};class T extends f{value;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 A(n){return new a(e=>{const t={};let s=Object.keys(n).length;const o=i=>r=>{i in t||s--,t[i]=r,s===0&&e.next(t)};return Object.entries(n).reduce((i,[r,u])=>i.add(u.subscribe(o(r))),new h)})}function C(...n){return new a(e=>n.reduce((t,s)=>t.add(s.subscribe(e)),new h))}var I=n=>new a(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(s){if(e.error)e.error(s);else throw s}},n);return()=>window.clearTimeout(t)}),D=n=>new a(e=>{const t=window.setInterval(()=>e.next(),n);return()=>window.clearInterval(t)}),S=n=>new a(e=>{n.forEach(t=>e.next(t))}),M=(n,e)=>new a(t=>{const s=o=>t.next(o);return n.addEventListener(e,s),()=>n.removeEventListener(e,s)});function O(n){return e=>new a(t=>e.subscribe(new j(t,n)))}class j{destination;size;lastValues=[];constructor(e,t){this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){this.destination.error?.(e)}}const F={leading:!1,trailing:!0};function k(n,e=F){return t=>new a(s=>t.subscribe(new P(s,n,e)))}class P{destination;time;config;lastValue;timeout;constructor(e,t,s){this.destination=e,this.time=t,this.config=s}next(e){this.lastValue=e,p(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){this.destination.error?.(e)}}const R={leading:!0,trailing:!1};function $(n,e=R){return t=>new a(s=>t.subscribe(new z(s,n,e)))}class z{destination;time;config;lastValue;timeout;constructor(e,t,s){this.destination=e,this.time=t,this.config=s}next(e){this.lastValue=e,m(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){this.destination.error?.(e)}}function K(n){return e=>new a(t=>e.subscribe(new W(t,n)))}class W{destination;predicate;constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(s){throw this.error(s),s}t&&this.destination.next(e)}error(e){this.destination.error?.(e)}}function Y(n=(e,t)=>e===t){return e=>new a(t=>e.subscribe(new B(t,n)))}const b={};class B{destination;predicate;lastValue=b;constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===b||!this.predicate(this.lastValue,e),this.lastValue=e}catch(s){throw this.error(s),s}t&&this.destination.next(e)}error(e){this.destination.error?.(e)}}function x(n){return e=>new a(t=>e.subscribe(new U(t,n)))}let U=class{destination;mapper;constructor(e,t){this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(s){throw this.error(s),s}this.destination.next(t)}error(e){this.destination.error?.(e)}};function X(n){return x(()=>n)}function q(){return n=>new a(e=>{let t=!1,s=!1;const o=n.subscribe(i=>{t||(t=!0,e.next(i)),s&&o.unsubscribe()},i=>{t=!0,e.error?.(i),s&&o.unsubscribe()});return s=!0,t&&o.unsubscribe(),o})}function G(){return n=>new a(e=>n.subscribe(new H(e)))}class H{destination;last;hasLast=!1;constructor(e){this.destination=e}next(e){const t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){this.destination.error?.(e)}}function J(n){return e=>new a(t=>e.subscribe(new Q(t,n)))}class Q{destination;effect;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){this.destination.error?.(e)}}exports.ErrorCategory=void 0;(function(n){n.NETWORK="network",n.VIDEO_PIPELINE="video_pipeline",n.EXTERNAL_API="external_api",n.PARSER="parser",n.DOM="dom",n.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));const Z=5;exports.ACTIVE_LIVE_VALID_DELAY=Z;exports.Logger=E;exports.Observable=a;exports.Subject=f;exports.Subscription=h;exports.ValueSubject=T;exports.abortable=N;exports.addScript=V;exports.assertNever=w;exports.assertNonNullable=v;exports.assertNullable=L;exports.buffer=O;exports.checkNever=g;exports.combine=A;exports.debounce=k;exports.filter=K;exports.filterChanged=Y;exports.fromEvent=M;exports.getExponentialDelay=_;exports.interval=D;exports.isNonNullable=p;exports.isNullable=m;exports.map=x;exports.mapTo=X;exports.merge=C;exports.noop=l;exports.now=y;exports.observableFrom=S;exports.once=q;exports.pairwise=G;exports.tap=J;exports.throttle=$;exports.timeout=I;
package/esnext.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.22
3
- * Fri, 24 Mar 2023 11:20:56 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-22/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.23
3
+ * Fri, 14 Apr 2023 14:20:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-23/doc/
5
5
  */
6
6
  class h{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(e=>typeof e=="function"?e():e.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=n=>{throw new Error(`${n} is value of unexpected type`)},C=n=>{},l=()=>{};class a{constructor(t){t&&(this._subscribe=t)}subscribe(t,e){let s;e?typeof e=="function"?s={next:e,error:l}:s={next:i=>e.next(i),error:i=>e.error?.(i)}:s={next:l,error:l};const o=typeof t=="function"?{next:i=>{try{t(i)}catch(u){s.next(u)}},error:i=>s.next(i)}:{next:i=>t.next(i),error:i=>t.error?t.error(i):s.next(i)};let r;try{r=this._subscribe(o)}catch(i){o.error?.(i)}return new h().add(()=>{switch(o.next=l,o.error=l,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return p(r)}})}pipe(...t){return t.reduce((e,s)=>s(e),this)}_subscribe(t){}}class w extends a{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(e=>e.next(t))}error(t){this.subscribers.forEach(e=>e.error?.(t))}_subscribe(t){const e=this.keyCounter++;return this.subscribers.set(e,t),new h().add(()=>this.subscribers.delete(e))}}class M{log$=new w;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let s;try{s=t(...e)}catch{s={message:"error in `createCustomLog`",component:"Logger"}}this.log(s)}}createComponentLog(t){return this.createCustomLog(e=>({component:t,...e}))}getAllLogs=()=>this.logs}function D(n,t='Assertion "value is not nullable" failed'){if(n==null)throw new Error(t)}function O(n,t='Assertion "value is nullable" failed'){if(n!=null)throw new Error(t)}function m(n){return typeof n<"u"&&n!==null}function x(n){return n==null}const F=(n,t,e)=>new Promise((s,o)=>{t.addEventListener("abort",()=>{u(),c.remove()});const r=()=>{u(),o()},i=()=>{u(),s()},u=()=>{d&&clearTimeout(d),c.removeEventListener("load",i),c.removeEventListener("error",r)};let d;e&&(d=window.setTimeout(r,e));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",r),c.src=n,document.head.appendChild(c)}),P=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),S=(n,t)=>async(...e)=>{const s=t(...e);let o=n.aborted,r;for(;!o&&!n.aborted;){const i=await s.next(r);o=i.done??!1,r=i.value}return r},j=(n,{start:t=0,factor:e=2,max:s=1/0,min:o=t,random:r=0}={})=>{let i=t;return i*=e**n,i*=1+(Math.random()*r*2-r),i=Math.round(i),i=Math.min(i,s),i=Math.max(i,o),i};class k extends w{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function R(n){return new a(t=>{const e={};let s=Object.keys(n).length;const o=r=>i=>{r in e||s--,e[r]=i,s===0&&t.next(e)};return Object.entries(n).reduce((r,[i,u])=>r.add(u.subscribe(o(i))),new h)})}function $(...n){return new a(t=>n.reduce((e,s)=>e.add(s.subscribe(t)),new h))}var z=n=>new a(t=>{const e=window.setTimeout(()=>{try{t.next()}catch(s){if(t.error)t.error(s);else throw s}},n);return()=>window.clearTimeout(e)}),K=n=>new a(t=>{const e=window.setInterval(()=>t.next(),n);return()=>window.clearInterval(e)}),W=n=>new a(t=>{n.forEach(e=>t.next(e))}),B=(n,t)=>new a(e=>{const s=o=>e.next(o);return n.addEventListener(t,s),()=>n.removeEventListener(t,s)});function U(n){return t=>new a(e=>t.subscribe(new g(e,n)))}class g{destination;size;lastValues=[];constructor(t,e){this.destination=t,this.size=e}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 E={leading:!1,trailing:!0};function X(n,t=E){return e=>new a(s=>e.subscribe(new L(s,n,t)))}class L{destination;time;config;lastValue;timeout;constructor(t,e,s){this.destination=t,this.time=e,this.config=s}next(t){this.lastValue=t,m(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(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const v={leading:!0,trailing:!1};function Y(n,t=v){return e=>new a(s=>e.subscribe(new y(s,n,t)))}class y{destination;time;config;lastValue;timeout;constructor(t,e,s){this.destination=t,this.time=e,this.config=s}next(t){this.lastValue=t,x(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 q(n){return t=>new a(e=>t.subscribe(new V(e,n)))}class V{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(s){throw this.error(s),s}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function G(n=(t,e)=>t===e){return t=>new a(e=>t.subscribe(new _(e,n)))}const f={};class _{destination;predicate;lastValue=f;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===f||!this.predicate(this.lastValue,t),this.lastValue=t}catch(s){throw this.error(s),s}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function T(n){return t=>new a(e=>t.subscribe(new N(e,n)))}let N=class{destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(s){throw this.error(s),s}this.destination.next(e)}error(t){this.destination.error?.(t)}};function J(n){return T(()=>n)}function Q(){return n=>new a(t=>{let e=!1,s=!1;const o=n.subscribe(r=>{e||(e=!0,t.next(r)),s&&o.unsubscribe()},r=>{e=!0,t.error?.(r),s&&o.unsubscribe()});return s=!0,e&&o.unsubscribe(),o})}function Z(){return n=>new a(t=>n.subscribe(new A(t)))}class A{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([e,t])}error(t){this.destination.error?.(t)}}function tt(n){return t=>new a(e=>t.subscribe(new I(e,n)))}class I{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(e){throw this.error(e),e}this.destination.next(t)}error(t){this.destination.error?.(t)}}var b;(function(n){n.NETWORK="network",n.VIDEO_PIPELINE="video_pipeline",n.EXTERNAL_API="external_api",n.PARSER="parser",n.DOM="dom",n.WTF="wtf"})(b||(b={}));const et=5;export{et as ACTIVE_LIVE_VALID_DELAY,b as ErrorCategory,M as Logger,a as Observable,w as Subject,h as Subscription,k as ValueSubject,S as abortable,F as addScript,p as assertNever,D as assertNonNullable,O as assertNullable,U as buffer,C as checkNever,R as combine,X as debounce,q as filter,G as filterChanged,B as fromEvent,j as getExponentialDelay,K as interval,m as isNonNullable,x as isNullable,T as map,J as mapTo,$ as merge,l as noop,P as now,W as observableFrom,Q as once,Z as pairwise,tt as tap,Y as throttle,z as timeout};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @vkontakte/videoplayer-shared v1.0.23
3
+ * Fri, 14 Apr 2023 14:20:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-23/doc/
5
+ */
6
+ class h{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(e=>typeof e=="function"?e():e.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=n=>{throw new Error(`${n} is value of unexpected type`)},C=n=>{},l=()=>{};class a{constructor(t){t&&(this._subscribe=t)}subscribe(t,e){let s;e?typeof e=="function"?s={next:e,error:l}:s={next:i=>e.next(i),error:i=>e.error?.(i)}:s={next:l,error:l};const o=typeof t=="function"?{next:i=>{try{t(i)}catch(u){s.next(u)}},error:i=>s.next(i)}:{next:i=>t.next(i),error:i=>t.error?t.error(i):s.next(i)};let r;try{r=this._subscribe(o)}catch(i){o.error?.(i)}return new h().add(()=>{switch(o.next=l,o.error=l,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return p(r)}})}pipe(...t){return t.reduce((e,s)=>s(e),this)}_subscribe(t){}}class w extends a{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(e=>e.next(t))}error(t){this.subscribers.forEach(e=>e.error?.(t))}_subscribe(t){const e=this.keyCounter++;return this.subscribers.set(e,t),new h().add(()=>this.subscribers.delete(e))}}class M{log$=new w;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let s;try{s=t(...e)}catch{s={message:"error in `createCustomLog`",component:"Logger"}}this.log(s)}}createComponentLog(t){return this.createCustomLog(e=>({component:t,...e}))}getAllLogs=()=>this.logs}function D(n,t='Assertion "value is not nullable" failed'){if(n==null)throw new Error(t)}function O(n,t='Assertion "value is nullable" failed'){if(n!=null)throw new Error(t)}function m(n){return typeof n<"u"&&n!==null}function x(n){return n==null}const F=(n,t,e)=>new Promise((s,o)=>{t.addEventListener("abort",()=>{u(),c.remove()});const r=()=>{u(),o()},i=()=>{u(),s()},u=()=>{d&&clearTimeout(d),c.removeEventListener("load",i),c.removeEventListener("error",r)};let d;e&&(d=window.setTimeout(r,e));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",r),c.src=n,document.head.appendChild(c)}),P=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),S=(n,t)=>async(...e)=>{const s=t(...e);let o=n.aborted,r;for(;!o&&!n.aborted;){const i=await s.next(r);o=i.done??!1,r=i.value}return r},j=(n,{start:t=0,factor:e=2,max:s=1/0,min:o=t,random:r=0}={})=>{let i=t;return i*=e**n,i*=1+(Math.random()*r*2-r),i=Math.round(i),i=Math.min(i,s),i=Math.max(i,o),i};class k extends w{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function R(n){return new a(t=>{const e={};let s=Object.keys(n).length;const o=r=>i=>{r in e||s--,e[r]=i,s===0&&t.next(e)};return Object.entries(n).reduce((r,[i,u])=>r.add(u.subscribe(o(i))),new h)})}function $(...n){return new a(t=>n.reduce((e,s)=>e.add(s.subscribe(t)),new h))}var z=n=>new a(t=>{const e=window.setTimeout(()=>{try{t.next()}catch(s){if(t.error)t.error(s);else throw s}},n);return()=>window.clearTimeout(e)}),K=n=>new a(t=>{const e=window.setInterval(()=>t.next(),n);return()=>window.clearInterval(e)}),W=n=>new a(t=>{n.forEach(e=>t.next(e))}),B=(n,t)=>new a(e=>{const s=o=>e.next(o);return n.addEventListener(t,s),()=>n.removeEventListener(t,s)});function U(n){return t=>new a(e=>t.subscribe(new g(e,n)))}class g{destination;size;lastValues=[];constructor(t,e){this.destination=t,this.size=e}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 E={leading:!1,trailing:!0};function X(n,t=E){return e=>new a(s=>e.subscribe(new L(s,n,t)))}class L{destination;time;config;lastValue;timeout;constructor(t,e,s){this.destination=t,this.time=e,this.config=s}next(t){this.lastValue=t,m(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(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const v={leading:!0,trailing:!1};function Y(n,t=v){return e=>new a(s=>e.subscribe(new y(s,n,t)))}class y{destination;time;config;lastValue;timeout;constructor(t,e,s){this.destination=t,this.time=e,this.config=s}next(t){this.lastValue=t,x(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 q(n){return t=>new a(e=>t.subscribe(new V(e,n)))}class V{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(s){throw this.error(s),s}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function G(n=(t,e)=>t===e){return t=>new a(e=>t.subscribe(new _(e,n)))}const f={};class _{destination;predicate;lastValue=f;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===f||!this.predicate(this.lastValue,t),this.lastValue=t}catch(s){throw this.error(s),s}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function T(n){return t=>new a(e=>t.subscribe(new N(e,n)))}let N=class{destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(s){throw this.error(s),s}this.destination.next(e)}error(t){this.destination.error?.(t)}};function J(n){return T(()=>n)}function Q(){return n=>new a(t=>{let e=!1,s=!1;const o=n.subscribe(r=>{e||(e=!0,t.next(r)),s&&o.unsubscribe()},r=>{e=!0,t.error?.(r),s&&o.unsubscribe()});return s=!0,e&&o.unsubscribe(),o})}function Z(){return n=>new a(t=>n.subscribe(new A(t)))}class A{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([e,t])}error(t){this.destination.error?.(t)}}function tt(n){return t=>new a(e=>t.subscribe(new I(e,n)))}class I{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(e){throw this.error(e),e}this.destination.next(t)}error(t){this.destination.error?.(t)}}var b;(function(n){n.NETWORK="network",n.VIDEO_PIPELINE="video_pipeline",n.EXTERNAL_API="external_api",n.PARSER="parser",n.DOM="dom",n.WTF="wtf"})(b||(b={}));const et=5;export{et as ACTIVE_LIVE_VALID_DELAY,b as ErrorCategory,M as Logger,a as Observable,w as Subject,h as Subscription,k as ValueSubject,S as abortable,F as addScript,p as assertNever,D as assertNonNullable,O as assertNullable,U as buffer,C as checkNever,R as combine,X as debounce,q as filter,G as filterChanged,B as fromEvent,j as getExponentialDelay,K as interval,m as isNonNullable,x as isNullable,T as map,J as mapTo,$ as merge,l as noop,P as now,W as observableFrom,Q as once,Z as pairwise,tt as tap,Y as throttle,z as timeout};
package/package.json CHANGED
@@ -1,37 +1,47 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-shared",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "author": "vk.com",
5
5
  "description": "Shared code for vk.com videoplayer",
6
6
  "homepage": "https://vk.com",
7
7
  "license": "GPL-3.0",
8
- "main": "esnext.cjs.js",
9
- "module": "esnext.esm.js",
10
- "types": "index.d.ts",
8
+ "main": "./esnext.cjs.js",
9
+ "module": "./esnext.esm.js",
10
+ "types": "./index.d.ts",
11
11
  "type": "module",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "esnext.esm.js",
15
- "require": "esnext.cjs.js"
14
+ "import": "./esnext.esm.js",
15
+ "require": "./esnext.cjs.js",
16
+ "types": "./index.d.ts"
17
+ },
18
+ "./evergreen": {
19
+ "import": "./evergreen.esm.js",
20
+ "require": "./evergreen.cjs.js",
21
+ "types": "./index.d.ts"
16
22
  },
17
23
  "./esnext": {
18
- "import": "esnext.esm.js",
19
- "require": "esnext.cjs.js"
24
+ "import": "./esnext.esm.js",
25
+ "require": "./esnext.cjs.js",
26
+ "types": "./index.d.ts"
20
27
  },
21
28
  "./es2018": {
22
- "import": "es2018.esm.js",
23
- "require": "es2018.cjs.js"
29
+ "import": "./es2018.esm.js",
30
+ "require": "./es2018.cjs.js",
31
+ "types": "./index.d.ts"
24
32
  },
25
33
  "./es2015": {
26
- "import": "es2015.esm.js",
27
- "require": "es2015.cjs.js"
34
+ "import": "./es2015.esm.js",
35
+ "require": "./es2015.cjs.js",
36
+ "types": "./index.d.ts"
28
37
  },
29
- "./esnext.esm.js": "esnext.esm.js",
30
- "./esnext.cjs.js": "esnext.cjs.js",
31
- "./es2018.esm.js": "es2018.esm.js",
32
- "./es2018.cjs.js": "es2018.cjs.js",
33
- "./es2015.esm.js": "es2015.esm.js",
34
- "./es2015.cjs.js": "es2015.cjs.js"
38
+ "./evergreen.esm.js": "./evergeen.esm.js",
39
+ "./esnext.esm.js": "./esnext.esm.js",
40
+ "./esnext.cjs.js": "./esnext.cjs.js",
41
+ "./es2018.esm.js": "./es2018.esm.js",
42
+ "./es2018.cjs.js": "./es2018.cjs.js",
43
+ "./es2015.esm.js": "./es2015.esm.js",
44
+ "./es2015.cjs.js": "./es2015.cjs.js"
35
45
  },
36
46
  "files": [
37
47
  "*.cjs.js",