Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@most/core

Package Overview
Dependencies
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@most/core - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

CHANGELOG.md

4

dist/mostCore.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.mostCore=t.mostCore||{})}(this,function(t){"use strict";function e(t,e){if(t<0)throw new TypeError("n must be >= 0");var i=e.length;return 0===t||0===i?e:t>=i?[]:n(t,e,i-t)}function n(t,e,n){for(var i=new Array(n),r=0;r<n;++r)i[r]=e[t+r];return i}function i(t){return e(1,t)}function r(t){for(var e=t.length,n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function o(t,e){for(var n=e.length,i=new Array(n),r=0;r<n;++r)i[r]=t(e[r]);return i}function s(t,e,n){for(var i=e,r=0,o=n.length;r<o;++r)i=t(i,n[r],r);return i}function u(t,e){for(var n=e.length,i=new Array(n),r=0,o=void 0,s=0;s<n;++s)o=e[s],t(o)||(i[r]=o,++r);return i.length=r,i}function h(t,e){for(var n=0,i=e.length;n<i;++n)if(t===e[n])return n;return-1}function c(t){function e(n,i){switch(arguments.length){case 0:return e;case 1:return function(e){return t(n,e)};default:return t(n,i)}}return e}function p(t){function e(n,i,r){switch(arguments.length){case 0:return e;case 1:return c(function(e,i){return t(n,e,i)});case 2:return function(e){return t(n,i,e)};default:return t(n,i,r)}}return e}function a(t){this.source=t}function f(t){try{return t.dispose()}catch(t){return Promise.reject(t)}}function d(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}function l(t,e,n){var i=f(e);return d(i)?i.catch(function(e){return n.error(t,e)}):i}function v(t){setTimeout(function(){throw t},0)}function y(t,e,n){this._run=t,this.value=e,this.sink=n,this.active=!0}function w(t,e,n){n.error(t,e)}function k(t,e,n){n.event(t,e)}function m(t,e,n){n.end(t,e)}function _(t,e,n){n.event(t,e),n.end(t,void 0)}function g(t){return new a(new wn(t))}function b(t){return new a(new x(t))}function x(t){this.array=t}function A(t,e,n){function i(t){n.end(t)}for(var r=0,o=e.length;r<o&&this.active;++r)n.event(t,e[r]);this.active&&i(t)}function T(t){return t[kn]()}function E(t,e,n){for(var i=e.next();!i.done&&this.active;)n.event(t,i.value),i=e.next();n.end(t,i.value)}function P(t,e,n,i){var r=sn(),o=new xn(n,i,r);r.setDisposable(t.run(o,e))}function I(t){this.sink=t}function C(t,e,n){return new a(new M(t,e,n.source))}function M(t,e,n){this.step=t,this.seed=e,this.source=n}function R(t,e,n){this.step=t,this.seed=e,this.sink=n}function q(t,e){return new a(new N(t,e))}function N(t,e){this.f=t,this.value=e}function S(t,e,n,i){function r(t){s.sink.error(s.scheduler.now(),t)}function o(t){return B(t,e)}this.f=t,this.sink=n,this.scheduler=i,this.active=!0;var s=this;Promise.resolve(this).then(o).catch(r)}function B(t,e){var n=t.f;return Promise.resolve(n(e)).then(function(e){return j(t,e)})}function j(t,e){return e.done?(t.sink.end(t.scheduler.now(),e.value),e.value):(t.sink.event(t.scheduler.now(),e.value),t.active?B(t,e.seed):e.value)}function V(t,e){return new a(new W(t,e))}function W(t,e){this.f=t,this.value=e}function D(t,e,n,i){function r(t){u.sink.error(u.scheduler.now(),t)}function o(t){return O(t,s)}this.f=t,this.sink=n,this.scheduler=i,this.active=!0;var s=e,u=this;Promise.resolve(this).then(o).catch(r)}function O(t,e){if(t.sink.event(t.scheduler.now(),e),!t.active)return e;var n=t.f;return Promise.resolve(n(e)).then(function(e){return z(t,e)})}function z(t,e){return t.active?O(t,e):t.value}function L(t){return new a(new F(t,i(arguments)))}function F(t,e){this.f=t,this.args=e}function G(t,e,n){function i(t){r.sink.error(r.scheduler.now(),t)}this.iterator=t,this.sink=e,this.scheduler=n,this.active=!0;var r=this;Promise.resolve(this).then(H).catch(i)}function H(t,e){return t.active?J(t,t.iterator.next(e)):e}function J(t,e){return e.done?t.sink.end(t.scheduler.now(),e.value):Promise.resolve(e.value).then(function(e){return K(t,e)},function(e){return Q(t,e)})}function K(t,e){return t.sink.event(t.scheduler.now(),e),H(t,e)}function Q(t,e){return J(t,t.iterator.throw(e))}function U(t,e){return new a(new X(t,e.source))}function X(t,e){this.f=t,this.source=e}function Y(t,e,n,i){this.f=t,this.sink=n,this.scheduler=i,this.active=!0,this.disposable=un(e.run(this,i))}function Z(t,e){this.p=t,this.source=e}function $(t,e){this.p=t,this.sink=e}function tt(t,e){return function(n){return t(n)&&e(n)}}function et(t,e,n){this.p=t,this.f=e,this.source=n}function nt(t,e,n){this.p=t,this.f=e,this.sink=n}function it(t,e){this.f=t,this.source=e}function rt(t,e){this.f=t,this.sink=e}function ot(t,e){return new a(it.create(t,e.source))}function st(t,e){return ot(function(){return t},e)}function ut(t,e){return new a(new ht(t,e.source))}function ht(t,e){this.source=e,this.f=t}function ct(t,e){this.sink=e,this.f=t}function pt(t,e){this.sink=e,this.index=t,this.active=!0,this.value=void 0}function at(t,e){switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);default:return t.apply(void 0,e)}}function ft(t){return dt(t,Rn(arguments))}function dt(t,e){var n=e.length;return 0===n?pn():1===n?ot(t,e[0]):new a(lt(t,e))}function lt(t,e){return new yt(t,Mn(vt,e))}function vt(t){return t.source}function yt(t,e){this.f=t,this.sources=e}function wt(t,e,n,i){var r=this;this.sink=n,this.disposables=t,this.sinks=e,this.f=i;var o=e.length;this.awaiting=o,this.values=new Array(o),this.hasValue=new Array(o);for(var s=0;s<o;++s)r.hasValue[s]=!1;this.activeCount=e.length}function kt(t,e){return ft(Ye,t,e)}function mt(){this.head=null,this.length=0}function _t(t,e){return gt(Ue,t,e)}function gt(t,e,n){return new a(new bt(t,e,n.source))}function bt(t,e,n){this.f=t,this.concurrency=e,this.source=n}function xt(t,e,n,i,r){this.f=t,this.concurrency=e,this.sink=i,this.scheduler=r,this.pending=[],this.current=new mt,this.disposable=un(n.run(this,r)),this.active=!0}function At(t,e,n,i){return t(e).source.run(n,i)}function Tt(t,e,n){this.prev=this.next=null,this.time=t,this.outer=e,this.sink=n,this.disposable=void 0}function Et(t,e){return gt(t,1,e)}function Pt(){return It(Sn(arguments))}function It(t){var e=t.length;return 0===e?pn():1===e?t[0]:new a(Ct(t))}function Ct(t){return new Rt(Bn(Mt,[],t))}function Mt(t,e){var n=e.source;return n instanceof Rt?t.concat(n.sources):t.concat(n)}function Rt(t){this.sources=t}function qt(t,e,n){this.sink=n,this.disposables=t,this.activeCount=e.length}function Nt(t){this._capacity=t||32,this._length=0,this._head=0}function St(t,e,n,i,r){for(var o=0;o<r;++o)n[o+i]=t[o+e],t[o+e]=void 0}function Bt(t){return jt(t,zn(arguments))}function jt(t,e){return 0===e.length?pn():1===e.length?ot(t,e[0]):new a(new Wt(t,On(Vt,e)))}function Vt(t){return t.source}function Wt(t,e){this.f=t,this.sources=e}function Dt(t,e,n,i){this.f=t,this.sinks=n,this.sink=i,this.buffers=e}function Ot(t,e,n,i){i.event(e,at(t,On(zt,n)))}function zt(t){return t.shift()}function Lt(t,e){for(var n=0,i=t.length;n<i;++n)if(t[n].isEmpty()&&!e[n].active)return!0;return!1}function Ft(t){for(var e=0,n=t.length;e<n;++e)if(t[e].isEmpty())return!1;return!0}function Gt(t,e){return new a(Z.create(t,e.source))}function Ht(t){return Jt(Ut,t)}function Jt(t,e){return new a(new Kt(t,e.source))}function Kt(t,e){this.equals=t,this.source=e}function Qt(t,e){this.equals=t,this.sink=e,this.value=void 0,this.init=!0}function Ut(t,e){return t===e}function Xt(t,e){return Zt(0,t,e)}function Yt(t,e){return Zt(t,1/0,e)}function Zt(t,e,n){return e<=t?pn():new a($t(t,e,n.source))}function $t(t,e,n){return n instanceof it?te(t,e,n):n instanceof ne?ee(t,e,n):new ne(t,e,n)}function te(t,e,n){return it.create(n.f,$t(t,e,n.source))}function ee(t,e,n){return t+=n.min,e=Math.min(e+n.min,n.max),new ne(t,e,n.source)}function ne(t,e,n){this.source=n,this.min=t,this.max=e}function ie(t,e,n,i,r){this.sink=i,this.skip=t,this.take=e,this.disposable=un(n.run(this,r))}function re(t,e){return new a(new oe(t,e.source))}function oe(t,e){this.p=t,this.source=e}function se(t,e,n,i){this.p=t,this.sink=n,this.active=!0,this.disposable=un(e.run(this,i))}function ue(t,e){return new a(new he(t,e.source))}function he(t,e){this.p=t,this.source=e}function ce(t,e){this.p=t,this.sink=e,this.skipping=!0}function pe(t,e){return new a(new de(t.source,e.source))}function ae(t,e){return new a(new le(t.source,e.source))}function fe(t,e){return pe(Nn(t),ae(t,e))}function de(t,e){this.maxSignal=t,this.source=e}function le(t,e){this.minSignal=t,this.source=e}function ve(t,e){this.value=t,this.sink=e}function ye(t,e,n){this.min=t,this.max=e,this.sink=n}function we(t,e,n){this.value=1/0,this.sink=e,this.disposable=t.run(this,n)}function ke(t,e,n){this.value=1/0,this.sink=e,this.disposable=t.run(this,n)}function me(){}function _e(t,e){return t<=0?e:new a(new ge(t,e.source))}function ge(t,e){this.dt=t,this.source=e}function be(t,e,n){this.dt=t,this.sink=e,this.scheduler=n}function xe(t,e){return new a(Ae(t,e.source))}function Ae(t,e){return e instanceof it?Te(t,e):e instanceof Pe?Ee(t,e):new Pe(t,e)}function Te(t,e){return it.create(e.f,Ae(t,e.source))}function Ee(t,e){return new Pe(Math.max(t,e.period),e.source)}function Pe(t,e){this.period=t,this.source=e}function Ie(t,e){this.time=0,this.period=t,this.sink=e}function Ce(t,e){return new a(new Me(t,e.source))}function Me(t,e){this.dt=t,this.source=e}function Re(t,e,n,i){this.dt=t,this.sink=n,this.scheduler=i,this.value=void 0,this.timer=null;var r=e.run(this,i);this.disposable=rn([this,r])}function qe(t){this.sink=t,this.active=!0}function Ne(t,e,n){try{n.event(t,e)}catch(e){n.error(t,e)}}function Se(t,e,n){try{n.end(t,e)}catch(e){n.error(t,e)}}function Be(t,e){return new a(new De(t,e.source))}function je(t){return new a(new Ve(t))}function Ve(t){this.value=t}function We(t,e,n){n.error(t,e)}function De(t,e){this.f=t,this.source=e}function Oe(t,e,n,i){this.f=t,this.sink=new qe(n),this.scheduler=i,this.disposable=e.run(this,i)}function ze(t,e,n,i){this.time=t,this.period=e,this.task=n,this.scheduler=i,this.active=!0}function Le(t){return Promise.resolve(t).then(Fe)}function Fe(t){try{return t.run()}catch(e){return t.error(e)}}function Ge(t,e,n){for(var i=0;i<e.length;++i){var r=e[i];r.active&&(t(r),r.period>=0&&r.active&&(r.time=r.time+r.period,He(r,n)))}return n}function He(t,e){var n=e.length;if(0===n)return void e.push(Zn(t.time,[t]));var i=Ke(t.time,e);i>=n?e.push(Zn(t.time,[t])):t.time===e[i].time?e[i].events.push(t):e.splice(i,0,Zn(t.time,[t]))}function Je(t,e){e.events=u(t,e.events)}function Ke(t,e){for(var n,i,r=0,o=e.length;r<o;){if(n=Math.floor((r+o)/2),i=e[n],t===i.time)return n;t<i.time?o=n:r=n+1}return o}function Qe(t){var e=new ti(t);return Le(e),e}var Ue=function(t){return t},Xe=function(t,e){return function(n){return t(e(n))}},Ye=function(t,e){return t(e)},Ze=function(t,e){this._dispose=t,this._data=e};Ze.prototype.dispose=function(){return this._dispose(this._data)};var $e=function(){var t=this;this.disposable=void 0,this.disposed=!1,this._resolve=void 0,this.result=new Promise(function(e){t._resolve=e})};$e.prototype.setDisposable=function(t){if(void 0!==this.disposable)throw new Error("setDisposable called more than once");this.disposable=t,this.disposed&&this._resolve(t.dispose())},$e.prototype.dispose=function(){return this.disposed?this.result:(this.disposed=!0,void 0!==this.disposable&&(this.result=this.disposable.dispose()),this.result)};var tn=function(t){this.disposed=!1,this.value=void 0,this.disposable=t};tn.prototype.dispose=function(){return this.disposed||(this.disposed=!0,this.value=f(this.disposable),this.disposable=void 0),this.value};var en=function(t,e){return un(new Ze(t,e))},nn=function(){return new Ze(Ue,void 0)},rn=function(t){return en(on,t)},on=function(t){return Promise.all(o(f,t))},sn=function(){return new $e},un=function(t){return new tn(t)};y.event=function(t,e){return new y(k,t,e)},y.end=function(t,e){return new y(m,t,e)},y.error=function(t,e){return new y(w,t,e)},y.prototype.dispose=function(){this.active=!1},y.prototype.run=function(t){this.active&&this._run(t,this.value,this.sink)},y.prototype.error=function(t,e){return this.active?void this.sink.error(t,e):v(e)};var hn=function(t){return new a(new cn(t))},cn=function(t){this.value=t};cn.prototype.run=function(t,e){return e.asap(new y(_,this.value,t))};var pn=function(){return dn},an=function(){};an.prototype.run=function(t,e){var n=y.end(void 0,t);return e.asap(n),en(fn,n)};var fn=function(t){return t.dispose()},dn=new a(new an),ln=function(){return yn},vn=function(){};vn.prototype.run=function(){return nn()};var yn=new a(new vn),wn=function(t){this.period=t};wn.prototype.run=function(t,e){return e.periodic(this.period,y.event(void 0,t))},x.prototype.run=function(t,e){return e.asap(new y(A,this.array,t))};var kn;kn="function"==typeof Set&&"function"==typeof(new Set)["@@iterator"]?"@@iterator":"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";var mn=function(t){return new a(new _n(t))},_n=function(t){this.iterable=t};_n.prototype.run=function(t,e){return e.asap(new y(E,T(this.iterable),t))};var gn=function(t,e){var n=t.source;return bn(n,e)},bn=function(t,e){return new Promise(function(n,i){return P(t,e,n,i)})},xn=function(t,e,n){this._end=t,this._error=e,this._disposable=n,this.active=!0};xn.prototype.event=function(t,e){},xn.prototype.end=function(t,e){this.active&&(this.active=!1,An(this._end,this._error,this._disposable,e))},xn.prototype.error=function(t,e){this.active=!1,An(this._error,this._error,this._disposable,e)};var An=function(t,e,n,i){return Promise.resolve(n.dispose()).then(function(){return t(i)},e)};I.prototype.event=function(t,e){return this.sink.event(t,e)},I.prototype.end=function(t,e){return this.sink.end(t,e)},I.prototype.error=function(t,e){return this.sink.error(t,e)},M.prototype.run=function(t,e){return this.source.run(new R(this.step,this.seed,t),e)},R.prototype.error=I.prototype.error,R.prototype.event=function(t,e){var n=this.step(this.seed,e);this.seed=n.seed,this.sink.event(t,n.value)},R.prototype.end=function(t){this.sink.end(t,this.seed)};var Tn=function(t,e,n){return new a(new En(t,e,n.source))},En=function(t,e,n){this.source=n,this.f=t,this.value=e};En.prototype.run=function(t,e){var n=e.asap(y.event(this.value,t)),i=this.source.run(new Pn(this.f,this.value,t),e);return rn([n,i])};var Pn=function(t){function e(e,n,i){t.call(this),this.f=e,this.value=n,this.sink=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.event=function(t,e){var n=this.f;this.value=n(this.value,e),this.sink.event(t,this.value)},e}(I);N.prototype.run=function(t,e){return new S(this.f,this.value,t,e)},S.prototype.dispose=function(){this.active=!1},W.prototype.run=function(t,e){return new D(this.f,this.value,t,e)},D.prototype.dispose=function(){this.active=!1},F.prototype.run=function(t,e){return new G(this.f.apply(void 0,this.args),t,e)},G.prototype.dispose=function(){this.active=!1},X.prototype.run=function(t,e){return new Y(this.f,this.source,t,e)},Y.prototype.error=I.prototype.error,Y.prototype.event=function(t,e){this.active&&this.sink.event(t,e)},Y.prototype.end=function(t,e){this.active&&(l(t,this.disposable,this.sink),this._startNext(t,e,this.sink))},Y.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}},Y.prototype._continue=function(t,e,n){return t(e).source.run(n,this.scheduler)},Y.prototype.dispose=function(){return this.active=!1,this.disposable.dispose()};var In=function(t,e){return Cn(hn(t),e)},Cn=function(t,e){return U(function(){return e},t)};Z.create=function(t,e){return e instanceof Z?new Z(tt(e.p,t),e.source):new Z(t,e)},Z.prototype.run=function(t,e){return this.source.run(new $(this.p,t),e)},$.prototype.end=I.prototype.end,$.prototype.error=I.prototype.error,$.prototype.event=function(t,e){var n=this.p;n(e)&&this.sink.event(t,e)},et.prototype.run=function(t,e){return this.source.run(new nt(this.p,this.f,t),e)},nt.prototype.event=function(t,e){var n=this.f,i=this.p;i(e)&&this.sink.event(t,n(e))},nt.prototype.end=I.prototype.end,nt.prototype.error=I.prototype.error,it.create=function(t,e){return e instanceof it?new it(Xe(t,e.f),e.source):e instanceof Z?new et(e.p,t,e.source):new it(t,e)},it.prototype.run=function(t,e){return this.source.run(new rt(this.f,t),e)},rt.prototype.end=I.prototype.end,rt.prototype.error=I.prototype.error,rt.prototype.event=function(t,e){var n=this.f;this.sink.event(t,n(e))},ht.prototype.run=function(t,e){return this.source.run(new ct(this.f,t),e)},ct.prototype.end=I.prototype.end,ct.prototype.error=I.prototype.error,ct.prototype.event=function(t,e){var n=this.f;n(e),this.sink.event(t,e)},pt.prototype.event=function(t,e){this.active&&(this.value=e,this.sink.event(t,this))},pt.prototype.end=function(t,e){this.active&&(this.active=!1,this.sink.end(t,{index:this.index,value:e}))},pt.prototype.error=I.prototype.error;var Mn=o,Rn=i;yt.prototype.run=function(t,e){for(var n,i=this,r=this.sources.length,o=new Array(r),s=new Array(r),u=new wt(o,s,t,this.f),h=0;h<r;++h)n=s[h]=new pt(h,u),o[h]=i.sources[h].run(n,e);return rn(o)},wt.prototype.error=I.prototype.error,wt.prototype.event=function(t,e){var n=e.index,i=this._updateReady(n);this.values[n]=e.value,0===i&&this.sink.event(t,at(this.f,this.values))},wt.prototype._updateReady=function(t){return this.awaiting>0&&(this.hasValue[t]||(this.hasValue[t]=!0,this.awaiting-=1)),this.awaiting},wt.prototype.end=function(t,e){l(t,this.disposables[e.index],this.sink),0===--this.activeCount&&this.sink.end(t,e.value)},mt.prototype.add=function(t){null!==this.head&&(this.head.prev=t,t.next=this.head),this.head=t,++this.length},mt.prototype.remove=function(t){--this.length,t===this.head&&(this.head=this.head.next),null!==t.next&&(t.next.prev=t.prev,t.next=null),null!==t.prev&&(t.prev.next=t.next,t.prev=null)},mt.prototype.isEmpty=function(){return 0===this.length},mt.prototype.dispose=function(){if(this.isEmpty())return Promise.resolve();var t=[],e=this.head;for(this.head=null,this.length=0;null!==e;)t.push(e.dispose()),e=e.next;return Promise.all(t)},bt.prototype.run=function(t,e){return new xt(this.f,this.concurrency,this.source,t,e)},xt.prototype.event=function(t,e){this._addInner(t,e)},xt.prototype._addInner=function(t,e){this.current.length<this.concurrency?this._startInner(t,e):this.pending.push(e)},xt.prototype._startInner=function(t,e){try{this._initInner(t,e)}catch(e){this.error(t,e)}},xt.prototype._initInner=function(t,e){var n=new Tt(t,this,this.sink);n.disposable=At(this.f,e,n,this.scheduler),this.current.add(n)},xt.prototype.end=function(t,e){this.active=!1,l(t,this.disposable,this.sink),this._checkEnd(t,e)},xt.prototype.error=function(t,e){this.active=!1,this.sink.error(t,e)},xt.prototype.dispose=function(){return this.active=!1,this.pending.length=0,Promise.all([this.disposable.dispose(),this.current.dispose()])},xt.prototype._endInner=function(t,e,n){this.current.remove(n),l(t,n,this),0===this.pending.length?this._checkEnd(t,e):this._startInner(t,this.pending.shift())},xt.prototype._checkEnd=function(t,e){!this.active&&this.current.isEmpty()&&this.sink.end(t,e)},Tt.prototype.event=function(t,e){this.sink.event(Math.max(t,this.time),e)},Tt.prototype.end=function(t,e){this.outer._endInner(Math.max(t,this.time),e,this)},Tt.prototype.error=function(t,e){this.outer.error(Math.max(t,this.time),e)},Tt.prototype.dispose=function(){return this.disposable.dispose()};var qn=function(t,e){return gt(t,1/0,e)},Nn=function(t){return _t(1/0,t)},Sn=r,Bn=s;Rt.prototype.run=function(t,e){for(var n,i=this,r=this.sources.length,o=new Array(r),s=new Array(r),u=new qt(o,s,t),h=0;h<r;++h)n=s[h]=new pt(h,u),o[h]=i.sources[h].run(n,e);return rn(o)},qt.prototype.error=I.prototype.error,qt.prototype.event=function(t,e){this.sink.event(t,e.value)},qt.prototype.end=function(t,e){l(t,this.disposables[e.index],this.sink),0===--this.activeCount&&this.sink.end(t,e.value)};var jn=function(t,e,n){return new a(new Vn(t,e,n))},Vn=function(t,e,n){this.source=n.source,this.sampler=e.source,this.f=t};Vn.prototype.run=function(t,e){var n=new Wn(this.f,this.source,t),i=this.source.run(n.hold,e),r=this.sampler.run(n,e);return rn([r,i])};var Wn=function(t){function e(e,n,i){t.call(this,i),this.sink=i,this.source=n,this.f=e,this.hold=new Dn(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.event=function(t,e){if(this.hold.hasValue){var n=this.f;this.sink.event(t,n(e,this.hold.value))}},e}(I),Dn=function(t){function e(e){t.call(this,e),this.hasValue=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.event=function(t,e){this.value=e,this.hasValue=!0},e.prototype.end=function(){},e}(I);Nt.prototype.push=function(t){var e=this._length;this._checkCapacity(e+1);var n=this._head+e&this._capacity-1;this[n]=t,this._length=e+1},Nt.prototype.shift=function(){var t=this._head,e=this[t];return this[t]=void 0,this._head=t+1&this._capacity-1,this._length--,e},Nt.prototype.isEmpty=function(){return 0===this._length},Nt.prototype.length=function(){return this._length},Nt.prototype._checkCapacity=function(t){this._capacity<t&&this._ensureCapacity(this._capacity<<1)},Nt.prototype._ensureCapacity=function(t){var e=this._capacity;this._capacity=t;var n=this._head+this._length;n>e&&St(this,0,this,e,n&e-1)};var On=o,zn=i;Wt.prototype.run=function(t,e){for(var n,i=this,r=this.sources.length,o=new Array(r),s=new Array(r),u=new Array(r),h=new Dt(this.f,u,s,t),c=0;c<r;++c)u[c]=new Nt,n=s[c]=new pt(c,h),o[c]=i.sources[c].run(n,e);return rn(o)},Dt.prototype.event=function(t,e){var n=this.buffers,i=n[e.index];if(i.push(e.value),1===i.length()){if(!Ft(this.buffers))return;Ot(this.f,t,n,this.sink),Lt(this.buffers,this.sinks)&&this.sink.end(t,void 0)}},Dt.prototype.end=function(t,e){var n=this.buffers[e.index];n.isEmpty()&&this.sink.end(t,e.value)},Dt.prototype.error=I.prototype.error;var Ln=function(t){return new a(new Fn(t.source))},Fn=function(t){this.source=t};Fn.prototype.run=function(t,e){var n=new Gn(t,e);return rn([n,this.source.run(n,e)])};var Gn=function(t,e){this.sink=t,this.scheduler=e,this.current=null,this.ended=!1};Gn.prototype.event=function(t,e){this._disposeCurrent(t),this.current=new Hn(t,1/0,this,this.sink),this.current.disposable=e.source.run(this.current,this.scheduler)},Gn.prototype.end=function(t,e){this.ended=!0,this._checkEnd(t,e)},Gn.prototype.error=function(t,e){this.ended=!0,this.sink.error(t,e)},Gn.prototype.dispose=function(){return this._disposeCurrent(this.scheduler.now())},Gn.prototype._disposeCurrent=function(t){if(null!==this.current)return this.current._dispose(t)},Gn.prototype._disposeInner=function(t,e){e._dispose(t),e===this.current&&(this.current=null)},Gn.prototype._checkEnd=function(t,e){this.ended&&null===this.current&&this.sink.end(t,e)},Gn.prototype._endInner=function(t,e,n){this._disposeInner(t,n),this._checkEnd(t,e)},Gn.prototype._errorInner=function(t,e,n){this._disposeInner(t,n),this.sink.error(t,e)};var Hn=function(t,e,n,i){this.min=t,this.max=e,this.outer=n,this.sink=i,this.disposable=nn()};Hn.prototype.event=function(t,e){t<this.max&&this.sink.event(Math.max(t,this.min),e)},Hn.prototype.end=function(t,e){this.outer._endInner(Math.max(t,this.min),e,this)},Hn.prototype.error=function(t,e){this.outer._errorInner(Math.max(t,this.min),e,this)},Hn.prototype._dispose=function(t){this.max=t,l(t,this.disposable,this.sink)},Kt.prototype.run=function(t,e){return this.source.run(new Qt(this.equals,t),e)},Qt.prototype.end=I.prototype.end,Qt.prototype.error=I.prototype.error,Qt.prototype.event=function(t,e){this.init?(this.init=!1,this.value=e,this.sink.event(t,e)):this.equals(this.value,e)||(this.value=e,this.sink.event(t,e))},ne.prototype.run=function(t,e){return new ie(this.min,this.max-this.min,this.source,t,e)},ie.prototype.end=I.prototype.end,ie.prototype.error=I.prototype.error,ie.prototype.event=function(t,e){return this.skip>0?void(this.skip-=1):void(0!==this.take&&(this.take-=1,this.sink.event(t,e),0===this.take&&(this.dispose(),this.sink.end(t,e))))},ie.prototype.dispose=function(){return this.disposable.dispose()},oe.prototype.run=function(t,e){return new se(this.p,this.source,t,e)},se.prototype.end=I.prototype.end,se.prototype.error=I.prototype.error,se.prototype.event=function(t,e){if(this.active){var n=this.p;this.active=n(e),this.active?this.sink.event(t,e):(this.dispose(),this.sink.end(t,e))}},se.prototype.dispose=function(){return this.disposable.dispose()},he.prototype.run=function(t,e){return this.source.run(new ce(this.p,t),e)},ce.prototype.end=I.prototype.end,ce.prototype.error=I.prototype.error,ce.prototype.event=function(t,e){if(this.skipping){var n=this.p;if(this.skipping=n(e),this.skipping)return}this.sink.event(t,e)},de.prototype.run=function(t,e){var n=new ve(-(1/0),t),i=new ke(this.maxSignal,t,e),r=this.source.run(new ye(n,i,t),e);return rn([n,i,r])},le.prototype.run=function(t,e){var n=new we(this.minSignal,t,e),i=new ve(1/0,t),r=this.source.run(new ye(n,i,t),e);return rn([n,i,r])},ve.prototype.error=I.prototype.error,ve.prototype.event=me,ve.prototype.end=me,ve.prototype.dispose=me,ye.prototype.event=function(t,e){t>=this.min.value&&t<this.max.value&&this.sink.event(t,e)},ye.prototype.error=I.prototype.error,ye.prototype.end=I.prototype.end,we.prototype.event=function(t){t<this.value&&(this.value=t)},we.prototype.end=me,we.prototype.error=I.prototype.error,we.prototype.dispose=function(){return this.disposable.dispose()},ke.prototype.event=function(t,e){t<this.value&&(this.value=t,this.sink.end(t,e))},ke.prototype.end=me,ke.prototype.error=I.prototype.error,ke.prototype.dispose=function(){return this.disposable.dispose()},ge.prototype.run=function(t,e){var n=new be(this.dt,t,e);return rn([n,this.source.run(n,e)])},be.prototype.dispose=function(){var t=this;this.scheduler.cancelAll(function(e){return e.sink===t.sink})},be.prototype.event=function(t,e){this.scheduler.delay(this.dt,y.event(e,this.sink))},be.prototype.end=function(t,e){this.scheduler.delay(this.dt,y.end(e,this.sink))},be.prototype.error=I.prototype.error,Pe.prototype.run=function(t,e){return this.source.run(new Ie(this.period,t),e)},Ie.prototype.event=function(t,e){t>=this.time&&(this.time=t+this.period,this.sink.event(t,e))},Ie.prototype.end=I.prototype.end,Ie.prototype.error=I.prototype.error,Me.prototype.run=function(t,e){return new Re(this.dt,this.source,t,e)},Re.prototype.event=function(t,e){this._clearTimer(),this.value=e,this.timer=this.scheduler.delay(this.dt,y.event(e,this.sink))},Re.prototype.end=function(t,e){this._clearTimer()&&(this.sink.event(t,this.value),this.value=void 0),this.sink.end(t,e)},Re.prototype.error=function(t,e){this._clearTimer(),this.sink.error(t,e)},Re.prototype.dispose=function(){this._clearTimer()},Re.prototype._clearTimer=function(){return null!==this.timer&&(this.timer.dispose(),this.timer=null,!0)};var Jn=function(t){return new a(new Qn(t.source))},Kn=Xe(Jn,hn),Qn=function(t){this.source=t};Qn.prototype.run=function(t,e){return this.source.run(new Un(t,e),e)};var Un=function(t,e){var n=this;this.sink=t,this.scheduler=e,this.queue=Promise.resolve(),this._eventBound=function(t){return n.sink.event(n.scheduler.now(),t)},this._endBound=function(t){return n.sink.end(n.scheduler.now(),t)},this._errorBound=function(t){return n.sink.error(n.scheduler.now(),t)}};Un.prototype.event=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._event(e)}).catch(this._errorBound)},Un.prototype.end=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._end(e)}).catch(this._errorBound)},Un.prototype.error=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._errorBound(e)}).catch(v)},Un.prototype._event=function(t){return t.then(this._eventBound)},Un.prototype._end=function(t){return Promise.resolve(t).then(this._endBound)},qe.prototype.event=function(t,e){this.active&&this.sink.event(t,e)},qe.prototype.end=function(t,e){this.active&&(this.disable(),this.sink.end(t,e))},qe.prototype.error=function(t,e){this.disable(),this.sink.error(t,e)},qe.prototype.disable=function(){return this.active=!1,this.sink},Ve.prototype.run=function(t,e){return e.asap(new y(We,this.value,t))},De.prototype.run=function(t,e){return new Oe(this.f,this.source,t,e)},Oe.prototype.event=function(t,e){Ne(t,e,this.sink)},Oe.prototype.end=function(t,e){Se(t,e,this.sink)},Oe.prototype.error=function(t,e){var n=this.sink.disable();l(t,this.disposable,this.sink),this._startNext(t,e,n)},Oe.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}},Oe.prototype._continue=function(t,e,n){var i=t(e);return i.source.run(n,this.scheduler)},Oe.prototype.dispose=function(){return this.disposable.dispose()},ze.prototype.run=function(){return this.task.run(this.time)},ze.prototype.error=function(t){return this.task.error(this.time,t)},ze.prototype.dispose=function(){return this.scheduler.cancel(this),this.task.dispose()};var Xn=function(t,e){var n=this;this.timer=t,this.timeline=e,this._timer=null,this._nextArrival=1/0,this._runReadyTasksBound=function(){return n._runReadyTasks(n.now())}};Xn.prototype.now=function(){return this.timer.now()},Xn.prototype.asap=function(t){return this.schedule(0,-1,t)},Xn.prototype.delay=function(t,e){return this.schedule(t,-1,e)},Xn.prototype.periodic=function(t,e){return this.schedule(0,t,e)},Xn.prototype.schedule=function(t,e,n){var i=this.now(),r=new ze(i+Math.max(0,t),e,n,this);return this.timeline.add(r),this._scheduleNextRun(i),r},Xn.prototype.cancel=function(t){t.active=!1,this.timeline.remove(t)&&this._reschedule()},Xn.prototype.cancelAll=function(t){this.timeline.removeAll(t),this._reschedule()},Xn.prototype._reschedule=function(){this.timeline.isEmpty()?this._unschedule():this._scheduleNextRun(this.now())},Xn.prototype._unschedule=function(){this.timer.clearTimer(this._timer),this._timer=null},Xn.prototype._scheduleNextRun=function(t){if(!this.timeline.isEmpty()){var e=this.timeline.nextArrival();null===this._timer?this._scheduleNextArrival(e,t):e<this._nextArrival&&(this._unschedule(),this._scheduleNextArrival(e,t))}},Xn.prototype._scheduleNextArrival=function(t,e){this._nextArrival=t;var n=Math.max(0,t-e);this._timer=this.timer.setTimer(this._runReadyTasksBound,n)},Xn.prototype._runReadyTasks=function(t){this._timer=null,this.timeline.runTasks(t,Fe),this._scheduleNextRun(this.now())};var Yn=function(){this.tasks=[]};Yn.prototype.nextArrival=function(){return this.isEmpty()?1/0:this.tasks[0].time},Yn.prototype.isEmpty=function(){return 0===this.tasks.length},Yn.prototype.add=function(t){He(t,this.tasks)},Yn.prototype.remove=function(t){var e=Ke(t.time,this.tasks);if(e>=0&&e<this.tasks.length){var n=h(t,this.tasks[e].events);if(n>=0)return this.tasks[e].events.splice(n,1),!0}return!1},Yn.prototype.removeAll=function(t){for(var e=this,n=0;n<this.tasks.length;++n)Je(t,e.tasks[n])},Yn.prototype.runTasks=function(t,e){for(var n=this,i=this.tasks,r=i.length,o=0;o<r&&i[o].time<=t;)++o;this.tasks=i.slice(o);for(var s=0;s<o;++s)n.tasks=Ge(e,i[s].events,n.tasks)};var Zn=function(t,e){return{time:t,events:e}},$n=function(){this.now=Date.now};$n.prototype.setTimer=function(t,e){return e<=0?Qe(t):setTimeout(t,e)},$n.prototype.clearTimer=function(t){return t instanceof ti?t.cancel():clearTimeout(t)};var ti=function(t){this.f=t,this.active=!0};ti.prototype.run=function(){return this.active&&this.f()},ti.prototype.error=function(t){throw t},ti.prototype.cancel=function(){this.active=!1};var ei=c(gn),ni=p(C),ii=p(Tn),ri=c(q),oi=c(V),si=c(Cn),ui=c(In),hi=c(ot),ci=c(st),pi=c(ut),ai=c(kt),fi=c(qn),di=c(U),li=c(Et),vi=c(_t),yi=p(gt),wi=c(dt),ki=p(jn),mi=c(jt),_i=c(Gt),gi=c(Jt),bi=c(Xt),xi=c(Yt),Ai=p(Zt),Ti=c(re),Ei=c(ue),Pi=c(pe),Ii=c(ae),Ci=c(fe),Mi=c(_e),Ri=c(xe),qi=c(Ce),Ni=c(Be),Si=function(){return new Xn(new $n,new Yn)};t.runEffects=ei,t.loop=ni,t.scan=ii,t.unfold=ri,t.iterate=oi,t.concat=si,t.startWith=ui,t.map=hi,t.constant=ci,t.tap=pi,t.ap=ai,t.chain=fi,t.join=Nn,t.continueWith=di,
t.concatMap=li,t.mergeConcurrently=vi,t.mergeMapConcurrently=yi,t.combine=ft,t.combineArray=wi,t.sample=ki,t.zip=Bt,t.zipArray=mi,t.filter=_i,t.skipRepeats=Ht,t.skipRepeatsWith=gi,t.take=bi,t.skip=xi,t.slice=Ai,t.takeWhile=Ti,t.skipWhile=Ei,t.until=Pi,t.since=Ii,t.during=Ci,t.delay=Mi,t.throttle=Ri,t.debounce=qi,t.recoverWith=Ni,t.throwError=je,t.createDefaultScheduler=Si,t.Scheduler=Xn,t.Timeline=Yn,t.ClockTimer=$n,t.Stream=a,t.just=hn,t.empty=pn,t.never=ln,t.periodic=g,t.fromArray=b,t.fromIterable=mn,t.generate=L,t.merge=Pt,t.mergeArray=It,t.switchLatest=Ln,t.fromPromise=Kn,t.awaitPromises=Jn,t.PropagateTask=y,Object.defineProperty(t,"__esModule",{value:!0})});
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define(["exports"],e):e(t.mostCore=t.mostCore||{})})(this,function(t){"use strict";function e(t,e){if(t<0){throw new TypeError("n must be >= 0")}var r=e.length;if(t===0||r===0){return e}if(t>=r){return[]}return n(t,e,r-t)}function n(t,e,n){var r=new Array(n);for(var i=0;i<n;++i){r[i]=e[t+i]}return r}function r(t){return e(1,t)}function i(t){var e=t.length;var n=new Array(e);for(var r=0;r<e;++r){n[r]=t[r]}return n}function s(t,e){var n=e.length;var r=new Array(n);for(var i=0;i<n;++i){r[i]=t(e[i])}return r}function o(t,e,n){var r=e;for(var i=0,s=n.length;i<s;++i){r=t(r,n[i],i)}return r}function u(t,e){var n=e.length;var r=new Array(n);var i=0;for(var s=void 0,o=0;o<n;++o){s=e[o];if(!t(s)){r[i]=s;++i}}r.length=i;return r}function h(t,e){for(var n=0,r=e.length;n<r;++n){if(t===e[n]){return n}}return-1}var c=function(t){return t};var p=function(t,e){return function(n){return t(e(n))}};var a=function(t,e){return t(e)};function f(t){function e(n,r){switch(arguments.length){case 0:return e;case 1:return function(e){return t(n,e)};default:return t(n,r)}}return e}function v(t){function e(n,r,i){switch(arguments.length){case 0:return e;case 1:return f(function(e,r){return t(n,e,r)});case 2:return function(e){return t(n,r,e)};default:return t(n,r,i)}}return e}function l(t){this.source=t}var d=function t(e,n){this._dispose=e;this._data=n};d.prototype.dispose=function t(){return this._dispose(this._data)};var y=function t(){var e=this;this.disposable=void 0;this.disposed=false;this._resolve=void 0;this.result=new Promise(function(t){e._resolve=t})};y.prototype.setDisposable=function t(e){if(this.disposable!==void 0){throw new Error("setDisposable called more than once")}this.disposable=e;if(this.disposed){this._resolve(e.dispose())}};y.prototype.dispose=function t(){if(this.disposed){return this.result}this.disposed=true;if(this.disposable!==void 0){this.result=this.disposable.dispose()}return this.result};function w(t){try{return t.dispose()}catch(t){return Promise.reject(t)}}var k=function t(e){this.disposed=false;this.value=undefined;this.disposable=e};k.prototype.dispose=function t(){if(!this.disposed){this.disposed=true;this.value=w(this.disposable);this.disposable=undefined}return this.value};function m(t){return t!==null&&typeof t==="object"&&typeof t.then==="function"}function _(t,e,n){var r=w(e);return m(r)?r.catch(function(e){return n.error(t,e)}):r}var g=function(t,e){return T(new d(t,e))};var b=function(){return new d(c,undefined)};var x=function(t){return g(A,t)};var A=function(t){return Promise.all(s(w,t))};var I=function(){return new y};var T=function(t){return new k(t)};function E(t){setTimeout(function(){throw t},0)}function P(t,e,n){this._run=t;this.value=e;this.sink=n;this.active=true}P.event=function(t,e){return new P(M,t,e)};P.end=function(t,e){return new P(R,t,e)};P.error=function(t,e){return new P(C,t,e)};P.prototype.dispose=function(){this.active=false};P.prototype.run=function(t){if(!this.active){return}this._run(t,this.value,this.sink)};P.prototype.error=function(t,e){if(!this.active){return E(e)}this.sink.error(t,e)};function C(t,e,n){n.error(t,e)}function M(t,e,n){n.event(t,e)}function R(t,e,n){n.end(t,e)}var S=function(t){return new l(new q(t))};var q=function t(e){this.value=e};q.prototype.run=function t(e,n){return n.asap(new P(N,this.value,e))};function N(t,e,n){n.event(t,e);n.end(t,void 0)}var B=function(){return W};var j=function t(){};j.prototype.run=function t(e,n){var r=P.end(void 0,e);n.asap(r);return g(V,r)};var V=function(t){return t.dispose()};var W=new l(new j);var D=function(){return z};var O=function t(){};O.prototype.run=function t(){return b()};var z=new l(new O);function L(t){return new l(new F(t))}var F=function t(e){this.period=e};F.prototype.run=function t(e,n){return n.periodic(this.period,P.event(undefined,e))};function G(t){return new l(new H(t))}function H(t){this.array=t}H.prototype.run=function(t,e){return e.asap(new P(J,this.array,t))};function J(t,e,n){for(var r=0,i=e.length;r<i&&this.active;++r){n.event(t,e[r])}this.active&&s(t);function s(t){n.end(t)}}var K;if(typeof Set==="function"&&typeof(new Set)["@@iterator"]==="function"){K="@@iterator"}else{K=typeof Symbol==="function"&&Symbol.iterator||"_es6shim_iterator_"}function Q(t){return t[K]()}var U=function(t){return new l(new X(t))};var X=function t(e){this.iterable=e};X.prototype.run=function t(e,n){return n.asap(new P(Y,Q(this.iterable),e))};function Y(t,e,n){var r=e.next();while(!r.done&&this.active){n.event(t,r.value);r=e.next()}n.end(t,r.value)}var Z=function(t,e){var n=t.source;return $(n,e)};var $=function(t,e){return new Promise(function(n,r){return tt(t,e,n,r)})};function tt(t,e,n,r){var i=I();var s=new et(n,r,i);i.setDisposable(t.run(s,e))}var et=function t(e,n,r){this._end=e;this._error=n;this._disposable=r;this.active=true};et.prototype.event=function t(e,n){};et.prototype.end=function t(e,n){if(!this.active){return}this.active=false;nt(this._end,this._error,this._disposable,n)};et.prototype.error=function t(e,n){this.active=false;nt(this._error,this._error,this._disposable,n)};var nt=function(t,e,n,r){return Promise.resolve(n.dispose()).then(function(){return t(r)},e)};function rt(t){this.sink=t}rt.prototype.event=function(t,e){return this.sink.event(t,e)};rt.prototype.end=function(t,e){return this.sink.end(t,e)};rt.prototype.error=function(t,e){return this.sink.error(t,e)};function it(t,e,n){return new l(new st(t,e,n.source))}function st(t,e,n){this.step=t;this.seed=e;this.source=n}st.prototype.run=function(t,e){return this.source.run(new ot(this.step,this.seed,t),e)};function ot(t,e,n){this.step=t;this.seed=e;this.sink=n}ot.prototype.error=rt.prototype.error;ot.prototype.event=function(t,e){var n=this.step(this.seed,e);this.seed=n.seed;this.sink.event(t,n.value)};ot.prototype.end=function(t){this.sink.end(t,this.seed)};var ut=function(t,e,n){return new l(new ht(t,e,n.source))};var ht=function t(e,n,r){this.source=r;this.f=e;this.value=n};ht.prototype.run=function t(e,n){var r=n.asap(P.event(this.value,e));var i=this.source.run(new ct(this.f,this.value,e),n);return x([r,i])};var ct=function(t){function e(e,n,r){t.call(this);this.f=e;this.value=n;this.sink=r}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.event=function t(e,n){var r=this.f;this.value=r(this.value,n);this.sink.event(e,this.value)};return e}(rt);function pt(t,e){return new l(new at(t,e))}function at(t,e){this.f=t;this.value=e}at.prototype.run=function(t,e){return new ft(this.f,this.value,t,e)};function ft(t,e,n,r){this.f=t;this.sink=n;this.scheduler=r;this.active=true;var i=this;function s(t){i.sink.error(i.scheduler.now(),t)}function o(t){return vt(t,e)}Promise.resolve(this).then(o).catch(s)}ft.prototype.dispose=function(){this.active=false};function vt(t,e){var n=t.f;return Promise.resolve(n(e)).then(function(e){return lt(t,e)})}function lt(t,e){if(e.done){t.sink.end(t.scheduler.now(),e.value);return e.value}t.sink.event(t.scheduler.now(),e.value);if(!t.active){return e.value}return vt(t,e.seed)}function dt(t,e){return new l(new yt(t,e))}function yt(t,e){this.f=t;this.value=e}yt.prototype.run=function(t,e){return new wt(this.f,this.value,t,e)};function wt(t,e,n,r){this.f=t;this.sink=n;this.scheduler=r;this.active=true;var i=e;var s=this;function o(t){s.sink.error(s.scheduler.now(),t)}function u(t){return kt(t,i)}Promise.resolve(this).then(u).catch(o)}wt.prototype.dispose=function(){this.active=false};function kt(t,e){t.sink.event(t.scheduler.now(),e);if(!t.active){return e}var n=t.f;return Promise.resolve(n(e)).then(function(e){return mt(t,e)})}function mt(t,e){return!t.active?t.value:kt(t,e)}function _t(t){return new l(new gt(t,r(arguments)))}function gt(t,e){this.f=t;this.args=e}gt.prototype.run=function(t,e){return new bt(this.f.apply(void 0,this.args),t,e)};function bt(t,e,n){this.iterator=t;this.sink=e;this.scheduler=n;this.active=true;var r=this;function i(t){r.sink.error(r.scheduler.now(),t)}Promise.resolve(this).then(xt).catch(i)}function xt(t,e){return t.active?At(t,t.iterator.next(e)):e}function At(t,e){if(e.done){return t.sink.end(t.scheduler.now(),e.value)}return Promise.resolve(e.value).then(function(e){return It(t,e)},function(e){return Tt(t,e)})}function It(t,e){t.sink.event(t.scheduler.now(),e);return xt(t,e)}function Tt(t,e){return At(t,t.iterator.throw(e))}bt.prototype.dispose=function(){this.active=false};function Et(t,e){return new l(new Pt(t,e.source))}function Pt(t,e){this.f=t;this.source=e}Pt.prototype.run=function(t,e){return new Ct(this.f,this.source,t,e)};function Ct(t,e,n,r){this.f=t;this.sink=n;this.scheduler=r;this.active=true;this.disposable=T(e.run(this,r))}Ct.prototype.error=rt.prototype.error;Ct.prototype.event=function(t,e){if(!this.active){return}this.sink.event(t,e)};Ct.prototype.end=function(t,e){if(!this.active){return}_(t,this.disposable,this.sink);this._startNext(t,e,this.sink)};Ct.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}};Ct.prototype._continue=function(t,e,n){return t(e).source.run(n,this.scheduler)};Ct.prototype.dispose=function(){this.active=false;return this.disposable.dispose()};var Mt=function(t,e){return Rt(S(t),e)};var Rt=function(t,e){return Et(function(){return e},t)};function St(t,e){this.p=t;this.source=e}St.create=function t(e,n){if(n instanceof St){return new St(Nt(n.p,e),n.source)}return new St(e,n)};St.prototype.run=function(t,e){return this.source.run(new qt(this.p,t),e)};function qt(t,e){this.p=t;this.sink=e}qt.prototype.end=rt.prototype.end;qt.prototype.error=rt.prototype.error;qt.prototype.event=function(t,e){var n=this.p;n(e)&&this.sink.event(t,e)};function Nt(t,e){return function(n){return t(n)&&e(n)}}function Bt(t,e,n){this.p=t;this.f=e;this.source=n}Bt.prototype.run=function(t,e){return this.source.run(new jt(this.p,this.f,t),e)};function jt(t,e,n){this.p=t;this.f=e;this.sink=n}jt.prototype.event=function(t,e){var n=this.f;var r=this.p;r(e)&&this.sink.event(t,n(e))};jt.prototype.end=rt.prototype.end;jt.prototype.error=rt.prototype.error;function Vt(t,e){this.f=t;this.source=e}Vt.create=function t(e,n){if(n instanceof Vt){return new Vt(p(e,n.f),n.source)}if(n instanceof St){return new Bt(n.p,e,n.source)}return new Vt(e,n)};Vt.prototype.run=function(t,e){return this.source.run(new Wt(this.f,t),e)};function Wt(t,e){this.f=t;this.sink=e}Wt.prototype.end=rt.prototype.end;Wt.prototype.error=rt.prototype.error;Wt.prototype.event=function(t,e){var n=this.f;this.sink.event(t,n(e))};function Dt(t,e){return new l(Vt.create(t,e.source))}function Ot(t,e){return Dt(function(){return t},e)}function zt(t,e){return new l(new Lt(t,e.source))}function Lt(t,e){this.source=e;this.f=t}Lt.prototype.run=function(t,e){return this.source.run(new Ft(this.f,t),e)};function Ft(t,e){this.sink=e;this.f=t}Ft.prototype.end=rt.prototype.end;Ft.prototype.error=rt.prototype.error;Ft.prototype.event=function(t,e){var n=this.f;n(e);this.sink.event(t,e)};function Gt(t,e){this.sink=e;this.index=t;this.active=true;this.value=void 0}Gt.prototype.event=function(t,e){if(!this.active){return}this.value=e;this.sink.event(t,this)};Gt.prototype.end=function(t,e){if(!this.active){return}this.active=false;this.sink.end(t,{index:this.index,value:e})};Gt.prototype.error=rt.prototype.error;function Ht(t,e){switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);default:return t.apply(void 0,e)}}var Jt=s;var Kt=r;function Qt(t){return Ut(t,Kt(arguments))}function Ut(t,e){var n=e.length;return n===0?B():n===1?Dt(t,e[0]):new l(Xt(t,e))}function Xt(t,e){return new Zt(t,Jt(Yt,e))}function Yt(t){return t.source}function Zt(t,e){this.f=t;this.sources=e}Zt.prototype.run=function(t,e){var n=this;var r=this.sources.length;var i=new Array(r);var s=new Array(r);var o=new $t(i,s,t,this.f);for(var u,h=0;h<r;++h){u=s[h]=new Gt(h,o);i[h]=n.sources[h].run(u,e)}return x(i)};function $t(t,e,n,r){var i=this;this.sink=n;this.disposables=t;this.sinks=e;this.f=r;var s=e.length;this.awaiting=s;this.values=new Array(s);this.hasValue=new Array(s);for(var o=0;o<s;++o){i.hasValue[o]=false}this.activeCount=e.length}$t.prototype.error=rt.prototype.error;$t.prototype.event=function(t,e){var n=e.index;var r=this._updateReady(n);this.values[n]=e.value;if(r===0){this.sink.event(t,Ht(this.f,this.values))}};$t.prototype._updateReady=function(t){if(this.awaiting>0){if(!this.hasValue[t]){this.hasValue[t]=true;this.awaiting-=1}}return this.awaiting};$t.prototype.end=function(t,e){_(t,this.disposables[e.index],this.sink);if(--this.activeCount===0){this.sink.end(t,e.value)}};function te(t,e){return Qt(a,t,e)}function ee(){this.head=null;this.length=0}ee.prototype.add=function(t){if(this.head!==null){this.head.prev=t;t.next=this.head}this.head=t;++this.length};ee.prototype.remove=function(t){--this.length;if(t===this.head){this.head=this.head.next}if(t.next!==null){t.next.prev=t.prev;t.next=null}if(t.prev!==null){t.prev.next=t.next;t.prev=null}};ee.prototype.isEmpty=function(){return this.length===0};ee.prototype.dispose=function(){if(this.isEmpty()){return Promise.resolve()}var t=[];var e=this.head;this.head=null;this.length=0;while(e!==null){t.push(e.dispose());e=e.next}return Promise.all(t)};function ne(t,e){return re(c,t,e)}function re(t,e,n){return new l(new ie(t,e,n.source))}function ie(t,e,n){this.f=t;this.concurrency=e;this.source=n}ie.prototype.run=function(t,e){return new se(this.f,this.concurrency,this.source,t,e)};function se(t,e,n,r,i){this.f=t;this.concurrency=e;this.sink=r;this.scheduler=i;this.pending=[];this.current=new ee;this.disposable=T(n.run(this,i));this.active=true}se.prototype.event=function(t,e){this._addInner(t,e)};se.prototype._addInner=function(t,e){if(this.current.length<this.concurrency){this._startInner(t,e)}else{this.pending.push(e)}};se.prototype._startInner=function(t,e){try{this._initInner(t,e)}catch(e){this.error(t,e)}};se.prototype._initInner=function(t,e){var n=new ue(t,this,this.sink);n.disposable=oe(this.f,e,n,this.scheduler);this.current.add(n)};function oe(t,e,n,r){return t(e).source.run(n,r)}se.prototype.end=function(t,e){this.active=false;_(t,this.disposable,this.sink);this._checkEnd(t,e)};se.prototype.error=function(t,e){this.active=false;this.sink.error(t,e)};se.prototype.dispose=function(){this.active=false;this.pending.length=0;return Promise.all([this.disposable.dispose(),this.current.dispose()])};se.prototype._endInner=function(t,e,n){this.current.remove(n);_(t,n,this);if(this.pending.length===0){this._checkEnd(t,e)}else{this._startInner(t,this.pending.shift())}};se.prototype._checkEnd=function(t,e){if(!this.active&&this.current.isEmpty()){this.sink.end(t,e)}};function ue(t,e,n){this.prev=this.next=null;this.time=t;this.outer=e;this.sink=n;this.disposable=void 0}ue.prototype.event=function(t,e){this.sink.event(Math.max(t,this.time),e)};ue.prototype.end=function(t,e){this.outer._endInner(Math.max(t,this.time),e,this)};ue.prototype.error=function(t,e){this.outer.error(Math.max(t,this.time),e)};ue.prototype.dispose=function(){return this.disposable.dispose()};var he=function(t,e){return re(t,Infinity,e)};var ce=function(t){return ne(Infinity,t)};function pe(t,e){return re(t,1,e)}var ae=i;var fe=o;function ve(){return le(ae(arguments))}function le(t){var e=t.length;return e===0?B():e===1?t[0]:new l(de(t))}function de(t){return new we(fe(ye,[],t))}function ye(t,e){var n=e.source;return n instanceof we?t.concat(n.sources):t.concat(n)}function we(t){this.sources=t}we.prototype.run=function(t,e){var n=this;var r=this.sources.length;var i=new Array(r);var s=new Array(r);var o=new ke(i,s,t);for(var u,h=0;h<r;++h){u=s[h]=new Gt(h,o);i[h]=n.sources[h].run(u,e)}return x(i)};function ke(t,e,n){this.sink=n;this.disposables=t;this.activeCount=e.length}ke.prototype.error=rt.prototype.error;ke.prototype.event=function(t,e){this.sink.event(t,e.value)};ke.prototype.end=function(t,e){_(t,this.disposables[e.index],this.sink);if(--this.activeCount===0){this.sink.end(t,e.value)}};var me=function(t,e,n){return new l(new _e(t,e,n))};var _e=function t(e,n,r){this.source=r.source;this.sampler=n.source;this.f=e};_e.prototype.run=function t(e,n){var r=new ge(this.f,this.source,e);var i=this.source.run(r.hold,n);var s=this.sampler.run(r,n);return x([s,i])};var ge=function(t){function e(e,n,r){t.call(this,r);this.sink=r;this.source=n;this.f=e;this.hold=new be(this)}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.event=function t(e,n){if(this.hold.hasValue){var r=this.f;this.sink.event(e,r(n,this.hold.value))}};return e}(rt);var be=function(t){function e(e){t.call(this,e);this.hasValue=false}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.event=function t(e,n){this.value=n;this.hasValue=true};e.prototype.end=function t(){};return e}(rt);function xe(t){this._capacity=t||32;this._length=0;this._head=0}xe.prototype.push=function(t){var e=this._length;this._checkCapacity(e+1);var n=this._head+e&this._capacity-1;this[n]=t;this._length=e+1};xe.prototype.shift=function(){var t=this._head;var e=this[t];this[t]=void 0;this._head=t+1&this._capacity-1;this._length--;return e};xe.prototype.isEmpty=function(){return this._length===0};xe.prototype.length=function(){return this._length};xe.prototype._checkCapacity=function(t){if(this._capacity<t){this._ensureCapacity(this._capacity<<1)}};xe.prototype._ensureCapacity=function(t){var e=this._capacity;this._capacity=t;var n=this._head+this._length;if(n>e){Ae(this,0,this,e,n&e-1)}};function Ae(t,e,n,r,i){for(var s=0;s<i;++s){n[s+r]=t[s+e];t[s+e]=void 0}}var Ie=s;var Te=r;function Ee(t){return Pe(t,Te(arguments))}function Pe(t,e){return e.length===0?B():e.length===1?Dt(t,e[0]):new l(new Me(t,Ie(Ce,e)))}function Ce(t){return t.source}function Me(t,e){this.f=t;this.sources=e}Me.prototype.run=function(t,e){var n=this;var r=this.sources.length;var i=new Array(r);var s=new Array(r);var o=new Array(r);var u=new Re(this.f,o,s,t);for(var h,c=0;c<r;++c){o[c]=new xe;h=s[c]=new Gt(c,u);i[c]=n.sources[c].run(h,e)}return x(i)};function Re(t,e,n,r){this.f=t;this.sinks=n;this.sink=r;this.buffers=e}Re.prototype.event=function(t,e){var n=this.buffers;var r=n[e.index];r.push(e.value);if(r.length()===1){if(!Be(this.buffers)){return}Se(this.f,t,n,this.sink);if(Ne(this.buffers,this.sinks)){this.sink.end(t,void 0)}}};Re.prototype.end=function(t,e){var n=this.buffers[e.index];if(n.isEmpty()){this.sink.end(t,e.value)}};Re.prototype.error=rt.prototype.error;function Se(t,e,n,r){r.event(e,Ht(t,Ie(qe,n)))}function qe(t){return t.shift()}function Ne(t,e){for(var n=0,r=t.length;n<r;++n){if(t[n].isEmpty()&&!e[n].active){return true}}return false}function Be(t){for(var e=0,n=t.length;e<n;++e){if(t[e].isEmpty()){return false}}return true}var je=function(t){return new l(new Ve(t.source))};var Ve=function t(e){this.source=e};Ve.prototype.run=function t(e,n){var r=new We(e,n);return x([r,this.source.run(r,n)])};var We=function t(e,n){this.sink=e;this.scheduler=n;this.current=null;this.ended=false};We.prototype.event=function t(e,n){this._disposeCurrent(e);this.current=new De(e,Infinity,this,this.sink);this.current.disposable=n.source.run(this.current,this.scheduler)};We.prototype.end=function t(e,n){this.ended=true;this._checkEnd(e,n)};We.prototype.error=function t(e,n){this.ended=true;this.sink.error(e,n)};We.prototype.dispose=function t(){return this._disposeCurrent(this.scheduler.now())};We.prototype._disposeCurrent=function t(e){if(this.current!==null){return this.current._dispose(e)}};We.prototype._disposeInner=function t(e,n){n._dispose(e);if(n===this.current){this.current=null}};We.prototype._checkEnd=function t(e,n){if(this.ended&&this.current===null){this.sink.end(e,n)}};We.prototype._endInner=function t(e,n,r){this._disposeInner(e,r);this._checkEnd(e,n)};We.prototype._errorInner=function t(e,n,r){this._disposeInner(e,r);this.sink.error(e,n)};var De=function t(e,n,r,i){this.min=e;this.max=n;this.outer=r;this.sink=i;this.disposable=b()};De.prototype.event=function t(e,n){if(e<this.max){this.sink.event(Math.max(e,this.min),n)}};De.prototype.end=function t(e,n){this.outer._endInner(Math.max(e,this.min),n,this)};De.prototype.error=function t(e,n){this.outer._errorInner(Math.max(e,this.min),n,this)};De.prototype._dispose=function t(e){this.max=e;_(e,this.disposable,this.sink)};function Oe(t,e){return new l(St.create(t,e.source))}function ze(t){return Le(He,t)}function Le(t,e){return new l(new Fe(t,e.source))}function Fe(t,e){this.equals=t;this.source=e}Fe.prototype.run=function(t,e){return this.source.run(new Ge(this.equals,t),e)};function Ge(t,e){this.equals=t;this.sink=e;this.value=void 0;this.init=true}Ge.prototype.end=rt.prototype.end;Ge.prototype.error=rt.prototype.error;Ge.prototype.event=function(t,e){if(this.init){this.init=false;this.value=e;this.sink.event(t,e)}else if(!this.equals(this.value,e)){this.value=e;this.sink.event(t,e)}};function He(t,e){return t===e}function Je(t,e){return Qe(0,t,e)}function Ke(t,e){return Qe(t,Infinity,e)}function Qe(t,e,n){return e<=t?B():new l(Ue(t,e,n.source))}function Ue(t,e,n){return n instanceof Vt?Xe(t,e,n):n instanceof Ze?Ye(t,e,n):new Ze(t,e,n)}function Xe(t,e,n){return Vt.create(n.f,Ue(t,e,n.source))}function Ye(t,e,n){t+=n.min;e=Math.min(e+n.min,n.max);return new Ze(t,e,n.source)}function Ze(t,e,n){this.source=n;this.min=t;this.max=e}Ze.prototype.run=function(t,e){return new $e(this.min,this.max-this.min,this.source,t,e)};function $e(t,e,n,r,i){this.sink=r;this.skip=t;this.take=e;this.disposable=T(n.run(this,i))}$e.prototype.end=rt.prototype.end;$e.prototype.error=rt.prototype.error;$e.prototype.event=function(t,e){if(this.skip>0){this.skip-=1;return}if(this.take===0){return}this.take-=1;this.sink.event(t,e);if(this.take===0){this.dispose();this.sink.end(t,e)}};$e.prototype.dispose=function(){return this.disposable.dispose()};function tn(t,e){return new l(new en(t,e.source))}function en(t,e){this.p=t;this.source=e}en.prototype.run=function(t,e){return new nn(this.p,this.source,t,e)};function nn(t,e,n,r){this.p=t;this.sink=n;this.active=true;this.disposable=T(e.run(this,r))}nn.prototype.end=rt.prototype.end;nn.prototype.error=rt.prototype.error;nn.prototype.event=function(t,e){if(!this.active){return}var n=this.p;this.active=n(e);if(this.active){this.sink.event(t,e)}else{this.dispose();this.sink.end(t,e)}};nn.prototype.dispose=function(){return this.disposable.dispose()};function rn(t,e){return new l(new sn(t,e.source))}function sn(t,e){this.p=t;this.source=e}sn.prototype.run=function(t,e){return this.source.run(new on(this.p,t),e)};function on(t,e){this.p=t;this.sink=e;this.skipping=true}on.prototype.end=rt.prototype.end;on.prototype.error=rt.prototype.error;on.prototype.event=function(t,e){if(this.skipping){var n=this.p;this.skipping=n(e);if(this.skipping){return}}this.sink.event(t,e)};function un(t,e){return new l(new pn(t.source,e.source))}function hn(t,e){return new l(new an(t.source,e.source))}function cn(t,e){return un(ce(t),hn(t,e))}function pn(t,e){this.maxSignal=t;this.source=e}pn.prototype.run=function(t,e){var n=new fn(-Infinity,t);var r=new dn(this.maxSignal,t,e);var i=this.source.run(new vn(n,r,t),e);return x([n,r,i])};function an(t,e){this.minSignal=t;this.source=e}an.prototype.run=function(t,e){var n=new ln(this.minSignal,t,e);var r=new fn(Infinity,t);var i=this.source.run(new vn(n,r,t),e);return x([n,r,i])};function fn(t,e){this.value=t;this.sink=e}fn.prototype.error=rt.prototype.error;fn.prototype.event=yn;fn.prototype.end=yn;fn.prototype.dispose=yn;function vn(t,e,n){this.min=t;this.max=e;this.sink=n}vn.prototype.event=function(t,e){if(t>=this.min.value&&t<this.max.value){this.sink.event(t,e)}};vn.prototype.error=rt.prototype.error;vn.prototype.end=rt.prototype.end;function ln(t,e,n){this.value=Infinity;this.sink=e;this.disposable=t.run(this,n)}ln.prototype.event=function(t){if(t<this.value){this.value=t}};ln.prototype.end=yn;ln.prototype.error=rt.prototype.error;ln.prototype.dispose=function(){return this.disposable.dispose()};function dn(t,e,n){this.value=Infinity;this.sink=e;this.disposable=t.run(this,n)}dn.prototype.event=function(t,e){if(t<this.value){this.value=t;this.sink.end(t,e)}};dn.prototype.end=yn;dn.prototype.error=rt.prototype.error;dn.prototype.dispose=function(){return this.disposable.dispose()};function yn(){}function wn(t,e){return t<=0?e:new l(new kn(t,e.source))}function kn(t,e){this.dt=t;this.source=e}kn.prototype.run=function(t,e){var n=new mn(this.dt,t,e);return x([n,this.source.run(n,e)])};function mn(t,e,n){this.dt=t;this.sink=e;this.scheduler=n}mn.prototype.dispose=function(){var t=this;this.scheduler.cancelAll(function(e){return e.sink===t.sink})};mn.prototype.event=function(t,e){this.scheduler.delay(this.dt,P.event(e,this.sink))};mn.prototype.end=function(t,e){this.scheduler.delay(this.dt,P.end(e,this.sink))};mn.prototype.error=rt.prototype.error;function _n(t,e){return new l(gn(t,e.source))}function gn(t,e){return e instanceof Vt?bn(t,e):e instanceof An?xn(t,e):new An(t,e)}function bn(t,e){return Vt.create(e.f,gn(t,e.source))}function xn(t,e){return new An(Math.max(t,e.period),e.source)}function An(t,e){this.period=t;this.source=e}An.prototype.run=function(t,e){return this.source.run(new In(this.period,t),e)};function In(t,e){this.time=0;this.period=t;this.sink=e}In.prototype.event=function(t,e){if(t>=this.time){this.time=t+this.period;this.sink.event(t,e)}};In.prototype.end=rt.prototype.end;In.prototype.error=rt.prototype.error;function Tn(t,e){return new l(new En(t,e.source))}function En(t,e){this.dt=t;this.source=e}En.prototype.run=function(t,e){return new Pn(this.dt,this.source,t,e)};function Pn(t,e,n,r){this.dt=t;this.sink=n;this.scheduler=r;this.value=void 0;this.timer=null;var i=e.run(this,r);this.disposable=x([this,i])}Pn.prototype.event=function(t,e){this._clearTimer();this.value=e;this.timer=this.scheduler.delay(this.dt,P.event(e,this.sink))};Pn.prototype.end=function(t,e){if(this._clearTimer()){this.sink.event(t,this.value);this.value=void 0}this.sink.end(t,e)};Pn.prototype.error=function(t,e){this._clearTimer();this.sink.error(t,e)};Pn.prototype.dispose=function(){this._clearTimer()};Pn.prototype._clearTimer=function(){if(this.timer===null){return false}this.timer.dispose();this.timer=null;return true};var Cn=function(t){return new l(new Rn(t.source))};var Mn=p(Cn,S);var Rn=function t(e){this.source=e};Rn.prototype.run=function t(e,n){return this.source.run(new Sn(e,n),n)};var Sn=function t(e,n){var r=this;this.sink=e;this.scheduler=n;this.queue=Promise.resolve();this._eventBound=function(t){return r.sink.event(r.scheduler.now(),t)};this._endBound=function(t){return r.sink.end(r.scheduler.now(),t)};this._errorBound=function(t){return r.sink.error(r.scheduler.now(),t)}};Sn.prototype.event=function t(e,n){var r=this;this.queue=this.queue.then(function(){return r._event(n)}).catch(this._errorBound)};Sn.prototype.end=function t(e,n){var r=this;this.queue=this.queue.then(function(){return r._end(n)}).catch(this._errorBound)};Sn.prototype.error=function t(e,n){var r=this;this.queue=this.queue.then(function(){return r._errorBound(n)}).catch(E)};Sn.prototype._event=function t(e){return e.then(this._eventBound)};Sn.prototype._end=function t(e){return Promise.resolve(e).then(this._endBound)};function qn(t){this.sink=t;this.active=true}qn.prototype.event=function(t,e){if(!this.active){return}this.sink.event(t,e)};qn.prototype.end=function(t,e){if(!this.active){return}this.disable();this.sink.end(t,e)};qn.prototype.error=function(t,e){this.disable();this.sink.error(t,e)};qn.prototype.disable=function(){this.active=false;return this.sink};function Nn(t,e,n){try{n.event(t,e)}catch(e){n.error(t,e)}}function Bn(t,e,n){try{n.end(t,e)}catch(e){n.error(t,e)}}function jn(t,e){return new l(new On(t,e.source))}function Vn(t){return new l(new Wn(t))}function Wn(t){this.value=t}Wn.prototype.run=function(t,e){return e.asap(new P(Dn,this.value,t))};function Dn(t,e,n){n.error(t,e)}function On(t,e){this.f=t;this.source=e}On.prototype.run=function(t,e){return new zn(this.f,this.source,t,e)};function zn(t,e,n,r){this.f=t;this.sink=new qn(n);this.scheduler=r;this.disposable=e.run(this,r)}zn.prototype.event=function(t,e){Nn(t,e,this.sink)};zn.prototype.end=function(t,e){Bn(t,e,this.sink)};zn.prototype.error=function(t,e){var n=this.sink.disable();_(t,this.disposable,this.sink);this._startNext(t,e,n)};zn.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}};zn.prototype._continue=function(t,e,n){var r=t(e);return r.source.run(n,this.scheduler)};zn.prototype.dispose=function(){return this.disposable.dispose()};function Ln(t,e,n,r){this.time=t;this.period=e;this.task=n;this.scheduler=r;this.active=true}Ln.prototype.run=function(){return this.task.run(this.time)};Ln.prototype.error=function(t){return this.task.error(this.time,t)};Ln.prototype.dispose=function(){this.scheduler.cancel(this);return this.task.dispose()};function Fn(t){return Promise.resolve(t).then(Gn)}function Gn(t){try{return t.run()}catch(e){return t.error(e)}}var Hn=function t(e,n){var r=this;this.timer=e;this.timeline=n;this._timer=null;this._nextArrival=Infinity;this._runReadyTasksBound=function(){return r._runReadyTasks(r.now())}};Hn.prototype.now=function t(){return this.timer.now()};Hn.prototype.asap=function t(e){return this.schedule(0,-1,e)};Hn.prototype.delay=function t(e,n){return this.schedule(e,-1,n)};Hn.prototype.periodic=function t(e,n){return this.schedule(0,e,n)};Hn.prototype.schedule=function t(e,n,r){var i=this.now();var s=new Ln(i+Math.max(0,e),n,r,this);this.timeline.add(s);this._scheduleNextRun(i);return s};Hn.prototype.cancel=function t(e){e.active=false;if(this.timeline.remove(e)){this._reschedule()}};Hn.prototype.cancelAll=function t(e){this.timeline.removeAll(e);this._reschedule()};Hn.prototype._reschedule=function t(){if(this.timeline.isEmpty()){this._unschedule()}else{this._scheduleNextRun(this.now())}};Hn.prototype._unschedule=function t(){this.timer.clearTimer(this._timer);this._timer=null};Hn.prototype._scheduleNextRun=function t(e){if(this.timeline.isEmpty()){return}var n=this.timeline.nextArrival();if(this._timer===null){this._scheduleNextArrival(n,e)}else if(n<this._nextArrival){this._unschedule();this._scheduleNextArrival(n,e)}};Hn.prototype._scheduleNextArrival=function t(e,n){this._nextArrival=e;var r=Math.max(0,e-n);this._timer=this.timer.setTimer(this._runReadyTasksBound,r)};Hn.prototype._runReadyTasks=function t(e){this._timer=null;this.timeline.runTasks(e,Gn);this._scheduleNextRun(this.now())};var Jn=function t(){this.tasks=[]};Jn.prototype.nextArrival=function t(){return this.isEmpty()?Infinity:this.tasks[0].time};Jn.prototype.isEmpty=function t(){return this.tasks.length===0};Jn.prototype.add=function t(e){Qn(e,this.tasks)};Jn.prototype.remove=function t(e){var n=Xn(e.time,this.tasks);if(n>=0&&n<this.tasks.length){var r=h(e,this.tasks[n].events);if(r>=0){this.tasks[n].events.splice(r,1);return true}}return false};Jn.prototype.removeAll=function t(e){var n=this;for(var r=0;r<this.tasks.length;++r){Un(e,n.tasks[r])}};Jn.prototype.runTasks=function t(e,n){var r=this;var i=this.tasks;var s=i.length;var o=0;while(o<s&&i[o].time<=e){++o}this.tasks=i.slice(o);for(var u=0;u<o;++u){r.tasks=Kn(n,i[u].events,r.tasks)}};function Kn(t,e,n){for(var r=0;r<e.length;++r){var i=e[r];if(i.active){t(i);if(i.period>=0&&i.active){i.time=i.time+i.period;Qn(i,n)}}}return n}function Qn(t,e){var n=e.length;if(n===0){e.push(Yn(t.time,[t]));return}var r=Xn(t.time,e);if(r>=n){e.push(Yn(t.time,[t]))}else if(t.time===e[r].time){e[r].events.push(t)}else{e.splice(r,0,Yn(t.time,[t]))}}function Un(t,e){e.events=u(t,e.events)}function Xn(t,e){var n=0;var r=e.length;
var i,s;while(n<r){i=Math.floor((n+r)/2);s=e[i];if(t===s.time){return i}else if(t<s.time){r=i}else{n=i+1}}return r}var Yn=function(t,e){return{time:t,events:e}};var Zn=function t(){this.now=Date.now};Zn.prototype.setTimer=function t(e,n){return n<=0?tr(e):setTimeout(e,n)};Zn.prototype.clearTimer=function t(e){return e instanceof $n?e.cancel():clearTimeout(e)};var $n=function t(e){this.f=e;this.active=true};$n.prototype.run=function t(){return this.active&&this.f()};$n.prototype.error=function t(e){throw e};$n.prototype.cancel=function t(){this.active=false};function tr(t){var e=new $n(t);Fn(e);return e}var er=f(Z);var nr=v(it);var rr=v(ut);var ir=f(pt);var sr=f(dt);var or=f(Rt);var ur=f(Mt);var hr=f(Dt);var cr=f(Ot);var pr=f(zt);var ar=f(te);var fr=f(he);var vr=f(Et);var lr=f(pe);var dr=f(ne);var yr=v(re);var wr=f(Ut);var kr=v(me);var mr=f(Pe);var _r=f(Oe);var gr=f(Le);var br=f(Je);var xr=f(Ke);var Ar=v(Qe);var Ir=f(tn);var Tr=f(rn);var Er=f(un);var Pr=f(hn);var Cr=f(cn);var Mr=f(wn);var Rr=f(_n);var Sr=f(Tn);var qr=f(jn);var Nr=function(t,e){return new Hn(t,e)};var Br=function(){return new Jn};var jr=function(){return new Zn};var Vr=f(Nr);var Wr=function(){return Nr(Br(),jr())};t.runEffects=er;t.loop=nr;t.scan=rr;t.unfold=ir;t.iterate=sr;t.concat=or;t.startWith=ur;t.map=hr;t.constant=cr;t.tap=pr;t.ap=ar;t.chain=fr;t.join=ce;t.continueWith=vr;t.concatMap=lr;t.mergeConcurrently=dr;t.mergeMapConcurrently=yr;t.combine=Qt;t.combineArray=wr;t.sample=kr;t.zip=Ee;t.zipArray=mr;t.filter=_r;t.skipRepeats=ze;t.skipRepeatsWith=gr;t.take=br;t.skip=xr;t.slice=Ar;t.takeWhile=Ir;t.skipWhile=Tr;t.until=Er;t.since=Pr;t.during=Cr;t.delay=Mr;t.throttle=Rr;t.debounce=Sr;t.recoverWith=qr;t.throwError=Vn;t.newTimeline=Br;t.newClockTimer=jr;t.newScheduler=Vr;t.newDefaultScheduler=Wr;t.Scheduler=Hn;t.Timeline=Jn;t.ClockTimer=Zn;t.Stream=l;t.just=S;t.empty=B;t.never=D;t.periodic=L;t.fromArray=G;t.fromIterable=U;t.generate=_t;t.merge=ve;t.mergeArray=le;t.switchLatest=je;t.fromPromise=Mn;t.awaitPromises=Cn;t.PropagateTask=P;Object.defineProperty(t,"__esModule",{value:true})});
{
"name": "@most/core",
"version": "0.1.0",
"version": "0.2.0",
"description": "Reactive programming with lean, functions-only, curried, tree-shakeable API",

@@ -14,6 +14,13 @@ "typings": "type-definitions/most.d.ts",

"scripts": {
"unit-test": "buster-test",
"test": "eslint src test && npm run unit-test",
"build": "rimraf lib dist && rollup -c && uglifyjs dist/mostCore.js -c \"warnings=false\" -m -o dist/mostCore.min.js",
"preversion": "npm run build"
"commit": "northbrook commit",
"test": "npm run test:lint && npm run test:unit && npm run test:flow",
"test:unit": "buster-test",
"test:lint": "northbrook eslint",
"test:flow": "flow check",
"build": "npm run build:dist && npm run build:min && npm run build:flow",
"build:dist": "northbrook rollup",
"build:min": "uglifyjs dist/mostCore.js -m -o dist/mostCore.min.js",
"build:flow": "cpy src/index.js.flow dist --rename=mostCore.js.flow && cpy src/index.js.flow dist --rename=mostCore.es.js.flow",
"prepublish": "npm run build",
"release": "northbrook release"
},

@@ -40,7 +47,10 @@ "repository": {

"@most/eslint-config-most": "^1.0.3",
"@northbrook/eslint": "^2.0.1",
"@northbrook/rollup": "^1.0.1",
"babel-eslint": "^7.1.1",
"buba": "^4.0.2",
"buster": "^0.7.18",
"eslint": "^3.12.1",
"rimraf": "^2.5.4",
"rollup": "^0.38.0",
"cpy-cli": "^1.0.1",
"flow-bin": "^0.37.4",
"northbrook": "^4.5.0",
"rollup-plugin-buble": "^0.15.0",

@@ -47,0 +57,0 @@ "rollup-plugin-node-resolve": "^2.0.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc