Socket
Socket
Sign inDemoInstall

rx

Package Overview
Dependencies
0
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.0.1

src/modular/modern/helpers/isfunction.js

21

dist/rx.aggregates.js

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return C.e=b,C}}}function f(a){if(0===a.length)throw new z;return a[0]}function g(a,b,c,d){var e=y(b,c,3);return new k(function(b){return a.subscribe(new da(b,a,e,d))},a)}var h=c.Observable,i=h.prototype,j=c.BinaryDisposable,k=c.AnonymousObservable,l=c.internals.AbstractObserver,m=c.Disposable.empty,n=c.helpers,o=n.defaultComparer,p=n.identity,q=n.defaultSubComparer,r=n.isFunction,s=n.isPromise,t=n.isArrayLike,u=n.isIterable,v=c.internals.inherits,w=h.fromPromise,x=h.from,y=c.internals.bindCallback,z=c.EmptyError,A=c.ObservableBase,B=c.ArgumentOutOfRangeError,C={e:{}},D=c.internals.tryCatch=function(a){if(!r(a))throw new TypeError("fn must be a function");return e(a)},E=function(a){function b(b,c,d){this.source=b,this._k=c,this._c=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new F(a,this._k,this._c))},b}(A),F=function(a){function b(b,c,d){this._o=b,this._k=c,this._c=d,this._v=null,this._hv=!1,this._l=[],a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._k)(a);if(b===C)return this._o.onError(b.e);var c=0;if(this._hv){if(c=D(this._c)(b,this._v),c===C)return this._o.onError(c.e)}else this._hv=!0,this._v=b;c>0&&(this._v=b,this._l=[]),c>=0&&this._l.push(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._l),this._o.onCompleted()},b}(l),G=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new H(a,this))},b}(A),H=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=D(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?D(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===C?this._o.onError(this._a.e):void this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv&&this._o.onNext(this._a),!this._hv&&this._hs&&this._o.onNext(this._s),!this._hv&&!this._hs&&this._o.onError(new z),this._o.onCompleted()},b}(l);i.reduce=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new G(this,c,b,a)};var I=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new J(a,this._fn,this.source))},b}(A),J=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._fn)(a,this._i++,this._s);return b===C?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(l);i.some=function(a,b){var c=y(a,b,3);return new I(this,c)};var K=function(a){function b(b){this.source=b,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new L(a))},b}(A),L=function(a){function b(b){this._o=b,a.call(this)}return v(b,a),b.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(l);i.isEmpty=function(){return new K(this)};var M=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new N(a,this._fn,this.source))},b}(A),N=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._fn)(a,this._i++,this._s);return b===C?this._o.onError(b.e):void(Boolean(b)||(this._o.onNext(!1),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(l);i.every=function(a,b){var c=y(a,b,3);return new M(this,c)};var O=function(a){function b(b,c,d){var e=+d||0;Math.abs(e)===1/0&&(e=0),this.source=b,this._elem=c,this._n=e,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(!1),a.onCompleted(),m):this.source.subscribe(new P(a,this._elem,this._n))},b}(A),P=function(a){function b(b,c,d){this._o=b,this._elem=c,this._n=d,this._i=0,a.call(this)}function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}return v(b,a),b.prototype.next=function(a){this._i++>=this._n&&c(a,this._elem)&&(this._o.onNext(!0),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(l);i.includes=function(a,b){return new O(this,a,b)};var Q=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new R(a,this._fn,this.source))},b}(A),R=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._fn){var b=D(this._fn)(a,this._i++,this._s);if(b===C)return this._o.onError(b.e);Boolean(b)&&this._c++}else this._c++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(l);i.count=function(a,b){var c=y(a,b,3);return new Q(this,c)};var S=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),m):this.source.subscribe(new T(a,this._e,this._n))},b}(A),T=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._o.onNext(this._i),this._o.onCompleted()),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(-1),this._o.onCompleted()},b}(l);i.indexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new S(this,a,c)};var U=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new V(a,this._fn,this.source))},b}(A),V=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._fn){var b=D(this._fn)(a,this._i++,this._s);if(b===C)return this._o.onError(b.e);this._c+=b}else this._c+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(l);i.sum=function(a,b){var c=y(a,b,3);return new U(this,c)},i.minBy=function(a,b){return b||(b=q),new E(this,a,function(a,c){return-1*b(a,c)})},i.min=function(a){return this.minBy(p,a).map(function(a){return f(a)})},i.maxBy=function(a,b){return b||(b=q),new E(this,a,b)},i.max=function(a){return this.maxBy(p,a).map(function(a){return f(a)})};var W=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new X(a,this._fn,this.source))},b}(A),X=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._c=0,this._t=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._fn){var b=D(this._fn)(a,this._c++,this._s);if(b===C)return this._o.onError(b.e);this._t+=b}else this._c++,this._t+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){return 0===this._c?this._o.onError(new z):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(l);i.average=function(a,b){var c,d=this;return r(a)&&(c=y(a,b,3)),new W(d,c)},i.sequenceEqual=function(a,b){var c=this;return b||(b=o),new k(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){if(h.length>0){var c=h.shift(),e=D(b)(c,a);if(e===C)return d.onError(e.e);e||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(t(a)||u(a))&&(a=x(a)),s(a)&&(a=w(a));var k=a.subscribe(function(a){if(g.length>0){var c=g.shift(),f=D(b)(c,a);if(f===C)return d.onError(f.e);f||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new j(i,k)},c)};var Y=function(a){function b(b,c,d){this.source=b,this._i=c,this._d=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Z(a,this._i,this._d))},b}(A),Z=function(a){function b(b,c,d){this._o=b,this._i=c,this._d=d,a.call(this)}return v(b,a),b.prototype.next=function(a){0===this._i--&&(this._o.onNext(a),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._d===d?this._o.onError(new B):(this._o.onNext(this._d),this._o.onCompleted())},b}(l);i.elementAt=function(a,b){if(0>a)throw new B;return new Y(this,a,b)};var $=function(a){function b(b,c,d){this._o=b,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=D(this._obj.predicate)(a,this._i++,this._s);if(c===C)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);if(b){if(this._hv)return this._o.onError(new Error("Sequence contains more than one matching element"));this._hv=!0,this._v=a}},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===d?this._o.onError(new z):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},b}(l);i.single=function(a,b){var c={},d=this;if(c="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},r(c.predicate)){var e=c.predicate;c.predicate=y(e,c.thisArg,3)}return new k(function(a){return d.subscribe(new $(a,c,d))},d)};var _=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new aa(a,this._obj,this.source))},b}(A),aa=function(a){function b(b,c,d){this._o=b,this._obj=c,this._s=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._obj.predicate){var b=D(this._obj.predicate)(a,this._i++,this._s);if(b===C)return this._o.onError(b.e);Boolean(b)&&(this._o.onNext(a),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(a),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._obj.defaultValue===d?this._o.onError(new z):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},b}(l);i.first=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},r(a.predicate)){var b=a.predicate;a.predicate=y(b,a.thisArg,3)}return new _(this,a)};var ba=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._obj,this.source))},b}(A),ca=function(a){function b(b,c,d){this._o=b,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=D(this._obj.predicate)(a,this._i++,this._s);if(c===C)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);b&&(this._hv=!0,this._v=a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===d?this._o.onError(new z):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},b}(l);i.last=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},r(a.predicate)){var b=a.predicate;a.predicate=y(b,a.thisArg,3)}return new ba(this,a)};var da=function(a){function b(b,c,d,e){this._o=b,this._s=c,this._cb=d,this._y=e,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._cb)(a,this._i,this._s);return b===C?this._o.onError(b.e):void(b?(this._o.onNext(this._y?this._i:a),this._o.onCompleted()):this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._y&&this._o.onNext(-1),this._o.onCompleted()},b}(l);i.find=function(a,b){return g(this,a,b,!1)},i.findIndex=function(a,b){return g(this,a,b,!0)};var ea=function(a){function b(b){this.source=b,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new fa(a))},b}(A),fa=function(b){function c(c){this._o=c,this._s=new a.Set,b.call(this)}return v(c,b),c.prototype.next=function(a){this._s.add(a)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onNext(this._s),this._o.onCompleted()},c}(l);i.toSet=function(){if("undefined"==typeof a.Set)throw new TypeError;return new ea(this)};var ga=function(a){function b(b,c,d){this.source=b,this._k=c,this._e=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ha(a,this._k,this._e))},b}(A),ha=function(b){function c(c,d,e){this._o=c,this._k=d,this._e=e,this._m=new a.Map,b.call(this)}return v(c,b),c.prototype.next=function(a){var b=D(this._k)(a);if(b===C)return this._o.onError(b.e);var c=a;return this._e&&(c=D(this._e)(a),c===C)?this._o.onError(c.e):void this._m.set(b,c)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onNext(this._m),this._o.onCompleted()},c}(l);i.toMap=function(b,c){if("undefined"==typeof a.Map)throw new TypeError;return new ga(this,b,c)};var ia=function(a){function b(b,c,d){this.source=b,this._b=c,this._e=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ja(a,this._b,this._e))},b}(A),ja=function(a){function b(b,c,d){this._o=b,this._b=c,this._e=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){this._i>=this._b&&(this._e===this._i?this._o.onCompleted():this._o.onNext(a)),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(l);i.slice=function(a,b){var d=a||0;if(0>d)throw new c.ArgumentOutOfRangeError;if("number"==typeof b&&d>b)throw new c.ArgumentOutOfRangeError;return new ia(this,d,b)};var ka=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),m):this.source.subscribe(new la(a,this._e,this._n))},b}(A),la=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._v=0,this._hv=!1,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._hv=!0,this._v=this._i),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?this._o.onNext(this._v):this._o.onNext(-1),this._o.onCompleted()},b}(l);return i.lastIndexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new ka(this,a,c)},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return C.e=b,C}}}function f(a){if(0===a.length)throw new z;return a[0]}function g(a,b,c,d){var e=y(b,c,3);return new k(function(b){return a.subscribe(new da(b,a,e,d))},a)}var h=c.Observable,i=h.prototype,j=c.BinaryDisposable,k=c.AnonymousObservable,l=c.internals.AbstractObserver,m=c.Disposable.empty,n=c.helpers,o=n.defaultComparer,p=n.identity,q=n.defaultSubComparer,r=n.isFunction,s=n.isPromise,t=n.isArrayLike,u=n.isIterable,v=c.internals.inherits,w=h.fromPromise,x=h.from,y=c.internals.bindCallback,z=c.EmptyError,A=c.ObservableBase,B=c.ArgumentOutOfRangeError,C={e:{}},D=c.internals.tryCatch=function(a){if(!r(a))throw new TypeError("fn must be a function");return e(a)},E=function(a){function b(b,c,d){this.source=b,this._k=c,this._c=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new F(a,this._k,this._c))},b}(A),F=function(a){function b(b,c,d){this._o=b,this._k=c,this._c=d,this._v=null,this._hv=!1,this._l=[],a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._k)(a);if(b===C)return this._o.onError(b.e);var c=0;if(this._hv){if(c=D(this._c)(b,this._v),c===C)return this._o.onError(c.e)}else this._hv=!0,this._v=b;c>0&&(this._v=b,this._l=[]),c>=0&&this._l.push(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._l),this._o.onCompleted()},b}(l),G=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new H(a,this))},b}(A),H=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=D(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?D(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===C?this._o.onError(this._a.e):void this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv&&this._o.onNext(this._a),!this._hv&&this._hs&&this._o.onNext(this._s),!this._hv&&!this._hs&&this._o.onError(new z),this._o.onCompleted()},b}(l);i.reduce=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new G(this,c,b,a)};var I=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new J(a,this._fn,this.source))},b}(A),J=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._fn)(a,this._i++,this._s);return b===C?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(l);i.some=function(a,b){var c=y(a,b,3);return new I(this,c)};var K=function(a){function b(b){this.source=b,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new L(a))},b}(A),L=function(a){function b(b){this._o=b,a.call(this)}return v(b,a),b.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(l);i.isEmpty=function(){return new K(this)};var M=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new N(a,this._fn,this.source))},b}(A),N=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._fn)(a,this._i++,this._s);return b===C?this._o.onError(b.e):void(Boolean(b)||(this._o.onNext(!1),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(l);i.every=function(a,b){var c=y(a,b,3);return new M(this,c)};var O=function(a){function b(b,c,d){var e=+d||0;Math.abs(e)===1/0&&(e=0),this.source=b,this._elem=c,this._n=e,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(!1),a.onCompleted(),m):this.source.subscribe(new P(a,this._elem,this._n))},b}(A),P=function(a){function b(b,c,d){this._o=b,this._elem=c,this._n=d,this._i=0,a.call(this)}function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}return v(b,a),b.prototype.next=function(a){this._i++>=this._n&&c(a,this._elem)&&(this._o.onNext(!0),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(l);i.includes=function(a,b){return new O(this,a,b)};var Q=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new R(a,this._fn,this.source))},b}(A),R=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._fn){var b=D(this._fn)(a,this._i++,this._s);if(b===C)return this._o.onError(b.e);Boolean(b)&&this._c++}else this._c++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(l);i.count=function(a,b){var c=y(a,b,3);return new Q(this,c)};var S=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),m):this.source.subscribe(new T(a,this._e,this._n))},b}(A),T=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._o.onNext(this._i),this._o.onCompleted()),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(-1),this._o.onCompleted()},b}(l);i.indexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new S(this,a,c)};var U=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new V(a,this._fn,this.source))},b}(A),V=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._fn){var b=D(this._fn)(a,this._i++,this._s);if(b===C)return this._o.onError(b.e);this._c+=b}else this._c+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(l);i.sum=function(a,b){var c=y(a,b,3);return new U(this,c)},i.minBy=function(a,b){return b||(b=q),new E(this,a,function(a,c){return-1*b(a,c)})},i.min=function(a){return this.minBy(p,a).map(function(a){return f(a)})},i.maxBy=function(a,b){return b||(b=q),new E(this,a,b)},i.max=function(a){return this.maxBy(p,a).map(function(a){return f(a)})};var W=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new X(a,this._fn,this.source))},b}(A),X=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._c=0,this._t=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._fn){var b=D(this._fn)(a,this._c++,this._s);if(b===C)return this._o.onError(b.e);this._t+=b}else this._c++,this._t+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){return 0===this._c?this._o.onError(new z):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(l);i.average=function(a,b){var c,d=this;return r(a)&&(c=y(a,b,3)),new W(d,c)},i.sequenceEqual=function(a,b){var c=this;return b||(b=o),new k(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){if(h.length>0){var c=h.shift(),e=D(b)(c,a);if(e===C)return d.onError(e.e);e||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(t(a)||u(a))&&(a=x(a)),s(a)&&(a=w(a));var k=a.subscribe(function(a){if(g.length>0){var c=g.shift(),f=D(b)(c,a);if(f===C)return d.onError(f.e);f||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new j(i,k)},c)};var Y=function(a){function b(b,c,d){this.source=b,this._i=c,this._d=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Z(a,this._i,this._d))},b}(A),Z=function(a){function b(b,c,d){this._o=b,this._i=c,this._d=d,a.call(this)}return v(b,a),b.prototype.next=function(a){0===this._i--&&(this._o.onNext(a),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._d===d?this._o.onError(new B):(this._o.onNext(this._d),this._o.onCompleted())},b}(l);i.elementAt=function(a,b){if(0>a)throw new B;return new Y(this,a,b)};var $=function(a){function b(b,c,d){this._o=b,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=D(this._obj.predicate)(a,this._i++,this._s);if(c===C)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);if(b){if(this._hv)return this._o.onError(new Error("Sequence contains more than one matching element"));this._hv=!0,this._v=a}},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===d?this._o.onError(new z):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},b}(l);i.single=function(a,b){var c={},d=this;if(c="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},r(c.predicate)){var e=c.predicate;c.predicate=y(e,c.thisArg,3)}return new k(function(a){return d.subscribe(new $(a,c,d))},d)};var _=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new aa(a,this._obj,this.source))},b}(A),aa=function(a){function b(b,c,d){this._o=b,this._obj=c,this._s=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){if(this._obj.predicate){var b=D(this._obj.predicate)(a,this._i++,this._s);if(b===C)return this._o.onError(b.e);Boolean(b)&&(this._o.onNext(a),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(a),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._obj.defaultValue===d?this._o.onError(new z):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},b}(l);i.first=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},r(a.predicate)){var b=a.predicate;a.predicate=y(b,a.thisArg,3)}return new _(this,a)};var ba=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._obj,this.source))},b}(A),ca=function(a){function b(b,c,d){this._o=b,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=D(this._obj.predicate)(a,this._i++,this._s);if(c===C)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);b&&(this._hv=!0,this._v=a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===d?this._o.onError(new z):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},b}(l);i.last=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},r(a.predicate)){var b=a.predicate;a.predicate=y(b,a.thisArg,3)}return new ba(this,a)};var da=function(a){function b(b,c,d,e){this._o=b,this._s=c,this._cb=d,this._y=e,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){var b=D(this._cb)(a,this._i,this._s);return b===C?this._o.onError(b.e):void(b?(this._o.onNext(this._y?this._i:a),this._o.onCompleted()):this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._y&&this._o.onNext(-1),this._o.onCompleted()},b}(l);i.find=function(a,b){return g(this,a,b,!1)},i.findIndex=function(a,b){return g(this,a,b,!0)};var ea=function(a){function b(b){this.source=b,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new fa(a))},b}(A),fa=function(b){function c(c){this._o=c,this._s=new a.Set,b.call(this)}return v(c,b),c.prototype.next=function(a){this._s.add(a)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onNext(this._s),this._o.onCompleted()},c}(l);i.toSet=function(){if("undefined"==typeof a.Set)throw new TypeError;return new ea(this)};var ga=function(a){function b(b,c,d){this.source=b,this._k=c,this._e=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ha(a,this._k,this._e))},b}(A),ha=function(b){function c(c,d,e){this._o=c,this._k=d,this._e=e,this._m=new a.Map,b.call(this)}return v(c,b),c.prototype.next=function(a){var b=D(this._k)(a);if(b===C)return this._o.onError(b.e);var c=a;return this._e&&(c=D(this._e)(a),c===C)?this._o.onError(c.e):void this._m.set(b,c)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onNext(this._m),this._o.onCompleted()},c}(l);i.toMap=function(b,c){if("undefined"==typeof a.Map)throw new TypeError;return new ga(this,b,c)};var ia=function(a){function b(b,c,d){this.source=b,this._b=c,this._e=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ja(a,this._b,this._e))},b}(A),ja=function(a){function b(b,c,d){this._o=b,this._b=c,this._e=d,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){this._i>=this._b&&(this._e===this._i?this._o.onCompleted():this._o.onNext(a)),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(l);i.slice=function(a,b){var d=a||0;if(0>d)throw new c.ArgumentOutOfRangeError;if("number"==typeof b&&d>b)throw new c.ArgumentOutOfRangeError;return new ia(this,d,b)};var ka=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return v(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),m):this.source.subscribe(new la(a,this._e,this._n))},b}(A),la=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._v=0,this._hv=!1,this._i=0,a.call(this)}return v(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._hv=!0,this._v=this._i),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?this._o.onNext(this._v):this._o.onNext(-1),this._o.onCompleted()},b}(l);return i.lastIndexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new ka(this,a,c)},c});
//# sourceMappingURL=rx.aggregates.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -38,2 +41,3 @@ // Because of build optimizers

AnonymousObservable = Rx.AnonymousObservable,
ObservableBase = Rx.ObservableBase,
AsyncSubject = Rx.AsyncSubject,

@@ -44,2 +48,3 @@ disposableCreate = Rx.Disposable.create,

defaultScheduler = Rx.Scheduler['default'],
inherits = Rx.internals.inherits,
isScheduler = Rx.Scheduler.isScheduler,

