@vkontakte/videoplayer-shared 1.0.13-beta.3 → 1.0.15
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.d.ts +4 -0
- package/es2015.cjs.js +4 -4
- package/es2015.esm.d.ts +4 -0
- package/es2015.esm.js +4 -4
- package/es2018.cjs.d.ts +4 -0
- package/es2018.cjs.js +4 -4
- package/es2018.esm.d.ts +4 -0
- package/es2018.esm.js +4 -4
- package/esnext.cjs.js +4 -4
- package/esnext.esm.d.ts +4 -0
- package/esnext.esm.js +4 -4
- package/package.json +1 -1
- package/types/index.d.ts +8 -0
- package/utils/exponentialBackoff.d.ts +8 -0
- package/utils/index.d.ts +1 -0
package/es2015.cjs.d.ts
ADDED
package/es2015.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.15
|
|
3
|
+
* Mon, 15 Aug 2022 17:01:22 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-15/doc/
|
|
5
5
|
*/
|
|
6
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class
|
|
6
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class n{constructor(t){t&&(this._subscribe=t)}subscribe(n,s){var i;let o;o=s?'function'==typeof s?{next:s,error:r}:{next:t=>s.next(t),error:t=>{var e;return null===(e=s.error)||void 0===e?void 0:e.call(s,t)}}:{next:r,error:r};const c='function'==typeof n?{next:t=>{try{n(t)}catch(t){o.next(t)}},error:t=>o.next(t)}:{next:t=>n.next(t),error:t=>n.error?n.error(t):o.next(t)};let a;try{a=this._subscribe(c)}catch(t){null===(i=c.error)||void 0===i||i.call(c,t)}return(new t).add((()=>{switch(c.next=r,c.error=r,typeof a){case'function':return void a();case'object':return void a.unsubscribe();case'undefined':return;default:return e(a)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class s extends n{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 null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}var c;const a='function'==typeof(null===(c=window.performance)||void 0===c?void 0:c.now)?()=>window.performance.now():()=>Date.now();function u(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{a(n.next(t))}catch(t){i(t)}}function c(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,c)}a((n=n.apply(t,e||[])).next())}))}const l={leading:!1,trailing:!0};class h{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(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(t){if(!this.destination.error)throw t;this.destination.error(t)}this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const d={leading:!0,trailing:!1};class b{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(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;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class p{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const x={};class w{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=x}next(t){let e;try{e=this.lastValue===x||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function v(t){return e=>new n((r=>e.subscribe(new f(r,t))))}class f{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class m{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class g{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}exports.Logger=class{constructor(){this.log$=new s,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 r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>Object.assign({component:t},e)))}},exports.Observable=n,exports.Subject=s,exports.Subscription=t,exports.ValueSubject=class extends s{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}},exports.abortable=(t,e)=>(...r)=>u(void 0,void 0,void 0,(function*(){var n;const s=e(...r);let i,o=t.aborted;for(;!o&&!t.aborted;){const t=yield s.next(i);o=null!==(n=t.done)&&void 0!==n&&n,i=t.value}return i})),exports.addScript=(t,e,r)=>new Promise(((n,s)=>{e.addEventListener('abort',(()=>{c(),u.remove()}));const i=()=>{c(),s()},o=()=>{c(),n()},c=()=>{a&&clearTimeout(a),u.removeEventListener('load',o),u.removeEventListener('error',i)};let a;r&&(a=window.setTimeout(i,r));const u=document.createElement('script');u.addEventListener('load',o),u.addEventListener('error',i),u.src=t,document.head.appendChild(u)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new n((r=>{const n={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in n||s--,n[t]=e,0===s&&r.next(n)})(e)))),new t)}))},exports.debounce=function(t,e=l){return r=>new n((n=>r.subscribe(new h(n,t,e))))},exports.filter=function(t){return e=>new n((r=>e.subscribe(new p(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new n((r=>e.subscribe(new w(r,t))))},exports.fromEvent=(t,e)=>new n((r=>{const n=t=>r.next(t);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)})),exports.getExponentialDelay=(t,{start:e=0,factor:r=2,max:n=1/0,random:s=0}={})=>Math.min(Math.round(e*Math.pow(r,t-1)+Math.random()*s),n),exports.interval=t=>new n((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=v,exports.mapTo=function(t){return v((()=>t))},exports.merge=function(...e){return new n((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=a,exports.observableFrom=t=>new n((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new n((e=>{let r=!1,n=!1;const s=t.subscribe((t=>{r||(r=!0,e.next(t)),n&&s.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),n&&s.unsubscribe()}));return n=!0,r&&s.unsubscribe(),s}))},exports.pairwise=function(){return t=>new n((e=>t.subscribe(new m(e))))},exports.tap=function(t){return e=>new n((r=>e.subscribe(new g(r,t))))},exports.throttle=function(t,e=d){return r=>new n((n=>r.subscribe(new b(n,t,e))))},exports.timeout=t=>new n((e=>{const r=window.setTimeout((()=>{try{e.next()}catch(t){if(!e.error)throw t;e.error(t)}}),t);return()=>window.clearTimeout(r)}));
|
package/es2015.esm.d.ts
ADDED
package/es2015.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.15
|
|
3
|
+
* Mon, 15 Aug 2022 17:01:22 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-15/doc/
|
|
5
5
|
*/
|
|
6
|
-
class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},
|
|
6
|
+
class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},n=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(r,s){var i;let o;o=s?'function'==typeof s?{next:s,error:n}:{next:t=>s.next(t),error:t=>{var e;return null===(e=s.error)||void 0===e?void 0:e.call(s,t)}}:{next:n,error:n};const c='function'==typeof r?{next:t=>{try{r(t)}catch(t){o.next(t)}},error:t=>o.next(t)}:{next:t=>r.next(t),error:t=>r.error?r.error(t):o.next(t)};let u;try{u=this._subscribe(c)}catch(t){null===(i=c.error)||void 0===i||i.call(c,t)}return(new t).add((()=>{switch(c.next=n,c.error=n,typeof u){case'function':return void u();case'object':return void u.unsubscribe();case'undefined':return;default:return e(u)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends s{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 null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}class o{constructor(){this.log$=new i,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 r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>Object.assign({component:t},e)))}}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function u(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function a(t){return null!=t}function l(t){return null==t}const h=(t,e,r)=>new Promise(((n,s)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),s()},o=()=>{c(),n()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)}));var d;const b='function'==typeof(null===(d=window.performance)||void 0===d?void 0:d.now)?()=>window.performance.now():()=>Date.now();function w(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,c)}u((n=n.apply(t,e||[])).next())}))}const v=(t,e)=>(...r)=>w(void 0,void 0,void 0,(function*(){var n;const s=e(...r);let i,o=t.aborted;for(;!o&&!t.aborted;){const t=yield s.next(i);o=null!==(n=t.done)&&void 0!==n&&n,i=t.value}return i})),f=(t,{start:e=0,factor:r=2,max:n=1/0,random:s=0}={})=>Math.min(Math.round(e*Math.pow(r,t-1)+Math.random()*s),n);class x extends i{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 m(e){return new s((r=>{const n={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in n||s--,n[t]=e,0===s&&r.next(n)})(e)))),new t)}))}function p(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))}var g=t=>new s((e=>{const r=window.setTimeout((()=>{try{e.next()}catch(t){if(!e.error)throw t;e.error(t)}}),t);return()=>window.clearTimeout(r)})),y=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),L=t=>new s((e=>{t.forEach((t=>e.next(t)))})),E=(t,e)=>new s((r=>{const n=t=>r.next(t);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}));const V={leading:!1,trailing:!0};function C(t,e=V){return r=>new s((n=>r.subscribe(new T(n,t,e))))}class T{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,a(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(t){if(!this.destination.error)throw t;this.destination.error(t)}this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const j={leading:!0,trailing:!1};function _(t,e=j){return r=>new s((n=>r.subscribe(new M(n,t,e))))}class M{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,l(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;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function O(t){return e=>new s((r=>e.subscribe(new k(r,t))))}class k{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function A(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new D(r,t))))}const $={};class D{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=$}next(t){let e;try{e=this.lastValue===$||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function I(t){return e=>new s((r=>e.subscribe(new P(r,t))))}class P{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function q(t){return I((()=>t))}function z(){return t=>new s((e=>{let r=!1,n=!1;const s=t.subscribe((t=>{r||(r=!0,e.next(t)),n&&s.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),n&&s.unsubscribe()}));return n=!0,r&&s.unsubscribe(),s}))}function B(){return t=>new s((e=>t.subscribe(new F(e))))}class F{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function G(t){return e=>new s((r=>e.subscribe(new H(r,t))))}class H{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}export{o as Logger,s as Observable,i as Subject,t as Subscription,x as ValueSubject,v as abortable,h as addScript,e as assertNever,c as assertNonNullable,u as assertNullable,r as checkNever,m as combine,C as debounce,O as filter,A as filterChanged,E as fromEvent,f as getExponentialDelay,y as interval,a as isNonNullable,l as isNullable,I as map,q as mapTo,p as merge,n as noop,b as now,L as observableFrom,z as once,B as pairwise,G as tap,_ as throttle,g as timeout};
|
package/es2018.cjs.d.ts
ADDED
package/es2018.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.15
|
|
3
|
+
* Mon, 15 Aug 2022 17:01:22 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-15/doc/
|
|
5
5
|
*/
|
|
6
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){
|
|
6
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){var i;let o;o=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>{var e;return null===(e=n.error)||void 0===e?void 0:e.call(n,t)}}:{next:r,error:r};const a='function'==typeof s?{next:t=>{try{s(t)}catch(t){o.next(t)}},error:t=>o.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):o.next(t)};let c;try{c=this._subscribe(a)}catch(t){null===(i=a.error)||void 0===i||i.call(a,t)}return(new t).add((()=>{switch(a.next=r,a.error=r,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{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 null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}var a;const c='function'==typeof(null===(a=window.performance)||void 0===a?void 0:a.now)?()=>window.performance.now():()=>Date.now();const u={leading:!1,trailing:!0};class l{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(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(t){if(!this.destination.error)throw t;this.destination.error(t)}this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const h={leading:!0,trailing:!1};class d{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(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;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class b{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const p={};class x{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(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function w(t){return e=>new s((r=>e.subscribe(new v(r,t))))}class v{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class f{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class m{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}exports.Logger=class{constructor(){this.log$=new n,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(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class extends n{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}},exports.abortable=(t,e)=>async(...r)=>{var s;const n=e(...r);let i,o=t.aborted;for(;!o&&!t.aborted;){const t=await n.next(i);o=null!==(s=t.done)&&void 0!==s&&s,i=t.value}return i},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{a(),u.remove()}));const i=()=>{a(),n()},o=()=>{a(),s()},a=()=>{c&&clearTimeout(c),u.removeEventListener('load',o),u.removeEventListener('error',i)};let c;r&&(c=window.setTimeout(i,r));const u=document.createElement('script');u.addEventListener('load',o),u.addEventListener('error',i),u.src=t,document.head.appendChild(u)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=u){return r=>new s((s=>r.subscribe(new l(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new b(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new x(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.getExponentialDelay=(t,{start:e=0,factor:r=2,max:s=1/0,random:n=0}={})=>Math.min(Math.round(e*r**(t-1)+Math.random()*n),s),exports.interval=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=w,exports.mapTo=function(t){return w((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=c,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=h){return r=>new s((s=>r.subscribe(new d(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>{try{e.next()}catch(t){if(!e.error)throw t;e.error(t)}}),t);return()=>window.clearTimeout(r)}));
|
package/es2018.esm.d.ts
ADDED
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.15
|
|
3
|
+
* Mon, 15 Aug 2022 17:01:22 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-15/doc/
|
|
5
5
|
*/
|
|
6
|
-
class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},n=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(r,s){
|
|
6
|
+
class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},n=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(r,s){var i;let o;o=s?'function'==typeof s?{next:s,error:n}:{next:t=>s.next(t),error:t=>{var e;return null===(e=s.error)||void 0===e?void 0:e.call(s,t)}}:{next:n,error:n};const c='function'==typeof r?{next:t=>{try{r(t)}catch(t){o.next(t)}},error:t=>o.next(t)}:{next:t=>r.next(t),error:t=>r.error?r.error(t):o.next(t)};let a;try{a=this._subscribe(c)}catch(t){null===(i=c.error)||void 0===i||i.call(c,t)}return(new t).add((()=>{switch(c.next=n,c.error=n,typeof a){case'function':return void a();case'object':return void a.unsubscribe();case'undefined':return;default:return e(a)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends s{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 null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}class o{constructor(){this.log$=new i,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(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function a(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function u(t){return null!=t}function l(t){return null==t}const h=(t,e,r)=>new Promise(((n,s)=>{e.addEventListener('abort',(()=>{c(),u.remove()}));const i=()=>{c(),s()},o=()=>{c(),n()},c=()=>{a&&clearTimeout(a),u.removeEventListener('load',o),u.removeEventListener('error',i)};let a;r&&(a=window.setTimeout(i,r));const u=document.createElement('script');u.addEventListener('load',o),u.addEventListener('error',i),u.src=t,document.head.appendChild(u)}));var d;const b='function'==typeof(null===(d=window.performance)||void 0===d?void 0:d.now)?()=>window.performance.now():()=>Date.now(),w=(t,e)=>async(...r)=>{var n;const s=e(...r);let i,o=t.aborted;for(;!o&&!t.aborted;){const t=await s.next(i);o=null!==(n=t.done)&&void 0!==n&&n,i=t.value}return i},v=(t,{start:e=0,factor:r=2,max:n=1/0,random:s=0}={})=>Math.min(Math.round(e*r**(t-1)+Math.random()*s),n);class f extends i{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 x(e){return new s((r=>{const n={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in n||s--,n[t]=e,0===s&&r.next(n)})(e)))),new t)}))}function m(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))}var p=t=>new s((e=>{const r=window.setTimeout((()=>{try{e.next()}catch(t){if(!e.error)throw t;e.error(t)}}),t);return()=>window.clearTimeout(r)})),g=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),y=t=>new s((e=>{t.forEach((t=>e.next(t)))})),L=(t,e)=>new s((r=>{const n=t=>r.next(t);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}));const E={leading:!1,trailing:!0};function V(t,e=E){return r=>new s((n=>r.subscribe(new C(n,t,e))))}class C{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}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(t){if(!this.destination.error)throw t;this.destination.error(t)}this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const T={leading:!0,trailing:!1};function _(t,e=T){return r=>new s((n=>r.subscribe(new M(n,t,e))))}class M{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,l(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;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function j(t){return e=>new s((r=>e.subscribe(new k(r,t))))}class k{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function A(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new D(r,t))))}const $={};class D{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=$}next(t){let e;try{e=this.lastValue===$||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function I(t){return e=>new s((r=>e.subscribe(new O(r,t))))}class O{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function P(t){return I((()=>t))}function q(){return t=>new s((e=>{let r=!1,n=!1;const s=t.subscribe((t=>{r||(r=!0,e.next(t)),n&&s.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),n&&s.unsubscribe()}));return n=!0,r&&s.unsubscribe(),s}))}function z(){return t=>new s((e=>t.subscribe(new B(e))))}class B{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function F(t){return e=>new s((r=>e.subscribe(new G(r,t))))}class G{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}export{o as Logger,s as Observable,i as Subject,t as Subscription,f as ValueSubject,w as abortable,h as addScript,e as assertNever,c as assertNonNullable,a as assertNullable,r as checkNever,x as combine,V as debounce,j as filter,A as filterChanged,L as fromEvent,v as getExponentialDelay,g as interval,u as isNonNullable,l as isNullable,I as map,P as mapTo,m as merge,n as noop,b as now,y as observableFrom,q as once,z as pairwise,F as tap,_ as throttle,p as timeout};
|
package/esnext.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.15
|
|
3
|
+
* Mon, 15 Aug 2022 17:01:22 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-15/doc/
|
|
5
5
|
*/
|
|
6
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>n.error?.(t)}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)}
|
|
6
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>n.error?.(t)}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)};let a;try{a=this._subscribe(o)}catch(t){o.error?.(t)}return(new t).add((()=>{switch(o.next=r,o.error=r,typeof a){case'function':return void a();case'object':return void a.unsubscribe();case'undefined':return;default:return e(a)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{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(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}const a='function'==typeof window.performance?.now?()=>window.performance.now():()=>Date.now();const c={leading:!1,trailing:!0};class u{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(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(t){if(!this.destination.error)throw t;this.destination.error(t)}this.timeout=void 0}),this.time)}error(t){this.destination.error?.(t)}}const l={leading:!0,trailing:!1};class h{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(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)}}class d{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}const b={};class p{destination;predicate;lastValue=b;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===b||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function x(t){return e=>new s((r=>e.subscribe(new w(r,t))))}class w{destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){this.destination.error?.(t)}}class f{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){this.destination.error?.(t)}}class m{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.Logger=class{log$=new n;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch{r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}getAllLogs=()=>this.logs},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class 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 e=super._subscribe(t);return t.next(this.value),e}},exports.abortable=(t,e)=>async(...r)=>{const s=e(...r);let n,i=t.aborted;for(;!i&&!t.aborted;){const t=await s.next(n);i=t.done??!1,n=t.value}return n},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{a(),u.remove()}));const i=()=>{a(),n()},o=()=>{a(),s()},a=()=>{c&&clearTimeout(c),u.removeEventListener('load',o),u.removeEventListener('error',i)};let c;r&&(c=window.setTimeout(i,r));const u=document.createElement('script');u.addEventListener('load',o),u.addEventListener('error',i),u.src=t,document.head.appendChild(u)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=c){return r=>new s((s=>r.subscribe(new u(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new d(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new p(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.getExponentialDelay=(t,{start:e=0,factor:r=2,max:s=1/0,random:n=0}={})=>Math.min(Math.round(e*r**(t-1)+Math.random()*n),s),exports.interval=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=x,exports.mapTo=function(t){return x((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=a,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{r=!0,e.error?.(t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=l){return r=>new s((s=>r.subscribe(new h(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>{try{e.next()}catch(t){if(!e.error)throw t;e.error(t)}}),t);return()=>window.clearTimeout(r)}));
|
package/esnext.esm.d.ts
ADDED
package/esnext.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.15
|
|
3
|
+
* Mon, 15 Aug 2022 17:01:22 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-15/doc/
|
|
5
5
|
*/
|
|
6
|
-
class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},
|
|
6
|
+
class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},n=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(r,s){let i;i=s?'function'==typeof s?{next:s,error:n}:{next:t=>s.next(t),error:t=>s.error?.(t)}:{next:n,error:n};const o='function'==typeof r?{next:t=>{try{r(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>r.next(t),error:t=>r.error?r.error(t):i.next(t)};let c;try{c=this._subscribe(o)}catch(t){o.error?.(t)}return(new t).add((()=>{switch(o.next=n,o.error=n,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends s{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(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}class o{log$=new i;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch{r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}getAllLogs=()=>this.logs}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function a(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function u(t){return null!=t}function h(t){return null==t}const l=(t,e,r)=>new Promise(((n,s)=>{e.addEventListener('abort',(()=>{c(),u.remove()}));const i=()=>{c(),s()},o=()=>{c(),n()},c=()=>{a&&clearTimeout(a),u.removeEventListener('load',o),u.removeEventListener('error',i)};let a;r&&(a=window.setTimeout(i,r));const u=document.createElement('script');u.addEventListener('load',o),u.addEventListener('error',i),u.src=t,document.head.appendChild(u)})),d='function'==typeof window.performance?.now?()=>window.performance.now():()=>Date.now(),b=(t,e)=>async(...r)=>{const n=e(...r);let s,i=t.aborted;for(;!i&&!t.aborted;){const t=await n.next(s);i=t.done??!1,s=t.value}return s},w=(t,{start:e=0,factor:r=2,max:n=1/0,random:s=0}={})=>Math.min(Math.round(e*r**(t-1)+Math.random()*s),n);class f extends i{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function m(e){return new s((r=>{const n={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in n||s--,n[t]=e,0===s&&r.next(n)})(e)))),new t)}))}function x(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))}var p=t=>new s((e=>{const r=window.setTimeout((()=>{try{e.next()}catch(t){if(!e.error)throw t;e.error(t)}}),t);return()=>window.clearTimeout(r)})),g=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),v=t=>new s((e=>{t.forEach((t=>e.next(t)))})),y=(t,e)=>new s((r=>{const n=t=>r.next(t);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}));const L={leading:!1,trailing:!0};function E(t,e=L){return r=>new s((n=>r.subscribe(new V(n,t,e))))}class V{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}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(t){if(!this.destination.error)throw t;this.destination.error(t)}this.timeout=void 0}),this.time)}error(t){this.destination.error?.(t)}}const C={leading:!0,trailing:!1};function T(t,e=C){return r=>new s((n=>r.subscribe(new _(n,t,e))))}class _{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,h(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 M(t){return e=>new s((r=>e.subscribe(new j(r,t))))}class j{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function k(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new $(r,t))))}const A={};class ${destination;predicate;lastValue=A;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function D(t){return e=>new s((r=>e.subscribe(new I(r,t))))}class I{destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){this.destination.error?.(t)}}function O(t){return D((()=>t))}function P(){return t=>new s((e=>{let r=!1,n=!1;const s=t.subscribe((t=>{r||(r=!0,e.next(t)),n&&s.unsubscribe()}),(t=>{r=!0,e.error?.(t),n&&s.unsubscribe()}));return n=!0,r&&s.unsubscribe(),s}))}function q(){return t=>new s((e=>t.subscribe(new z(e))))}class z{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){this.destination.error?.(t)}}function B(t){return e=>new s((r=>e.subscribe(new F(r,t))))}class F{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){this.destination.error?.(t)}}export{o as Logger,s as Observable,i as Subject,t as Subscription,f as ValueSubject,b as abortable,l as addScript,e as assertNever,c as assertNonNullable,a as assertNullable,r as checkNever,m as combine,E as debounce,M as filter,k as filterChanged,y as fromEvent,w as getExponentialDelay,g as interval,u as isNonNullable,h as isNullable,D as map,O as mapTo,x as merge,n as noop,d as now,v as observableFrom,P as once,q as pairwise,B as tap,T as throttle,p as timeout};
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -16,3 +16,11 @@ export interface IError {
|
|
|
16
16
|
*/
|
|
17
17
|
thrown?: Error | unknown;
|
|
18
18
|
}
|
|
19
|
+
export interface IRange<Unit extends number = number> {
|
|
20
|
+
from: Unit;
|
|
21
|
+
to: Unit;
|
|
22
|
+
}
|
|
23
|
+
export interface IRectangle<Unit extends number = number> {
|
|
24
|
+
width: Unit;
|
|
25
|
+
height: Unit;
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Milliseconds } from './semanticTypes';
|
|
2
|
+
export declare type ExponentialBackoffConfig = Partial<{
|
|
3
|
+
start: Milliseconds;
|
|
4
|
+
factor: number;
|
|
5
|
+
max: Milliseconds;
|
|
6
|
+
random: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const getExponentialDelay: (errorsCount: number, { start, factor, max, random }?: ExponentialBackoffConfig) => number;
|
package/utils/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export { addScript } from './addScript';
|
|
|
5
5
|
export type { Milliseconds, bps, Byte, Seconds, Kbps, Mbps } from './semanticTypes';
|
|
6
6
|
export { now } from './now';
|
|
7
7
|
export { abortable } from './abortable';
|
|
8
|
+
export { getExponentialDelay, ExponentialBackoffConfig } from './exponentialBackoff';
|