@@ -115,5 +120,12 @@ isPromise = Rx.helpers.isPromise,

}
var value = toObservable.call(self, ret.value);
if (Observable.isObservable(value)) {
g.add(value.subscribe(processGenerator, onError));
var obs = toObservable.call(self, ret.value);
var value = null;
var hasValue = false;
if (Observable.isObservable(obs)) {
g.add(obs.subscribe(function(val) {
hasValue = true;
value = val;
}, onError, function() {
hasValue && processGenerator(value);
}));
} else {

@@ -140,5 +152,9 @@ onError(new TypeError('type not supported'));

function arrayToObservable (obj) {
return Observable.from(obj)
.flatMap(toObservable)
.toArray();
return Observable.from(obj).concatMap(function(o) {
if(Observable.isObservable(o) || isObject(o)) {
return toObservable.call(null, o);
} else {
return Rx.Observable.just(o);
}
}).toArray();
}

@@ -351,64 +367,11 @@

function isNodeList(el) {
if (window.StaticNodeList) {
if (root.StaticNodeList) {
// IE8 Specific
// instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
return (el instanceof window.StaticNodeList || el instanceof window.NodeList);
return el instanceof root.StaticNodeList || el instanceof root.NodeList;
} else {
return (Object.prototype.toString.call(el) == '[object NodeList]')
return Object.prototype.toString.call(el) === '[object NodeList]';
}
}
function fixEvent(event) {
var stopPropagation = function () {
this.cancelBubble = true;
};
var preventDefault = function () {
this.bubbledKeyCode = this.keyCode;
if (this.ctrlKey) {
try {
this.keyCode = 0;
} catch (e) { }
}
this.defaultPrevented = true;
this.returnValue = false;
this.modified = true;
};
event || (event = root.event);
if (!event.target) {
event.target = event.target || event.srcElement;
if (event.type == 'mouseover') {
event.relatedTarget = event.fromElement;
}
if (event.type == 'mouseout') {
event.relatedTarget = event.toElement;
}
// Adding stopPropogation and preventDefault to IE
if (!event.stopPropagation) {
event.stopPropagation = stopPropagation;
event.preventDefault = preventDefault;
}
// Normalize key events
switch (event.type) {
case 'keypress':
var c = ('charCode' in event ? event.charCode : event.keyCode);
if (c == 10) {
c = 0;
event.keyCode = 13;
} else if (c == 13 || c == 27) {
c = 0;
} else if (c == 3) {
c = 99;
}
event.charCode = c;
event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : '';
break;
}
}
return event;
}
function ListenDisposable(e, n, fn) {

@@ -428,43 +391,8 @@ this._e = e;

function AttachEventDisposable(e, n, fn) {
this._e = e;
this._n = 'on' + n;
this._fn = function (e) { fn(fixEvent(e)); };
this._e.attachEvent(this._n, this._fn);
this.isDisposed = false;
}
AttachEventDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this._e.detachEvent(this._n, this._fn);
this.isDisposed = true;
}
};
function LevelOneDisposable(e, n, fn) {
this._e = e;
this._n = 'on' + n;
this._e[this._n] = fn;
this.isDisposed = false;
}
LevelOneDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this._e[this._n] = null;
this.isDisposed = true;
}
};
function createListener (el, eventName, handler) {
if (el.addEventListener) {
return new ListenDisposable(el, eventName, handler)
}
if (el.attachEvent) {
return new AttachEventDisposable(el, eventName, handler);
}
return LevelOneDisposable(el, eventName, handler);
}
function createEventListener (el, eventName, handler) {
var disposables = new CompositeDisposable();
// Asume NodeList
if (isNodeList(el) || Object.prototype.toString.call(el) === '[object HTMLCollection]') {
// Asume NodeList or HTMLCollection
var elemToString = Object.prototype.toString.call(el);
if (isNodeList(el) || elemToString === '[object HTMLCollection]') {
for (var i = 0, len = el.length; i < len; i++) {

@@ -474,3 +402,3 @@ disposables.add(createEventListener(el.item(i), eventName, handler));

} else if (el) {
disposables.add(createListener(el, eventName, handler));
disposables.add(new ListenDisposable(el, eventName, handler));
}

@@ -486,2 +414,32 @@

var EventObservable = (function(__super__) {
inherits(EventObservable, __super__);
function EventObservable(el, name, fn) {
this._el = el;
this._name = name;
this._fn = fn;
__super__.call(this);
}
function createHandler(o, fn) {
return function handler () {
var results = arguments[0];
if (isFunction(fn)) {
results = tryCatch(fn).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
};
}
EventObservable.prototype.subscribeCore = function (o) {
return createEventListener(
this._el,
this._n,
createHandler(o, this._fn));
};
return EventObservable;
}(ObservableBase));
/**

@@ -513,17 +471,48 @@ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.

}
return new AnonymousObservable(function (o) {
return createEventListener(
element,
eventName,
function handler () {
var results = arguments[0];
if (isFunction(selector)) {
results = tryCatch(selector).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
});
}).publish().refCount();
return new EventObservable(element, eventName, selector).publish().refCount();
};
var EventPatternObservable = (function(__super__) {
inherits(EventPatternObservable, __super__);
function EventPatternObservable(add, del, fn) {
this._add = add;
this._del = del;
this._fn = fn;
__super__.call(this);
}
function createHandler(o, fn) {
return function handler () {
var results = arguments[0];
if (isFunction(fn)) {
results = tryCatch(fn).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
};
}
EventPatternObservable.prototype.subscribeCore = function (o) {
var fn = createHandler(o, this._fn);
var returnValue = this._add(fn);
return new EventPatternDisposable(this._del, fn, returnValue);
};
function EventPatternDisposable(del, fn, ret) {
this._del = del;
this._fn = fn;
this._ret = ret;
this.isDisposed = false;
}
EventPatternDisposable.prototype.dispose = function () {
if(!this.isDisposed) {
isFunction(this._del) && this._del(this._fn, this._ret);
}
};
return EventPatternObservable;
}(ObservableBase));
/**

@@ -534,22 +523,6 @@ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.

* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @param {Scheduler} [scheduler] A scheduler used to schedule the remove handler.
* @returns {Observable} An observable sequence which wraps an event from an event emitter
*/
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (o) {
function innerHandler () {
var result = arguments[0];
if (isFunction(selector)) {
result = tryCatch(selector).apply(null, arguments);
if (result === errorObj) { return o.onError(result.e); }
}
o.onNext(result);
}
var returnValue = addHandler(innerHandler);
return disposableCreate(function () {
isFunction(removeHandler) && removeHandler(innerHandler, returnValue);
});
}).publish().refCount();
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
return new EventPatternObservable(addHandler, removeHandler, selector).publish().refCount();
};

@@ -556,0 +529,0 @@

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.binding","exports"],function(b,c){return h.Rx=a(h,c,b),h.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return L.e=b,L}}}function f(a){return a?x.isObservable(a)?a:H(a)?x.fromPromise(a):k(a)||j(a)?N.call(this,a):I(a)?i.call(this,a):K(a)||J(a)?g.call(this,a):l(a)?h.call(this,a):a:a}function g(a){return x.from(a).flatMap(f).toArray()}function h(a){function b(a,b){c[b]=d,g.push(a.map(function(a){c[b]=a}))}for(var c=new a.constructor,e=Object.keys(a),g=[],h=0,i=e.length;i>h;h++){var j=e[h],k=f.call(this,a[j]);k&&x.isObservable(k)?b(k,j):c[j]=a[j]}return x.forkJoin.apply(x,g).map(function(){return c})}function i(a){var b=this;return new A(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function j(a){return I(a.next)&&I(a["throw"])}function k(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:j(b.prototype):!1}function l(a){return Object==a.constructor}function m(a,b,c,d){var e=new B;return d.push(n(e,b,c)),a.apply(b,d),e.asObservable()}function n(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(I(c)){if(e=M(c).apply(b,e),e===L)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function o(a,b,c,d){var e=new B;return d.push(p(e,b,c)),a.apply(b,d),e.asObservable()}function p(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(I(c)){var f=M(c).apply(b,f);if(f===L)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function q(a){return window.StaticNodeList?a instanceof window.StaticNodeList||a instanceof window.NodeList:"[object NodeList]"==Object.prototype.toString.call(a)}function r(b){var c=function(){this.cancelBubble=!0},d=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(b||(b=a.event),!b.target)switch(b.target=b.target||b.srcElement,"mouseover"==b.type&&(b.relatedTarget=b.fromElement),"mouseout"==b.type&&(b.relatedTarget=b.toElement),b.stopPropagation||(b.stopPropagation=c,b.preventDefault=d),b.type){case"keypress":var e="charCode"in b?b.charCode:b.keyCode;10==e?(e=0,b.keyCode=13):13==e||27==e?e=0:3==e&&(e=99),b.charCode=e,b.keyChar=b.charCode?String.fromCharCode(b.charCode):""}return b}function s(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function t(a,b,c){this._e=a,this._n="on"+b,this._fn=function(a){c(r(a))},this._e.attachEvent(this._n,this._fn),this.isDisposed=!1}function u(a,b,c){this._e=a,this._n="on"+b,this._e[this._n]=c,this.isDisposed=!1}function v(a,b,c){return a.addEventListener?new s(a,b,c):a.attachEvent?new t(a,b,c):u(a,b,c)}function w(a,b,c){var d=new D;if(q(a)||"[object HTMLCollection]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(w(a.item(e),b,c));else a&&d.add(v(a,b,c));return d}var x=c.Observable,y=x.fromPromise,z=x.throwError,A=c.AnonymousObservable,B=c.AsyncSubject,C=c.Disposable.create,D=c.CompositeDisposable,E=c.Scheduler.immediate,F=c.Scheduler["default"],G=c.Scheduler.isScheduler,H=c.helpers.isPromise,I=c.helpers.isFunction,J=c.helpers.isIterable,K=c.helpers.isArrayLike,L={e:{}},M=c.internals.tryCatch=function(a){if(!I(a))throw new TypeError("fn must be a function");return e(a)};x.wrap=function(a){function b(){return x.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var N=x.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new A(function(d){function e(b){var c=M(a.next).call(a,b);return c===L?d.onError(c.e):void h(c)}function g(b){var c=M(a.next).call(a,b);return c===L?d.onError(c.e):void h(c)}function h(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=f.call(b,a.value);x.isObservable(c)?i.add(c.subscribe(e,g)):g(new TypeError("type not supported"))}var i=new D;return I(a)&&(a=a.apply(b,c)),a&&I(a.next)?(e(),i):(d.onNext(a),d.onCompleted())})};x.start=function(a,b,c){return O(a,b,c)()};var O=x.toAsync=function(a,b,c){return G(c)||(c=F),function(){var d=arguments,e=new B;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};x.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return m(a,b,c,e)}},x.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return o(a,b,c,e)}},s.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},t.prototype.dispose=function(){this.isDisposed||(this._e.detachEvent(this._n,this._fn),this.isDisposed=!0)},u.prototype.dispose=function(){this.isDisposed||(this._e[this._n]=null,this.isDisposed=!0)},c.config.useNativeEvents=!1,x.fromEvent=function(a,b,d){return a.addListener?P(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new A(function(c){return w(a,b,function(){var a=arguments[0];return I(d)&&(a=M(d).apply(null,arguments),a===L)?c.onError(a.e):void c.onNext(a)})}).publish().refCount():P(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var P=x.fromEventPattern=function(a,b,c,d){return G(d)||(d=E),new A(function(d){function e(){var a=arguments[0];return I(c)&&(a=M(c).apply(null,arguments),a===L)?d.onError(a.e):void d.onNext(a)}var f=a(e);return C(function(){I(b)&&b(e,f)})}).publish().refCount()};return x.startAsync=function(a){var b=M(a)();return b===L?z(b.e):y(b)},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx.binding","exports"],function(b,c){return j.Rx=a(j,c,b),j.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return H.e=b,H}}}function f(a){return a?t.isObservable(a)?a:D(a)?t.fromPromise(a):k(a)||j(a)?J.call(this,a):E(a)?i.call(this,a):G(a)||F(a)?g.call(this,a):l(a)?h.call(this,a):a:a}function g(a){return t.from(a).concatMap(function(a){return t.isObservable(a)||l(a)?f.call(null,a):c.Observable.just(a)}).toArray()}function h(a){function b(a,b){c[b]=d,g.push(a.map(function(a){c[b]=a}))}for(var c=new a.constructor,e=Object.keys(a),g=[],h=0,i=e.length;i>h;h++){var j=e[h],k=f.call(this,a[j]);k&&t.isObservable(k)?b(k,j):c[j]=a[j]}return t.forkJoin.apply(t,g).map(function(){return c})}function i(a){var b=this;return new w(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function j(a){return E(a.next)&&E(a["throw"])}function k(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:j(b.prototype):!1}function l(a){return Object==a.constructor}function m(a,b,c,d){var e=new y;return d.push(n(e,b,c)),a.apply(b,d),e.asObservable()}function n(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(E(c)){if(e=I(c).apply(b,e),e===H)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function o(a,b,c,d){var e=new y;return d.push(p(e,b,c)),a.apply(b,d),e.asObservable()}function p(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(E(c)){var f=I(c).apply(b,f);if(f===H)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function q(b){return a.StaticNodeList?b instanceof a.StaticNodeList||b instanceof a.NodeList:"[object NodeList]"===Object.prototype.toString.call(b)}function r(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function s(a,b,c){var d=new z,e=Object.prototype.toString.call(a);if(q(a)||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(s(a.item(f),b,c));else a&&d.add(new r(a,b,c));return d}var t=c.Observable,u=t.fromPromise,v=t.throwError,w=c.AnonymousObservable,x=c.ObservableBase,y=c.AsyncSubject,z=(c.Disposable.create,c.CompositeDisposable),A=(c.Scheduler.immediate,c.Scheduler["default"]),B=c.internals.inherits,C=c.Scheduler.isScheduler,D=c.helpers.isPromise,E=c.helpers.isFunction,F=c.helpers.isIterable,G=c.helpers.isArrayLike,H={e:{}},I=c.internals.tryCatch=function(a){if(!E(a))throw new TypeError("fn must be a function");return e(a)};t.wrap=function(a){function b(){return t.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var J=t.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new w(function(d){function e(b){var c=I(a.next).call(a,b);return c===H?d.onError(c.e):void h(c)}function g(b){var c=I(a.next).call(a,b);return c===H?d.onError(c.e):void h(c)}function h(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=f.call(b,a.value),h=null,j=!1;t.isObservable(c)?i.add(c.subscribe(function(a){j=!0,h=a},g,function(){j&&e(h)})):g(new TypeError("type not supported"))}var i=new z;return E(a)&&(a=a.apply(b,c)),a&&E(a.next)?(e(),i):(d.onNext(a),d.onCompleted())})};t.start=function(a,b,c){return K(a,b,c)()};var K=t.toAsync=function(a,b,c){return C(c)||(c=A),function(){var d=arguments,e=new y;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};t.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return m(a,b,c,e)}},t.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return o(a,b,c,e)}},r.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},c.config.useNativeEvents=!1;var L=function(a){function b(b,c,d){this._el=b,this._name=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return E(b)&&(c=I(b).apply(null,arguments),c===H)?a.onError(c.e):void a.onNext(c)}}return B(b,a),b.prototype.subscribeCore=function(a){return s(this._el,this._n,c(a,this._fn))},b}(x);t.fromEvent=function(a,b,d){return a.addListener?N(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new L(a,b,d).publish().refCount():N(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var M=function(a){function b(b,c,d){this._add=b,this._del=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return E(b)&&(c=I(b).apply(null,arguments),c===H)?a.onError(c.e):void a.onNext(c)}}function d(a,b,c){this._del=a,this._fn=b,this._ret=c,this.isDisposed=!1}return B(b,a),b.prototype.subscribeCore=function(a){var b=c(a,this._fn),e=this._add(b);return new d(this._del,b,e)},d.prototype.dispose=function(){this.isDisposed||E(this._del)&&this._del(this._fn,this._ret)},b}(x),N=t.fromEventPattern=function(a,b,c){return new M(a,b,c).publish().refCount()};return t.startAsync=function(a){var b=I(a)();return b===H?v(b.e):u(b)},c});
//# sourceMappingURL=rx.async.compat.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -38,2 +41,3 @@ // Because of build optimizers

AnonymousObservable = Rx.AnonymousObservable,
ObservableBase = Rx.ObservableBase,
AsyncSubject = Rx.AsyncSubject,

@@ -44,2 +48,3 @@ disposableCreate = Rx.Disposable.create,

defaultScheduler = Rx.Scheduler['default'],
inherits = Rx.internals.inherits,
isScheduler = Rx.Scheduler.isScheduler,

@@ -115,5 +120,12 @@ isPromise = Rx.helpers.isPromise,

}
var value = toObservable.call(self, ret.value);
if (Observable.isObservable(value)) {
g.add(value.subscribe(processGenerator, onError));
var obs = toObservable.call(self, ret.value);
var value = null;
var hasValue = false;
if (Observable.isObservable(obs)) {
g.add(obs.subscribe(function(val) {
hasValue = true;
value = val;
}, onError, function() {
hasValue && processGenerator(value);
}));
} else {

@@ -140,5 +152,9 @@ onError(new TypeError('type not supported'));

function arrayToObservable (obj) {
return Observable.from(obj)
.flatMap(toObservable)
.toArray();
return Observable.from(obj).concatMap(function(o) {
if(Observable.isObservable(o) || isObject(o)) {
return toObservable.call(null, o);
} else {
return Rx.Observable.just(o);
}
}).toArray();
}

@@ -350,2 +366,12 @@

function isNodeList(el) {
if (root.StaticNodeList) {
// IE8 Specific
// instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
return el instanceof root.StaticNodeList || el instanceof root.NodeList;
} else {
return Object.prototype.toString.call(el) === '[object NodeList]';
}
}
function ListenDisposable(e, n, fn) {

@@ -370,3 +396,3 @@ this._e = e;

var elemToString = Object.prototype.toString.call(el);
if (elemToString === '[object NodeList]' || elemToString === '[object HTMLCollection]') {
if (isNodeList(el) || elemToString === '[object HTMLCollection]') {
for (var i = 0, len = el.length; i < len; i++) {

@@ -387,13 +413,32 @@ disposables.add(createEventListener(el.item(i), eventName, handler));

function eventHandler(o, selector) {
return function handler () {
var results = arguments[0];
if (isFunction(selector)) {
results = tryCatch(selector).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
var EventObservable = (function(__super__) {
inherits(EventObservable, __super__);
function EventObservable(el, name, fn) {
this._el = el;
this._name = name;
this._fn = fn;
__super__.call(this);
}
function createHandler(o, fn) {
return function handler () {
var results = arguments[0];
if (isFunction(fn)) {
results = tryCatch(fn).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
};
}
EventObservable.prototype.subscribeCore = function (o) {
return createEventListener(
this._el,
this._n,
createHandler(o, this._fn));
};
}
return EventObservable;
}(ObservableBase));
/**

@@ -426,10 +471,47 @@ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.

return new AnonymousObservable(function (o) {
return createEventListener(
element,
eventName,
eventHandler(o, selector));
}).publish().refCount();
return new EventObservable(element, eventName, selector).publish().refCount();
};
var EventPatternObservable = (function(__super__) {
inherits(EventPatternObservable, __super__);
function EventPatternObservable(add, del, fn) {
this._add = add;
this._del = del;
this._fn = fn;
__super__.call(this);
}
function createHandler(o, fn) {
return function handler () {
var results = arguments[0];
if (isFunction(fn)) {
results = tryCatch(fn).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
};
}
EventPatternObservable.prototype.subscribeCore = function (o) {
var fn = createHandler(o, this._fn);
var returnValue = this._add(fn);
return new EventPatternDisposable(this._del, fn, returnValue);
};
function EventPatternDisposable(del, fn, ret) {
this._del = del;
this._fn = fn;
this._ret = ret;
this.isDisposed = false;
}
EventPatternDisposable.prototype.dispose = function () {
if(!this.isDisposed) {
isFunction(this._del) && this._del(this._fn, this._ret);
}
};
return EventPatternObservable;
}(ObservableBase));
/**

@@ -440,22 +522,6 @@ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.

* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @param {Scheduler} [scheduler] A scheduler used to schedule the remove handler.
* @returns {Observable} An observable sequence which wraps an event from an event emitter
*/
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (o) {
function innerHandler () {
var result = arguments[0];
if (isFunction(selector)) {
result = tryCatch(selector).apply(null, arguments);
if (result === errorObj) { return o.onError(result.e); }
}
o.onNext(result);
}
var returnValue = addHandler(innerHandler);
return disposableCreate(function () {
isFunction(removeHandler) && removeHandler(innerHandler, returnValue);
});
}).publish().refCount();
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
return new EventPatternObservable(addHandler, removeHandler, selector).publish().refCount();
};

@@ -462,0 +528,0 @@

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.binding","exports"],function(b,c){return h.Rx=a(h,c,b),h.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return H.e=b,H}}}function f(a){return a?t.isObservable(a)?a:D(a)?t.fromPromise(a):k(a)||j(a)?J.call(this,a):E(a)?i.call(this,a):G(a)||F(a)?g.call(this,a):l(a)?h.call(this,a):a:a}function g(a){return t.from(a).flatMap(f).toArray()}function h(a){function b(a,b){c[b]=d,g.push(a.map(function(a){c[b]=a}))}for(var c=new a.constructor,e=Object.keys(a),g=[],h=0,i=e.length;i>h;h++){var j=e[h],k=f.call(this,a[j]);k&&t.isObservable(k)?b(k,j):c[j]=a[j]}return t.forkJoin.apply(t,g).map(function(){return c})}function i(a){var b=this;return new w(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function j(a){return E(a.next)&&E(a["throw"])}function k(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:j(b.prototype):!1}function l(a){return Object==a.constructor}function m(a,b,c,d){var e=new x;return d.push(n(e,b,c)),a.apply(b,d),e.asObservable()}function n(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(E(c)){if(e=I(c).apply(b,e),e===H)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function o(a,b,c,d){var e=new x;return d.push(p(e,b,c)),a.apply(b,d),e.asObservable()}function p(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(E(c)){var f=I(c).apply(b,f);if(f===H)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function q(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function r(a,b,c){var d=new z,e=Object.prototype.toString.call(a);if("[object NodeList]"===e||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(r(a.item(f),b,c));else a&&d.add(new q(a,b,c));return d}function s(a,b){return function(){var c=arguments[0];return E(b)&&(c=I(b).apply(null,arguments),c===H)?a.onError(c.e):void a.onNext(c)}}var t=c.Observable,u=t.fromPromise,v=t.throwError,w=c.AnonymousObservable,x=c.AsyncSubject,y=c.Disposable.create,z=c.CompositeDisposable,A=c.Scheduler.immediate,B=c.Scheduler["default"],C=c.Scheduler.isScheduler,D=c.helpers.isPromise,E=c.helpers.isFunction,F=c.helpers.isIterable,G=c.helpers.isArrayLike,H={e:{}},I=c.internals.tryCatch=function(a){if(!E(a))throw new TypeError("fn must be a function");return e(a)};t.wrap=function(a){function b(){return t.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var J=t.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new w(function(d){function e(b){var c=I(a.next).call(a,b);return c===H?d.onError(c.e):void h(c)}function g(b){var c=I(a.next).call(a,b);return c===H?d.onError(c.e):void h(c)}function h(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=f.call(b,a.value);t.isObservable(c)?i.add(c.subscribe(e,g)):g(new TypeError("type not supported"))}var i=new z;return E(a)&&(a=a.apply(b,c)),a&&E(a.next)?(e(),i):(d.onNext(a),d.onCompleted())})};t.start=function(a,b,c){return K(a,b,c)()};var K=t.toAsync=function(a,b,c){return C(c)||(c=B),function(){var d=arguments,e=new x;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};t.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return m(a,b,c,e)}},t.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return o(a,b,c,e)}},q.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},c.config.useNativeEvents=!1,t.fromEvent=function(a,b,d){return a.addListener?L(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new w(function(c){return r(a,b,s(c,d))}).publish().refCount():L(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var L=t.fromEventPattern=function(a,b,c,d){return C(d)||(d=A),new w(function(d){function e(){var a=arguments[0];return E(c)&&(a=I(c).apply(null,arguments),a===H)?d.onError(a.e):void d.onNext(a)}var f=a(e);return y(function(){E(b)&&b(e,f)})}).publish().refCount()};return t.startAsync=function(a){var b=I(a)();return b===H?v(b.e):u(b)},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx.binding","exports"],function(b,c){return j.Rx=a(j,c,b),j.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return H.e=b,H}}}function f(a){return a?t.isObservable(a)?a:D(a)?t.fromPromise(a):k(a)||j(a)?J.call(this,a):E(a)?i.call(this,a):G(a)||F(a)?g.call(this,a):l(a)?h.call(this,a):a:a}function g(a){return t.from(a).concatMap(function(a){return t.isObservable(a)||l(a)?f.call(null,a):c.Observable.just(a)}).toArray()}function h(a){function b(a,b){c[b]=d,g.push(a.map(function(a){c[b]=a}))}for(var c=new a.constructor,e=Object.keys(a),g=[],h=0,i=e.length;i>h;h++){var j=e[h],k=f.call(this,a[j]);k&&t.isObservable(k)?b(k,j):c[j]=a[j]}return t.forkJoin.apply(t,g).map(function(){return c})}function i(a){var b=this;return new w(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function j(a){return E(a.next)&&E(a["throw"])}function k(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:j(b.prototype):!1}function l(a){return Object==a.constructor}function m(a,b,c,d){var e=new y;return d.push(n(e,b,c)),a.apply(b,d),e.asObservable()}function n(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(E(c)){if(e=I(c).apply(b,e),e===H)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function o(a,b,c,d){var e=new y;return d.push(p(e,b,c)),a.apply(b,d),e.asObservable()}function p(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(E(c)){var f=I(c).apply(b,f);if(f===H)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function q(b){return a.StaticNodeList?b instanceof a.StaticNodeList||b instanceof a.NodeList:"[object NodeList]"===Object.prototype.toString.call(b)}function r(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function s(a,b,c){var d=new z,e=Object.prototype.toString.call(a);if(q(a)||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(s(a.item(f),b,c));else a&&d.add(new r(a,b,c));return d}var t=c.Observable,u=t.fromPromise,v=t.throwError,w=c.AnonymousObservable,x=c.ObservableBase,y=c.AsyncSubject,z=(c.Disposable.create,c.CompositeDisposable),A=(c.Scheduler.immediate,c.Scheduler["default"]),B=c.internals.inherits,C=c.Scheduler.isScheduler,D=c.helpers.isPromise,E=c.helpers.isFunction,F=c.helpers.isIterable,G=c.helpers.isArrayLike,H={e:{}},I=c.internals.tryCatch=function(a){if(!E(a))throw new TypeError("fn must be a function");return e(a)};t.wrap=function(a){function b(){return t.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var J=t.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new w(function(d){function e(b){var c=I(a.next).call(a,b);return c===H?d.onError(c.e):void h(c)}function g(b){var c=I(a.next).call(a,b);return c===H?d.onError(c.e):void h(c)}function h(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=f.call(b,a.value),h=null,j=!1;t.isObservable(c)?i.add(c.subscribe(function(a){j=!0,h=a},g,function(){j&&e(h)})):g(new TypeError("type not supported"))}var i=new z;return E(a)&&(a=a.apply(b,c)),a&&E(a.next)?(e(),i):(d.onNext(a),d.onCompleted())})};t.start=function(a,b,c){return K(a,b,c)()};var K=t.toAsync=function(a,b,c){return C(c)||(c=A),function(){var d=arguments,e=new y;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};t.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return m(a,b,c,e)}},t.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return o(a,b,c,e)}},r.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},c.config.useNativeEvents=!1;var L=function(a){function b(b,c,d){this._el=b,this._name=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return E(b)&&(c=I(b).apply(null,arguments),c===H)?a.onError(c.e):void a.onNext(c)}}return B(b,a),b.prototype.subscribeCore=function(a){return s(this._el,this._n,c(a,this._fn))},b}(x);t.fromEvent=function(a,b,d){return a.addListener?N(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new L(a,b,d).publish().refCount():N(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var M=function(a){function b(b,c,d){this._add=b,this._del=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return E(b)&&(c=I(b).apply(null,arguments),c===H)?a.onError(c.e):void a.onNext(c)}}function d(a,b,c){this._del=a,this._fn=b,this._ret=c,this.isDisposed=!1}return B(b,a),b.prototype.subscribeCore=function(a){var b=c(a,this._fn),e=this._add(b);return new d(this._del,b,e)},d.prototype.dispose=function(){this.isDisposed||E(this._del)&&this._del(this._fn,this._ret)},b}(x),N=t.fromEventPattern=function(a,b,c){return new M(a,b,c).publish().refCount()};return t.startAsync=function(a){var b=I(a)();return b===H?v(b.e):u(b)},c});
//# sourceMappingURL=rx.async.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return y.e=b,y}}}function f(a,b,c){return new i(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(v))){if(f)return d.onError(f);var e=z(c).apply(null,j);if(e===y)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new k(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var g=c.Observable,h=g.prototype,i=c.AnonymousObservable,j=c.internals.AbstractObserver,k=(c.CompositeDisposable,c.BinaryDisposable),l=c.NAryDisposable,m=c.Notification,n=c.Subject,o=c.Observer,p=c.Disposable.empty,q=c.Disposable.create,r=c.internals.inherits,s=c.internals.addProperties,t=c.Scheduler["default"],u=c.Scheduler.currentThread,v=c.helpers.identity,w=c.Scheduler.isScheduler,x=c.helpers.isFunction,y=(c.Disposable.checkDisposed,{e:{}}),z=c.internals.tryCatch=function(a){if(!x(a))throw new TypeError("fn must be a function");return e(a)};c.Pauser=function(a){function b(){a.call(this)}return r(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(n);var A=function(a){function b(b,c){this.source=b,this.controller=new n,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return r(b,a),b.prototype._subscribe=function(a){var b=this.source.publish(),c=b.subscribe(a),d=p,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=p)});return new l([c,d,e])},b.prototype.pause=function(){this.controller.onNext(!1)},b.prototype.resume=function(){this.controller.onNext(!0)},b}(g);h.pausable=function(a){return new A(this,a)};var B=function(a){function b(b,c){this.source=b,this.controller=new n,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return r(b,a),b.prototype._subscribe=function(a){function b(){for(;e.length>0;)a.onNext(e.shift())}var c,e=[],g=f(this.source,this.pauser.startWith(!1).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){c!==d&&f.shouldFire!==c?(c=f.shouldFire,f.shouldFire&&b()):(c=f.shouldFire,f.shouldFire?a.onNext(f.data):e.push(f.data))},function(c){b(),a.onError(c)},function(){b(),a.onCompleted()});return g},b.prototype.pause=function(){this.controller.onNext(!1)},b.prototype.resume=function(){this.controller.onNext(!0)},b}(g);h.pausableBuffered=function(a){return new B(this,a)};var C=function(a){function b(b,c,d){a.call(this),this.subject=new D(c,d),this.source=b.multicast(this.subject).refCount()}return r(b,a),b.prototype._subscribe=function(a){return this.source.subscribe(a)},b.prototype.request=function(a){return this.subject.request(null==a?-1:a)},b}(g),D=function(a){function b(b,c){null==b&&(b=!0),a.call(this),this.subject=new n,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=c||u}return r(b,a),s(b.prototype,o,{_subscribe:function(a){return this.subject.subscribe(a)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(m.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(m.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(m.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.schedule(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,q(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),b}(g);h.controlled=function(a,b){return a&&w(a)&&(b=a,a=!0),null==a&&(a=!0),new C(this,a,b)};var E=function(a){function b(b){a.call(this),this.source=b}function c(a,b){b.source.request(1)}r(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new k(this.subscription,t.schedule(this,c))};var d=function(a){function c(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d,this.scheduleDisposable=null}function d(a,b){b.observable.source.request(1)}return r(c,a),c.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},c.prototype.error=function(a){this.observer.onError(a),this.dispose()},c.prototype.next=function(a){this.observer.onNext(a),this.scheduleDisposable=t.schedule(this,d)},b.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},c}(j);return b}(g);C.prototype.stopAndWait=function(){return new E(this)};var F=function(a){function b(b,c){a.call(this),this.source=b,this.windowSize=c}function c(a,b){b.source.request(b.windowSize)}r(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new k(this.subscription,t.schedule(this,c))};var d=function(a){function b(b,c,d){this.observer=b,this.observable=c,this.cancel=d,this.received=0,this.scheduleDisposable=null,a.call(this)}function c(a,b){b.observable.source.request(b.observable.windowSize)}return r(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received&&(this.scheduleDisposable=t.schedule(this,c))},b.prototype.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(j);return b}(g);return C.prototype.windowed=function(a){return new F(this,a)},h.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return y.e=b,y}}}function f(a,b,c){return new i(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(v))){if(f)return d.onError(f);var e=z(c).apply(null,j);if(e===y)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new k(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var g=c.Observable,h=g.prototype,i=c.AnonymousObservable,j=c.internals.AbstractObserver,k=(c.CompositeDisposable,c.BinaryDisposable),l=c.NAryDisposable,m=c.Notification,n=c.Subject,o=c.Observer,p=c.Disposable.empty,q=c.Disposable.create,r=c.internals.inherits,s=c.internals.addProperties,t=c.Scheduler["default"],u=c.Scheduler.currentThread,v=c.helpers.identity,w=c.Scheduler.isScheduler,x=c.helpers.isFunction,y=(c.Disposable.checkDisposed,{e:{}}),z=c.internals.tryCatch=function(a){if(!x(a))throw new TypeError("fn must be a function");return e(a)};c.Pauser=function(a){function b(){a.call(this)}return r(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(n);var A=function(a){function b(b,c){this.source=b,this.controller=new n,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return r(b,a),b.prototype._subscribe=function(a){var b=this.source.publish(),c=b.subscribe(a),d=p,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=p)});return new l([c,d,e])},b.prototype.pause=function(){this.controller.onNext(!1)},b.prototype.resume=function(){this.controller.onNext(!0)},b}(g);h.pausable=function(a){return new A(this,a)};var B=function(a){function b(b,c){this.source=b,this.controller=new n,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return r(b,a),b.prototype._subscribe=function(a){function b(){for(;e.length>0;)a.onNext(e.shift())}var c,e=[],g=f(this.source,this.pauser.startWith(!1).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){c!==d&&f.shouldFire!==c?(c=f.shouldFire,f.shouldFire&&b()):(c=f.shouldFire,f.shouldFire?a.onNext(f.data):e.push(f.data))},function(c){b(),a.onError(c)},function(){b(),a.onCompleted()});return g},b.prototype.pause=function(){this.controller.onNext(!1)},b.prototype.resume=function(){this.controller.onNext(!0)},b}(g);h.pausableBuffered=function(a){return new B(this,a)};var C=function(a){function b(b,c,d){a.call(this),this.subject=new D(c,d),this.source=b.multicast(this.subject).refCount()}return r(b,a),b.prototype._subscribe=function(a){return this.source.subscribe(a)},b.prototype.request=function(a){return this.subject.request(null==a?-1:a)},b}(g),D=function(a){function b(b,c){null==b&&(b=!0),a.call(this),this.subject=new n,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=c||u}return r(b,a),s(b.prototype,o,{_subscribe:function(a){return this.subject.subscribe(a)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(m.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(m.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(m.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.schedule(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,q(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),b}(g);h.controlled=function(a,b){return a&&w(a)&&(b=a,a=!0),null==a&&(a=!0),new C(this,a,b)};var E=function(a){function b(b){a.call(this),this.source=b}function c(a,b){b.source.request(1)}r(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new k(this.subscription,t.schedule(this,c))};var d=function(a){function c(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d,this.scheduleDisposable=null}function d(a,b){b.observable.source.request(1)}return r(c,a),c.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},c.prototype.error=function(a){this.observer.onError(a),this.dispose()},c.prototype.next=function(a){this.observer.onNext(a),this.scheduleDisposable=t.schedule(this,d)},b.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},c}(j);return b}(g);C.prototype.stopAndWait=function(){return new E(this)};var F=function(a){function b(b,c){a.call(this),this.source=b,this.windowSize=c}function c(a,b){b.source.request(b.windowSize)}r(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new k(this.subscription,t.schedule(this,c))};var d=function(a){function b(b,c,d){this.observer=b,this.observable=c,this.cancel=d,this.received=0,this.scheduleDisposable=null,a.call(this)}function c(a,b){b.observable.source.request(b.observable.windowSize)}return r(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received&&(this.scheduleDisposable=t.schedule(this,c))},b.prototype.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(j);return b}(g);return C.prototype.windowed=function(a){return new F(this,a)},h.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},c});
//# sourceMappingURL=rx.backpressure.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -238,3 +241,3 @@ // Because of build optimizers

addProperties(BehaviorSubject.prototype, Observer, {
addProperties(BehaviorSubject.prototype, Observer.prototype, {
_subscribe: function (o) {

@@ -241,0 +244,0 @@ checkDisposed(this);

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=c.ObservableBase,j=c.Subject,k=c.AsyncSubject,l=c.Observer,m=c.internals.ScheduledObserver,n=c.Disposable.create,o=c.Disposable.empty,p=c.BinaryDisposable,q=c.Scheduler.currentThread,r=c.helpers.isFunction,s=c.internals.inherits,t=c.internals.addProperties,u=c.Disposable.checkDisposed,v=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return s(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new p(this._fn2(b).subscribe(a),b.connect())},b}(i);g.multicast=function(a,b){return r(a)?new v(this,a,b):new A(this,a)},g.publish=function(a){return a&&r(a)?this.multicast(function(){return new j},a):this.multicast(new j)},g.share=function(){return this.publish().refCount()},g.publishLast=function(a){return a&&r(a)?this.multicast(function(){return new k},a):this.multicast(new k)},g.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new x(b)},a):this.multicast(new x(a))},g.shareValue=function(a){return this.publishValue(a).refCount()},g.replay=function(a,b,c,d){return a&&r(a)?this.multicast(function(){return new y(b,c,d)},a):this.multicast(new y(b,c,d))},g.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var w=function(a,b){this._s=a,this._o=b};w.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var x=c.BehaviorSubject=function(a){function b(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return s(b,a),t(b.prototype,l,{_subscribe:function(a){return u(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),o):(this.observers.push(a),a.onNext(this.value),new w(this,a))},getValue:function(){if(u(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(u(this),!this.isStopped){this.value=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.error=null}}),b}(f),y=c.ReplaySubject=function(a){function b(a,b){return n(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(b,c,e){this.bufferSize=null==b?d:b,this.windowSize=null==c?d:c,this.scheduler=e||q,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var d=Math.pow(2,53)-1;return s(c,a),t(c.prototype,l.prototype,{_subscribe:function(a){u(this);var c=new m(this.scheduler,a),d=b(this,c);this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d},hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(u(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onNext(a),g.ensureActive()}}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,c=e(this.observers),d=c.length;d>b;b++){var f=c[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),c}(f),z=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return s(b,a),b.prototype.subscribeCore=function(a){var b=1===++this._count,d=this.source.subscribe(a);return b&&(this._connectableSubscription=this.source.connect()),new c(this,d)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(i),A=c.ConnectableObservable=function(a){function b(b,c){this.source=b,this._hasSubscription=!1,this._subscription=null,this._sourceObservable=b.asObservable(),this._subject=c,a.call(this)}function c(a){this._p=a,this.isDisposed=!1}return s(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._p._hasSubscription=!1)},b.prototype.connect=function(){return this._hasSubscription||(this._hasSubscription=!0,this._subscription=new p(this._sourceObservable.subscribe(this._subject),new c(this))),this._subscription},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new z(this)},b}(f);return g.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new h(function(b){return a().subscribe(b)})},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=c.ObservableBase,j=c.Subject,k=c.AsyncSubject,l=c.Observer,m=c.internals.ScheduledObserver,n=c.Disposable.create,o=c.Disposable.empty,p=c.BinaryDisposable,q=c.Scheduler.currentThread,r=c.helpers.isFunction,s=c.internals.inherits,t=c.internals.addProperties,u=c.Disposable.checkDisposed,v=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return s(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new p(this._fn2(b).subscribe(a),b.connect())},b}(i);g.multicast=function(a,b){return r(a)?new v(this,a,b):new A(this,a)},g.publish=function(a){return a&&r(a)?this.multicast(function(){return new j},a):this.multicast(new j)},g.share=function(){return this.publish().refCount()},g.publishLast=function(a){return a&&r(a)?this.multicast(function(){return new k},a):this.multicast(new k)},g.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new x(b)},a):this.multicast(new x(a))},g.shareValue=function(a){return this.publishValue(a).refCount()},g.replay=function(a,b,c,d){return a&&r(a)?this.multicast(function(){return new y(b,c,d)},a):this.multicast(new y(b,c,d))},g.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var w=function(a,b){this._s=a,this._o=b};w.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var x=c.BehaviorSubject=function(a){function b(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return s(b,a),t(b.prototype,l.prototype,{_subscribe:function(a){return u(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),o):(this.observers.push(a),a.onNext(this.value),new w(this,a))},getValue:function(){if(u(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(u(this),!this.isStopped){this.value=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.error=null}}),b}(f),y=c.ReplaySubject=function(a){function b(a,b){return n(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(b,c,e){this.bufferSize=null==b?d:b,this.windowSize=null==c?d:c,this.scheduler=e||q,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var d=Math.pow(2,53)-1;return s(c,a),t(c.prototype,l.prototype,{_subscribe:function(a){u(this);var c=new m(this.scheduler,a),d=b(this,c);this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d},hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(u(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onNext(a),g.ensureActive()}}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,c=e(this.observers),d=c.length;d>b;b++){var f=c[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),c}(f),z=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return s(b,a),b.prototype.subscribeCore=function(a){var b=1===++this._count,d=this.source.subscribe(a);return b&&(this._connectableSubscription=this.source.connect()),new c(this,d)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(i),A=c.ConnectableObservable=function(a){function b(b,c){this.source=b,this._hasSubscription=!1,this._subscription=null,this._sourceObservable=b.asObservable(),this._subject=c,a.call(this)}function c(a){this._p=a,this.isDisposed=!1}return s(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._p._hasSubscription=!1)},b.prototype.connect=function(){return this._hasSubscription||(this._hasSubscription=!0,this._subscription=new p(this._sourceObservable.subscribe(this._subject),new c(this))),this._subscription},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new z(this)},b}(f);return g.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new h(function(b){return a().subscribe(b)})},c});
//# sourceMappingURL=rx.binding.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -34,2 +37,3 @@ // Because of build optimizers

ObservableBase = Rx.ObservableBase,
AbstractObserver = Rx.internals.AbstractObserver,
CompositeDisposable = Rx.CompositeDisposable,

@@ -47,2 +51,3 @@ BinaryDisposable = Rx.BinaryDisposable,

inherits = Rx.internals.inherits,
bindCallback = Rx.internals.bindCallback,
noop = Rx.helpers.noop,

@@ -418,2 +423,38 @@ isPromise = Rx.helpers.isPromise,

var PairwiseObservable = (function (__super__) {
inherits(PairwiseObservable, __super__);
function PairwiseObservable(source) {
this.source = source;
__super__.call(this);
}
PairwiseObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new PairwiseObserver(o));
};
return PairwiseObservable;
}(ObservableBase));
var PairwiseObserver = (function(__super__) {
inherits(PairwiseObserver, __super__);
function PairwiseObserver(o) {
this._o = o;
this._p = null;
this._hp = false;
}
PairwiseObserver.prototype.next = function (x) {
if (this._hp) {
this._o.onNext([this._p, x]);
} else {
this._hp = true;
}
this._p = x;
};
PairwiseObserver.prototype.error = function (err) { this._o.onError(err); };
PairwiseObserver.prototype.completed = function () { this._o.onCompleted(); };
return PairwiseObserver;
}(AbstractObserver));
/**

@@ -426,17 +467,3 @@ * Returns a new observable that triggers on the second and subsequent triggerings of the input observable.

observableProto.pairwise = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var previous, hasPrevious = false;
return source.subscribe(
function (x) {
if (hasPrevious) {
observer.onNext([previous, x]);
} else {
hasPrevious = true;
}
previous = x;
},
observer.onError.bind(observer),
observer.onCompleted.bind(observer));
}, source);
return new PairwiseObservable(this);
};

@@ -458,5 +485,6 @@

observableProto.partition = function(predicate, thisArg) {
var fn = bindCallback(predicate, thisArg, 3);
return [
this.filter(predicate, thisArg),
this.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
this.filter(function (x, i, o) { return !fn(x, i, o); })
];

@@ -463,0 +491,0 @@ };

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return B.e=b,B}}}function f(a){return a.toArray()}function g(a,b){return a.groupJoin(this,b,s,function(a,b){return b})}function h(a){var b=this;return new u(function(c){var d=new q,e=new l,f=new n(e);return c.onNext(v(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),y(a)&&(a=A(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new q,c.onNext(v(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function i(a){var b=this;return new u(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}y(b)&&(b=A(b));var i=new o;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(x,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new q,c.onNext(v(h,g)),d()}))}var e=new p,f=new l(e),g=new n(f),h=new q;return c.onNext(v(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}var j=c.Observable,k=c.ObservableBase,l=c.CompositeDisposable,m=c.BinaryDisposable,n=c.RefCountDisposable,o=c.SingleAssignmentDisposable,p=c.SerialDisposable,q=c.Subject,r=j.prototype,s=j.empty,t=j.never,u=c.AnonymousObservable,v=c.internals.addRef,w=c.internals.inherits,x=c.helpers.noop,y=c.helpers.isPromise,z=c.helpers.isFunction,A=j.fromPromise,B={e:{}},C=c.internals.tryCatch=function(a){if(!z(a))throw new TypeError("fn must be a function");return e(a)},D=a.Map||function(){function a(){this.size=0,this._values=[],this._keys=[]}return a.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1===b?d:this._values[b]},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},a.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},a}();r.join=function(a,b,c,d){var e=this;return new u(function(f){var g=new l,h=!1,i=!1,j=0,k=0,m=new D,n=new D,p=function(a){f.onError(a)};return g.add(e.subscribe(function(a){var c=j++,e=new o;m.set(c,a),g.add(e);var i=C(b)(a);return i===B?f.onError(i.e):(e.setDisposable(i.take(1).subscribe(x,p,function(){m["delete"](c)&&0===m.size&&h&&f.onCompleted(),g.remove(e)})),void n.forEach(function(b){var c=C(d)(a,b);return c===B?f.onError(c.e):void f.onNext(c)}))},p,function(){h=!0,(i||0===m.size)&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new o;n.set(b,a),g.add(e);var h=C(c)(a);return h===B?f.onError(h.e):(e.setDisposable(h.take(1).subscribe(x,p,function(){n["delete"](b)&&0===n.size&&i&&f.onCompleted(),g.remove(e)})),void m.forEach(function(b){var c=C(d)(b,a);return c===B?f.onError(c.e):void f.onNext(c)}))},p,function(){i=!0,(h||0===n.size)&&f.onCompleted()})),g},e)},r.groupJoin=function(a,b,c,d){var e=this;return new u(function(f){function g(a){}var h=new l,i=new n(h),j=new D,k=new D,m=0,p=0,g=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(a){var c=new q,e=m++;j.set(e,c);var l=C(d)(a,v(c,i));if(l===B)return j.forEach(g(l.e)),f.onError(l.e);f.onNext(l),k.forEach(function(a){c.onNext(a)});var n=new o;h.add(n);var p=C(b)(a);return p===B?(j.forEach(g(p.e)),f.onError(p.e)):void n.setDisposable(p.take(1).subscribe(x,function(a){j.forEach(g(a)),f.onError(a)},function(){j["delete"](e)&&c.onCompleted(),h.remove(n)}))},function(a){j.forEach(g(a)),f.onError(a)},function(){f.onCompleted()})),h.add(a.subscribe(function(a){var b=p++;k.set(b,a);var d=new o;h.add(d);var e=C(c)(a);return e===B?(j.forEach(g(e.e)),f.onError(e.e)):(d.setDisposable(e.take(1).subscribe(x,function(a){j.forEach(g(a)),f.onError(a)},function(){k["delete"](b),h.remove(d)})),void j.forEach(function(b){b.onNext(a)}))},function(a){j.forEach(g(a)),f.onError(a)})),i},e)},r.buffer=function(){return this.window.apply(this,arguments).flatMap(f)},r.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?h.call(this,a):"function"==typeof a?i.call(this,a):g.call(this,a,b)},r.pairwise=function(){var a=this;return new u(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},r.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]},r.groupBy=function(a,b){return this.groupByUntil(a,b,t)},r.groupByUntil=function(a,b,c){var e=this;return new u(function(f){var g=new D,h=new l,i=new n(h),j=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(e){var k=C(a)(e);if(k===B)return g.forEach(j(k.e)),f.onError(k.e);var l=!1,m=g.get(k);if(m===d&&(m=new q,g.set(k,m),l=!0),l){var n=new F(k,m,i),p=new F(k,m),r=C(c)(p);if(r===B)return g.forEach(j(r.e)),f.onError(r.e);f.onNext(n);var s=new o;h.add(s),s.setDisposable(r.take(1).subscribe(x,function(a){g.forEach(j(a)),f.onError(a)},function(){g["delete"](k)&&m.onCompleted(),h.remove(s)}))}var t=e;return z(b)&&(t=C(b)(e),t===B)?(g.forEach(j(t.e)),f.onError(t.e)):void m.onNext(t)},function(a){g.forEach(j(a)),f.onError(a)},function(){g.forEach(function(a){a.onCompleted()}),f.onCompleted()})),i},e)};var E=function(a){function b(b,c){this._m=b,this._u=c,a.call(this)}return w(b,a),b.prototype.subscribeCore=function(a){return new m(this._m.getDisposable(),this._u.subscribe(a))},b}(k),F=function(a){function b(b,c,d){a.call(this),this.key=b,this.underlyingObservable=d?new E(d,c):c}return w(b,a),b.prototype._subscribe=function(a){return this.underlyingObservable.subscribe(a)},b}(j);return c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return D.e=b,D}}}function f(a){return a.toArray()}function g(a,b){return a.groupJoin(this,b,t,function(a,b){return b})}function h(a){var b=this;return new v(function(c){var d=new r,e=new m,f=new o(e);return c.onNext(w(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),A(a)&&(a=C(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new r,c.onNext(w(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function i(a){var b=this;return new v(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}A(b)&&(b=C(b));var i=new p;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(z,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new r,c.onNext(w(h,g)),d()}))}var e=new q,f=new m(e),g=new o(f),h=new r;return c.onNext(w(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}var j=c.Observable,k=c.ObservableBase,l=c.internals.AbstractObserver,m=c.CompositeDisposable,n=c.BinaryDisposable,o=c.RefCountDisposable,p=c.SingleAssignmentDisposable,q=c.SerialDisposable,r=c.Subject,s=j.prototype,t=j.empty,u=j.never,v=c.AnonymousObservable,w=c.internals.addRef,x=c.internals.inherits,y=c.internals.bindCallback,z=c.helpers.noop,A=c.helpers.isPromise,B=c.helpers.isFunction,C=j.fromPromise,D={e:{}},E=c.internals.tryCatch=function(a){if(!B(a))throw new TypeError("fn must be a function");return e(a)},F=a.Map||function(){function a(){this.size=0,this._values=[],this._keys=[]}return a.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1===b?d:this._values[b]},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},a.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},a}();s.join=function(a,b,c,d){var e=this;return new v(function(f){var g=new m,h=!1,i=!1,j=0,k=0,l=new F,n=new F,o=function(a){f.onError(a)};return g.add(e.subscribe(function(a){var c=j++,e=new p;l.set(c,a),g.add(e);var i=E(b)(a);return i===D?f.onError(i.e):(e.setDisposable(i.take(1).subscribe(z,o,function(){l["delete"](c)&&0===l.size&&h&&f.onCompleted(),g.remove(e)})),void n.forEach(function(b){var c=E(d)(a,b);return c===D?f.onError(c.e):void f.onNext(c)}))},o,function(){h=!0,(i||0===l.size)&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new p;n.set(b,a),g.add(e);var h=E(c)(a);return h===D?f.onError(h.e):(e.setDisposable(h.take(1).subscribe(z,o,function(){n["delete"](b)&&0===n.size&&i&&f.onCompleted(),g.remove(e)})),void l.forEach(function(b){var c=E(d)(b,a);return c===D?f.onError(c.e):void f.onNext(c)}))},o,function(){i=!0,(h||0===n.size)&&f.onCompleted()})),g},e)},s.groupJoin=function(a,b,c,d){var e=this;return new v(function(f){function g(a){}var h=new m,i=new o(h),j=new F,k=new F,l=0,n=0,g=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(a){var c=new r,e=l++;j.set(e,c);var m=E(d)(a,w(c,i));if(m===D)return j.forEach(g(m.e)),f.onError(m.e);f.onNext(m),k.forEach(function(a){c.onNext(a)});var n=new p;h.add(n);var o=E(b)(a);return o===D?(j.forEach(g(o.e)),f.onError(o.e)):void n.setDisposable(o.take(1).subscribe(z,function(a){j.forEach(g(a)),f.onError(a)},function(){j["delete"](e)&&c.onCompleted(),h.remove(n)}))},function(a){j.forEach(g(a)),f.onError(a)},function(){f.onCompleted()})),h.add(a.subscribe(function(a){var b=n++;k.set(b,a);var d=new p;h.add(d);var e=E(c)(a);return e===D?(j.forEach(g(e.e)),f.onError(e.e)):(d.setDisposable(e.take(1).subscribe(z,function(a){j.forEach(g(a)),f.onError(a)},function(){k["delete"](b),h.remove(d)})),void j.forEach(function(b){b.onNext(a)}))},function(a){j.forEach(g(a)),f.onError(a)})),i},e)},s.buffer=function(){return this.window.apply(this,arguments).flatMap(f)},s.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?h.call(this,a):"function"==typeof a?i.call(this,a):g.call(this,a,b)};var G=function(a){function b(b){this.source=b,a.call(this)}return x(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new H(a))},b}(k),H=function(a){function b(a){this._o=a,this._p=null,this._hp=!1}return x(b,a),b.prototype.next=function(a){this._hp?this._o.onNext([this._p,a]):this._hp=!0,this._p=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(l);s.pairwise=function(){return new G(this)},s.partition=function(a,b){var c=y(a,b,3);return[this.filter(a,b),this.filter(function(a,b,d){return!c(a,b,d)})]},s.groupBy=function(a,b){return this.groupByUntil(a,b,u)},s.groupByUntil=function(a,b,c){var e=this;return new v(function(f){var g=new F,h=new m,i=new o(h),j=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(e){var k=E(a)(e);if(k===D)return g.forEach(j(k.e)),f.onError(k.e);var l=!1,m=g.get(k);if(m===d&&(m=new r,g.set(k,m),l=!0),l){var n=new J(k,m,i),o=new J(k,m),q=E(c)(o);if(q===D)return g.forEach(j(q.e)),f.onError(q.e);f.onNext(n);var s=new p;h.add(s),s.setDisposable(q.take(1).subscribe(z,function(a){g.forEach(j(a)),f.onError(a)},function(){g["delete"](k)&&m.onCompleted(),h.remove(s)}))}var t=e;return B(b)&&(t=E(b)(e),t===D)?(g.forEach(j(t.e)),f.onError(t.e)):void m.onNext(t)},function(a){g.forEach(j(a)),f.onError(a)},function(){g.forEach(function(a){a.onCompleted()}),f.onCompleted()})),i},e)};var I=function(a){function b(b,c){this._m=b,this._u=c,a.call(this)}return x(b,a),b.prototype.subscribeCore=function(a){return new n(this._m.getDisposable(),this._u.subscribe(a))},b}(k),J=function(a){function b(b,c,d){a.call(this),this.key=b,this.underlyingObservable=d?new I(d,c):c}return x(b,a),b.prototype._subscribe=function(a){return this.underlyingObservable.subscribe(a)},b}(j);return c});
//# sourceMappingURL=rx.coincidence.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -451,3 +454,3 @@ // Because of build optimizers

addProperties(AsyncSubject.prototype, Observer, {
addProperties(AsyncSubject.prototype, Observer.prototype, {
_subscribe: function (o) {

@@ -562,3 +565,3 @@ checkDisposed(this);

addProperties(BehaviorSubject.prototype, Observer, {
addProperties(BehaviorSubject.prototype, Observer.prototype, {
_subscribe: function (o) {

@@ -565,0 +568,0 @@ checkDisposed(this);

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.core"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx.core")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function f(a){return function(){try{return a.apply(this,arguments)}catch(b){return v.e=b,v}}}function g(a){throw a}var h=c.Observable,i=h.prototype,j=(c.AnonymousObservable,c.ObservableBase),k=c.Observer,l=c.internals.AbstractObserver,m=c.Disposable.create,n=c.Disposable.empty,o=(c.CompositeDisposable,c.BinaryDisposable),p=c.SerialDisposable,q=c.Scheduler.currentThread,r=c.helpers.isFunction,s=c.internals.inherits,t=c.internals.addProperties,u=c.Disposable.checkDisposed,v={e:{}},w=c.internals.tryCatch=function(a){if(!r(a))throw new TypeError("fn must be a function");return f(a)},x=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return s(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new o(this._fn2(b).subscribe(a),b.connect())},b}(j);i.multicast=function(a,b){return r(a)?new x(this,a,b):new G(this,a)},i.publish=function(a){return a&&r(a)?this.multicast(function(){return new A},a):this.multicast(new A)},i.share=function(){return this.publish().refCount()},i.publishLast=function(a){return a&&r(a)?this.multicast(function(){return new C},a):this.multicast(new C)},i.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new D(b)},a):this.multicast(new D(a))},i.shareValue=function(a){return this.publishValue(a).refCount()},i.replay=function(a,b,c,d){return a&&r(a)?this.multicast(function(){return new E(b,c,d)},a):this.multicast(new E(b,c,d))},i.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var y=c.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new p}return s(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=w(c)();return d===v?(a.queue=[],a.hasFaulted=!0,g(d.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(l),z=function(a,b){this._s=a,this._o=b};z.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var A=c.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return s(b,a),t(b.prototype,k.prototype,{_subscribe:function(a){return u(this),this.isStopped?this.hasError?(a.onError(this.error),n):(a.onCompleted(),n):(this.observers.push(a),new z(this,a))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(u(this),!this.isStopped)for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),b.create=function(a,b){return new B(a,b)},b}(h),B=c.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return s(b,a),t(b.prototype,k.prototype,{_subscribe:function(a){return this.observable.subscribe(a)},onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(h),C=c.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return s(b,a),t(b.prototype,k,{_subscribe:function(a){return u(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),n):(this.observers.push(a),new z(this,a))},hasObservers:function(){return u(this),this.observers.length>0},onCompleted:function(){var a,b;if(u(this),!this.isStopped){this.isStopped=!0;var c=e(this.observers),b=c.length;if(this.hasValue)for(a=0;b>a;a++){var d=c[a];d.onNext(this.value),d.onCompleted()}else for(a=0;b>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){u(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(h),D=c.BehaviorSubject=function(a){function b(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return s(b,a),t(b.prototype,k,{_subscribe:function(a){return u(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),n):(this.observers.push(a),a.onNext(this.value),new z(this,a))},getValue:function(){if(u(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(u(this),!this.isStopped){this.value=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.error=null}}),b}(h),E=c.ReplaySubject=function(a){function b(a,b){return m(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(b,c,e){this.bufferSize=null==b?d:b,this.windowSize=null==c?d:c,this.scheduler=e||q,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var d=Math.pow(2,53)-1;return s(c,a),t(c.prototype,k.prototype,{_subscribe:function(a){u(this);var c=new y(this.scheduler,a),d=b(this,c);this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d},hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(u(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onNext(a),g.ensureActive()}}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,c=e(this.observers),d=c.length;d>b;b++){var f=c[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),c}(h),F=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return s(b,a),b.prototype.subscribeCore=function(a){var b=1===++this._count,d=this.source.subscribe(a);return b&&(this._connectableSubscription=this.source.connect()),new c(this,d)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(j),G=c.ConnectableObservable=function(a){function b(b,c){this.source=b,this._hasSubscription=!1,this._subscription=null,this._sourceObservable=b.asObservable(),this._subject=c,a.call(this)}function c(a){this._p=a,this.isDisposed=!1}return s(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._p._hasSubscription=!1)},b.prototype.connect=function(){return this._hasSubscription||(this._hasSubscription=!0,this._subscription=new o(this._sourceObservable.subscribe(this._subject),new c(this))),this._subscription},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new F(this)},b}(h);return c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx.core"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx.core")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function f(a){return function(){try{return a.apply(this,arguments)}catch(b){return v.e=b,v}}}function g(a){throw a}var h=c.Observable,i=h.prototype,j=(c.AnonymousObservable,c.ObservableBase),k=c.Observer,l=c.internals.AbstractObserver,m=c.Disposable.create,n=c.Disposable.empty,o=(c.CompositeDisposable,c.BinaryDisposable),p=c.SerialDisposable,q=c.Scheduler.currentThread,r=c.helpers.isFunction,s=c.internals.inherits,t=c.internals.addProperties,u=c.Disposable.checkDisposed,v={e:{}},w=c.internals.tryCatch=function(a){if(!r(a))throw new TypeError("fn must be a function");return f(a)},x=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return s(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new o(this._fn2(b).subscribe(a),b.connect())},b}(j);i.multicast=function(a,b){return r(a)?new x(this,a,b):new G(this,a)},i.publish=function(a){return a&&r(a)?this.multicast(function(){return new A},a):this.multicast(new A)},i.share=function(){return this.publish().refCount()},i.publishLast=function(a){return a&&r(a)?this.multicast(function(){return new C},a):this.multicast(new C)},i.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new D(b)},a):this.multicast(new D(a))},i.shareValue=function(a){return this.publishValue(a).refCount()},i.replay=function(a,b,c,d){return a&&r(a)?this.multicast(function(){return new E(b,c,d)},a):this.multicast(new E(b,c,d))},i.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var y=c.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new p}return s(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=w(c)();return d===v?(a.queue=[],a.hasFaulted=!0,g(d.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(l),z=function(a,b){this._s=a,this._o=b};z.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var A=c.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return s(b,a),t(b.prototype,k.prototype,{_subscribe:function(a){return u(this),this.isStopped?this.hasError?(a.onError(this.error),n):(a.onCompleted(),n):(this.observers.push(a),new z(this,a))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(u(this),!this.isStopped)for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),b.create=function(a,b){return new B(a,b)},b}(h),B=c.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return s(b,a),t(b.prototype,k.prototype,{_subscribe:function(a){return this.observable.subscribe(a)},onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(h),C=c.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return s(b,a),t(b.prototype,k.prototype,{_subscribe:function(a){return u(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),n):(this.observers.push(a),new z(this,a))},hasObservers:function(){return u(this),this.observers.length>0},onCompleted:function(){var a,b;if(u(this),!this.isStopped){this.isStopped=!0;var c=e(this.observers),b=c.length;if(this.hasValue)for(a=0;b>a;a++){var d=c[a];d.onNext(this.value),d.onCompleted()}else for(a=0;b>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){u(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(h),D=c.BehaviorSubject=function(a){function b(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return s(b,a),t(b.prototype,k.prototype,{_subscribe:function(a){return u(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),n):(this.observers.push(a),a.onNext(this.value),new z(this,a))},getValue:function(){if(u(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(u(this),!this.isStopped){this.value=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.error=null}}),b}(h),E=c.ReplaySubject=function(a){function b(a,b){return m(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(b,c,e){this.bufferSize=null==b?d:b,this.windowSize=null==c?d:c,this.scheduler=e||q,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var d=Math.pow(2,53)-1;return s(c,a),t(c.prototype,k.prototype,{_subscribe:function(a){u(this);var c=new y(this.scheduler,a),d=b(this,c);this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d},hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(u(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onNext(a),g.ensureActive()}}},onError:function(a){if(u(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(u(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,c=e(this.observers),d=c.length;d>b;b++){var f=c[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),c}(h),F=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return s(b,a),b.prototype.subscribeCore=function(a){var b=1===++this._count,d=this.source.subscribe(a);return b&&(this._connectableSubscription=this.source.connect()),new c(this,d)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(j),G=c.ConnectableObservable=function(a){function b(b,c){this.source=b,this._hasSubscription=!1,this._subscription=null,this._sourceObservable=b.asObservable(),this._subject=c,a.call(this)}function c(a){this._p=a,this.isDisposed=!1}return s(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._p._hasSubscription=!1)},b.prototype.connect=function(){return this._hasSubscription||(this._hasSubscription=!0,this._subscription=new o(this._sourceObservable.subscribe(this._subject),new c(this))),this._subscription},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new F(this)},b}(h);return c});
//# sourceMappingURL=rx.core.binding.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -10,11 +10,14 @@ ;(function (undefined) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -773,3 +776,3 @@ var Rx = {

function onGlobalPostMessage(event) {
var onGlobalPostMessage = function (event) {
// Only if we're a match to avoid any other global events

@@ -779,11 +782,5 @@ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {

}
}
};
if (root.addEventListener) {
root.addEventListener('message', onGlobalPostMessage, false);
} else if (root.attachEvent) {
root.attachEvent('onmessage', onGlobalPostMessage);
} else {
root.onmessage = onGlobalPostMessage;
}
root.addEventListener('message', onGlobalPostMessage, false);

@@ -846,11 +843,18 @@ scheduleMethod = function (action) {

function DefaultSchedulerDisposable(id) {
function scheduleAction(disposable, action, scheduler, state) {
return function schedule() {
!disposable.isDisposed && disposable.setDisposable(Disposable._fixup(action(scheduler, state)));
};
}
function ClearDisposable(method, id) {
this._id = id;
this._method = method;
this.isDisposed = false;
}
DefaultSchedulerDisposable.prototype.dispose = function () {
ClearDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
localClearTimeout(this._id);
this._method.call(null, this._id);
}

@@ -860,16 +864,12 @@ };

DefaultScheduler.prototype.schedule = function (state, action) {
var scheduler = this, disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
!disposable.isDisposed && disposable.setDisposable(disposableFixup(action(scheduler, state)));
});
return new BinaryDisposable(disposable, new DefaultSchedulerDisposable(id));
var disposable = new SingleAssignmentDisposable(),
id = scheduleMethod(scheduleAction(disposable, action, this, state));
return new BinaryDisposable(disposable, new ClearDisposable(clearMethod, id));
};
DefaultScheduler.prototype._scheduleFuture = function (state, dueTime, action) {
var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
if (dt === 0) { return scheduler.schedule(state, action); }
var id = localSetTimeout(function () {
!disposable.isDisposed && disposable.setDisposable(disposableFixup(action(scheduler, state)));
}, dt);
return new BinaryDisposable(disposable, new DefaultSchedulerDisposable(id));
if (dueTime === 0) { return this.schedule(state, action); }
var disposable = new SingleAssignmentDisposable(),
id = localSetTimeout(scheduleAction(disposable, action, this, state), dueTime);
return new BinaryDisposable(disposable, new ClearDisposable(localClearTimeout, id));
};

@@ -876,0 +876,0 @@

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){return function(){try{return a.apply(this,arguments)}catch(b){return A.e=b,A}}}function c(a){throw a}function d(a,b){if(C&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(G)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var f=c.join("\n"+G+"\n");a.stack=e(f)}}function e(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var h=b[d];f(h)||g(h)||!h||c.push(h)}return c.join("\n")}function f(a){var b=i(a);if(!b)return!1;var c=b[0],d=b[1];return c===E&&d>=F&&na>=d}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(){if(C)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=i(c);if(!d)return;return E=d[0],d[1]}}function i(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function j(a,b){this.id=a,this.value=b}var k={"function":!0,object:!0},l=k[typeof exports]&&exports&&!exports.nodeType&&exports,m=k[typeof self]&&self.Object&&self,n=k[typeof window]&&window&&window.Object&&window,o=k[typeof module]&&module&&!module.nodeType&&module,p=o&&o.exports===l&&l,q=l&&o&&"object"==typeof global&&global&&global.Object&&global,r=r=q||n!==(this&&this.window)&&n||m||this,s={internals:{},config:{Promise:r.Promise},helpers:{}},t=s.helpers.noop=function(){},u=s.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}(),v=s.helpers.defaultError=function(a){throw a},w=(s.helpers.isPromise=function(a){return!!a&&!isFunction(a.subscribe)&&isFunction(a.then)},s.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0});isFunction=s.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==toString.call(a)}),a}();var x=s.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};x.prototype=Error.prototype;var y=s.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};y.prototype=Error.prototype;var z=s.helpers.notImplemented=function(){throw new x},A=(s.helpers.notSupported=function(){throw new y},{e:{}}),B=s.internals.tryCatch=function(a){if(!isFunction(a))throw new TypeError("fn must be a function");return b(a)};s.config.longStackSupport=!1;var C=!1,D=B(function(){throw new Error})();C=!!D.e&&!!D.e.stack;var E,F=h(),G="From previous event:",H=({}.hasOwnProperty,Array.prototype.slice,s.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),I=(s.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},s.internals.addRef=function(a,b){return new la(function(c){return new R(b.getDisposable(),a.subscribe(c))})},s.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];this.disposables=c,this.isDisposed=!1,this.length=c.length}),J=I.prototype;J.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},J.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},J.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var K=s.Disposable=function(a){this.isDisposed=!1,this.action=a||t};K.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var L=K.create=function(a){return new K(a)},M=K.empty={dispose:t},N=K.isDisposable=function(a){return a&&isFunction(a.dispose)},O=(K.checkDisposed=function(a){if(a.isDisposed)throw new ObjectDisposedError},K._fixup=function(a){return N(a)?a:M}),P=s.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};P.prototype.getDisposable=function(){return this.current},P.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},P.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var Q=s.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Q.prototype.getDisposable=function(){return this.current},Q.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Q.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var R=s.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};R.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var S=s.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};S.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var T=s.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||w,this.disposable=new P};T.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},T.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},T.prototype.isCancelled=function(){return this.disposable.isDisposed},T.prototype.invokeCore=function(){return O(this.action(this.scheduler,this.state))};var U=s.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new x},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new x},a.now=u,a.prototype.now=u,a.normalize=function(a){return 0>a&&(a=0),a},a}(),V=U.normalize;U.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),M}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new I;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),M}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new I;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(U.prototype),function(a){U.prototype.schedulePeriodic=function(a,b,c){if("undefined"==typeof r.setInterval)throw new y;b=V(b);var d=a,e=r.setInterval(function(){d=c(d)},b);return L(function(){r.clearInterval(e)})}}(U.prototype);var W,X,Y=(s.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new P;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a.bind(this))),b},b}(),function(a){function b(){a.call(this)}return H(b,a),b.prototype.schedule=function(a,b){return O(b(this,a))},b}(U)),Z=(U.immediate=new Y,function(a){function b(){for(;e.length>0;){var a=e.dequeue();!a.isCancelled()&&a.invoke()}}function d(){a.call(this)}var e;return H(d,a),d.prototype.schedule=function(a,d){var f=new T(this,a,d,this.now());if(e)e.enqueue(f);else{e=new da(4),e.enqueue(f);var g=B(b)();e=null,g===A&&c(g.e)}return f.disposable},d.prototype.scheduleRequired=function(){return!e},d}(U)),$=U.currentThread=new Z,_=function(){var a,b=t;if(r.setTimeout)a=r.setTimeout,b=r.clearTimeout;else{if(!r.WScript)throw new y;a=function(a,b){r.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),aa=_.setTimeout,ba=_.clearTimeout;!function(){function a(b){if(g)aa(function(){a(b)},0);else{var d=f[b];if(d){g=!0;var e=B(d)();X(b),g=!1,e===A&&c(e.e)}}}function b(){if(!r.postMessage||r.importScripts)return!1;var a=!1,b=r.onmessage;return r.onmessage=function(){a=!0},r.postMessage("","*"),r.onmessage=b,a}function d(b){"string"==typeof b.data&&b.data.substring(0,j.length)===j&&a(b.data.substring(j.length))}var e=1,f={},g=!1;X=function(a){delete f[a]};var h=new RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=q&&p&&q.setImmediate)&&!h.test(i)&&i;if(isFunction(i))W=function(b){var c=e++;return f[c]=b,i(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))W=function(b){var c=e++;return f[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var j="ms.rx.schedule"+Math.random();r.addEventListener?r.addEventListener("message",d,!1):r.attachEvent?r.attachEvent("onmessage",d):r.onmessage=d,W=function(a){var b=e++;return f[b]=a,r.postMessage(j+currentId,"*"),b}}else if(r.MessageChannel){var k=new r.MessageChannel;k.port1.onmessage=function(b){a(b.data)},W=function(a){var b=e++;return f[b]=a,k.port2.postMessage(b),b}}else W="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(b){var c=r.document.createElement("script"),d=e++;return f[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},r.document.documentElement.appendChild(c),d}:function(b){var c=e++;return f[c]=b,aa(function(){a(c)},0),c}}();var ca=function(a){function b(){a.call(this)}function c(a){this._id=a,this.isDisposed=!1}return H(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,ba(this._id))},b.prototype.schedule=function(a,b){var d=this,e=new P,f=W(function(){!e.isDisposed&&e.setDisposable(O(b(d,a)))});return new R(e,new c(f))},b.prototype._scheduleFuture=function(a,b,d){var e=this,f=U.normalize(b),g=new P;if(0===f)return e.schedule(a,d);var h=aa(function(){!g.isDisposed&&g.setDisposable(O(d(e,a)))},f);return new R(g,new c(h))},b}(U);U["default"]=U.async=new ca;j.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var da=s.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},ea=da.prototype;ea.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},ea.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},ea.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},ea.peek=function(){return this.items[0].value},ea.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},ea.dequeue=function(){var a=this.peek();return this.removeAt(0),a},ea.enqueue=function(a){var b=this.length++;this.items[b]=new j(da.count++,a),this.percolate(b)},ea.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},da.count=0;var fa,ga=s.Observer=function(){},ha=ga.create=function(a,b,c){return a||(a=t),b||(b=v),c||(c=t),new ja(a,b,c)},ia=s.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return H(b,a),b.prototype.next=z,b.prototype.error=z,b.prototype.completed=z,b.prototype.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ga),ja=s.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return H(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(ia),ka=s.Observable=function(){function a(a,b){return function(c){var e=c.onError;return c.onError=function(b){d(b,a),e.call(c,b)},b.call(a,c)}}function b(){if(s.config.longStackSupport&&C){var b=this._subscribe,d=B(c)(new Error).e;this.stack=d.stack.substring(d.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return fa=b.prototype,b.isObservable=function(a){return a&&isFunction(a.subscribe)},fa.subscribe=fa.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ha(a,b,c))},fa.subscribeOnNext=function(a,b){return this._subscribe(ha("undefined"!=typeof b?function(c){a.call(b,c)}:a))},fa.subscribeOnError=function(a,b){return this._subscribe(ha(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},fa.subscribeOnCompleted=function(a,b){return this._subscribe(ha(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),la=s.AnonymousObservable=function(a){function b(a){return a&&isFunction(a.dispose)?a:isFunction(a)?L(a):M}function d(a,d){var e=d[0],f=d[1],g=B(f.__subscribe).call(f,e);g!==A||e.fail(A.e)||c(A.e),e.setDisposable(b(g))}function e(b,c){this.source=c,this.__subscribe=b,a.call(this)}return H(e,a),e.prototype._subscribe=function(a){var b=new ma(a),c=[b,this];return $.scheduleRequired()?$.schedule(c,d):d(null,c),b},e}(ka),ma=(s.ObservableBase=function(a){function b(a){return a&&isFunction(a.dispose)?a:isFunction(a)?L(a):M}function d(a,d){var e=d[0],f=d[1],g=B(f.subscribeCore).call(f,e);g!==A||e.fail(A.e)||c(A.e),e.setDisposable(b(g))}function e(){a.call(this)}return H(e,a),e.prototype._subscribe=function(a){var b=new ma(a),c=[b,this];return $.scheduleRequired()?$.schedule(c,d):d(null,c),b},e.prototype.subscribeCore=z,e}(ka),function(a){function b(b){a.call(this),this.observer=b,this.m=new P}H(b,a);var d=b.prototype;return d.next=function(a){var b=B(this.observer.onNext).call(this.observer,a);b===A&&(this.dispose(),c(b.e))},d.error=function(a){var b=B(this.observer.onError).call(this.observer,a);this.dispose(),b===A&&c(b.e)},d.completed=function(){var a=B(this.observer.onCompleted).call(this.observer);this.dispose(),a===A&&c(a.e)},d.setDisposable=function(a){this.m.setDisposable(a)},d.getDisposable=function(){return this.m.getDisposable()},d.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(ia));ka.create=function(a,b){return new la(a,b)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?(r.Rx=s,define(function(){return s})):l&&o?p?(o.exports=s).Rx=s:l.Rx=s:r.Rx=s;var na=h()}).call(this);
(function(a){function b(a){return a&&a.Object===Object?a:null}function c(a){return function(){try{return a.apply(this,arguments)}catch(b){return C.e=b,C}}}function d(a){throw a}function e(a,b){if(E&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(I)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+I+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];g(f)||h(f)||!f||c.push(f)}return c.join("\n")}function g(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===G&&d>=H&&pa>=d}function h(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function i(){if(E)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return G=d[0],d[1]}}function j(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function k(a,b){this.id=a,this.value=b}var l={"function":!0,object:!0},m=l[typeof exports]&&exports&&!exports.nodeType?exports:null,n=l[typeof module]&&module&&!module.nodeType?module:null,o=b(m&&n&&"object"==typeof global&&global),p=b(l[typeof self]&&self),q=b(l[typeof window]&&window),r=n&&n.exports===m?m:null,s=b(l[typeof this]&&this),t=o||q!==(s&&s.window)&&q||p||s||Function("return this")(),u={internals:{},config:{Promise:t.Promise},helpers:{}},v=u.helpers.noop=function(){},w=u.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}(),x=u.helpers.defaultError=function(a){throw a},y=(u.helpers.isPromise=function(a){return!!a&&!isFunction(a.subscribe)&&isFunction(a.then)},u.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0});isFunction=u.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==toString.call(a)}),a}();var z=u.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};z.prototype=Error.prototype;var A=u.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};A.prototype=Error.prototype;var B=u.helpers.notImplemented=function(){throw new z},C=(u.helpers.notSupported=function(){throw new A},{e:{}}),D=u.internals.tryCatch=function(a){if(!isFunction(a))throw new TypeError("fn must be a function");return c(a)};u.config.longStackSupport=!1;var E=!1,F=D(function(){throw new Error})();E=!!F.e&&!!F.e.stack;var G,H=i(),I="From previous event:",J=({}.hasOwnProperty,Array.prototype.slice,u.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),K=(u.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},u.internals.addRef=function(a,b){return new na(function(c){return new T(b.getDisposable(),a.subscribe(c))})},u.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];this.disposables=c,this.isDisposed=!1,this.length=c.length}),L=K.prototype;L.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},L.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},L.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var M=u.Disposable=function(a){this.isDisposed=!1,this.action=a||v};M.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var N=M.create=function(a){return new M(a)},O=M.empty={dispose:v},P=M.isDisposable=function(a){return a&&isFunction(a.dispose)},Q=(M.checkDisposed=function(a){if(a.isDisposed)throw new ObjectDisposedError},M._fixup=function(a){return P(a)?a:O}),R=u.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};R.prototype.getDisposable=function(){return this.current},R.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},R.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var S=u.SerialDisposable=function(){this.isDisposed=!1,this.current=null};S.prototype.getDisposable=function(){return this.current},S.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},S.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var T=u.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};T.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var U=u.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};U.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var V=u.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||y,this.disposable=new R};V.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},V.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},V.prototype.isCancelled=function(){return this.disposable.isDisposed},V.prototype.invokeCore=function(){return Q(this.action(this.scheduler,this.state))};var W=u.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new z},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new z},a.now=w,a.prototype.now=w,a.normalize=function(a){return 0>a&&(a=0),a},a}(),X=W.normalize;W.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),O}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new K;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),O}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new K;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(W.prototype),function(a){W.prototype.schedulePeriodic=function(a,b,c){if("undefined"==typeof t.setInterval)throw new A;b=X(b);var d=a,e=t.setInterval(function(){d=c(d)},b);return N(function(){t.clearInterval(e)})}}(W.prototype);var Y,Z,$=(u.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new R;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a.bind(this))),b},b}(),function(a){function b(){a.call(this)}return J(b,a),b.prototype.schedule=function(a,b){return Q(b(this,a))},b}(W)),_=(W.immediate=new $,function(a){function b(){for(;e.length>0;){var a=e.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var e;return J(c,a),c.prototype.schedule=function(a,c){var f=new V(this,a,c,this.now());if(e)e.enqueue(f);else{e=new fa(4),e.enqueue(f);var g=D(b)();e=null,g===C&&d(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!e},c}(W)),aa=W.currentThread=new _,ba=function(){var a,b=v;if(t.setTimeout)a=t.setTimeout,b=t.clearTimeout;else{if(!t.WScript)throw new A;a=function(a,b){t.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),ca=ba.setTimeout,da=ba.clearTimeout;!function(){function a(b){if(f)ca(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var g=D(c)();Z(b),f=!1,g===C&&d(g.e)}}}function b(){if(!t.postMessage||t.importScripts)return!1;var a=!1,b=t.onmessage;return t.onmessage=function(){a=!0},t.postMessage("","*"),t.onmessage=b,a}var c=1,e={},f=!1;Z=function(a){delete e[a]};var g=new RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=o&&r&&o.setImmediate)&&!g.test(h)&&h;if(isFunction(h))Y=function(b){var d=c++;return e[d]=b,h(function(){a(d)}),d};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Y=function(b){var d=c++;return e[d]=b,process.nextTick(function(){a(d)}),d};else if(b()){var i="ms.rx.schedule"+Math.random(),j=function(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))};t.addEventListener("message",j,!1),Y=function(a){var b=c++;return e[b]=a,t.postMessage(i+currentId,"*"),b}}else if(t.MessageChannel){var k=new t.MessageChannel;k.port1.onmessage=function(b){a(b.data)},Y=function(a){var b=c++;return e[b]=a,k.port2.postMessage(b),b}}else Y="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(b){var d=t.document.createElement("script"),f=c++;return e[f]=b,d.onreadystatechange=function(){a(f),d.onreadystatechange=null,d.parentNode.removeChild(d),d=null},t.document.documentElement.appendChild(d),f}:function(b){var d=c++;return e[d]=b,ca(function(){a(d)},0),d}}();var ea=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){!a.isDisposed&&a.setDisposable(M._fixup(b(c,d)))}}function d(a,b){this._id=b,this._method=a,this.isDisposed=!1}return J(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._method.call(null,this._id))},b.prototype.schedule=function(a,b){var e=new R,f=Y(c(e,b,this,a));return new T(e,new d(Z,f))},b.prototype._scheduleFuture=function(a,b,e){if(0===b)return this.schedule(a,e);var f=new R,g=ca(c(f,e,this,a),b);return new T(f,new d(da,g))},b}(W);W["default"]=W.async=new ea;k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var fa=u.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},ga=fa.prototype;ga.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},ga.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},ga.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},ga.peek=function(){return this.items[0].value},ga.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},ga.dequeue=function(){var a=this.peek();return this.removeAt(0),a},ga.enqueue=function(a){var b=this.length++;this.items[b]=new k(fa.count++,a),this.percolate(b)},ga.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},fa.count=0;var ha,ia=u.Observer=function(){},ja=ia.create=function(a,b,c){return a||(a=v),b||(b=x),c||(c=v),new la(a,b,c)},ka=u.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return J(b,a),b.prototype.next=B,b.prototype.error=B,b.prototype.completed=B,b.prototype.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ia),la=u.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return J(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(ka),ma=u.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){e(b,a),d.call(c,b)},b.call(a,c)}}function b(){if(u.config.longStackSupport&&E){var b=this._subscribe,c=D(d)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return ha=b.prototype,b.isObservable=function(a){return a&&isFunction(a.subscribe)},ha.subscribe=ha.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ja(a,b,c))},ha.subscribeOnNext=function(a,b){return this._subscribe(ja("undefined"!=typeof b?function(c){a.call(b,c)}:a))},ha.subscribeOnError=function(a,b){return this._subscribe(ja(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},ha.subscribeOnCompleted=function(a,b){return this._subscribe(ja(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),na=u.AnonymousObservable=function(a){function b(a){return a&&isFunction(a.dispose)?a:isFunction(a)?N(a):O}function c(a,c){var e=c[0],f=c[1],g=D(f.__subscribe).call(f,e);g!==C||e.fail(C.e)||d(C.e),e.setDisposable(b(g))}function e(b,c){this.source=c,this.__subscribe=b,a.call(this)}return J(e,a),e.prototype._subscribe=function(a){var b=new oa(a),d=[b,this];return aa.scheduleRequired()?aa.schedule(d,c):c(null,d),b},e}(ma),oa=(u.ObservableBase=function(a){function b(a){return a&&isFunction(a.dispose)?a:isFunction(a)?N(a):O}function c(a,c){var e=c[0],f=c[1],g=D(f.subscribeCore).call(f,e);g!==C||e.fail(C.e)||d(C.e),e.setDisposable(b(g))}function e(){a.call(this)}return J(e,a),e.prototype._subscribe=function(a){var b=new oa(a),d=[b,this];return aa.scheduleRequired()?aa.schedule(d,c):c(null,d),b},e.prototype.subscribeCore=B,e}(ma),function(a){function b(b){a.call(this),this.observer=b,this.m=new R}J(b,a);var c=b.prototype;return c.next=function(a){var b=D(this.observer.onNext).call(this.observer,a);b===C&&(this.dispose(),d(b.e))},c.error=function(a){var b=D(this.observer.onError).call(this.observer,a);this.dispose(),b===C&&d(b.e)},c.completed=function(){var a=D(this.observer.onCompleted).call(this.observer);this.dispose(),a===C&&d(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(ka));ma.create=function(a,b){return new na(a,b)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?(t.Rx=u,define(function(){return u})):m&&n?r?(n.exports=u).Rx=u:m.Rx=u:t.Rx=u;var pa=i()}).call(this);
//# sourceMappingURL=rx.core.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.core"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx.core")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){var b=[];if(!_(a))return b;$.nonEnumArgs&&a.length&&aa(a)&&(a=slice.call(a));var c=$.enumPrototypes&&"function"==typeof a,d=$.enumErrorProps&&(a===U||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if($.nonEnumShadows&&a!==V){var f=a.constructor,g=-1,h=G;if(a===(f&&f.prototype))var i=a===W?Q:a===U?L:R.call(a),j=Z[i];for(;++g<h;)e=F[g],j&&j[e]||!S.call(a,e)||b.push(e)}return b}function f(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function g(a,b){return f(a,b,e)}function h(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var j=R.call(a),k=R.call(b);if(j==H&&(j=O),k==H&&(k=O),j!=k)return!1;switch(j){case J:case K:return+a==+b;case N:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case P:case Q:return a==String(b)}var l=j==I;if(!l){if(j!=O||!$.nodeClass&&(h(a)||h(b)))return!1;var m=!$.argsObject&&aa(a)?Object:a.constructor,n=!$.argsObject&&aa(b)?Object:b.constructor;if(!(m==n||S.call(a,"constructor")&&S.call(b,"constructor")||isFunction(m)&&m instanceof m&&isFunction(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=i(a[p],r,c,d)))break}}else g(b,function(b,e,f){return S.call(f,e)?(p++,q=S.call(a,e)&&i(a[e],b,c,d)):void 0}),q&&g(a,function(a,b,c){return S.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function j(a){this.predicate=a}function k(a){this.predicate=a}function l(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return q})}(g)}}var m,n=c.Observer,o=c.Observable,p=c.Disposable,q=p.empty,r=p.create,s=c.CompositeDisposable,t=c.SingleAssignmentDisposable,u=c.Scheduler,v=c.internals.ScheduledItem,w=c.internals.SchedulePeriodicRecursive,x=c.internals.PriorityQueue,y=c.internals.inherits,z=c.helpers.notImplemented,A=c.helpers.defaultComparer=function(a,b){return ba(a,b)},B=c.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new NotImplementedError},a.prototype._acceptObservable=function(a,b,c){throw new NotImplementedError},a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return isScheduler(a)||(a=immediateScheduler),new AnonymousObservable(function(c){return a.schedule(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),C=function(a){function b(a){this.value=a,this.kind="N"}return y(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObservable=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(B),D=function(a){function b(a){this.error=a,this.kind="E"}return y(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObservable=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(B),E=function(a){function b(){this.kind="C"}return y(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObservable=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(B),F=(B.createOnNext=function(a){return new C(a)},B.createOnError=function(a){return new D(a)},B.createOnCompleted=function(){return new E},["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]),G=F.length,H="[object Arguments]",I="[object Array]",J="[object Boolean]",K="[object Date]",L="[object Error]",M="[object Function]",N="[object Number]",O="[object Object]",P="[object RegExp]",Q="[object String]",R=Object.prototype.toString,S=Object.prototype.hasOwnProperty,T=R.call(arguments)==H,U=Error.prototype,V=Object.prototype,W=String.prototype,X=V.propertyIsEnumerable;try{m=!(R.call(document)==O&&!({toString:0}+""))}catch(Y){m=!0}var Z={};Z[I]=Z[K]=Z[N]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Z[J]=Z[Q]={constructor:!0,toString:!0,valueOf:!0},Z[L]=Z[M]=Z[P]={constructor:!0,toString:!0},Z[O]={constructor:!0};var $={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);$.enumErrorProps=X.call(U,"message")||X.call(U,"name"),$.enumPrototypes=X.call(a,"prototype"),$.nonEnumArgs=0!=c,$.nonEnumShadows=!/valueOf/.test(b)}(1);var _=c.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},aa=function(a){return a&&"object"==typeof a?R.call(a)==H:!1};T||(aa=function(a){return a&&"object"==typeof a?S.call(a,"callee"):!1});var ba=c.internals.isEqual=function(a,b){return i(a,b,[],[])},w=c.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new t;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a.bind(this))),b},b}(),ca=c.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new x(1024),a.call(this)}y(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=z,c.toAbsoluteTime=z,c.toRelativeTime=z,c.schedulePeriodic=function(a,b,c){var d=new w(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ArgumentOutOfRangeError;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ArgumentOutOfRangeError;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ArgumentOutOfRangeError;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new v(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},b}(u);j.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},k.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.error)};var da=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new ea(a,new j(b)):new ea(a,B.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new ea(a,new k(b)):new ea(a,B.createOnError(b))},onCompleted:function(a){return new ea(a,B.createOnCompleted())},subscribe:function(a,b){return new fa(a,b)}},ea=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||A};ea.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},ea.prototype.toString=function(){return this.value.toString()+"@"+this.time};var fa=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};fa.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},fa.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var ga=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};ga.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var ha=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}y(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new ea(this.scheduler.clock,B.createOnNext(a)))},c.onError=function(a){this.messages.push(new ea(this.scheduler.clock,B.createOnError(a)))},c.onCompleted=function(){this.messages.push(new ea(this.scheduler.clock,B.createOnCompleted()))},b}(n);l.prototype.then=function(a,b){var e=this;this.subscriptions.push(new fa(this.scheduler.clock));var f,g=this.subscriptions.length-1,h=c.Observer.create(function(b){var i=a(b);if(i&&"function"==typeof i.then)f=i;else{var j=e.scheduler.clock;f=new l(e.scheduler,[c.ReactiveTest.onNext(j,d),c.ReactiveTest.onCompleted(j)])}var k=e.observers.indexOf(h);e.observers.splice(k,1),e.subscriptions[g]=new fa(e.subscriptions[g].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(h);e.observers.splice(c,1),e.subscriptions[g]=new fa(e.subscriptions[g].subscribe,e.scheduler.clock)});return this.observers.push(h),f||new l(this.scheduler,this.messages)};var ia=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return q})}(e)}return y(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new fa(this.scheduler.clock));var c=this.subscriptions.length-1;return r(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new fa(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(o),ja=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return y(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new fa(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new s,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),q}))}(c);return r(function(){d.subscriptions[e]=new fa(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(o);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return y(d,a),d.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},d.prototype.toRelativeTime=function(a){return a},d.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=da.created),null==b.subscribed&&(b.subscribed=da.subscribed),null==b.disposed&&(b.disposed=da.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),q}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),q}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),q}),this.start(),e},d.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ia(this,a)},d.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ja(this,a)},d.prototype.createResolvedPromise=function(a,b){return new l(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new l(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new ha(this)},d}(ca),c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx.core"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx.core")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){var b=[];if(!_(a))return b;$.nonEnumArgs&&a.length&&aa(a)&&(a=slice.call(a));var c=$.enumPrototypes&&"function"==typeof a,d=$.enumErrorProps&&(a===U||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if($.nonEnumShadows&&a!==V){var f=a.constructor,g=-1,h=G;if(a===(f&&f.prototype))var i=a===W?Q:a===U?L:R.call(a),j=Z[i];for(;++g<h;)e=F[g],j&&j[e]||!S.call(a,e)||b.push(e)}return b}function f(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function g(a,b){return f(a,b,e)}function h(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var j=R.call(a),k=R.call(b);if(j==H&&(j=O),k==H&&(k=O),j!=k)return!1;switch(j){case J:case K:return+a==+b;case N:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case P:case Q:return a==String(b)}var l=j==I;if(!l){if(j!=O||!$.nodeClass&&(h(a)||h(b)))return!1;var m=!$.argsObject&&aa(a)?Object:a.constructor,n=!$.argsObject&&aa(b)?Object:b.constructor;if(!(m==n||S.call(a,"constructor")&&S.call(b,"constructor")||isFunction(m)&&m instanceof m&&isFunction(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=i(a[p],r,c,d)))break}}else g(b,function(b,e,f){return S.call(f,e)?(p++,q=S.call(a,e)&&i(a[e],b,c,d)):void 0}),q&&g(a,function(a,b,c){return S.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function j(a){this.predicate=a}function k(a){this.predicate=a}function l(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return q})}(g)}}var m,n=c.Observer,o=c.Observable,p=c.Disposable,q=p.empty,r=p.create,s=c.CompositeDisposable,t=c.SingleAssignmentDisposable,u=c.Scheduler,v=c.internals.ScheduledItem,w=c.internals.SchedulePeriodicRecursive,x=c.internals.PriorityQueue,y=c.internals.inherits,z=c.helpers.notImplemented,A=c.helpers.defaultComparer=function(a,b){return ba(a,b)},B=c.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new NotImplementedError},a.prototype._acceptObservable=function(a,b,c){throw new NotImplementedError},a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return isScheduler(a)||(a=immediateScheduler),new AnonymousObservable(function(c){return a.schedule(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),C=function(a){function b(a){this.value=a,this.kind="N"}return y(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObservable=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(B),D=function(a){function b(a){this.error=a,this.kind="E"}return y(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObservable=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(B),E=function(a){function b(){this.kind="C"}return y(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObservable=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(B),F=(B.createOnNext=function(a){return new C(a)},B.createOnError=function(a){return new D(a)},B.createOnCompleted=function(){return new E},["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]),G=F.length,H="[object Arguments]",I="[object Array]",J="[object Boolean]",K="[object Date]",L="[object Error]",M="[object Function]",N="[object Number]",O="[object Object]",P="[object RegExp]",Q="[object String]",R=Object.prototype.toString,S=Object.prototype.hasOwnProperty,T=R.call(arguments)==H,U=Error.prototype,V=Object.prototype,W=String.prototype,X=V.propertyIsEnumerable;try{m=!(R.call(document)==O&&!({toString:0}+""))}catch(Y){m=!0}var Z={};Z[I]=Z[K]=Z[N]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Z[J]=Z[Q]={constructor:!0,toString:!0,valueOf:!0},Z[L]=Z[M]=Z[P]={constructor:!0,toString:!0},Z[O]={constructor:!0};var $={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);$.enumErrorProps=X.call(U,"message")||X.call(U,"name"),$.enumPrototypes=X.call(a,"prototype"),$.nonEnumArgs=0!=c,$.nonEnumShadows=!/valueOf/.test(b)}(1);var _=c.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},aa=function(a){return a&&"object"==typeof a?R.call(a)==H:!1};T||(aa=function(a){return a&&"object"==typeof a?S.call(a,"callee"):!1});var ba=c.internals.isEqual=function(a,b){return i(a,b,[],[])},w=c.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new t;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a.bind(this))),b},b}(),ca=c.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new x(1024),a.call(this)}y(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=z,c.toAbsoluteTime=z,c.toRelativeTime=z,c.schedulePeriodic=function(a,b,c){var d=new w(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ArgumentOutOfRangeError;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ArgumentOutOfRangeError;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ArgumentOutOfRangeError;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new v(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},b}(u);j.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},k.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.error)};var da=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new ea(a,new j(b)):new ea(a,B.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new ea(a,new k(b)):new ea(a,B.createOnError(b))},onCompleted:function(a){return new ea(a,B.createOnCompleted())},subscribe:function(a,b){return new fa(a,b)}},ea=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||A};ea.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},ea.prototype.toString=function(){return this.value.toString()+"@"+this.time};var fa=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};fa.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},fa.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var ga=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};ga.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var ha=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}y(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new ea(this.scheduler.clock,B.createOnNext(a)))},c.onError=function(a){this.messages.push(new ea(this.scheduler.clock,B.createOnError(a)))},c.onCompleted=function(){this.messages.push(new ea(this.scheduler.clock,B.createOnCompleted()))},b}(n);l.prototype.then=function(a,b){var e=this;this.subscriptions.push(new fa(this.scheduler.clock));var f,g=this.subscriptions.length-1,h=c.Observer.create(function(b){var i=a(b);if(i&&"function"==typeof i.then)f=i;else{var j=e.scheduler.clock;f=new l(e.scheduler,[c.ReactiveTest.onNext(j,d),c.ReactiveTest.onCompleted(j)])}var k=e.observers.indexOf(h);e.observers.splice(k,1),e.subscriptions[g]=new fa(e.subscriptions[g].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(h);e.observers.splice(c,1),e.subscriptions[g]=new fa(e.subscriptions[g].subscribe,e.scheduler.clock)});return this.observers.push(h),f||new l(this.scheduler,this.messages)};var ia=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return q})}(e)}return y(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new fa(this.scheduler.clock));var c=this.subscriptions.length-1;return r(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new fa(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(o),ja=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return y(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new fa(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new s,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),q}))}(c);return r(function(){d.subscriptions[e]=new fa(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(o);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return y(d,a),d.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},d.prototype.toRelativeTime=function(a){return a},d.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=da.created),null==b.subscribed&&(b.subscribed=da.subscribed),null==b.disposed&&(b.disposed=da.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),q}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),q}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),q}),this.start(),e},d.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ia(this,a)},d.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ja(this,a)},d.prototype.createResolvedPromise=function(a,b){return new l(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new l(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new ha(this)},d}(ca),c});
//# sourceMappingURL=rx.core.testing.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function f(a){return function(){try{return a.apply(this,arguments)}catch(b){return H.e=b,H}}}function g(a,b){return new K(a,b)}var h=c.Observable,i=h.prototype,j=c.AnonymousObservable,k=c.FlatMapObservable,l=h.concat,m=h.defer,n=h.empty,o=c.Disposable.empty,p=c.CompositeDisposable,q=c.BinaryDisposable,r=c.SerialDisposable,s=c.SingleAssignmentDisposable,t=c.internals.Enumerable,u=t.of,v=c.Scheduler.immediate,w=c.Scheduler.currentThread,x=c.AsyncSubject,y=c.Observer,z=c.internals.inherits,A=c.internals.addProperties,B=c.helpers,C=B.noop,D=B.isPromise,E=B.isFunction,F=(c.helpers.isIterable,c.helpers.isArrayLike,c.Scheduler.isScheduler),G=h.fromPromise,H={e:{}},I=c.internals.tryCatch=function(a){if(!E(a))throw new TypeError("fn must be a function");return f(a)},J="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(J="@@iterator");c.doneEnumerator={done:!0,value:d},c.helpers.isIterable=function(a){return a[J]!==d},c.helpers.isArrayLike=function(a){return a&&a.length!==d};c.helpers.iterator=J;var K=function(a){function b(a,b){this.c=a,this.s=b}return z(b,a),b.prototype[J]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(t);i.letBind=i.let=function(a){return a(this)},h["if"]=function(a,b,c){return m(function(){return c||(c=n()),D(b)&&(b=G(b)),D(c)&&(c=G(c)),"function"==typeof c.now&&(c=n(c)),a()?b:c})},h["for"]=h.forIn=function(a,b,c){return u(a,b,c).concat()};var L=h["while"]=h.whileDo=function(a,b){return D(b)&&(b=G(b)),g(a,b).concat()};i.doWhile=function(a){return l([this,L(a,this)])},h["case"]=function(a,b,c){return m(function(){D(c)&&(c=G(c)),c||(c=n()),F(c)&&(c=n(c));var d=b[a()];return D(d)&&(d=G(d)),d||c})},i.expand=function(a,b){F(b)||(b=v);var c=this;return new j(function(d){var e=[],f=new r,g=new p(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(null,function(b,c){var f;if(!(e.length>0))return void(i=!1);f=e.shift();var k=new s;g.add(k),k.setDisposable(f.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},function(a){d.onError(a)},function(){g.remove(k),h--,0===h&&d.onCompleted()})),c()}))};return e.push(c),h++,j(),g},this)},h.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new j(function(b){var c=a.length;if(0===c)return b.onCompleted(),o;for(var d=new p,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];D(j)&&(j=G(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},i.forkJoin=function(a,b){var c=this;return new j(function(d){var f,g,h=!1,i=!1,j=!1,k=!1,l=new s,m=new s;return D(a)&&(a=G(a)),l.setDisposable(c.subscribe(function(a){j=!0,f=a},function(a){m.dispose(),d.onError(a)},function(){if(h=!0,i)if(j)if(k){var a=I(b)(f,g);if(a===H)return d.onError(e);d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),m.setDisposable(a.subscribe(function(a){k=!0,g=a},function(a){l.dispose(),d.onError(a)},function(){if(i=!0,h)if(j)if(k){var a=I(b)(f,g);if(a===H)return d.onError(a.e);d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new q(l,m)},c)},i.manySelect=i.extend=function(a,b){F(b)||(b=v);var c=this;return m(function(){var d;return c.map(function(a){var b=new M(a);return d&&d.onNext(a),d=b,b}).tap(C,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var M=function(a){function b(b){a.call(this),this.head=b,this.tail=new x}return z(b,a),A(b.prototype,y,{_subscribe:function(a){var b=new p;return b.add(w.schedule(this,function(c,d){a.onNext(d.head),b.add(d.tail.mergeAll().subscribe(a))})),b},onCompleted:function(){this.onNext(h.empty())},onError:function(a){this.onNext(h["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),b}(h);return i.switchFirst=function(){var a=this;return new j(function(b){var c=!1,d=!1,e=new s,f=new p;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,D(a)&&(a=G(a));var e=new s;f.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},function(a){b.onError(a)},function(){d=!0,!c&&1===f.length&&b.onCompleted()})),f},this)},i.flatMapFirst=i.selectManyFirst=function(a,b,c){return new k(this,a,b,c).switchFirst()},c.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new k(this,b,c,d).merge(a)},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function f(a){return function(){try{return a.apply(this,arguments)}catch(b){return H.e=b,H}}}function g(a,b){return new K(a,b)}var h=c.Observable,i=h.prototype,j=c.AnonymousObservable,k=c.FlatMapObservable,l=h.concat,m=h.defer,n=h.empty,o=c.Disposable.empty,p=c.CompositeDisposable,q=c.BinaryDisposable,r=c.SerialDisposable,s=c.SingleAssignmentDisposable,t=c.internals.Enumerable,u=t.of,v=c.Scheduler.immediate,w=c.Scheduler.currentThread,x=c.AsyncSubject,y=c.Observer,z=c.internals.inherits,A=c.internals.addProperties,B=c.helpers,C=B.noop,D=B.isPromise,E=B.isFunction,F=(c.helpers.isIterable,c.helpers.isArrayLike,c.Scheduler.isScheduler),G=h.fromPromise,H={e:{}},I=c.internals.tryCatch=function(a){if(!E(a))throw new TypeError("fn must be a function");return f(a)},J="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(J="@@iterator");c.doneEnumerator={done:!0,value:d},c.helpers.isIterable=function(a){return a[J]!==d},c.helpers.isArrayLike=function(a){return a&&a.length!==d};c.helpers.iterator=J;var K=function(a){function b(a,b){this.c=a,this.s=b}return z(b,a),b.prototype[J]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(t);i.letBind=i.let=function(a){return a(this)},h["if"]=function(a,b,c){return m(function(){return c||(c=n()),D(b)&&(b=G(b)),D(c)&&(c=G(c)),"function"==typeof c.now&&(c=n(c)),a()?b:c})},h["for"]=h.forIn=function(a,b,c){return u(a,b,c).concat()};var L=h["while"]=h.whileDo=function(a,b){return D(b)&&(b=G(b)),g(a,b).concat()};i.doWhile=function(a){return l([this,L(a,this)])},h["case"]=function(a,b,c){return m(function(){D(c)&&(c=G(c)),c||(c=n()),F(c)&&(c=n(c));var d=b[a()];return D(d)&&(d=G(d)),d||c})},i.expand=function(a,b){F(b)||(b=v);var c=this;return new j(function(d){var e=[],f=new r,g=new p(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(null,function(b,c){var f;if(!(e.length>0))return void(i=!1);f=e.shift();var k=new s;g.add(k),k.setDisposable(f.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},function(a){d.onError(a)},function(){g.remove(k),h--,0===h&&d.onCompleted()})),c()}))};return e.push(c),h++,j(),g},this)},h.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new j(function(b){var c=a.length;if(0===c)return b.onCompleted(),o;for(var d=new p,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];D(j)&&(j=G(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},i.forkJoin=function(a,b){var c=this;return new j(function(d){var f,g,h=!1,i=!1,j=!1,k=!1,l=new s,m=new s;return D(a)&&(a=G(a)),l.setDisposable(c.subscribe(function(a){j=!0,f=a},function(a){m.dispose(),d.onError(a)},function(){if(h=!0,i)if(j)if(k){var a=I(b)(f,g);if(a===H)return d.onError(e);d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),m.setDisposable(a.subscribe(function(a){k=!0,g=a},function(a){l.dispose(),d.onError(a)},function(){if(i=!0,h)if(j)if(k){var a=I(b)(f,g);if(a===H)return d.onError(a.e);d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new q(l,m)},c)},i.manySelect=i.extend=function(a,b){F(b)||(b=v);var c=this;return m(function(){var d;return c.map(function(a){var b=new M(a);return d&&d.onNext(a),d=b,b}).tap(C,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var M=function(a){function b(b){a.call(this),this.head=b,this.tail=new x}return z(b,a),A(b.prototype,y,{_subscribe:function(a){var b=new p;return b.add(w.schedule(this,function(c,d){a.onNext(d.head),b.add(d.tail.mergeAll().subscribe(a))})),b},onCompleted:function(){this.onNext(h.empty())},onError:function(a){this.onNext(h["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),b}(h);return i.switchFirst=function(){var a=this;return new j(function(b){var c=!1,d=!1,e=new s,f=new p;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,D(a)&&(a=G(a));var e=new s;f.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},function(a){b.onError(a)},function(){d=!0,!c&&1===f.length&&b.onCompleted()})),f},this)},i.flatMapFirst=i.selectManyFirst=function(a,b,c){return new k(this,a,b,c).switchFirst()},c.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new k(this,b,c,d).merge(a)},c});
//# sourceMappingURL=rx.experimental.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){this.patterns=a}function f(a,b){this.expression=a,this.selector=b}function g(a,b,c){var d=a.get(b);if(!d){var e=new t(b,c);return a.set(b,e),e}return d}function h(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new s;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}var i=c.Observable,j=i.prototype,k=c.AnonymousObservable,l=i.throwError,m=c.Observer.create,n=c.SingleAssignmentDisposable,o=c.CompositeDisposable,p=c.internals.AbstractObserver,q=c.helpers.noop,r=c.internals.inherits,s=a.Map||function(){function a(){this.size=0,this._values=[],this._keys=[]}return a.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1===b?d:this._values[b]},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},a.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},a}();e.prototype.and=function(a){return new e(this.patterns.concat(a))},e.prototype.thenDo=function(a){return new f(this,a)},f.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,i=this.expression.patterns.length;i>f;f++)e.push(g(a,this.expression.patterns[f],b.onError.bind(b)));var j=new h(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(j);c(j)});for(f=0,i=e.length;i>f;f++)e[f].addActivePlan(j);return j},h.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},h.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var t=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new n,this.isDisposed=!1}r(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.error);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=q,c.completed=q,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(p);return j.and=function(a){return new e([this,a])},j.thenDo=function(a){return new e([this]).thenDo(a)},i.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new k(function(b){var c=[],d=new s,e=m(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){l(h).subscribe(b)}var i=new o;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){this.patterns=a}function f(a,b){this.expression=a,this.selector=b}function g(a,b,c){var d=a.get(b);if(!d){var e=new t(b,c);return a.set(b,e),e}return d}function h(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new s;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}var i=c.Observable,j=i.prototype,k=c.AnonymousObservable,l=i.throwError,m=c.Observer.create,n=c.SingleAssignmentDisposable,o=c.CompositeDisposable,p=c.internals.AbstractObserver,q=c.helpers.noop,r=c.internals.inherits,s=a.Map||function(){function a(){this.size=0,this._values=[],this._keys=[]}return a.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1===b?d:this._values[b]},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},a.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},a}();e.prototype.and=function(a){return new e(this.patterns.concat(a))},e.prototype.thenDo=function(a){return new f(this,a)},f.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,i=this.expression.patterns.length;i>f;f++)e.push(g(a,this.expression.patterns[f],b.onError.bind(b)));var j=new h(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(j);c(j)});for(f=0,i=e.length;i>f;f++)e[f].addActivePlan(j);return j},h.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},h.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var t=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new n,this.isDisposed=!1}r(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.error);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=q,c.completed=q,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(p);return j.and=function(a){return new e([this,a])},j.thenDo=function(a){return new e([this]).thenDo(a)},i.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new k(function(b){var c=[],d=new s,e=m(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){l(h).subscribe(b)}var i=new o;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})},c});
//# sourceMappingURL=rx.joinpatterns.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -650,3 +653,3 @@ // Because of build optimizers

DefaultIfEmptyObserver.prototype.completed = function () {
!this._f && this._o.onNext(defaultValue);
!this._f && this._o.onNext(this._d);
this._o.onCompleted();

@@ -653,0 +656,0 @@ };

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.lite.compat"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("rx-lite-compat")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return S.e=b,S}}}function f(a){throw a}function g(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function h(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function i(a,b){return a.amb(b)}function j(a){return a.toArray()}function k(a){return a.length>0}function l(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function m(a){this.comparer=a,this.set=[]}var n=c.Observable,o=n.prototype,p=n.never,q=n["throw"],r=c.AnonymousObservable,s=c.ObservableBase,t=c.AnonymousObserver,u=c.Notification.createOnNext,v=c.Notification.createOnError,w=c.Notification.createOnCompleted,x=c.Observer,y=x.create,z=c.internals.AbstractObserver,A=c.Subject,B=c.internals,C=c.helpers,D=B.ScheduledObserver,E=c.SerialDisposable,F=c.SingleAssignmentDisposable,G=(c.CompositeDisposable,c.BinaryDisposable),H=c.RefCountDisposable,I=c.Disposable.empty,J=c.Scheduler.immediate,K=(C.defaultKeySerializer,c.internals.addRef),L=(C.identity,C.isPromise),M=C.isFunction,N=B.inherits,O=B.bindCallback,P=(C.noop,c.Scheduler.isScheduler),Q=n.fromPromise,R=c.ArgumentOutOfRangeError,S={e:{}},T=c.internals.tryCatch=function(a){if(!M(a))throw new TypeError("fn must be a function");return e(a)};g.prototype.dispose=function(){this.scheduler.schedule(this,h)};var U=function(a){function b(b){a.call(this),this._observer=b,this._state=0}N(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=T(this._observer.onNext).call(this._observer,a);this._state=0,b===S&&f(b.e)},c.onError=function(a){this.checkAccess();var b=T(this._observer.onError).call(this._observer,a);this._state=2,b===S&&f(b.e)},c.onCompleted=function(){this.checkAccess();var a=T(this._observer.onCompleted).call(this._observer);this._state=2,a===S&&f(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(x),V=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return N(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(D);x.prototype.checked=function(){return new U(this)},x.notifyOn=function(a){return new V(a,this)},x.fromNotifier=function(a,b){var c=O(a,b,1);return new t(function(a){return c(u(a))},function(a){return c(v(a))},function(){return c(w())})},x.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},x.prototype.asObserver=function(){var a=this;return new t(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})};var W=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new V(this._s,a))},b}(s);o.observeOn=function(a){return new W(this,a)};var X=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new g(a,c.subscribe(e)))}return N(b,a),b.prototype.subscribeCore=function(a){var b=new F,d=new E;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(s);o.subscribeOn=function(a){return new X(this,a)};var Y=function(a){function b(b,c,d,e,f){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,this._first=!0,a.call(this)}function c(a,b){if(a._first)a._first=!1;else if(a._state=T(a._itrFn)(a._state),a._state===S)return a._o.onError(a._state.e);var c=T(a._cndFn)(a._state);if(c===S)return a._o.onError(c.e);if(c){var d=T(a._resFn)(a._state);if(d===S)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return N(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(s);n.generate=function(a,b,c,d,e){return P(e)||(e=currentThreadScheduler),new Y(a,b,c,d,e)};var Z=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){var b=I,c=T(this._resFn)();if(c===S)return new G(q(c.e).subscribe(a),b);c&&(b=c);var d=T(this._obsFn)(c);return d===S?new G(q(d.e).subscribe(a),b):new G(d.subscribe(a),b)},b}(s);n.using=function(a,b){return new Z(a,b)},o.amb=function(a){var b=this;return new r(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new F,j=new F;L(a)&&(a=Q(a));var k=y(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=y(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new G(i,j)})},n.amb=function(){var a,b=p();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=i(b,a[d]);return b},o.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return $([this,a])};var $=n.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new r(function(b){var c=0,d=new E,e=J.scheduleRecursive(null,function(e,f){var g,h;c<a.length?(g=a[c++],L(g)&&(g=Q(g)),h=new F,d.setDisposable(h),h.setDisposable(g.subscribe(b.onNext.bind(b),f,f))):b.onCompleted()});return new G(d,e)})};o.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(j).filter(k)},o.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new R;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new R;return new r(function(d){function e(){var a=new A;i.push(a),d.onNext(K(a,g))}var f=new F,g=new H(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)};var _=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return N(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(z);o.takeLastBuffer=function(a){if(0>a)throw new R;var b=this;return new r(function(c){return b.subscribe(new _(c,a))},b)};var aa=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return N(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(defaultValue),this._o.onCompleted()},b}(z);o.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new r(function(c){return b.subscribe(new aa(c,a))},b)},m.prototype.push=function(a){var b=-1===l(this.set,a,this.comparer);return b&&this.set.push(a),b};var ba=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._keyFn,this._cmpFn))},b}(s),ca=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new m(d),a.call(this)}return N(b,a),b.prototype.next=function(a){var b=a;return M(this._keyFn)&&(b=T(this._keyFn)(a),b===S)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(z);return o.distinct=function(a,b){return b||(b=defaultComparer),new ba(this,a,b)},o.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new r(function(b){return a().subscribe(b)})},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx.lite.compat"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("rx-lite-compat")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return S.e=b,S}}}function f(a){throw a}function g(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function h(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function i(a,b){return a.amb(b)}function j(a){return a.toArray()}function k(a){return a.length>0}function l(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function m(a){this.comparer=a,this.set=[]}var n=c.Observable,o=n.prototype,p=n.never,q=n["throw"],r=c.AnonymousObservable,s=c.ObservableBase,t=c.AnonymousObserver,u=c.Notification.createOnNext,v=c.Notification.createOnError,w=c.Notification.createOnCompleted,x=c.Observer,y=x.create,z=c.internals.AbstractObserver,A=c.Subject,B=c.internals,C=c.helpers,D=B.ScheduledObserver,E=c.SerialDisposable,F=c.SingleAssignmentDisposable,G=(c.CompositeDisposable,c.BinaryDisposable),H=c.RefCountDisposable,I=c.Disposable.empty,J=c.Scheduler.immediate,K=(C.defaultKeySerializer,c.internals.addRef),L=(C.identity,C.isPromise),M=C.isFunction,N=B.inherits,O=B.bindCallback,P=(C.noop,c.Scheduler.isScheduler),Q=n.fromPromise,R=c.ArgumentOutOfRangeError,S={e:{}},T=c.internals.tryCatch=function(a){if(!M(a))throw new TypeError("fn must be a function");return e(a)};g.prototype.dispose=function(){this.scheduler.schedule(this,h)};var U=function(a){function b(b){a.call(this),this._observer=b,this._state=0}N(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=T(this._observer.onNext).call(this._observer,a);this._state=0,b===S&&f(b.e)},c.onError=function(a){this.checkAccess();var b=T(this._observer.onError).call(this._observer,a);this._state=2,b===S&&f(b.e)},c.onCompleted=function(){this.checkAccess();var a=T(this._observer.onCompleted).call(this._observer);this._state=2,a===S&&f(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(x),V=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return N(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(D);x.prototype.checked=function(){return new U(this)},x.notifyOn=function(a){return new V(a,this)},x.fromNotifier=function(a,b){var c=O(a,b,1);return new t(function(a){return c(u(a))},function(a){return c(v(a))},function(){return c(w())})},x.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},x.prototype.asObserver=function(){var a=this;return new t(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})};var W=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new V(this._s,a))},b}(s);o.observeOn=function(a){return new W(this,a)};var X=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new g(a,c.subscribe(e)))}return N(b,a),b.prototype.subscribeCore=function(a){var b=new F,d=new E;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(s);o.subscribeOn=function(a){return new X(this,a)};var Y=function(a){function b(b,c,d,e,f){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,this._first=!0,a.call(this)}function c(a,b){if(a._first)a._first=!1;else if(a._state=T(a._itrFn)(a._state),a._state===S)return a._o.onError(a._state.e);var c=T(a._cndFn)(a._state);if(c===S)return a._o.onError(c.e);if(c){var d=T(a._resFn)(a._state);if(d===S)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return N(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(s);n.generate=function(a,b,c,d,e){return P(e)||(e=currentThreadScheduler),new Y(a,b,c,d,e)};var Z=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){var b=I,c=T(this._resFn)();if(c===S)return new G(q(c.e).subscribe(a),b);c&&(b=c);var d=T(this._obsFn)(c);return d===S?new G(q(d.e).subscribe(a),b):new G(d.subscribe(a),b)},b}(s);n.using=function(a,b){return new Z(a,b)},o.amb=function(a){var b=this;return new r(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new F,j=new F;L(a)&&(a=Q(a));var k=y(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=y(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new G(i,j)})},n.amb=function(){var a,b=p();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=i(b,a[d]);return b},o.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return $([this,a])};var $=n.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new r(function(b){var c=0,d=new E,e=J.scheduleRecursive(null,function(e,f){var g,h;c<a.length?(g=a[c++],L(g)&&(g=Q(g)),h=new F,d.setDisposable(h),h.setDisposable(g.subscribe(b.onNext.bind(b),f,f))):b.onCompleted()});return new G(d,e)})};o.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(j).filter(k)},o.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new R;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new R;return new r(function(d){function e(){var a=new A;i.push(a),d.onNext(K(a,g))}var f=new F,g=new H(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)};var _=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return N(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(z);o.takeLastBuffer=function(a){if(0>a)throw new R;var b=this;return new r(function(c){return b.subscribe(new _(c,a))},b)};var aa=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return N(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(this._d),this._o.onCompleted()},b}(z);o.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new r(function(c){return b.subscribe(new aa(c,a))},b)},m.prototype.push=function(a){var b=-1===l(this.set,a,this.comparer);return b&&this.set.push(a),b};var ba=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._keyFn,this._cmpFn))},b}(s),ca=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new m(d),a.call(this)}return N(b,a),b.prototype.next=function(a){var b=a;return M(this._keyFn)&&(b=T(this._keyFn)(a),b===S)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(z);return o.distinct=function(a,b){return b||(b=defaultComparer),new ba(this,a,b)},o.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new r(function(b){return a().subscribe(b)})},c});
//# sourceMappingURL=rx.lite.extras.compat.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -650,3 +653,3 @@ // Because of build optimizers

DefaultIfEmptyObserver.prototype.completed = function () {
!this._f && this._o.onNext(defaultValue);
!this._f && this._o.onNext(this._d);
this._o.onCompleted();

@@ -653,0 +656,0 @@ };

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.lite"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("rx-lite")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return S.e=b,S}}}function f(a){throw a}function g(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function h(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function i(a,b){return a.amb(b)}function j(a){return a.toArray()}function k(a){return a.length>0}function l(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function m(a){this.comparer=a,this.set=[]}var n=c.Observable,o=n.prototype,p=n.never,q=n["throw"],r=c.AnonymousObservable,s=c.ObservableBase,t=c.AnonymousObserver,u=c.Notification.createOnNext,v=c.Notification.createOnError,w=c.Notification.createOnCompleted,x=c.Observer,y=x.create,z=c.internals.AbstractObserver,A=c.Subject,B=c.internals,C=c.helpers,D=B.ScheduledObserver,E=c.SerialDisposable,F=c.SingleAssignmentDisposable,G=(c.CompositeDisposable,c.BinaryDisposable),H=c.RefCountDisposable,I=c.Disposable.empty,J=c.Scheduler.immediate,K=(C.defaultKeySerializer,c.internals.addRef),L=(C.identity,C.isPromise),M=C.isFunction,N=B.inherits,O=B.bindCallback,P=(C.noop,c.Scheduler.isScheduler),Q=n.fromPromise,R=c.ArgumentOutOfRangeError,S={e:{}},T=c.internals.tryCatch=function(a){if(!M(a))throw new TypeError("fn must be a function");return e(a)};g.prototype.dispose=function(){this.scheduler.schedule(this,h)};var U=function(a){function b(b){a.call(this),this._observer=b,this._state=0}N(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=T(this._observer.onNext).call(this._observer,a);this._state=0,b===S&&f(b.e)},c.onError=function(a){this.checkAccess();var b=T(this._observer.onError).call(this._observer,a);this._state=2,b===S&&f(b.e)},c.onCompleted=function(){this.checkAccess();var a=T(this._observer.onCompleted).call(this._observer);this._state=2,a===S&&f(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(x),V=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return N(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(D);x.prototype.checked=function(){return new U(this)},x.notifyOn=function(a){return new V(a,this)},x.fromNotifier=function(a,b){var c=O(a,b,1);return new t(function(a){return c(u(a))},function(a){return c(v(a))},function(){return c(w())})},x.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},x.prototype.asObserver=function(){var a=this;return new t(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})};var W=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new V(this._s,a))},b}(s);o.observeOn=function(a){return new W(this,a)};var X=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new g(a,c.subscribe(e)))}return N(b,a),b.prototype.subscribeCore=function(a){var b=new F,d=new E;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(s);o.subscribeOn=function(a){return new X(this,a)};var Y=function(a){function b(b,c,d,e,f){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,this._first=!0,a.call(this)}function c(a,b){if(a._first)a._first=!1;else if(a._state=T(a._itrFn)(a._state),a._state===S)return a._o.onError(a._state.e);var c=T(a._cndFn)(a._state);if(c===S)return a._o.onError(c.e);if(c){var d=T(a._resFn)(a._state);if(d===S)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return N(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(s);n.generate=function(a,b,c,d,e){return P(e)||(e=currentThreadScheduler),new Y(a,b,c,d,e)};var Z=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){var b=I,c=T(this._resFn)();if(c===S)return new G(q(c.e).subscribe(a),b);c&&(b=c);var d=T(this._obsFn)(c);return d===S?new G(q(d.e).subscribe(a),b):new G(d.subscribe(a),b)},b}(s);n.using=function(a,b){return new Z(a,b)},o.amb=function(a){var b=this;return new r(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new F,j=new F;L(a)&&(a=Q(a));var k=y(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=y(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new G(i,j)})},n.amb=function(){var a,b=p();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=i(b,a[d]);return b},o.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return $([this,a])};var $=n.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new r(function(b){var c=0,d=new E,e=J.scheduleRecursive(null,function(e,f){var g,h;c<a.length?(g=a[c++],L(g)&&(g=Q(g)),h=new F,d.setDisposable(h),h.setDisposable(g.subscribe(b.onNext.bind(b),f,f))):b.onCompleted()});return new G(d,e)})};o.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(j).filter(k)},o.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new R;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new R;return new r(function(d){function e(){var a=new A;i.push(a),d.onNext(K(a,g))}var f=new F,g=new H(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)};var _=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return N(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(z);o.takeLastBuffer=function(a){if(0>a)throw new R;var b=this;return new r(function(c){return b.subscribe(new _(c,a))},b)};var aa=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return N(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(defaultValue),this._o.onCompleted()},b}(z);o.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new r(function(c){return b.subscribe(new aa(c,a))},b)},m.prototype.push=function(a){var b=-1===l(this.set,a,this.comparer);return b&&this.set.push(a),b};var ba=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._keyFn,this._cmpFn))},b}(s),ca=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new m(d),a.call(this)}return N(b,a),b.prototype.next=function(a){var b=a;return M(this._keyFn)&&(b=T(this._keyFn)(a),b===S)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(z);return o.distinct=function(a,b){return b||(b=defaultComparer),new ba(this,a,b)},o.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new r(function(b){return a().subscribe(b)})},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx.lite"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("rx-lite")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return S.e=b,S}}}function f(a){throw a}function g(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function h(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function i(a,b){return a.amb(b)}function j(a){return a.toArray()}function k(a){return a.length>0}function l(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function m(a){this.comparer=a,this.set=[]}var n=c.Observable,o=n.prototype,p=n.never,q=n["throw"],r=c.AnonymousObservable,s=c.ObservableBase,t=c.AnonymousObserver,u=c.Notification.createOnNext,v=c.Notification.createOnError,w=c.Notification.createOnCompleted,x=c.Observer,y=x.create,z=c.internals.AbstractObserver,A=c.Subject,B=c.internals,C=c.helpers,D=B.ScheduledObserver,E=c.SerialDisposable,F=c.SingleAssignmentDisposable,G=(c.CompositeDisposable,c.BinaryDisposable),H=c.RefCountDisposable,I=c.Disposable.empty,J=c.Scheduler.immediate,K=(C.defaultKeySerializer,c.internals.addRef),L=(C.identity,C.isPromise),M=C.isFunction,N=B.inherits,O=B.bindCallback,P=(C.noop,c.Scheduler.isScheduler),Q=n.fromPromise,R=c.ArgumentOutOfRangeError,S={e:{}},T=c.internals.tryCatch=function(a){if(!M(a))throw new TypeError("fn must be a function");return e(a)};g.prototype.dispose=function(){this.scheduler.schedule(this,h)};var U=function(a){function b(b){a.call(this),this._observer=b,this._state=0}N(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=T(this._observer.onNext).call(this._observer,a);this._state=0,b===S&&f(b.e)},c.onError=function(a){this.checkAccess();var b=T(this._observer.onError).call(this._observer,a);this._state=2,b===S&&f(b.e)},c.onCompleted=function(){this.checkAccess();var a=T(this._observer.onCompleted).call(this._observer);this._state=2,a===S&&f(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(x),V=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return N(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(D);x.prototype.checked=function(){return new U(this)},x.notifyOn=function(a){return new V(a,this)},x.fromNotifier=function(a,b){var c=O(a,b,1);return new t(function(a){return c(u(a))},function(a){return c(v(a))},function(){return c(w())})},x.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},x.prototype.asObserver=function(){var a=this;return new t(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})};var W=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new V(this._s,a))},b}(s);o.observeOn=function(a){return new W(this,a)};var X=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new g(a,c.subscribe(e)))}return N(b,a),b.prototype.subscribeCore=function(a){var b=new F,d=new E;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(s);o.subscribeOn=function(a){return new X(this,a)};var Y=function(a){function b(b,c,d,e,f){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,this._first=!0,a.call(this)}function c(a,b){if(a._first)a._first=!1;else if(a._state=T(a._itrFn)(a._state),a._state===S)return a._o.onError(a._state.e);var c=T(a._cndFn)(a._state);if(c===S)return a._o.onError(c.e);if(c){var d=T(a._resFn)(a._state);if(d===S)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return N(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(s);n.generate=function(a,b,c,d,e){return P(e)||(e=currentThreadScheduler),new Y(a,b,c,d,e)};var Z=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){var b=I,c=T(this._resFn)();if(c===S)return new G(q(c.e).subscribe(a),b);c&&(b=c);var d=T(this._obsFn)(c);return d===S?new G(q(d.e).subscribe(a),b):new G(d.subscribe(a),b)},b}(s);n.using=function(a,b){return new Z(a,b)},o.amb=function(a){var b=this;return new r(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new F,j=new F;L(a)&&(a=Q(a));var k=y(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=y(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new G(i,j)})},n.amb=function(){var a,b=p();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=i(b,a[d]);return b},o.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return $([this,a])};var $=n.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new r(function(b){var c=0,d=new E,e=J.scheduleRecursive(null,function(e,f){var g,h;c<a.length?(g=a[c++],L(g)&&(g=Q(g)),h=new F,d.setDisposable(h),h.setDisposable(g.subscribe(b.onNext.bind(b),f,f))):b.onCompleted()});return new G(d,e)})};o.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(j).filter(k)},o.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new R;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new R;return new r(function(d){function e(){var a=new A;i.push(a),d.onNext(K(a,g))}var f=new F,g=new H(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)};var _=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return N(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(z);o.takeLastBuffer=function(a){if(0>a)throw new R;var b=this;return new r(function(c){return b.subscribe(new _(c,a))},b)};var aa=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return N(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(this._d),this._o.onCompleted()},b}(z);o.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new r(function(c){return b.subscribe(new aa(c,a))},b)},m.prototype.push=function(a){var b=-1===l(this.set,a,this.comparer);return b&&this.set.push(a),b};var ba=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return N(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._keyFn,this._cmpFn))},b}(s),ca=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new m(d),a.call(this)}return N(b,a),b.prototype.next=function(a){var b=a;return M(this._keyFn)&&(b=T(this._keyFn)(a),b===S)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(z);return o.distinct=function(a,b){return b||(b=defaultComparer),new ba(this,a,b)},o.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new r(function(b){return a().subscribe(b)})},c});
//# sourceMappingURL=rx.lite.extras.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=e.never,i=c.internals.isEqual,j=c.helpers.defaultSubComparer;return f.jortSort=function(){return this.jortSortUntil(h())},f.jortSortUntil=function(a){var b=this;return new g(function(c){var d=[];return b.takeUntil(a).subscribe(d.push.bind(d),c.onError.bind(c),function(){var a=d.slice(0).sort(j);c.onNext(i(d,a)),c.onCompleted()})},b)},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=e.never,i=c.internals.isEqual,j=c.helpers.defaultSubComparer;return f.jortSort=function(){return this.jortSortUntil(h())},f.jortSortUntil=function(a){var b=this;return new g(function(c){var d=[];return b.takeUntil(a).subscribe(d.push.bind(d),c.onError.bind(c),function(){var a=d.slice(0).sort(j);c.onNext(i(d,a)),c.onCompleted()})},b)},c});
//# sourceMappingURL=rx.sorting.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx.virtualtime","exports"],function(b,c){return h.Rx=a(h,c,b),h.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){this.predicate=a}function f(a){this.predicate=a}function g(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return m})}(g)}}var h=c.Observer,i=c.Observable,j=c.Notification,k=c.VirtualTimeScheduler,l=c.Disposable,m=l.empty,n=l.create,o=c.CompositeDisposable,p=c.internals.inherits,q=c.internals.isEqual;e.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},f.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.error)};var r=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new s(a,new e(b)):new s(a,j.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new s(a,new f(b)):new s(a,j.createOnError(b))},onCompleted:function(a){return new s(a,j.createOnCompleted())},subscribe:function(a,b){return new t(a,b)}},s=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||q};s.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},s.prototype.toString=function(){return this.value.toString()+"@"+this.time};var t=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};t.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},t.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var u=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};u.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var v=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}p(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnNext(a)))},c.onError=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnError(a)))},c.onCompleted=function(){this.messages.push(new s(this.scheduler.clock,j.createOnCompleted()))},b}(h);g.prototype.then=function(a,b){var e=this;this.subscriptions.push(new t(this.scheduler.clock));var f,h=this.subscriptions.length-1,i=c.Observer.create(function(b){var j=a(b);if(j&&"function"==typeof j.then)f=j;else{var k=e.scheduler.clock;f=new g(e.scheduler,[c.ReactiveTest.onNext(k,d),c.ReactiveTest.onCompleted(k)])}var l=e.observers.indexOf(i);e.observers.splice(l,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(i);e.observers.splice(c,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)});return this.observers.push(i),f||new g(this.scheduler,this.messages)};var w=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return m})}(e)}return p(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new t(this.scheduler.clock));var c=this.subscriptions.length-1;return n(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new t(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(i),x=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return p(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new t(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new o,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),m}))}(c);return n(function(){d.subscriptions[e]=new t(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(i);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return p(d,a),d.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},d.prototype.toRelativeTime=function(a){return a},d.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=r.created),null==b.subscribed&&(b.subscribed=r.subscribed),null==b.disposed&&(b.disposed=r.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),m}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),m}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),m}),this.start(),e},d.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new w(this,a)},d.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new x(this,a)},d.prototype.createResolvedPromise=function(a,b){return new g(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new g(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new v(this)},d}(k),c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx.virtualtime","exports"],function(b,c){return j.Rx=a(j,c,b),j.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){this.predicate=a}function f(a){this.predicate=a}function g(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return m})}(g)}}var h=c.Observer,i=c.Observable,j=c.Notification,k=c.VirtualTimeScheduler,l=c.Disposable,m=l.empty,n=l.create,o=c.CompositeDisposable,p=c.internals.inherits,q=c.internals.isEqual;e.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},f.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.error)};var r=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new s(a,new e(b)):new s(a,j.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new s(a,new f(b)):new s(a,j.createOnError(b))},onCompleted:function(a){return new s(a,j.createOnCompleted())},subscribe:function(a,b){return new t(a,b)}},s=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||q};s.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},s.prototype.toString=function(){return this.value.toString()+"@"+this.time};var t=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};t.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},t.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var u=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};u.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var v=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}p(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnNext(a)))},c.onError=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnError(a)))},c.onCompleted=function(){this.messages.push(new s(this.scheduler.clock,j.createOnCompleted()))},b}(h);g.prototype.then=function(a,b){var e=this;this.subscriptions.push(new t(this.scheduler.clock));var f,h=this.subscriptions.length-1,i=c.Observer.create(function(b){var j=a(b);if(j&&"function"==typeof j.then)f=j;else{var k=e.scheduler.clock;f=new g(e.scheduler,[c.ReactiveTest.onNext(k,d),c.ReactiveTest.onCompleted(k)])}var l=e.observers.indexOf(i);e.observers.splice(l,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(i);e.observers.splice(c,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)});return this.observers.push(i),f||new g(this.scheduler,this.messages)};var w=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return m})}(e)}return p(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new t(this.scheduler.clock));var c=this.subscriptions.length-1;return n(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new t(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(i),x=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return p(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new t(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new o,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),m}))}(c);return n(function(){d.subscriptions[e]=new t(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(i);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return p(d,a),d.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},d.prototype.toRelativeTime=function(a){return a},d.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=r.created),null==b.subscribed&&(b.subscribed=r.subscribed),null==b.disposed&&(b.disposed=r.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),m}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),m}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),m}),this.start(),e},d.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new w(this,a)},d.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new x(this,a)},d.prototype.createResolvedPromise=function(a,b){return new g(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new g(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new v(this)},d}(k),c});
//# sourceMappingURL=rx.testing.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -111,4 +114,4 @@ // Because of build optimizers

var now = scheduler.now();
d = d + p;
d <= now && (d = now + p);
d = new Date(d.getTime() + p);
d.getTime() <= now && (d = new Date(now + p));
}

@@ -115,0 +118,0 @@ observer.onNext(count);

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return N.e=b,N}}}function f(a,b){return new P(a,b)}function g(a,b,c){return new u(function(d){var e=a,f=H(b);return c.scheduleRecursiveFuture(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,new Date(e))})})}function h(a,b,c){return a===b?new u(function(a){return c.schedulePeriodic(0,b,function(b){return a.onNext(b),b+1})}):w(function(){return g(new Date(c.now()+a),b,c)})}function i(a,b,c){return new u(function(d){var e,f=!1,g=new B,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.error,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new A,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveFuture(null,b,function(a,b){var e,g,k,l;if(null===h){j=!0;do k=null,i.length>0&&i[0].timestamp-c.now()<=0&&(k=i.shift().value),null!==k&&k.accept(d);while(null!==k);l=!1,g=0,i.length>0?(l=!0,g=Math.max(0,i[0].timestamp-c.now())):f=!1,e=h,j=!1,null!==e?d.onError(e):l&&b(null,g)}}))))}),new D(e,g)},a)}function j(a,b,c){return w(function(){return i(a,b-c.now(),c)})}function k(a,b,c){var d,e;return K(b)?e=b:(d=b,e=c),new u(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=O(e)(a);if(c===N)return b.onError(c.e);var d=new A;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new C,h=!1,i=new B;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new D(i,g)},this)}function l(a,b){return new u(function(c){var d,e=!1,f=new B,g=0,h=a.subscribe(function(a){var h=O(b)(a);if(h===N)return c.onError(h.e);J(h)&&(h=M(h)),e=!0,d=a,g++;var i=g,j=new A;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new D(h,f)},a)}function m(a){return a.toArray()}function m(a){return a.toArray()}function n(a,b){return new u(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new A;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new D(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function o(a,b,c,d){return K(b)&&(d=c,c=b,b=x()),d||(d=y(new X)),new u(function(e){function f(a){function b(){return l=c===k}var c=k,f=new A;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(d.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new B,i=new B,j=new A;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=O(c)(a);if(b===N)return e.onError(b.e);f(J(b)?M(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new D(h,i)},a)}function p(a,b,c,d){return L(c)&&(d=c,c=y(new X)),c instanceof Error&&(c=y(c)),L(d)||(d=z),new u(function(e){function f(){var a=g;k.setDisposable(d.scheduleFuture(null,b,function(){j=g===a,j&&(J(c)&&(c=M(c)),i.setDisposable(c.subscribe(e)))}))}var g=0,h=new A,i=new B,j=!1,k=new B;return i.setDisposable(h),f(),h.setDisposable(a.subscribe(function(a){j||(g++,e.onNext(a),f())},function(a){j||(g++,e.onError(a))},function(){j||(g++,e.onCompleted())})),new D(i,k)},a)}var q=c.internals.inherits,r=c.internals.AbstractObserver,s=c.Observable,t=s.prototype,u=c.AnonymousObservable,v=c.ObservableBase,w=s.defer,x=(s.empty,s.never),y=s["throw"],z=(s.fromArray,c.Scheduler["default"]),A=c.SingleAssignmentDisposable,B=c.SerialDisposable,C=c.CompositeDisposable,D=c.BinaryDisposable,E=c.RefCountDisposable,F=c.Subject,G=c.internals.addRef,H=c.Scheduler.normalize,I=c.helpers,J=I.isPromise,K=I.isFunction,L=c.Scheduler.isScheduler,M=s.fromPromise,N={e:{}},O=c.internals.tryCatch=function(a){if(!K(a))throw new TypeError("fn must be a function");return e(a)},P=function(a){function b(b,c){this._dt=b,this._s=c,a.call(this)}function c(a,b){b.onNext(0),b.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return this._s.scheduleFuture(a,this._dt,c)},b}(v),Q=s.interval=function(a,b){return h(a,a,L(b)?b:z)};s.timer=function(a,b,c){var e;return L(c)||(c=z),null!=b&&"number"==typeof b?e=b:L(b)&&(c=b),(a instanceof Date||"number"==typeof a)&&e===d?f(a,c):a instanceof Date&&e!==d?g(a.getTime(),b,c):h(a,e,c)};t.delay=function(){var a=arguments[0];if("number"==typeof a||a instanceof Date){var b=a,c=arguments[1];return L(c)||(c=z),b instanceof Date?j(this,b,c):i(this,b,c)}if(s.isObservable(a)||K(a))return k(this,a,arguments[1]);throw new Error("Invalid arguments")};var R=function(a){function b(b,c,d){L(d)||(d=z),this.source=b,this._dt=c,this._s=d,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){var b=new B;return new D(this.source.subscribe(new S(a,this.source,this._dt,this._s,b)),b)},b}(v),S=function(a){function b(b,c,d,e,f){this._o=b,this._s=c,this._d=d,this._scheduler=e,this._c=f,this._v=null,this._hv=!1,this._id=0,a.call(this)}return q(b,a),b.prototype.next=function(a){this._hv=!0,this._v=a;var b=++this._id,c=new A;this._c.setDisposable(c),c.setDisposable(this._scheduler.scheduleFuture(this,this._d,function(c,d){d._hv&&d._id===b&&d._o.onNext(a),d._hv=!1}))},b.prototype.error=function(a){this._c.dispose(),this._o.onError(a),this._hv=!1,this._id++},b.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},b}(r);t.debounce=function(){if(K(arguments[0]))return l(this,arguments[0]);if("number"==typeof arguments[0])return new R(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},t.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),L(c)||(c=z),"number"==typeof b?d=b:L(b)&&(d=a,c=b),new u(function(b){function f(){var a=new A,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleFuture(null,o,function(){if(g){var a=new F;k.push(a),b.onNext(G(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new B,m=0;return g=new C(l),h=new E(g),k.push(new F),b.onNext(G(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},t.windowWithTimeOrCount=function(a,b,c){var d=this;return L(c)||(c=z),new u(function(e){function f(b){var d=new A;g.setDisposable(d),d.setDisposable(c.scheduleFuture(null,a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new F,e.onNext(G(l,i)),f(a)}}))}var g=new B,h=new C(g),i=new E(h),j=0,k=0,l=new F;return e.onNext(G(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new F,e.onNext(G(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},t.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(m)},t.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(m)};var T=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new U(a,this._s))},b}(v),U=function(a){function b(b,c){this._o=b,this._s=c,this._l=c.now(),a.call(this)}return q(b,a),b.prototype.next=function(a){var b=this._s.now(),c=b-this._l;this._l=b,this._o.onNext({value:a,interval:c})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);t.timeInterval=function(a){return L(a)||(a=z),new T(this,a)};var V=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new W(a,this._s))},b}(v),W=function(a){function b(b,c){this._o=b,this._s=c,a.call(this)}return q(b,a),b.prototype.next=function(a){this._o.onNext({value:a,timestamp:this._s.now()})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);t.timestamp=function(a){return L(a)||(a=z),new V(this,a)},t.sample=t.throttleLatest=function(a,b){return L(b)||(b=z),"number"==typeof a?n(this,Q(a,b)):n(this,a)};var X=c.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};X.prototype=Object.create(Error.prototype),t.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return p(this,a,arguments[1],arguments[2]);if(s.isObservable(a)||K(a))return o(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")};var Y=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=O(a._itrFn)(a._state),a._state===N)return a._o.onError(a._state.e);if(a._hasResult=O(a._cndFn)(a._state),a._hasResult===N)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=O(a._resFn)(a._state);if(c===N)return a._o.onError(c.e);var d=O(a._timeFn)(a._state);if(d===N)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,new Date(this._s.now()),c)},b}(v);s.generateWithAbsoluteTime=function(a,b,c,d,e,f){return L(f)||(f=z),new Y(a,b,c,d,e,f)};var Z=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=O(a._itrFn)(a._state),a._state===N)return a._o.onError(a._state.e);if(a._hasResult=O(a._cndFn)(a._state),a._hasResult===N)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=O(a._resFn)(a._state);if(c===N)return a._o.onError(c.e);var d=O(a._timeFn)(a._state);if(d===N)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,0,c)},b}(v);s.generateWithRelativeTime=function(a,b,c,d,e,f){return L(f)||(f=z),new Z(a,b,c,d,e,f)};var $=function(a){function b(b,c,d){this.source=b,this._dt=c,this._s=d,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];e.setDisposable(c.subscribe(d))}return q(b,a),b.prototype.subscribeCore=function(a){var b=new B;return b.setDisposable(this._s.scheduleFuture([this.source,a,b],this._dt,c)),b},b}(v);t.delaySubscription=function(a,b){return L(b)||(b=z),new $(this,a,b)};var _=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new aa(a,this))},b}(v),aa=function(a){function b(b,c){this._o=b,this._s=c._s,this._d=c._d,this._q=[],a.call(this)}return q(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0&&a-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value);this._o.onCompleted()},b}(r);t.skipLastWithTime=function(a,b){return L(b)||(b=z),new _(this,a,b)};var ba=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._d,this._s))},b}(v),ca=function(a){function b(b,c,d){this._o=b,this._d=c,this._s=d,this._q=[],a.call(this)}return q(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0;){var b=this._q.shift();a-b.interval<=this._d&&this._o.onNext(b.value)}this._o.onCompleted()},b}(r);t.takeLastWithTime=function(a,b){return L(b)||(b=z),new ba(this,a,b)},t.takeLastBufferWithTime=function(a,b){var c=this;return L(b)||(b=z),new u(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)};var da=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}function c(a,b){b.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return new D(this._s.scheduleFuture(a,this._d,c),this.source.subscribe(a))},b}(v);t.takeWithTime=function(a,b){return L(b)||(b=z),new da(this,a,b)};var ea=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,this._open=!1,a.call(this)}function c(a,b){b._open=!0}return q(b,a),b.prototype.subscribeCore=function(a){return new D(this._s.scheduleFuture(this,this._d,c),this.source.subscribe(new fa(a,this)))},b}(v),fa=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return q(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);t.skipWithTime=function(a,b){return L(b)||(b=z),new ea(this,a,b)};var ga=function(a){function b(b,c,d){this.source=b,this._st=c,this._s=d,a.call(this)}function c(a,b){b._open=!0}return q(b,a),b.prototype.subscribeCore=function(a){return this._open=!1,new D(this._s.scheduleFuture(this,this._st,c),this.source.subscribe(new ha(a,this)))},b}(v),ha=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return q(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);return t.skipUntilWithTime=function(a,b){return L(b)||(b=z),new ga(this,a,b)},t.takeUntilWithTime=function(a,b){L(b)||(b=z);var c=this;return new u(function(d){return new D(b.scheduleFuture(d,a,function(a,b){b.onCompleted()}),c.subscribe(d))},c)},t.throttle=function(a,b){L(b)||(b=z);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new u(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)},c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return N.e=b,N}}}function f(a,b){return new P(a,b)}function g(a,b,c){return new u(function(d){var e=a,f=H(b);return c.scheduleRecursiveFuture(0,e,function(a,b){if(f>0){var g=c.now();e=new Date(e.getTime()+f),e.getTime()<=g&&(e=new Date(g+f))}d.onNext(a),b(a+1,new Date(e))})})}function h(a,b,c){return a===b?new u(function(a){return c.schedulePeriodic(0,b,function(b){return a.onNext(b),b+1})}):w(function(){return g(new Date(c.now()+a),b,c)})}function i(a,b,c){return new u(function(d){var e,f=!1,g=new B,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.error,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new A,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveFuture(null,b,function(a,b){var e,g,k,l;if(null===h){j=!0;do k=null,i.length>0&&i[0].timestamp-c.now()<=0&&(k=i.shift().value),null!==k&&k.accept(d);while(null!==k);l=!1,g=0,i.length>0?(l=!0,g=Math.max(0,i[0].timestamp-c.now())):f=!1,e=h,j=!1,null!==e?d.onError(e):l&&b(null,g)}}))))}),new D(e,g)},a)}function j(a,b,c){return w(function(){return i(a,b-c.now(),c)})}function k(a,b,c){var d,e;return K(b)?e=b:(d=b,e=c),new u(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=O(e)(a);if(c===N)return b.onError(c.e);var d=new A;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new C,h=!1,i=new B;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new D(i,g)},this)}function l(a,b){return new u(function(c){var d,e=!1,f=new B,g=0,h=a.subscribe(function(a){var h=O(b)(a);if(h===N)return c.onError(h.e);J(h)&&(h=M(h)),e=!0,d=a,g++;var i=g,j=new A;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new D(h,f)},a)}function m(a){return a.toArray()}function m(a){return a.toArray()}function n(a,b){return new u(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new A;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new D(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function o(a,b,c,d){return K(b)&&(d=c,c=b,b=x()),d||(d=y(new X)),new u(function(e){function f(a){function b(){return l=c===k}var c=k,f=new A;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(d.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new B,i=new B,j=new A;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=O(c)(a);if(b===N)return e.onError(b.e);f(J(b)?M(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new D(h,i)},a)}function p(a,b,c,d){return L(c)&&(d=c,c=y(new X)),c instanceof Error&&(c=y(c)),L(d)||(d=z),new u(function(e){function f(){var a=g;k.setDisposable(d.scheduleFuture(null,b,function(){j=g===a,j&&(J(c)&&(c=M(c)),i.setDisposable(c.subscribe(e)))}))}var g=0,h=new A,i=new B,j=!1,k=new B;return i.setDisposable(h),f(),h.setDisposable(a.subscribe(function(a){j||(g++,e.onNext(a),f())},function(a){j||(g++,e.onError(a))},function(){j||(g++,e.onCompleted())})),new D(i,k)},a)}var q=c.internals.inherits,r=c.internals.AbstractObserver,s=c.Observable,t=s.prototype,u=c.AnonymousObservable,v=c.ObservableBase,w=s.defer,x=(s.empty,s.never),y=s["throw"],z=(s.fromArray,c.Scheduler["default"]),A=c.SingleAssignmentDisposable,B=c.SerialDisposable,C=c.CompositeDisposable,D=c.BinaryDisposable,E=c.RefCountDisposable,F=c.Subject,G=c.internals.addRef,H=c.Scheduler.normalize,I=c.helpers,J=I.isPromise,K=I.isFunction,L=c.Scheduler.isScheduler,M=s.fromPromise,N={e:{}},O=c.internals.tryCatch=function(a){if(!K(a))throw new TypeError("fn must be a function");return e(a)},P=function(a){function b(b,c){this._dt=b,this._s=c,a.call(this)}function c(a,b){b.onNext(0),b.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return this._s.scheduleFuture(a,this._dt,c)},b}(v),Q=s.interval=function(a,b){return h(a,a,L(b)?b:z)};s.timer=function(a,b,c){var e;return L(c)||(c=z),null!=b&&"number"==typeof b?e=b:L(b)&&(c=b),(a instanceof Date||"number"==typeof a)&&e===d?f(a,c):a instanceof Date&&e!==d?g(a.getTime(),b,c):h(a,e,c)};t.delay=function(){var a=arguments[0];if("number"==typeof a||a instanceof Date){var b=a,c=arguments[1];return L(c)||(c=z),b instanceof Date?j(this,b,c):i(this,b,c)}if(s.isObservable(a)||K(a))return k(this,a,arguments[1]);throw new Error("Invalid arguments")};var R=function(a){function b(b,c,d){L(d)||(d=z),this.source=b,this._dt=c,this._s=d,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){var b=new B;return new D(this.source.subscribe(new S(a,this.source,this._dt,this._s,b)),b)},b}(v),S=function(a){function b(b,c,d,e,f){this._o=b,this._s=c,this._d=d,this._scheduler=e,this._c=f,this._v=null,this._hv=!1,this._id=0,a.call(this)}return q(b,a),b.prototype.next=function(a){this._hv=!0,this._v=a;var b=++this._id,c=new A;this._c.setDisposable(c),c.setDisposable(this._scheduler.scheduleFuture(this,this._d,function(c,d){d._hv&&d._id===b&&d._o.onNext(a),d._hv=!1}))},b.prototype.error=function(a){this._c.dispose(),this._o.onError(a),this._hv=!1,this._id++},b.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},b}(r);t.debounce=function(){if(K(arguments[0]))return l(this,arguments[0]);if("number"==typeof arguments[0])return new R(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},t.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),L(c)||(c=z),"number"==typeof b?d=b:L(b)&&(d=a,c=b),new u(function(b){function f(){var a=new A,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleFuture(null,o,function(){if(g){var a=new F;k.push(a),b.onNext(G(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new B,m=0;return g=new C(l),h=new E(g),k.push(new F),b.onNext(G(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},t.windowWithTimeOrCount=function(a,b,c){var d=this;return L(c)||(c=z),new u(function(e){function f(b){var d=new A;g.setDisposable(d),d.setDisposable(c.scheduleFuture(null,a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new F,e.onNext(G(l,i)),f(a)}}))}var g=new B,h=new C(g),i=new E(h),j=0,k=0,l=new F;return e.onNext(G(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new F,e.onNext(G(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},t.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(m)},t.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(m)};var T=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new U(a,this._s))},b}(v),U=function(a){function b(b,c){this._o=b,this._s=c,this._l=c.now(),a.call(this)}return q(b,a),b.prototype.next=function(a){var b=this._s.now(),c=b-this._l;this._l=b,this._o.onNext({value:a,interval:c})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);t.timeInterval=function(a){return L(a)||(a=z),new T(this,a)};var V=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new W(a,this._s))},b}(v),W=function(a){function b(b,c){this._o=b,this._s=c,a.call(this)}return q(b,a),b.prototype.next=function(a){this._o.onNext({value:a,timestamp:this._s.now()})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);t.timestamp=function(a){return L(a)||(a=z),new V(this,a)},t.sample=t.throttleLatest=function(a,b){return L(b)||(b=z),"number"==typeof a?n(this,Q(a,b)):n(this,a)};var X=c.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};X.prototype=Object.create(Error.prototype),t.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return p(this,a,arguments[1],arguments[2]);if(s.isObservable(a)||K(a))return o(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")};var Y=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=O(a._itrFn)(a._state),a._state===N)return a._o.onError(a._state.e);if(a._hasResult=O(a._cndFn)(a._state),a._hasResult===N)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=O(a._resFn)(a._state);if(c===N)return a._o.onError(c.e);var d=O(a._timeFn)(a._state);if(d===N)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,new Date(this._s.now()),c)},b}(v);s.generateWithAbsoluteTime=function(a,b,c,d,e,f){return L(f)||(f=z),new Y(a,b,c,d,e,f)};var Z=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=O(a._itrFn)(a._state),a._state===N)return a._o.onError(a._state.e);if(a._hasResult=O(a._cndFn)(a._state),a._hasResult===N)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=O(a._resFn)(a._state);if(c===N)return a._o.onError(c.e);var d=O(a._timeFn)(a._state);if(d===N)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,0,c)},b}(v);s.generateWithRelativeTime=function(a,b,c,d,e,f){return L(f)||(f=z),new Z(a,b,c,d,e,f)};var $=function(a){function b(b,c,d){this.source=b,this._dt=c,this._s=d,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];e.setDisposable(c.subscribe(d))}return q(b,a),b.prototype.subscribeCore=function(a){var b=new B;return b.setDisposable(this._s.scheduleFuture([this.source,a,b],this._dt,c)),b},b}(v);t.delaySubscription=function(a,b){return L(b)||(b=z),new $(this,a,b)};var _=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new aa(a,this))},b}(v),aa=function(a){function b(b,c){this._o=b,this._s=c._s,this._d=c._d,this._q=[],a.call(this)}return q(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0&&a-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value);this._o.onCompleted()},b}(r);t.skipLastWithTime=function(a,b){return L(b)||(b=z),new _(this,a,b)};var ba=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return q(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ca(a,this._d,this._s))},b}(v),ca=function(a){function b(b,c,d){this._o=b,this._d=c,this._s=d,this._q=[],a.call(this)}return q(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0;){var b=this._q.shift();a-b.interval<=this._d&&this._o.onNext(b.value)}this._o.onCompleted()},b}(r);t.takeLastWithTime=function(a,b){return L(b)||(b=z),new ba(this,a,b)},t.takeLastBufferWithTime=function(a,b){var c=this;return L(b)||(b=z),new u(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)};var da=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}function c(a,b){b.onCompleted()}return q(b,a),b.prototype.subscribeCore=function(a){return new D(this._s.scheduleFuture(a,this._d,c),this.source.subscribe(a))},b}(v);t.takeWithTime=function(a,b){return L(b)||(b=z),new da(this,a,b)};var ea=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,this._open=!1,a.call(this)}function c(a,b){b._open=!0}return q(b,a),b.prototype.subscribeCore=function(a){return new D(this._s.scheduleFuture(this,this._d,c),this.source.subscribe(new fa(a,this)))},b}(v),fa=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return q(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);t.skipWithTime=function(a,b){return L(b)||(b=z),new ea(this,a,b)};var ga=function(a){function b(b,c,d){this.source=b,this._st=c,this._s=d,a.call(this)}function c(a,b){b._open=!0}return q(b,a),b.prototype.subscribeCore=function(a){return this._open=!1,new D(this._s.scheduleFuture(this,this._st,c),this.source.subscribe(new ha(a,this)))},b}(v),ha=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return q(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(r);return t.skipUntilWithTime=function(a,b){return L(b)||(b=z),new ga(this,a,b)},t.takeUntilWithTime=function(a,b){L(b)||(b=z);var c=this;return new u(function(d){return new D(b.scheduleFuture(d,a,function(a,b){b.onCompleted()}),c.subscribe(d))},c)},t.throttle=function(a,b){L(b)||(b=z);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new u(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)},c});
//# sourceMappingURL=rx.time.map

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -9,11 +9,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -20,0 +23,0 @@ // Because of build optimizers

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){var e=c.Scheduler,f=c.internals.ScheduledItem,g=c.internals.SchedulePeriodicRecursive,h=c.internals.PriorityQueue,i=c.internals.inherits,j=c.helpers.defaultSubComparer,k=c.helpers.notImplemented;c.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new h(1024),a.call(this)}i(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=k,c.toAbsoluteTime=k,c.toRelativeTime=k,c.schedulePeriodic=function(a,b,c){var d=new g(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ArgumentOutOfRangeError;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ArgumentOutOfRangeError;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ArgumentOutOfRangeError;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(g),c(a,b)}var e=this,g=new f(this,a,d,b,this.comparer);return this.queue.enqueue(g),g.disposable},b}(e);return c.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||j;a.call(this,d,e)}i(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toAbsoluteTime=function(a){return new Date(a).getTime()},c.toRelativeTime=function(a){return a},b}(c.VirtualTimeScheduler),c});
(function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("./rx")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){var e=c.Scheduler,f=c.internals.ScheduledItem,g=c.internals.SchedulePeriodicRecursive,h=c.internals.PriorityQueue,i=c.internals.inherits,j=c.helpers.defaultSubComparer,k=c.helpers.notImplemented;c.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new h(1024),a.call(this)}i(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=k,c.toAbsoluteTime=k,c.toRelativeTime=k,c.schedulePeriodic=function(a,b,c){var d=new g(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ArgumentOutOfRangeError;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ArgumentOutOfRangeError;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ArgumentOutOfRangeError;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(g),c(a,b)}var e=this,g=new f(this,a,d,b,this.comparer);return this.queue.enqueue(g),g.disposable},b}(e);return c.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||j;a.call(this,d,e)}i(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toAbsoluteTime=function(a){return new Date(a).getTime()},c.toRelativeTime=function(a){return a},b}(c.VirtualTimeScheduler),c});
//# sourceMappingURL=rx.virtualtime.map

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

Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
Copyright (c) Microsoft. All rights reserved.
Microsoft Open Technologies would like to thank its contributors, a list

@@ -3,0 +3,0 @@ of whom are at http://rx.codeplex.com/wikipage?title=Contributors.

@@ -5,3 +5,3 @@ {

"description": "Library for composing asynchronous and event-based operations in JavaScript",
"version": "4.0.0",
"version": "4.0.1",
"homepage": "https://github.com/Reactive-Extensions/RxJS",

@@ -8,0 +8,0 @@ "author": {

@@ -89,3 +89,3 @@ var scheduleMethod, clearMethod;

function onGlobalPostMessage(event) {
var onGlobalPostMessage = function (event) {
// Only if we're a match to avoid any other global events

@@ -95,11 +95,5 @@ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {

}
}
};
if (root.addEventListener) {
root.addEventListener('message', onGlobalPostMessage, false);
} else if (root.attachEvent) {
root.attachEvent('onmessage', onGlobalPostMessage);
} else {
root.onmessage = onGlobalPostMessage;
}
root.addEventListener('message', onGlobalPostMessage, false);

@@ -162,11 +156,18 @@ scheduleMethod = function (action) {

function DefaultSchedulerDisposable(id) {
function scheduleAction(disposable, action, scheduler, state) {
return function schedule() {
!disposable.isDisposed && disposable.setDisposable(Disposable._fixup(action(scheduler, state)));
};
}
function ClearDisposable(method, id) {
this._id = id;
this._method = method;
this.isDisposed = false;
}
DefaultSchedulerDisposable.prototype.dispose = function () {
ClearDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
localClearTimeout(this._id);
this._method.call(null, this._id);
}

@@ -176,16 +177,12 @@ };

DefaultScheduler.prototype.schedule = function (state, action) {
var scheduler = this, disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
!disposable.isDisposed && disposable.setDisposable(disposableFixup(action(scheduler, state)));
});
return new BinaryDisposable(disposable, new DefaultSchedulerDisposable(id));
var disposable = new SingleAssignmentDisposable(),
id = scheduleMethod(scheduleAction(disposable, action, this, state));
return new BinaryDisposable(disposable, new ClearDisposable(clearMethod, id));
};
DefaultScheduler.prototype._scheduleFuture = function (state, dueTime, action) {
var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
if (dt === 0) { return scheduler.schedule(state, action); }
var id = localSetTimeout(function () {
!disposable.isDisposed && disposable.setDisposable(disposableFixup(action(scheduler, state)));
}, dt);
return new BinaryDisposable(disposable, new DefaultSchedulerDisposable(id));
if (dueTime === 0) { return this.schedule(state, action); }
var disposable = new SingleAssignmentDisposable(),
id = localSetTimeout(scheduleAction(disposable, action, this, state), dueTime);
return new BinaryDisposable(disposable, new ClearDisposable(localClearTimeout, id));
};

@@ -192,0 +189,0 @@

@@ -6,2 +6,3 @@ // Aliases

AnonymousObservable = Rx.AnonymousObservable,
ObservableBase = Rx.ObservableBase,
AsyncSubject = Rx.AsyncSubject,

@@ -12,2 +13,3 @@ disposableCreate = Rx.Disposable.create,

defaultScheduler = Rx.Scheduler['default'],
inherits = Rx.internals.inherits,
isScheduler = Rx.Scheduler.isScheduler,

@@ -14,0 +16,0 @@ isPromise = Rx.helpers.isPromise,

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

var Observable = Rx.Observable,
ObservableBase = Rx.ObservableBase,
AbstractObserver = Rx.internals.AbstractObserver,
CompositeDisposable = Rx.CompositeDisposable,

@@ -15,2 +16,3 @@ BinaryDisposable = Rx.BinaryDisposable,

inherits = Rx.internals.inherits,
bindCallback = Rx.internals.bindCallback,
noop = Rx.helpers.noop,

@@ -17,0 +19,0 @@ isPromise = Rx.helpers.isPromise,

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

@@ -8,11 +8,14 @@ ;(function (undefined) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -19,0 +22,0 @@ var Rx = {

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

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

@@ -7,11 +7,14 @@ ;(function (factory) {

var
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeSelf = objectTypes[typeof self] && self.Object && self,
freeWindow = objectTypes[typeof window] && window && window.Object && window,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global);
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();

@@ -18,0 +21,0 @@ // Because of build optimizers

var EmptyError = Rx.EmptyError = function() {
this.message = 'Sequence contains no elements.';
this.name = 'EmptyError';
Error.call(this);
};
EmptyError.prototype = Object.create(Error.prototype);
EmptyError.prototype.name = 'EmptyError';
var ObjectDisposedError = Rx.ObjectDisposedError = function() {
this.message = 'Object has been disposed';
this.name = 'ObjectDisposedError';
Error.call(this);
};
ObjectDisposedError.prototype = Object.create(Error.prototype);
ObjectDisposedError.prototype.name = 'ObjectDisposedError';
var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
this.message = 'Argument out of range';
this.name = 'ArgumentOutOfRangeError';
Error.call(this);
};
ArgumentOutOfRangeError.prototype = Object.create(Error.prototype);
ArgumentOutOfRangeError.prototype.name = 'ArgumentOutOfRangeError';
var NotSupportedError = Rx.NotSupportedError = function (message) {
this.message = message || 'This operation is not supported';
this.name = 'NotSupportedError';
Error.call(this);
};
NotSupportedError.prototype = Object.create(Error.prototype);
NotSupportedError.prototype.name = 'NotSupportedError';
var NotImplementedError = Rx.NotImplementedError = function (message) {
this.message = message || 'This operation is not implemented';
this.name = 'NotImplementedError';
Error.call(this);
};
NotImplementedError.prototype = Object.create(Error.prototype);
NotImplementedError.prototype.name = 'NotImplementedError';

@@ -36,0 +36,0 @@ var notImplemented = Rx.helpers.notImplemented = function () {

@@ -194,32 +194,173 @@ // Utilities

if (typeof Object.create !== 'function') {
// Production steps of ECMA-262, Edition 5, 15.2.3.5
// Reference: http://es5.github.io/#x15.2.3.5
Object.create = (function() {
function Temp() {}
// Production steps of ECMA-262, Edition 5, 15.2.3.5
// Reference: http://es5.github.io/#x15.2.3.5
Object.create = (function() {
function Temp() {}
var hasOwn = Object.prototype.hasOwnProperty;
var hasOwn = Object.prototype.hasOwnProperty;
return function (O) {
if (typeof O !== 'object') {
throw new TypeError('Object prototype may only be an Object or null');
}
return function (O) {
if (typeof O !== 'object') {
throw new TypeError('Object prototype may only be an Object or null');
}
Temp.prototype = O;
var obj = new Temp();
Temp.prototype = null;
Temp.prototype = O;
var obj = new Temp();
Temp.prototype = null;
if (arguments.length > 1) {
// Object.defineProperties does ToObject on its first argument.
var Properties = Object(arguments[1]);
for (var prop in Properties) {
if (hasOwn.call(Properties, prop)) {
obj[prop] = Properties[prop];
if (arguments.length > 1) {
// Object.defineProperties does ToObject on its first argument.
var Properties = Object(arguments[1]);
for (var prop in Properties) {
if (hasOwn.call(Properties, prop)) {
obj[prop] = Properties[prop];
}
}
}
// 5. Return obj
return obj;
};
})();
}
root.Element && root.Element.prototype.attachEvent && !root.Element.prototype.addEventListener && (function () {
function addMethod(name, fn) {
Window.prototype[name] = HTMLDocument.prototype[name] = Element.prototype[name] = fn;
}
addMethod('addEventListener', function (type, listener) {
var target = this;
var listeners = target._c1_listeners = target._c1_listeners || {};
var typeListeners = listeners[type] = listeners[type] || [];
target.attachEvent('on' + type, typeListeners.event = function (e) {
e || (e = root.event);
var documentElement = target.document &&
target.document.documentElement ||
target.documentElement ||
{ scrollLeft: 0, scrollTop: 0 };
e.currentTarget = target;
e.pageX = e.clientX + documentElement.scrollLeft;
e.pageY = e.clientY + documentElement.scrollTop;
e.preventDefault = function () {
e.bubbledKeyCode = e.keyCode;
if (e.ctrlKey) {
try {
e.keyCode = 0;
} catch (e) { }
}
e.defaultPrevented = true;
e.returnValue = false;
e.modified = true;
e.returnValue = false;
};
e.stopImmediatePropagation = function () {
immediatePropagation = false;
e.cancelBubble = true;
};
e.stopPropagation = function () {
e.cancelBubble = true;
};
e.relatedTarget = e.fromElement || null;
e.target = e.srcElement || target;
e.timeStamp = +new Date();
// Normalize key events
switch(e.type) {
case 'keypress':
var c = ('charCode' in e ? e.charCode : e.keyCode);
if (c === 10) {
c = 0;
e.keyCode = 13;
} else if (c === 13 || c === 27) {
c = 0;
} else if (c === 3) {
c = 99;
}
e.charCode = c;
e.keyChar = e.charCode ? String.fromCharCode(e.charCode) : '';
break;
}
var copiedEvent = {};
for (var prop in e) {
copiedEvent[prop] = e[prop];
}
for (var i = 0, typeListenersCache = [].concat(typeListeners), typeListenerCache, immediatePropagation = true; immediatePropagation && (typeListenerCache = typeListenersCache[i]); ++i) {
for (var ii = 0, typeListener; typeListener = typeListeners[ii]; ++ii) {
if (typeListener === typeListenerCache) { typeListener.call(target, copiedEvent); break; }
}
}
});
typeListeners.push(listener);
});
addMethod('removeEventListener', function (type, listener) {
var target = this;
var listeners = target._c1_listeners = target._c1_listeners || {};
var typeListeners = listeners[type] = listeners[type] || [];
for (var i = typeListeners.length - 1, typeListener; typeListener = typeListeners[i]; --i) {
if (typeListener === listener) { typeListeners.splice(i, 1); break; }
}
// 5. Return obj
return obj;
};
})();
}
!typeListeners.length &&
typeListeners.event &&
target.detachEvent('on' + type, typeListeners.event);
});
addMethod('dispatchEvent', function (e) {
var target = this;
var type = e.type;
var listeners = target._c1_listeners = target._c1_listeners || {};
var typeListeners = listeners[type] = listeners[type] || [];
try {
return target.fireEvent('on' + type, e);
} catch (err) {
return typeListeners.event && typeListeners.event(e);
}
});
function ready() {
if (ready.interval && document.body) {
ready.interval = clearInterval(ready.interval);
document.dispatchEvent(new CustomEvent('DOMContentLoaded'));
}
}
ready.interval = setInterval(ready, 1);
root.addEventListener('load', ready);
}());
(!root.CustomEvent || typeof root.CustomEvent === 'object') && (function() {
function CustomEvent (type, params) {
var event;
params = params || { bubbles: false, cancelable: false, detail: undefined };
try {
event = document.createEvent('CustomEvent');
event.initCustomEvent(type, params.bubbles, params.cancelable, params.detail);
} catch (error) {
event = document.createEvent('Event');
event.initEvent(type, params.bubbles, params.cancelable);
event.detail = params.detail;
}
return event;
}
root.CustomEvent && (CustomEvent.prototype = root.CustomEvent.prototype);
root.CustomEvent = CustomEvent;
}());

@@ -7,4 +7,4 @@ function observableTimerDateAndPeriod(dueTime, period, scheduler) {

var now = scheduler.now();
d = d + p;
d <= now && (d = now + p);
d = new Date(d.getTime() + p);
d.getTime() <= now && (d = new Date(now + p));
}

@@ -11,0 +11,0 @@ observer.onNext(count);

@@ -20,3 +20,3 @@ var DefaultIfEmptyObserver = (function (__super__) {

DefaultIfEmptyObserver.prototype.completed = function () {
!this._f && this._o.onNext(defaultValue);
!this._f && this._o.onNext(this._d);
this._o.onCompleted();

@@ -23,0 +23,0 @@ };

@@ -0,1 +1,11 @@

function isNodeList(el) {
if (root.StaticNodeList) {
// IE8 Specific
// instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
return el instanceof root.StaticNodeList || el instanceof root.NodeList;
} else {
return Object.prototype.toString.call(el) === '[object NodeList]';
}
}
function ListenDisposable(e, n, fn) {

@@ -20,3 +30,3 @@ this._e = e;

var elemToString = Object.prototype.toString.call(el);
if (elemToString === '[object NodeList]' || elemToString === '[object HTMLCollection]') {
if (isNodeList(el) || elemToString === '[object HTMLCollection]') {
for (var i = 0, len = el.length; i < len; i++) {

@@ -37,13 +47,32 @@ disposables.add(createEventListener(el.item(i), eventName, handler));

function eventHandler(o, selector) {
return function handler () {
var results = arguments[0];
if (isFunction(selector)) {
results = tryCatch(selector).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
var EventObservable = (function(__super__) {
inherits(EventObservable, __super__);
function EventObservable(el, name, fn) {
this._el = el;
this._name = name;
this._fn = fn;
__super__.call(this);
}
function createHandler(o, fn) {
return function handler () {
var results = arguments[0];
if (isFunction(fn)) {
results = tryCatch(fn).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
};
}
EventObservable.prototype.subscribeCore = function (o) {
return createEventListener(
this._el,
this._n,
createHandler(o, this._fn));
};
}
return EventObservable;
}(ObservableBase));
/**

@@ -76,8 +105,3 @@ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.

return new AnonymousObservable(function (o) {
return createEventListener(
element,
eventName,
eventHandler(o, selector));
}).publish().refCount();
return new EventObservable(element, eventName, selector).publish().refCount();
};

@@ -0,1 +1,43 @@

var EventPatternObservable = (function(__super__) {
inherits(EventPatternObservable, __super__);
function EventPatternObservable(add, del, fn) {
this._add = add;
this._del = del;
this._fn = fn;
__super__.call(this);
}
function createHandler(o, fn) {
return function handler () {
var results = arguments[0];
if (isFunction(fn)) {
results = tryCatch(fn).apply(null, arguments);
if (results === errorObj) { return o.onError(results.e); }
}
o.onNext(results);
};
}
EventPatternObservable.prototype.subscribeCore = function (o) {
var fn = createHandler(o, this._fn);
var returnValue = this._add(fn);
return new EventPatternDisposable(this._del, fn, returnValue);
};
function EventPatternDisposable(del, fn, ret) {
this._del = del;
this._fn = fn;
this._ret = ret;
this.isDisposed = false;
}
EventPatternDisposable.prototype.dispose = function () {
if(!this.isDisposed) {
isFunction(this._del) && this._del(this._fn, this._ret);
}
};
return EventPatternObservable;
}(ObservableBase));
/**

@@ -6,22 +48,6 @@ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.

* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @param {Scheduler} [scheduler] A scheduler used to schedule the remove handler.
* @returns {Observable} An observable sequence which wraps an event from an event emitter
*/
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (o) {
function innerHandler () {
var result = arguments[0];
if (isFunction(selector)) {
result = tryCatch(selector).apply(null, arguments);
if (result === errorObj) { return o.onError(result.e); }
}
o.onNext(result);
}
var returnValue = addHandler(innerHandler);
return disposableCreate(function () {
isFunction(removeHandler) && removeHandler(innerHandler, returnValue);
});
}).publish().refCount();
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
return new EventPatternObservable(addHandler, removeHandler, selector).publish().refCount();
};
var CompositeError = Rx.CompositeError = function(errors) {
this.name = "NotImplementedError";
this.innerErrors = errors;
this.message = 'This contains multiple errors. Check the innerErrors';
Error.call(this);
}
};
CompositeError.prototype = Error.prototype;
CompositeError.prototype.name = 'NotImplementedError';

@@ -9,0 +9,0 @@ /**

@@ -0,1 +1,37 @@

var PairwiseObservable = (function (__super__) {
inherits(PairwiseObservable, __super__);
function PairwiseObservable(source) {
this.source = source;
__super__.call(this);
}
PairwiseObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new PairwiseObserver(o));
};
return PairwiseObservable;
}(ObservableBase));
var PairwiseObserver = (function(__super__) {
inherits(PairwiseObserver, __super__);
function PairwiseObserver(o) {
this._o = o;
this._p = null;
this._hp = false;
}
PairwiseObserver.prototype.next = function (x) {
if (this._hp) {
this._o.onNext([this._p, x]);
} else {
this._hp = true;
}
this._p = x;
};
PairwiseObserver.prototype.error = function (err) { this._o.onError(err); };
PairwiseObserver.prototype.completed = function () { this._o.onCompleted(); };
return PairwiseObserver;
}(AbstractObserver));
/**

@@ -8,17 +44,3 @@ * Returns a new observable that triggers on the second and subsequent triggerings of the input observable.

observableProto.pairwise = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var previous, hasPrevious = false;
return source.subscribe(
function (x) {
if (hasPrevious) {
observer.onNext([previous, x]);
} else {
hasPrevious = true;
}
previous = x;
},
observer.onError.bind(observer),
observer.onCompleted.bind(observer));
}, source);
return new PairwiseObservable(this);
};

@@ -15,6 +15,7 @@ /**

observableProto.partition = function(predicate, thisArg) {
var fn = bindCallback(predicate, thisArg, 3);
return [
this.filter(predicate, thisArg),
this.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
this.filter(function (x, i, o) { return !fn(x, i, o); })
];
};
Observable.wrap = function (fn) {
createObservable.__generatorFunction__ = fn;
return createObservable;
function createObservable() {
return Observable.spawn.call(this, fn.apply(this, arguments));
}
createObservable.__generatorFunction__ = fn;
return createObservable;
};

@@ -23,4 +23,2 @@

processGenerator();
function processGenerator(res) {

@@ -32,2 +30,4 @@ var ret = tryCatch(gen.next).call(gen, res);

processGenerator();
function onError(err) {

@@ -45,5 +45,12 @@ var ret = tryCatch(gen.next).call(gen, err);

}
var value = toObservable.call(self, ret.value);
if (Observable.isObservable(value)) {
g.add(value.subscribe(processGenerator, onError));
var obs = toObservable.call(self, ret.value);
var value = null;
var hasValue = false;
if (Observable.isObservable(obs)) {
g.add(obs.subscribe(function(val) {
hasValue = true;
value = val;
}, onError, function() {
hasValue && processGenerator(value);
}));
} else {

@@ -70,5 +77,9 @@ onError(new TypeError('type not supported'));

function arrayToObservable (obj) {
return Observable.from(obj)
.flatMap(toObservable)
.toArray();
return Observable.from(obj).concatMap(function(o) {
if(Observable.isObservable(o) || isObject(o)) {
return toObservable.call(null, o);
} else {
return Rx.Observable.just(o);
}
}).toArray();
}

@@ -75,0 +86,0 @@

@@ -22,5 +22,5 @@ var FromArrayObservable = (function(__super__) {

FromArraySink.prototype.run = function () {
var observer = this.observer, args = this.parent.args, len = args.length;
function loopRecursive(i, recurse) {
function loopRecursive(args, observer) {
var len = args.length;
return function loop (i, recurse) {
if (i < len) {

@@ -32,5 +32,7 @@ observer.onNext(args[i]);

}
}
};
}
return this.parent.scheduler.scheduleRecursive(0, loopRecursive);
FromArraySink.prototype.run = function () {
return this.parent.scheduler.scheduleRecursive(0, loopRecursive(this.parent.args, this.observer));
};
var FromPromiseObservable = (function(__super__) {
inherits(FromPromiseObservable, __super__);
function FromPromiseObservable(p) {
this.p = p;
function FromPromiseObservable(p, s) {
this._p = p;
this._s = s;
__super__.call(this);
}
function scheduleNext(s, state) {
var o = state[0], data = state[1];
o.onNext(data);
o.onCompleted();
}
function scheduleError(s, state) {
var o = state[0], err = state[1];
o.onError(err);
}
FromPromiseObservable.prototype.subscribeCore = function(o) {
this.p
var sad = new SingleAssignmentDisposable(), self = this;
this._p
.then(function (data) {
o.onNext(data);
o.onCompleted();
sad.setDisposable(self._s.schedule([o, data], scheduleNext));
}, function (err) {
o.onError(err);
sad.setDisposable(self._s.schedule([o, err], scheduleError));
});
return disposableEmpty;
return sad;
};

@@ -27,4 +41,5 @@

*/
var observableFromPromise = Observable.fromPromise = function (promise) {
return new FromPromiseObservable(promise);
var observableFromPromise = Observable.fromPromise = function (promise, scheduler) {
scheduler || (scheduler = defaultScheduler);
return new FromPromiseObservable(promise, scheduler);
};

@@ -24,5 +24,4 @@ var RangeObservable = (function(__super__) {

RangeSink.prototype.run = function () {
var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
function loopRecursive(i, recurse) {
function loopRecursive(start, count, observer) {
return function loop (i, recurse) {
if (i < count) {

@@ -34,5 +33,10 @@ observer.onNext(start + i);

}
}
};
}
return this.parent.scheduler.scheduleRecursive(0, loopRecursive);
RangeSink.prototype.run = function () {
return this.parent.scheduler.scheduleRecursive(
0,
loopRecursive(this.parent.start, this.parent.rangeCount, this.observer)
);
};

@@ -39,0 +43,0 @@

@@ -21,3 +21,3 @@ /**

addProperties(AsyncSubject.prototype, Observer, {
addProperties(AsyncSubject.prototype, Observer.prototype, {
_subscribe: function (o) {

@@ -24,0 +24,0 @@ checkDisposed(this);

@@ -16,3 +16,3 @@ /**

addProperties(BehaviorSubject.prototype, Observer, {
addProperties(BehaviorSubject.prototype, Observer.prototype, {
_subscribe: function (o) {

@@ -19,0 +19,0 @@ checkDisposed(this);

@@ -1,76 +0,71 @@

// TODO: Refactor longStackSupport and hasStacks
var Rx.config = {
longStackSupport = false;
};
var hasStacks = false;
'use strict';
function Observable(subscribe) {
if (Rx.config.longStackSupport && hasStacks) {
try {
throw new Error();
} catch (e) {
this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
}
var Observer = require('./observer');
var isFunction = require('./helpers/isFunction');
var AnonymousObservable = require('./observable/anonymousobservable');
var self = this;
this._subscribe = function (observer) {
var oldOnError = observer.onError.bind(observer);
function Observable() { }
observer.onError = function (err) {
makeStackTraceLong(err, self);
oldOnError(err);
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.create = function (subscribe, parent) {
return new AnonymousObservable(subscribe, parent);
};
return subscribe.call(self, observer);
};
} else {
this._subscribe = subscribe;
}
}
// Class methods
Observable['amb'] = require('./observable/amb');
Observable['case'] = require('./observable/case');
Observable['catch'] = require('./observable/catch');
Observable['create'] = require('./observable/create');
Observable['combineLatest'] = require('./observable/combinelatest');
Observable['concat'] = require('./observable/concat');
Observable['defer'] = require('./observable/defer');
Observable['empty'] = require('./observable/empty');
Observable['for'] = require('./observable/for');
Observable['forkJoin'] = require('./observable/forkjoin');
Observable['from'] = require('./observable/from');
Observable['fromArray'] = require('./observable/fromarray');
Observable['fromCallback'] = require('./observable/fromcallback');
Observable['fromEvent'] = require('./observable/fromevent');
Observable['fromEventPattern'] = require('./observable/fromeventpattern');
Observable['fromNodeCallback'] = require('./observable/fromnodecallback');
Observable['fromPromise'] = require('./observable/frompromise');
Observable['generate'] = require('./observable/generate');
Observable['generateWithAbsoluteTime'] = require('./observable/generatewithabsolutetime');
Observable['generateWithRelativeTime'] = require('./observable/generatewithrelativetime');
Observable['if'] = require('./observable/if');
Observable['interval'] = require('./observable/interval');
Observable['just'] = require('./observable/just');
Observable['merge'] = require('./observable/merge');
Observable['never'] = require('./observable/never');
Observable['of'] = require('./observable/of');
Observable['ofArrayChanges'] = require('./observable/ofarraychanges');
Observable['ofObjectChanges'] = require('./observable/ofobjectchanges');
Observable['onErrorResumeNext'] = require('./observable/onerrorresumenext');
Observable['pairs'] = require('./observable/pairs');
Observable['range'] = require('./observable/range');
Observable['repeat'] = require('./observable/repeat');
Observable['spawn'] = require('./observable/spawn');
Observable['throw'] = require('./observable/throw');
Observable['timer'] = require('./observable/timer');
Observable['toAsync'] = require('./observable/toasync');
Observable['using'] = require('./observable/using');
Observable['when'] = require('./observable/when');
Observable['zip'] = require('./observable/zip');
/**
* Determines whether the given object is an Observable
* @param {Any} An object to determine whether it is an Observable
* @returns {Boolean} true if an Observable, else false.
*/
Observable.isObservable = function (o) {
return o && isFunction(o.subscribe);
};
// Instance methods
/**
* Subscribes an o to the observable sequence.
* @param {Mixed} [oOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
* @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
*/
Observable.prototype.subscribe = function (oOrOnNext, onError, onCompleted) {
return this._subscribe(typeof oOrOnNext === 'object' ?
oOrOnNext :
Observer.create(oOrOnNext, onError, onCompleted));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onNext The function to invoke on each element in the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
Observable.prototype.subscribeOnNext = function (onNext, thisArg) {
return this._subscribe(Observer.create(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
};
/**
* Subscribes to an exceptional condition in the sequence with an optional "this" argument.
* @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
Observable.prototype.subscribeOnError = function (onError, thisArg) {
return this._subscribe(Observer.create(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
Observable.prototype.subscribeOnCompleted = function (onCompleted, thisArg) {
return this._subscribe(Observer.create(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
};
module.exports = Observable;

@@ -220,3 +220,3 @@ {

"./core/linq/observable/zip.ts",
"./core/linq/observable/ziparray.ts",
"./core/linq/observable/zipiterable.ts",
"./core/linq/observable/zipproto.ts",

@@ -223,0 +223,0 @@ "./core/notification.ts",

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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 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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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 too big to display

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

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

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

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc