Socket
Socket
Sign inDemoInstall

rx

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx - npm Package Compare versions

Comparing version 2.3.19 to 2.3.20

src/core/longstackbegin.js

2

bower.json
{
"name": "rxjs",
"version": "2.3.19",
"version": "2.3.20",
"main": [

@@ -5,0 +5,0 @@ "dist/rx.all.js",

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

return new AnonymousObservable(function (observer) {
function handler(e) {
var results = e;
function handler() {
var results = arguments;
if (selector) {
try {
results = selector(arguments);
results = selector(results);
} catch (err) {

@@ -357,0 +357,0 @@ observer.onError(err);

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?B(a.call(b)):j(a)?B(a):h(a)?f(a):isPromise(a)?g(a):typeof a===z?a:k(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==z)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void w.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===z}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===z&&typeof a[A]===z}function k(a){return a&&a.constructor===Object}function l(a){a&&w.schedule(function(){throw a})}function m(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 n(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),u(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(m(a))};return a.attachEvent("on"+b,d),u(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,u(function(){a["on"+b]=null})}function o(a,b,c){var d=new v;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(o(a.item(e),b,c));else a&&d.add(n(a,b,c));return d}var p=c.Observable,q=(p.prototype,p.fromPromise),r=p.throwException,s=c.AnonymousObservable,t=c.AsyncSubject,u=c.Disposable.create,v=c.CompositeDisposable,w=(c.Scheduler.immediate,c.Scheduler.timeout),x=c.helpers.isScheduler,y=Array.prototype.slice,z="function",A="throw",B=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){w.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2&&(b=y.call(arguments,1)),a)try{c=h[A](a)}catch(i){return e(i)}if(!a)try{c=h.next(b)}catch(i){return e(i)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==z)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var j=!1;try{c.value.call(g,function(){j||(j=!0,f.apply(g,arguments))})}catch(i){w.schedule(function(){j||(j=!0,f.call(g,i))})}}}var g=this,h=a;if(b){var i=y.call(arguments),j=i.length,k=j&&typeof i[j-1]===z;c=k?i.pop():l,h=a.apply(this,i)}else c=c||l;f()}};c.denodify=function(a){return function(){var b,c,d,e=y.call(arguments);return e.push(function(){b=arguments,d&&!c&&(c=!0,cb.apply(this,b))}),a.apply(this,e),function(a){d=a,b&&!c&&(c=!0,a.apply(this,b))}}},p.start=function(a,b,c){return C(a,b,c)()};var C=p.toAsync=function(a,b,c){return x(c)||(c=w),function(){var d=arguments,e=new t;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};p.fromCallback=function(a,b,c){return function(){var d=y.call(arguments,0);return new s(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},p.fromNodeCallback=function(a,b,c){return function(){var d=y.call(arguments,0);return new s(function(e){function f(a){if(a)return void e.onError(a);var b=y.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},c.config.useNativeEvents=!1;var D=a.angular&&angular.element?angular.element:a.jQuery?a.jQuery:a.Zepto?a.Zepto:null,E=!!a.Ember&&"function"==typeof a.Ember.addListener,F=!!a.Backbone&&!!a.Backbone.Marionette;p.fromEvent=function(a,b,d){if(a.addListener)return G(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d);if(!c.config.useNativeEvents){if(F)return G(function(c){a.on(b,c)},function(c){a.off(b,c)},d);if(E)return G(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},d);if(D){var e=D(a);return G(function(a){e.on(b,a)},function(a){e.off(b,a)},d)}}return new s(function(c){return o(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return void c.onError(e)}c.onNext(b)})}).publish().refCount()};var G=p.fromEventPattern=function(a,b,c){return new s(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return u(function(){b&&b(e,f)})}).publish().refCount()};return p.startAsync=function(a){var b;try{b=a()}catch(c){return r(c)}return q(b)},c});
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?B(a.call(b)):j(a)?B(a):h(a)?f(a):isPromise(a)?g(a):typeof a===z?a:k(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==z)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void w.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===z}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===z&&typeof a[A]===z}function k(a){return a&&a.constructor===Object}function l(a){a&&w.schedule(function(){throw a})}function m(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 n(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),u(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(m(a))};return a.attachEvent("on"+b,d),u(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,u(function(){a["on"+b]=null})}function o(a,b,c){var d=new v;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(o(a.item(e),b,c));else a&&d.add(n(a,b,c));return d}var p=c.Observable,q=(p.prototype,p.fromPromise),r=p.throwException,s=c.AnonymousObservable,t=c.AsyncSubject,u=c.Disposable.create,v=c.CompositeDisposable,w=(c.Scheduler.immediate,c.Scheduler.timeout),x=c.helpers.isScheduler,y=Array.prototype.slice,z="function",A="throw",B=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){w.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2&&(b=y.call(arguments,1)),a)try{c=h[A](a)}catch(i){return e(i)}if(!a)try{c=h.next(b)}catch(i){return e(i)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==z)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var j=!1;try{c.value.call(g,function(){j||(j=!0,f.apply(g,arguments))})}catch(i){w.schedule(function(){j||(j=!0,f.call(g,i))})}}}var g=this,h=a;if(b){var i=y.call(arguments),j=i.length,k=j&&typeof i[j-1]===z;c=k?i.pop():l,h=a.apply(this,i)}else c=c||l;f()}};c.denodify=function(a){return function(){var b,c,d,e=y.call(arguments);return e.push(function(){b=arguments,d&&!c&&(c=!0,cb.apply(this,b))}),a.apply(this,e),function(a){d=a,b&&!c&&(c=!0,a.apply(this,b))}}},p.start=function(a,b,c){return C(a,b,c)()};var C=p.toAsync=function(a,b,c){return x(c)||(c=w),function(){var d=arguments,e=new t;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};p.fromCallback=function(a,b,c){return function(){var d=y.call(arguments,0);return new s(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return void e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},p.fromNodeCallback=function(a,b,c){return function(){var d=y.call(arguments,0);return new s(function(e){function f(a){if(a)return void e.onError(a);var b=y.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},c.config.useNativeEvents=!1;var D=a.angular&&angular.element?angular.element:a.jQuery?a.jQuery:a.Zepto?a.Zepto:null,E=!!a.Ember&&"function"==typeof a.Ember.addListener,F=!!a.Backbone&&!!a.Backbone.Marionette;p.fromEvent=function(a,b,d){if(a.addListener)return G(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d);if(!c.config.useNativeEvents){if(F)return G(function(c){a.on(b,c)},function(c){a.off(b,c)},d);if(E)return G(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},d);if(D){var e=D(a);return G(function(a){e.on(b,a)},function(a){e.off(b,a)},d)}}return new s(function(c){return o(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return void c.onError(e)}c.onNext(b)})}).publish().refCount()};var G=p.fromEventPattern=function(a,b,c){return new s(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return u(function(){b&&b(e,f)})}).publish().refCount()};return p.startAsync=function(a){var b;try{b=a()}catch(c){return r(c)}return q(b)},c});
//# sourceMappingURL=rx.async.compat.map

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

return new AnonymousObservable(function (observer) {
function handler(e) {
var results = e;
function handler() {
var results = arguments;
if (selector) {
try {
results = selector(arguments);
results = selector(results);
} catch (err) {

@@ -357,0 +357,0 @@ observer.onError(err);

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?A(a.call(b)):j(a)?A(a):h(a)?f(a):isPromise(a)?g(a):typeof a===y?a:k(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==y)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void v.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===y}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===y&&typeof a[z]===y}function k(a){return a&&a.constructor===Object}function l(a){a&&v.schedule(function(){throw a})}function m(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),t(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function n(a,b,c){var d=new u;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(n(a.item(e),b,c));else a&&d.add(m(a,b,c));return d}var o=c.Observable,p=(o.prototype,o.fromPromise),q=o.throwException,r=c.AnonymousObservable,s=c.AsyncSubject,t=c.Disposable.create,u=c.CompositeDisposable,v=(c.Scheduler.immediate,c.Scheduler.timeout),w=c.helpers.isScheduler,x=Array.prototype.slice,y="function",z="throw",A=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){v.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2&&(b=x.call(arguments,1)),a)try{c=h[z](a)}catch(i){return e(i)}if(!a)try{c=h.next(b)}catch(i){return e(i)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==y)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var j=!1;try{c.value.call(g,function(){j||(j=!0,f.apply(g,arguments))})}catch(i){v.schedule(function(){j||(j=!0,f.call(g,i))})}}}var g=this,h=a;if(b){var i=x.call(arguments),j=i.length,k=j&&typeof i[j-1]===y;c=k?i.pop():l,h=a.apply(this,i)}else c=c||l;f()}};c.denodify=function(a){return function(){var b,c,d,e=x.call(arguments);return e.push(function(){b=arguments,d&&!c&&(c=!0,cb.apply(this,b))}),a.apply(this,e),function(a){d=a,b&&!c&&(c=!0,a.apply(this,b))}}},o.start=function(a,b,c){return B(a,b,c)()};var B=o.toAsync=function(a,b,c){return w(c)||(c=v),function(){var d=arguments,e=new s;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};o.fromCallback=function(a,b,c){return function(){var d=x.call(arguments,0);return new r(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},o.fromNodeCallback=function(a,b,c){return function(){var d=x.call(arguments,0);return new r(function(e){function f(a){if(a)return void e.onError(a);var b=x.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},c.config.useNativeEvents=!1;var C=a.angular&&angular.element?angular.element:a.jQuery?a.jQuery:a.Zepto?a.Zepto:null,D=!!a.Ember&&"function"==typeof a.Ember.addListener,E=!!a.Backbone&&!!a.Backbone.Marionette;o.fromEvent=function(a,b,d){if(a.addListener)return F(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d);if(!c.config.useNativeEvents){if(E)return F(function(c){a.on(b,c)},function(c){a.off(b,c)},d);if(D)return F(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},d);if(C){var e=C(a);return F(function(a){e.on(b,a)},function(a){e.off(b,a)},d)}}return new r(function(c){return n(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return void c.onError(e)}c.onNext(b)})}).publish().refCount()};var F=o.fromEventPattern=function(a,b,c){return new r(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return t(function(){b&&b(e,f)})}).publish().refCount()};return o.startAsync=function(a){var b;try{b=a()}catch(c){return q(c)}return p(b)},c});
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?A(a.call(b)):j(a)?A(a):h(a)?f(a):isPromise(a)?g(a):typeof a===y?a:k(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==y)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void v.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===y}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===y&&typeof a[z]===y}function k(a){return a&&a.constructor===Object}function l(a){a&&v.schedule(function(){throw a})}function m(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),t(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function n(a,b,c){var d=new u;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(n(a.item(e),b,c));else a&&d.add(m(a,b,c));return d}var o=c.Observable,p=(o.prototype,o.fromPromise),q=o.throwException,r=c.AnonymousObservable,s=c.AsyncSubject,t=c.Disposable.create,u=c.CompositeDisposable,v=(c.Scheduler.immediate,c.Scheduler.timeout),w=c.helpers.isScheduler,x=Array.prototype.slice,y="function",z="throw",A=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){v.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2&&(b=x.call(arguments,1)),a)try{c=h[z](a)}catch(i){return e(i)}if(!a)try{c=h.next(b)}catch(i){return e(i)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==y)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var j=!1;try{c.value.call(g,function(){j||(j=!0,f.apply(g,arguments))})}catch(i){v.schedule(function(){j||(j=!0,f.call(g,i))})}}}var g=this,h=a;if(b){var i=x.call(arguments),j=i.length,k=j&&typeof i[j-1]===y;c=k?i.pop():l,h=a.apply(this,i)}else c=c||l;f()}};c.denodify=function(a){return function(){var b,c,d,e=x.call(arguments);return e.push(function(){b=arguments,d&&!c&&(c=!0,cb.apply(this,b))}),a.apply(this,e),function(a){d=a,b&&!c&&(c=!0,a.apply(this,b))}}},o.start=function(a,b,c){return B(a,b,c)()};var B=o.toAsync=function(a,b,c){return w(c)||(c=v),function(){var d=arguments,e=new s;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};o.fromCallback=function(a,b,c){return function(){var d=x.call(arguments,0);return new r(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return void e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},o.fromNodeCallback=function(a,b,c){return function(){var d=x.call(arguments,0);return new r(function(e){function f(a){if(a)return void e.onError(a);var b=x.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},c.config.useNativeEvents=!1;var C=a.angular&&angular.element?angular.element:a.jQuery?a.jQuery:a.Zepto?a.Zepto:null,D=!!a.Ember&&"function"==typeof a.Ember.addListener,E=!!a.Backbone&&!!a.Backbone.Marionette;o.fromEvent=function(a,b,d){if(a.addListener)return F(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d);if(!c.config.useNativeEvents){if(E)return F(function(c){a.on(b,c)},function(c){a.off(b,c)},d);if(D)return F(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},d);if(C){var e=C(a);return F(function(a){e.on(b,a)},function(a){e.off(b,a)},d)}}return new r(function(c){return n(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return void c.onError(e)}c.onNext(b)})}).publish().refCount()};var F=o.fromEventPattern=function(a,b,c){return new r(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return t(function(){b&&b(e,f)})}).publish().refCount()};return o.startAsync=function(a){var b;try{b=a()}catch(c){return q(c)}return p(b)},c});
//# sourceMappingURL=rx.async.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(T)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&tb(a)&&(a=vb.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===lb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==mb){var g=a.constructor,h=-1,i=qb.length;if(a===(g&&g.prototype))var j=a===nb?hb:a===lb?cb:ib.call(a),k=rb[j];for(;++h<i;)f=qb[h],k&&k[f]||!jb.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=ib.call(a),k=ib.call(b);if(j==$&&(j=fb),k==$&&(k=fb),j!=k)return!1;switch(j){case ab:case bb:return+a==+b;case eb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case gb:case hb:return a==String(b)}var l=j==_;if(!l){if(j!=fb||!sb.nodeClass&&(g(a)||g(b)))return!1;var m=!sb.argsObject&&tb(a)?Object:a.constructor,n=!sb.argsObject&&tb(b)?Object:b.constructor;if(!(m==n||jb.call(a,"constructor")&&jb.call(b,"constructor")||R(m)&&m instanceof m&&R(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=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return jb.call(f,e)?(p++,q=jb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return jb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:vb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&D.isFinite(a)}function r(b){var c,d=b[U];if(!d&&"string"==typeof b)return c=new m(b),c[U]();if(!d&&b.length!==a)return c=new o(b),c[U]();if(!d)throw new TypeError("Object is not iterable");return b[U]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>oc?oc:b):b}function v(a,b){return K(a)||(a=Qb),new zc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new zc(function(c){var d=new Ib,e=new Jb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Q(f)&&(f=lc(f)),d=new Ib,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new zc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=lc(f)),(X(f)||W(f))&&(f=pc(f)),f}).concatAll()}function z(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function A(a){this.comparer=a,this.set=[]}function B(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=lc(f)),(X(f)||W(f))&&(f=pc(f)),f}).mergeAll()}var C={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},D=C[typeof window]&&window||this,E=C[typeof exports]&&exports&&!exports.nodeType&&exports,F=C[typeof module]&&module&&!module.nodeType&&module,G=F&&F.exports===E&&E,H=C[typeof global]&&global;!H||H.global!==H&&H.window!==H||(D=H);var I={internals:{},config:{Promise:D.Promise},helpers:{}},J=I.helpers.noop=function(){},K=(I.helpers.notDefined=function(a){return"undefined"==typeof a},I.helpers.isScheduler=function(a){return a instanceof I.Scheduler}),L=I.helpers.identity=function(a){return a},M=(I.helpers.pluck=function(a){return function(b){return b[a]}},I.helpers.just=function(a){return function(){return a}},I.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),N=I.helpers.defaultComparer=function(a,b){return ub(a,b)},O=I.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},P=(I.helpers.defaultKeySerializer=function(a){return a.toString()},I.helpers.defaultError=function(a){throw a}),Q=I.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},R=(I.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},I.helpers.not=function(a){return!a},I.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ib.call(a)}),a}()),S="Argument out of range",T="Object has been disposed",U="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";D.Set&&"function"==typeof(new D.Set)["@@iterator"]&&(U="@@iterator");var V=I.doneEnumerator={done:!0,value:a},W=I.helpers.isIterable=function(b){return b[U]!==a},X=I.helpers.isArrayLike=function(b){return b&&b.length!==a};I.helpers.iterator=U;var Y,Z=I.helpers.deprecate=function(){},$="[object Arguments]",_="[object Array]",ab="[object Boolean]",bb="[object Date]",cb="[object Error]",db="[object Function]",eb="[object Number]",fb="[object Object]",gb="[object RegExp]",hb="[object String]",ib=Object.prototype.toString,jb=Object.prototype.hasOwnProperty,kb=ib.call(arguments)==$,lb=Error.prototype,mb=Object.prototype,nb=String.prototype,ob=mb.propertyIsEnumerable;try{Y=!(ib.call(document)==fb&&!({toString:0}+""))}catch(pb){Y=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[_]=rb[bb]=rb[eb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[ab]=rb[hb]={constructor:!0,toString:!0,valueOf:!0},rb[cb]=rb[db]=rb[gb]={constructor:!0,toString:!0},rb[fb]={constructor:!0};var sb={};!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);sb.enumErrorProps=ob.call(lb,"message")||ob.call(lb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1);var tb=function(a){return a&&"object"==typeof a?ib.call(a)==$:!1};kb||(tb=function(a){return a&&"object"==typeof a?jb.call(a,"callee"):!1});var ub=I.internals.isEqual=function(a,b){return h(a,b,[],[])},vb=Array.prototype.slice,wb=({}.hasOwnProperty,this.inherits=I.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),xb=I.internals.addProperties=function(a){for(var b=vb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},yb=I.internals.addRef=function(a,b){return new zc(function(c){return new Db(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=vb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(vb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(vb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var zb=Object("a"),Ab="a"!=zb[0]||!(0 in zb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Ab&&{}.toString.call(this)==hb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=db)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Ab&&{}.toString.call(this)==hb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=db)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==_}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Bb=I.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Cb=Bb.prototype;Cb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Cb.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)}}},Cb.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)}}},Cb.peek=function(){return this.items[0].value},Cb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Cb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Cb.enqueue=function(a){var b=this.length++;this.items[b]=new k(Bb.count++,a),this.percolate(b)},Cb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Bb.count=0;var Db=I.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Eb=Db.prototype;Eb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Eb.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},Eb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Eb.toArray=function(){return this.disposables.slice(0)};var Fb=I.Disposable=function(a){this.isDisposed=!1,this.action=a||J};Fb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Gb=Fb.create=function(a){return new Fb(a)},Hb=Fb.empty={dispose:J},Ib=I.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Jb=I.SerialDisposable=Ib,Kb=I.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Hb:new a(this)},b}();l.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Lb=I.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||O,this.disposable=new Ib};Lb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Lb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Lb.prototype.isCancelled=function(){return this.disposable.isDisposed},Lb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Mb=I.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Hb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=M,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Nb=Mb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Db,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Hb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Db,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Hb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Mb.prototype),function(){Mb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Mb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof D.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=D.setInterval(function(){d=c(d)},b);return Gb(function(){D.clearInterval(e)})}}(Mb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Vb(this,a)}}(Mb.prototype);var Ob,Pb=(I.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 Ib;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Mb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Nb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Mb(M,a,b,c)}()),Qb=Mb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Mb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Mb.normalize(c),g=new Lb(this,b,d,f);if(e)e.enqueue(g);else{e=new Bb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Mb(M,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Rb=J,Sb=function(){var a,b=J;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!D.setTimeout)throw new Error("No concurrency detected!");a=D.setTimeout,b=D.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Tb=Sb.setTimeout,Ub=Sb.clearTimeout;!function(){function a(){if(!D.postMessage||D.importScripts)return!1;var a=!1,b=D.onmessage;return D.onmessage=function(){a=!0},D.postMessage("","*"),D.onmessage=b,a}var b=RegExp("^"+String(ib).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=H&&G&&H.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=H&&G&&H.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Ob=c,Rb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Ob=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};D.addEventListener?D.addEventListener("message",h,!1):D.attachEvent("onmessage",h,!1),Ob=function(a){var b=g++;f[b]=a,D.postMessage(e+b,"*")}}else if(D.MessageChannel){var i=new D.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Ob=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in D&&"onreadystatechange"in D.document.createElement("script")?Ob=function(a){var b=D.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},D.document.documentElement.appendChild(b)}:(Ob=function(a){return Tb(a,0)},Rb=Ub)}();var Vb=(Mb.timeout=function(){function a(a,b){var c=this,d=new Ib,e=Ob(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Db(d,Gb(function(){Rb(e)}))}function b(a,b,c){var d=this,e=Mb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Ib,g=Tb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Db(f,Gb(function(){Ub(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Mb(M,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return wb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Hb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Ib;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Mb)),Wb=I.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 K(a)||(a=Pb),new zc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Xb=Wb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Wb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Yb=Wb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Wb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Zb=Wb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Wb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),$b=I.internals.Enumerator=function(a){this._next=a};$b.prototype.next=function(){return this._next()},$b.prototype[U]=function(){return this};var _b=I.internals.Enumerable=function(a){this._iterator=a};_b.prototype[U]=function(){return this._iterator()},_b.prototype.concat=function(){var a=this;return new zc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f=new Jb,g=Pb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Q(h)&&(h=lc(h));var i=new Ib;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Db(f,g,Gb(function(){e=!0}))})},_b.prototype.catchError=function(){var a=this;return new zc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f,g=new Jb,h=Pb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Q(i)&&(i=lc(i));var j=new Ib;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Db(g,h,Gb(function(){e=!0}))})};var ac=_b.repeat=function(a,b){return null==b&&(b=-1),new _b(function(){var c=b;return new $b(function(){return 0===c?V:(c>0&&c--,{done:!1,value:a})})})},bc=_b.of=function(a,b,c){return b||(b=L),new _b(function(){var d=-1;return new $b(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:V})})},cc=I.Observer=function(){};cc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},cc.prototype.asObserver=function(){return new gc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},cc.prototype.checked=function(){return new hc(this)};var dc=cc.create=function(a,b,c){return a||(a=J),b||(b=P),c||(c=J),new gc(a,b,c)};cc.fromNotifier=function(a,b){return new gc(function(c){return a.call(b,Xb(c))},function(c){return a.call(b,Yb(c))},function(){return a.call(b,Zb())})},cc.prototype.notifyOn=function(a){return new jc(a,this)};var ec,fc=I.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return wb(b,a),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}(cc),gc=I.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return wb(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}(fc),hc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}wb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},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}(cc),ic=I.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 Jb}return wb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(fc),jc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return wb(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}(ic),kc=I.Observable=function(){function a(a){this._subscribe=a}return ec=a.prototype,ec.subscribe=ec.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:dc(a,b,c))},ec.subscribeOnNext=function(a,b){return this._subscribe(dc(2===arguments.length?function(c){a.call(b,c)}:a))},ec.subscribeOnError=function(a,b){return this._subscribe(dc(null,2===arguments.length?function(c){a.call(b,c)}:a))},ec.subscribeOnCompleted=function(a,b){return this._subscribe(dc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();ec.observeOn=function(a){var b=this;return new zc(function(c){return b.subscribe(new jc(a,c))})},ec.subscribeOn=function(a){var b=this;return new zc(function(c){var d=new Ib,e=new Jb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new l(a,b.subscribe(c)))})),e})};var lc=kc.fromPromise=function(a){return mc(function(){var b=new I.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};ec.toPromise=function(a){if(a||(a=I.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},ec.toArray=function(){var a=this;return new zc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},kc.create=kc.createWithDisposable=function(a){return new zc(a)};var mc=kc.defer=function(a){return new zc(function(b){var c;try{c=a()}catch(d){return tc(d).subscribe(b)}return Q(c)&&(c=lc(c)),c.subscribe(b)})},nc=kc.empty=function(a){return K(a)||(a=Pb),new zc(function(b){return a.schedule(function(){b.onCompleted()})})},oc=Math.pow(2,53)-1;m.prototype[U]=function(){return new n(this._s)},n.prototype[U]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return V},o.prototype[U]=function(){return new p(this._a)},p.prototype[U]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return V};var pc=kc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!R(b))throw new Error("mapFn when provided must be a function");K(d)||(d=Qb);var e=Object(a),f=r(e);return new zc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&R(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},qc=kc.fromArray=function(a,b){return Z("fromArray","from"),K(b)||(b=Qb),new zc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};kc.generate=function(a,b,c,d,e){return K(e)||(e=Qb),new zc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var rc=kc.never=function(){return new zc(function(){return Hb})};kc.of=function(){return v(null,arguments)},kc.ofWithScheduler=function(a){return v(a,vb.call(arguments,1))},kc.range=function(a,b,c){return K(c)||(c=Qb),new zc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},kc.repeat=function(a,b,c){return K(c)||(c=Qb),sc(a,c).repeat(null==b?-1:b)};var sc=kc["return"]=kc.just=function(a,b){return K(b)||(b=Pb),new zc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};kc.returnValue=function(){return Z("returnValue","return or just"),sc.apply(null,arguments)};var tc=kc["throw"]=kc.throwException=kc.throwError=function(a,b){return K(b)||(b=Pb),new zc(function(c){return b.schedule(function(){c.onError(a)})})};kc.using=function(a,b){return new zc(function(c){var d,e,f=Hb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Db(tc(g).subscribe(c),f)}return new Db(e.subscribe(c),f)})},ec.amb=function(a){var b=this;return new zc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Ib,j=new Ib;return Q(a)&&(a=lc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Db(i,j)})},kc.amb=function(){function a(a,b){return a.amb(b)}for(var b=rc(),c=i(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},ec["catch"]=ec.catchError=function(a){return"function"==typeof a?w(this,a):uc([this,a])},ec.catchException=function(a){return Z("catchException","catch or catchError"),this.catchError(a)};var uc=kc.catchError=kc["catch"]=function(){return bc(i(arguments,0)).catchError()};kc.catchException=function(){return Z("catchException","catch or catchError"),uc.apply(null,arguments)},ec.combineLatest=function(){var a=vb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),vc.apply(this,a)};var vc=kc.combineLatest=function(){var a=vb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new zc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(L))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(L)&&c.onCompleted()}function e(a){k[a]=!0,k.every(L)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Ib;Q(f)&&(f=lc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Db(m)})};ec.concat=function(){var a=vb.call(arguments,0);return a.unshift(this),wc.apply(this,a)};var wc=kc.concat=function(){return bc(i(arguments,0)).concat()};ec.concatAll=function(){return this.merge(1)},ec.concatObservable=function(){return Z("concatObservable","concatAll"),this.merge(1)},ec.merge=function(a){if("number"!=typeof a)return xc(this,a);var b=this;
return new zc(function(c){function d(a){var b=new Ib;f.add(b),Q(a)&&(a=lc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Db,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var xc=kc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=vb.call(arguments,1)):(a=Pb,b=vb.call(arguments,0)):(a=Pb,b=vb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};ec.mergeAll=function(){var a=this;return new zc(function(b){var c=new Db,d=!1,e=new Ib;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Ib;c.add(e),Q(a)&&(a=lc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},ec.mergeObservable=function(){return Z("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},ec.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return yc([this,a])};var yc=kc.onErrorResumeNext=function(){var a=i(arguments,0);return new zc(function(b){var c=0,d=new Jb,e=Pb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Q(f)&&(f=lc(f)),g=new Ib,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Db(d,e)})};ec.skipUntil=function(a){var b=this;return new zc(function(c){var d=!1,e=new Db(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Q(a)&&(a=lc(a));var f=new Ib;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},ec["switch"]=ec.switchLatest=function(){var a=this;return new zc(function(b){var c=!1,d=new Jb,e=!1,f=0,g=a.subscribe(function(a){var g=new Ib,h=++f;c=!0,d.setDisposable(g),Q(a)&&(a=lc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Db(g,d)})},ec.takeUntil=function(a){var b=this;return new zc(function(c){return Q(a)&&(a=lc(a)),new Db(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),J))})},ec.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=vb.call(arguments),c=b.pop();return b.unshift(a),new zc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(L)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Ib;Q(c)&&(c=lc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Db(k)})},kc.zip=function(){var a=vb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},kc.zipArray=function(){var a=i(arguments,0);return new zc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(L))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(L)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Ib,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Db(h);return k.add(Gb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},ec.asObservable=function(){return new zc(this.subscribe.bind(this))},ec.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},ec.dematerialize=function(){var a=this;return new zc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},ec.distinctUntilChanged=function(a,b){var c=this;return a||(a=L),b||(b=N),new zc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},ec["do"]=ec.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new zc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},ec.doAction=function(){return Z("doAction","do or tap"),this.tap.apply(this,arguments)},ec.doOnNext=ec.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},ec.doOnError=ec.tapOnError=function(a,b){return this.tap(J,2===arguments.length?function(c){a.call(b,c)}:a)},ec.doOnCompleted=ec.tapOnCompleted=function(a,b){return this.tap(J,null,2===arguments.length?function(){a.call(b)}:a)},ec["finally"]=ec.ensure=function(a){var b=this;return new zc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Gb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},ec.finallyAction=function(a){return Z("finallyAction","finally or ensure"),this.ensure(a)},ec.ignoreElements=function(){var a=this;return new zc(function(b){return a.subscribe(J,b.onError.bind(b),b.onCompleted.bind(b))})},ec.materialize=function(){var a=this;return new zc(function(b){return a.subscribe(function(a){b.onNext(Xb(a))},function(a){b.onNext(Yb(a)),b.onCompleted()},function(){b.onNext(Zb()),b.onCompleted()})})},ec.repeat=function(a){return ac(this,a).concat()},ec.retry=function(a){return ac(this,a).catchError()},ec.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new zc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},ec.skipLast=function(a){var b=this;return new zc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},ec.startWith=function(){var a,b,c=0;return arguments.length&&K(arguments[0])?(b=arguments[0],c=1):b=Pb,a=vb.call(arguments,c),bc([qc(a,b),this]).concat()},ec.takeLast=function(a){var b=this;return new zc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},ec.takeLastBuffer=function(a){var b=this;return new zc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},ec.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(S);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(S);return new zc(function(d){function e(){var a=new Cc;i.push(a),d.onNext(yb(a,g))}var f=new Ib,g=new Kb(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})},ec.selectConcat=ec.concatMap=function(a,b,c){return R(a)&&R(b)?this.concatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=lc(e)),(X(e)||W(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})}):R(a)?y(this,a,c):y(this,function(){return a})},ec.concatMapObserver=ec.selectConcatObserver=function(a,b,c,d){var e=this;return new zc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=lc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},ec.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new zc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},A.prototype.push=function(a){var b=-1===z(this.set,a,this.comparer);return b&&this.set.push(a),b},ec.distinct=function(a,b){var c=this;return b||(b=N),new zc(function(d){var e=new A(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},ec.select=ec.map=function(a,b){var c=R(a)?a:function(){return a},d=this;return new zc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},ec.pluck=function(a){return this.map(function(b){return b[a]})},ec.selectMany=ec.flatMap=function(a,b,c){return R(a)&&R(b)?this.flatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=lc(e)),(X(e)||W(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):R(a)?B(this,a,c):B(this,function(){return a})},ec.flatMapObserver=ec.selectManyObserver=function(a,b,c,d){var e=this;return new zc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=lc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},ec.selectSwitch=ec.flatMapLatest=ec.switchMap=function(a,b){return this.select(a,b).switchLatest()},ec.skip=function(a){if(0>a)throw new Error(S);var b=this;return new zc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},ec.skipWhile=function(a,b){var c=this;return new zc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},ec.take=function(a,b){if(0>a)throw new RangeError(S);if(0===a)return nc(b);var c=this;return new zc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},ec.takeWhile=function(a,b){var c=this;return new zc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},ec.where=ec.filter=function(a,b){var c=this;return new zc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},ec.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new zc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var zc=I.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Gb(a):Hb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Ac(a);return Qb.scheduleRequired()?Qb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return wb(c,a),c}(kc),Ac=function(a){function b(b){a.call(this),this.observer=b,this.m=new Ib}wb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(fc),Bc=function(a,b){this.subject=a,this.observer=b};Bc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Cc=I.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Hb):(a.onCompleted(),Hb):(this.observers.push(a),new Bc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return wb(d,a),xb(d.prototype,cc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Dc(a,b)},d}(kc),Dc=(I.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Bc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Hb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return wb(d,a),xb(d.prototype,cc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(kc),I.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return wb(b,a),xb(b.prototype,cc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(kc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(D.Rx=I,define(function(){return I})):E&&F?G?(F.exports=I).Rx=I:E.Rx=I:D.Rx=I}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(Z)}function c(a,b){if($&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(cb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+cb+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return console.log(ab,bb,Oc),c===ab&&d>=bb&&Oc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if($)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ab=d[0],d[1]}}function h(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 i(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;Cb.nonEnumArgs&&a.length&&Db(a)&&(a=Fb.call(a));var c=Cb.enumPrototypes&&"function"==typeof a,d=Cb.enumErrorProps&&(a===wb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Cb.nonEnumShadows&&a!==xb){var f=a.constructor,g=-1,h=Ab.length;if(a===(f&&f.prototype))var j=a===yb?sb:a===wb?nb:tb.call(a),k=Bb[j];for(;++g<h;)e=Ab[g],k&&k[e]||!ub.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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 g=tb.call(a),h=tb.call(b);if(g==jb&&(g=qb),h==jb&&(h=qb),g!=h)return!1;switch(g){case lb:case mb:return+a==+b;case pb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case rb:case sb:return a==String(b)}var i=g==kb;if(!i){if(g!=qb||!Cb.nodeClass&&(m(a)||m(b)))return!1;var j=!Cb.argsObject&&Db(a)?Object:a.constructor,k=!Cb.argsObject&&Db(b)?Object:b.constructor;if(!(j==k||ub.call(a,"constructor")&&ub.call(b,"constructor")||X(j)&&j instanceof j&&X(k)&&k instanceof k||!("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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return ub.call(f,e)?(p++,q=ub.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return ub.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Fb.call(a)}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(){this._s=s}function u(){this._s=s,this._l=s.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&J.isFinite(a)}function y(b){var c,d=b[db];if(!d&&"string"==typeof b)return c=new t(b),c[db]();if(!d&&b.length!==a)return c=new v(b),c[db]();if(!d)throw new TypeError("Object is not iterable");return b[db]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>yc?yc:b):b}function B(a,b){return Q(a)||(a=$b),new Jc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function C(a,b){return new Jc(function(c){var d=new Sb,e=new Tb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}W(f)&&(f=vc(f)),d=new Sb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function D(a,b){var c=this;return new Jc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function E(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return W(f)&&(f=vc(f)),(gb(f)||fb(f))&&(f=zc(f)),f}).concatAll()}function F(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function G(a){this.comparer=a,this.set=[]}function H(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return W(f)&&(f=vc(f)),(gb(f)||fb(f))&&(f=zc(f)),f}).mergeAll()}var I={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},J=I[typeof window]&&window||this,K=I[typeof exports]&&exports&&!exports.nodeType&&exports,L=I[typeof module]&&module&&!module.nodeType&&module,M=L&&L.exports===K&&K,N=I[typeof global]&&global;!N||N.global!==N&&N.window!==N||(J=N);var O={internals:{},config:{Promise:J.Promise},helpers:{}},P=O.helpers.noop=function(){},Q=(O.helpers.notDefined=function(a){return"undefined"==typeof a},O.helpers.isScheduler=function(a){return a instanceof O.Scheduler}),R=O.helpers.identity=function(a){return a},S=(O.helpers.pluck=function(a){return function(b){return b[a]}},O.helpers.just=function(a){return function(){return a}},O.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),T=O.helpers.defaultComparer=function(a,b){return Eb(a,b)},U=O.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},V=(O.helpers.defaultKeySerializer=function(a){return a.toString()},O.helpers.defaultError=function(a){throw a}),W=O.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},X=(O.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},O.helpers.not=function(a){return!a},O.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==tb.call(a)}),a}()),Y="Argument out of range",Z="Object has been disposed";O.config.longStackSupport=!1;var $=!1;try{throw new Error}catch(_){$=!!_.stack}var ab,bb=g(),cb="From previous event:",db="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";J.Set&&"function"==typeof(new J.Set)["@@iterator"]&&(db="@@iterator");var eb=O.doneEnumerator={done:!0,value:a},fb=O.helpers.isIterable=function(b){return b[db]!==a},gb=O.helpers.isArrayLike=function(b){return b&&b.length!==a};O.helpers.iterator=db;var hb,ib=O.helpers.deprecate=function(){},jb="[object Arguments]",kb="[object Array]",lb="[object Boolean]",mb="[object Date]",nb="[object Error]",ob="[object Function]",pb="[object Number]",qb="[object Object]",rb="[object RegExp]",sb="[object String]",tb=Object.prototype.toString,ub=Object.prototype.hasOwnProperty,vb=tb.call(arguments)==jb,wb=Error.prototype,xb=Object.prototype,yb=String.prototype,zb=xb.propertyIsEnumerable;try{hb=!(tb.call(document)==qb&&!({toString:0}+""))}catch(_){hb=!0}var Ab=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bb={};Bb[kb]=Bb[mb]=Bb[pb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Bb[lb]=Bb[sb]={constructor:!0,toString:!0,valueOf:!0},Bb[nb]=Bb[ob]=Bb[rb]={constructor:!0,toString:!0},Bb[qb]={constructor:!0};var Cb={};!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);Cb.enumErrorProps=zb.call(wb,"message")||zb.call(wb,"name"),Cb.enumPrototypes=zb.call(a,"prototype"),Cb.nonEnumArgs=0!=c,Cb.nonEnumShadows=!/valueOf/.test(b)}(1);var Db=function(a){return a&&"object"==typeof a?tb.call(a)==jb:!1};vb||(Db=function(a){return a&&"object"==typeof a?ub.call(a,"callee"):!1});var Eb=O.internals.isEqual=function(a,b){return n(a,b,[],[])},Fb=Array.prototype.slice,Gb=({}.hasOwnProperty,this.inherits=O.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Hb=O.internals.addProperties=function(a){for(var b=Fb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},Ib=O.internals.addRef=function(a,b){return new Jc(function(c){return new Nb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Fb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Fb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Fb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Jb=Object("a"),Kb="a"!=Jb[0]||!(0 in Jb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Kb&&{}.toString.call(this)==sb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=ob)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Kb&&{}.toString.call(this)==sb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=ob)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==kb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Lb=O.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Mb=Lb.prototype;Mb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Mb.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)}}},Mb.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)}}},Mb.peek=function(){return this.items[0].value},Mb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Mb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Mb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Lb.count++,a),this.percolate(b)},Mb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Lb.count=0;var Nb=O.CompositeDisposable=function(){this.disposables=o(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Ob=Nb.prototype;Ob.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Ob.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},Ob.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Ob.toArray=function(){return this.disposables.slice(0)};var Pb=O.Disposable=function(a){this.isDisposed=!1,this.action=a||P};Pb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Qb=Pb.create=function(a){return new Pb(a)},Rb=Pb.empty={dispose:P},Sb=O.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Tb=O.SerialDisposable=Sb,Ub=O.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Rb:new a(this)},b}();r.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Vb=O.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||U,this.disposable=new Sb};Vb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Vb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Vb.prototype.isCancelled=function(){return this.disposable.isDisposed},Vb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Wb=O.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Rb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=S,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Xb=Wb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Nb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Rb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Nb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Rb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Wb.prototype),function(){Wb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Wb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof J.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=J.setInterval(function(){d=c(d)},b);return Qb(function(){J.clearInterval(e)})}}(Wb.prototype),function(a){a.catchError=a["catch"]=function(a){return new dc(this,a)}}(Wb.prototype);var Yb,Zb=(O.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 Sb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Wb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Xb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Wb(S,a,b,c)}()),$b=Wb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Wb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Wb.normalize(c),g=new Vb(this,b,d,f);if(e)e.enqueue(g);else{e=new Lb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Wb(S,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),_b=P,ac=function(){var a,b=P;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!J.setTimeout)throw new Error("No concurrency detected!");a=J.setTimeout,b=J.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),bc=ac.setTimeout,cc=ac.clearTimeout;!function(){function a(){if(!J.postMessage||J.importScripts)return!1;var a=!1,b=J.onmessage;return J.onmessage=function(){a=!0},J.postMessage("","*"),J.onmessage=b,a}var b=RegExp("^"+String(tb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=N&&M&&N.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=N&&M&&N.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Yb=c,_b=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Yb=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};J.addEventListener?J.addEventListener("message",h,!1):J.attachEvent("onmessage",h,!1),Yb=function(a){var b=g++;f[b]=a,J.postMessage(e+b,"*")}}else if(J.MessageChannel){var i=new J.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Yb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in J&&"onreadystatechange"in J.document.createElement("script")?Yb=function(a){var b=J.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},J.document.documentElement.appendChild(b)}:(Yb=function(a){return bc(a,0)},_b=cc)}();var dc=(Wb.timeout=function(){function a(a,b){var c=this,d=new Sb,e=Yb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Nb(d,Qb(function(){_b(e)}))}function b(a,b,c){var d=this,e=Wb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Sb,g=bc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Nb(f,Qb(function(){cc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Wb(S,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Gb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Rb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Sb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Wb)),ec=O.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 Q(a)||(a=Zb),new Jc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),fc=ec.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new ec("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),gc=ec.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new ec("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),hc=ec.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new ec("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),ic=O.internals.Enumerator=function(a){this._next=a};ic.prototype.next=function(){return this._next()},ic.prototype[db]=function(){return this};var jc=O.internals.Enumerable=function(a){this._iterator=a};jc.prototype[db]=function(){return this._iterator()},jc.prototype.concat=function(){var a=this;return new Jc(function(b){var c;try{c=a[db]()}catch(d){return void b.onError(d)}var e,f=new Tb,g=Zb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;W(h)&&(h=vc(h));var i=new Sb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Nb(f,g,Qb(function(){e=!0}))})},jc.prototype.catchError=function(){var a=this;return new Jc(function(b){var c;try{c=a[db]()}catch(d){return void b.onError(d)}var e,f,g=new Tb,h=Zb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;W(i)&&(i=vc(i));var j=new Sb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Nb(g,h,Qb(function(){e=!0}))})};var kc=jc.repeat=function(a,b){return null==b&&(b=-1),new jc(function(){var c=b;return new ic(function(){return 0===c?eb:(c>0&&c--,{done:!1,value:a})})})},lc=jc.of=function(a,b,c){return b||(b=R),new jc(function(){var d=-1;return new ic(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:eb})})},mc=O.Observer=function(){};mc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},mc.prototype.asObserver=function(){return new qc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},mc.prototype.checked=function(){return new rc(this)};var nc=mc.create=function(a,b,c){return a||(a=P),b||(b=V),c||(c=P),new qc(a,b,c)};mc.fromNotifier=function(a,b){return new qc(function(c){return a.call(b,fc(c))},function(c){return a.call(b,gc(c))},function(){return a.call(b,hc())})},mc.prototype.notifyOn=function(a){return new tc(a,this)};var oc,pc=O.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Gb(b,a),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}(mc),qc=O.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Gb(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}(pc),rc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Gb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},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}(mc),sc=O.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 Tb}return Gb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(pc),tc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Gb(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}(sc),uc=O.Observable=function(){function a(a){if(O.config.longStackSupport&&$){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){b.onError=function(a){c(d,a),b.onError(a)},a(b)}}this._subscribe=a}return oc=a.prototype,oc.subscribe=oc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:nc(a,b,c))},oc.subscribeOnNext=function(a,b){return this._subscribe(nc(2===arguments.length?function(c){a.call(b,c)}:a))},oc.subscribeOnError=function(a,b){return this._subscribe(nc(null,2===arguments.length?function(c){a.call(b,c)}:a))},oc.subscribeOnCompleted=function(a,b){return this._subscribe(nc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();oc.observeOn=function(a){var b=this;return new Jc(function(c){return b.subscribe(new tc(a,c))})},oc.subscribeOn=function(a){var b=this;return new Jc(function(c){var d=new Sb,e=new Tb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e})};var vc=uc.fromPromise=function(a){return wc(function(){var b=new O.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};oc.toPromise=function(a){if(a||(a=O.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},oc.toArray=function(){var a=this;return new Jc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},uc.create=uc.createWithDisposable=function(a,b){return new Jc(a,b)};var wc=uc.defer=function(a){return new Jc(function(b){var c;try{c=a()}catch(d){return Dc(d).subscribe(b)}return W(c)&&(c=vc(c)),c.subscribe(b)})},xc=uc.empty=function(a){return Q(a)||(a=Zb),new Jc(function(b){return a.schedule(function(){b.onCompleted()})})},yc=Math.pow(2,53)-1;t.prototype[db]=function(){return new u(this._s)},u.prototype[db]=function(){return this},u.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return eb},v.prototype[db]=function(){return new w(this._a)},w.prototype[db]=function(){return this},w.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return eb};var zc=uc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!X(b))throw new Error("mapFn when provided must be a function");Q(d)||(d=$b);var e=Object(a),f=y(e);return new Jc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&X(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},Ac=uc.fromArray=function(a,b){return ib("fromArray","from"),Q(b)||(b=$b),new Jc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};uc.generate=function(a,b,c,d,e){return Q(e)||(e=$b),new Jc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var Bc=uc.never=function(){return new Jc(function(){return Rb})};uc.of=function(){return B(null,arguments)},uc.ofWithScheduler=function(a){return B(a,Fb.call(arguments,1))},uc.range=function(a,b,c){return Q(c)||(c=$b),new Jc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},uc.repeat=function(a,b,c){return Q(c)||(c=$b),Cc(a,c).repeat(null==b?-1:b)};var Cc=uc["return"]=uc.just=function(a,b){return Q(b)||(b=Zb),new Jc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};uc.returnValue=function(){return ib("returnValue","return or just"),Cc.apply(null,arguments)};var Dc=uc["throw"]=uc.throwException=uc.throwError=function(a,b){return Q(b)||(b=Zb),new Jc(function(c){return b.schedule(function(){c.onError(a)})})};uc.using=function(a,b){return new Jc(function(c){var d,e,f=Rb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Nb(Dc(g).subscribe(c),f)}return new Nb(e.subscribe(c),f)})},oc.amb=function(a){var b=this;return new Jc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Sb,j=new Sb;return W(a)&&(a=vc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Nb(i,j)})},uc.amb=function(){function a(a,b){return a.amb(b)}for(var b=Bc(),c=o(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},oc["catch"]=oc.catchError=function(a){return"function"==typeof a?C(this,a):Ec([this,a])},oc.catchException=function(a){return ib("catchException","catch or catchError"),this.catchError(a)};var Ec=uc.catchError=uc["catch"]=function(){return lc(o(arguments,0)).catchError()
};uc.catchException=function(){return ib("catchException","catch or catchError"),Ec.apply(null,arguments)},oc.combineLatest=function(){var a=Fb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Fc.apply(this,a)};var Fc=uc.combineLatest=function(){var a=Fb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Jc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(R))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(R)&&c.onCompleted()}function e(a){j[a]=!0,j.every(R)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new Sb;W(f)&&(f=vc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),l[b]=g}(m);return new Nb(l)})};oc.concat=function(){var a=Fb.call(arguments,0);return a.unshift(this),Gc.apply(this,a)};var Gc=uc.concat=function(){return lc(o(arguments,0)).concat()};oc.concatAll=function(){return this.merge(1)},oc.concatObservable=function(){return ib("concatObservable","concatAll"),this.merge(1)},oc.merge=function(a){if("number"!=typeof a)return Hc(this,a);var b=this;return new Jc(function(c){function d(a){var b=new Sb;f.add(b),W(a)&&(a=vc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Nb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var Hc=uc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Fb.call(arguments,1)):(a=Zb,b=Fb.call(arguments,0)):(a=Zb,b=Fb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),B(a,b).mergeAll()};oc.mergeAll=function(){var a=this;return new Jc(function(b){var c=new Nb,d=!1,e=new Sb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Sb;c.add(e),W(a)&&(a=vc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},oc.mergeObservable=function(){return ib("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},oc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Ic([this,a])};var Ic=uc.onErrorResumeNext=function(){var a=o(arguments,0);return new Jc(function(b){var c=0,d=new Tb,e=Zb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],W(f)&&(f=vc(f)),g=new Sb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Nb(d,e)})};oc.skipUntil=function(a){var b=this;return new Jc(function(c){var d=!1,e=new Nb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));W(a)&&(a=vc(a));var f=new Sb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},oc["switch"]=oc.switchLatest=function(){var a=this;return new Jc(function(b){var c=!1,d=new Tb,e=!1,f=0,g=a.subscribe(function(a){var g=new Sb,h=++f;c=!0,d.setDisposable(g),W(a)&&(a=vc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Nb(g,d)})},oc.takeUntil=function(a){var b=this;return new Jc(function(c){return W(a)&&(a=vc(a)),new Nb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),P))})},oc.zip=function(){if(Array.isArray(arguments[0]))return D.apply(this,arguments);var a=this,b=Fb.call(arguments),c=b.pop();return b.unshift(a),new Jc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(R)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=p(g,function(){return[]}),i=p(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new Sb;W(c)&&(c=vc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new Nb(j)})},uc.zip=function(){var a=Fb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},uc.zipArray=function(){var a=o(arguments,0);return new Jc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(R))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(R)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Sb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Nb(h);return j.add(Qb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},oc.asObservable=function(){return new Jc(this.subscribe.bind(this))},oc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},oc.dematerialize=function(){var a=this;return new Jc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},oc.distinctUntilChanged=function(a,b){var c=this;return a||(a=R),b||(b=T),new Jc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},oc["do"]=oc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Jc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},oc.doAction=function(){return ib("doAction","do or tap"),this.tap.apply(this,arguments)},oc.doOnNext=oc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},oc.doOnError=oc.tapOnError=function(a,b){return this.tap(P,2===arguments.length?function(c){a.call(b,c)}:a)},oc.doOnCompleted=oc.tapOnCompleted=function(a,b){return this.tap(P,null,2===arguments.length?function(){a.call(b)}:a)},oc["finally"]=oc.ensure=function(a){var b=this;return new Jc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Qb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},oc.finallyAction=function(a){return ib("finallyAction","finally or ensure"),this.ensure(a)},oc.ignoreElements=function(){var a=this;return new Jc(function(b){return a.subscribe(P,b.onError.bind(b),b.onCompleted.bind(b))})},oc.materialize=function(){var a=this;return new Jc(function(b){return a.subscribe(function(a){b.onNext(fc(a))},function(a){b.onNext(gc(a)),b.onCompleted()},function(){b.onNext(hc()),b.onCompleted()})})},oc.repeat=function(a){return kc(this,a).concat()},oc.retry=function(a){return kc(this,a).catchError()},oc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Jc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},oc.skipLast=function(a){var b=this;return new Jc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},oc.startWith=function(){var a,b,c=0;return arguments.length&&Q(arguments[0])?(b=arguments[0],c=1):b=Zb,a=Fb.call(arguments,c),lc([Ac(a,b),this]).concat()},oc.takeLast=function(a){var b=this;return new Jc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},oc.takeLastBuffer=function(a){var b=this;return new Jc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},oc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(Y);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(Y);return new Jc(function(d){function e(){var a=new Mc;i.push(a),d.onNext(Ib(a,g))}var f=new Sb,g=new Ub(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})},oc.selectConcat=oc.concatMap=function(a,b,c){return X(a)&&X(b)?this.concatMap(function(c,d){var e=a(c,d);return W(e)&&(e=vc(e)),(gb(e)||fb(e))&&(e=zc(e)),e.map(function(a,e){return b(c,a,d,e)})}):X(a)?E(this,a,c):E(this,function(){return a})},oc.concatMapObserver=oc.selectConcatObserver=function(a,b,c,d){var e=this;return new Jc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}W(c)&&(c=vc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}W(c)&&(c=vc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}W(a)&&(a=vc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},oc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Jc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},G.prototype.push=function(a){var b=-1===F(this.set,a,this.comparer);return b&&this.set.push(a),b},oc.distinct=function(a,b){var c=this;return b||(b=T),new Jc(function(d){var e=new G(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},oc.select=oc.map=function(a,b){var c=X(a)?a:function(){return a},d=this;return new Jc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},oc.pluck=function(a){return this.map(function(b){return b[a]})},oc.selectMany=oc.flatMap=function(a,b,c){return X(a)&&X(b)?this.flatMap(function(c,d){var e=a(c,d);return W(e)&&(e=vc(e)),(gb(e)||fb(e))&&(e=zc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):X(a)?H(this,a,c):H(this,function(){return a})},oc.flatMapObserver=oc.selectManyObserver=function(a,b,c,d){var e=this;return new Jc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}W(c)&&(c=vc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}W(c)&&(c=vc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}W(a)&&(a=vc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},oc.selectSwitch=oc.flatMapLatest=oc.switchMap=function(a,b){return this.select(a,b).switchLatest()},oc.skip=function(a){if(0>a)throw new Error(Y);var b=this;return new Jc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},oc.skipWhile=function(a,b){var c=this;return new Jc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},oc.take=function(a,b){if(0>a)throw new RangeError(Y);if(0===a)return xc(b);var c=this;return new Jc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},oc.takeWhile=function(a,b){var c=this;return new Jc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},oc.where=oc.filter=function(a,b){var c=this;return new Jc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},oc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Jc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Jc=O.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Qb(a):Rb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Kc(a);return $b.scheduleRequired()?$b.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Gb(c,a),c}(uc),Kc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Sb}Gb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(pc),Lc=function(a,b){this.subject=a,this.observer=b};Lc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Mc=O.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Rb):(a.onCompleted(),Rb):(this.observers.push(a),new Lc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Gb(d,a),Hb(d.prototype,mc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Nc(a,b)},d}(uc),Nc=(O.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Lc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Rb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Gb(d,a),Hb(d.prototype,mc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(uc),O.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Gb(b,a),Hb(b.prototype,mc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(uc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(J.Rx=O,define(function(){return O})):K&&L?M?(L.exports=O).Rx=O:K.Rx=O:J.Rx=O;var Oc=g()}).call(this);
//# sourceMappingURL=rx.compat.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(_)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;Ab.nonEnumArgs&&a.length&&Bb(a)&&(a=Db.call(a));var d=Ab.enumPrototypes&&"function"==typeof a,e=Ab.enumErrorProps&&(a===tb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(Ab.nonEnumShadows&&a!==ub){var g=a.constructor,h=-1,i=yb.length;if(a===(g&&g.prototype))var j=a===vb?pb:a===tb?kb:qb.call(a),k=zb[j];for(;++h<i;)f=yb[h],k&&k[f]||!rb.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=qb.call(a),k=qb.call(b);if(j==gb&&(j=nb),k==gb&&(k=nb),j!=k)return!1;switch(j){case ib:case jb:return+a==+b;case mb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ob:case pb:return a==String(b)}var l=j==hb;if(!l){if(j!=nb||!Ab.nodeClass&&(g(a)||g(b)))return!1;var m=!Ab.argsObject&&Bb(a)?Object:a.constructor,n=!Ab.argsObject&&Bb(b)?Object:b.constructor;if(!(m==n||rb.call(a,"constructor")&&rb.call(b,"constructor")||Z(m)&&m instanceof m&&Z(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=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return rb.call(f,e)?(p++,q=rb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return rb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Db.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(){this._s=s}function m(){this._s=s,this._l=s.length,this._i=0}function n(a){this._a=a}function o(a){this._a=a,this._l=t(a),this._i=0}function p(a){return"number"==typeof a&&L.isFinite(a)}function q(b){var c,d=b[ab];if(!d&&"string"==typeof b)return c=new l(b),c[ab]();if(!d&&b.length!==a)return c=new n(b),c[ab]();if(!d)throw new TypeError("Object is not iterable");return b[ab]()}function r(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function t(a){var b=+a.length;return isNaN(b)?0:0!==b&&p(b)?(b=r(b)*Math.floor(Math.abs(b)),0>=b?0:b>rc?rc:b):b}function u(a,b){return S(a)||(a=Wb),new Lc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function v(a,b){return new Lc(function(c){var d=new Pb,e=new Qb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Y(f)&&(f=Ec(f)),d=new Pb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function w(a,b){var c=this;return new Lc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function x(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ec(f)),(db(f)||cb(f))&&(f=sc(f)),f}).concatAll()}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ec(f)),(db(f)||cb(f))&&(f=sc(f)),f}).mergeAll()}function z(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=L.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function A(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Nb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(z(a))};return a.attachEvent("on"+b,d),Nb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Nb(function(){a["on"+b]=null})}function B(a,b,c){var d=new Kb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(B(a.item(e),b,c));else a&&d.add(A(a,b,c));return d}function C(a,b){return new Lc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function D(a,b,c){return new Lc(function(d){var e=0,f=a,g=Tb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function E(a,b){return new Lc(function(c){return b.scheduleWithRelative(Tb(a),function(){c.onNext(0),c.onCompleted()})})}function F(a,b,c){return a===b?new Lc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):pc(function(){return D(c.now()+a,b,c)})}function G(a,b,c){return new Lc(function(d){var e,f=!1,g=new Qb,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.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Pb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Kb(e,g)})}function H(a,b,c){return pc(function(){return G(a,b-c.now(),c)})}function I(a,b){return new Lc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Kb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function J(a,b,c){return new Lc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(T))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Kb(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)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var K={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},L=K[typeof window]&&window||this,M=K[typeof exports]&&exports&&!exports.nodeType&&exports,N=K[typeof module]&&module&&!module.nodeType&&module,O=N&&N.exports===M&&M,P=K[typeof global]&&global;!P||P.global!==P&&P.window!==P||(L=P);var Q={internals:{},config:{Promise:L.Promise},helpers:{}},R=Q.helpers.noop=function(){},S=(Q.helpers.notDefined=function(a){return"undefined"==typeof a},Q.helpers.isScheduler=function(a){return a instanceof Q.Scheduler}),T=Q.helpers.identity=function(a){return a},U=(Q.helpers.pluck=function(a){return function(b){return b[a]}},Q.helpers.just=function(a){return function(){return a}},Q.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),V=Q.helpers.defaultComparer=function(a,b){return Cb(a,b)},W=Q.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},X=(Q.helpers.defaultKeySerializer=function(a){return a.toString()},Q.helpers.defaultError=function(a){throw a}),Y=Q.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Z=(Q.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Q.helpers.not=function(a){return!a},Q.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==qb.call(a)}),a}()),$="Argument out of range",_="Object has been disposed",ab="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";L.Set&&"function"==typeof(new L.Set)["@@iterator"]&&(ab="@@iterator");var bb=Q.doneEnumerator={done:!0,value:a},cb=Q.helpers.isIterable=function(b){return b[ab]!==a},db=Q.helpers.isArrayLike=function(b){return b&&b.length!==a};Q.helpers.iterator=ab;var eb,fb=Q.helpers.deprecate=function(){},gb="[object Arguments]",hb="[object Array]",ib="[object Boolean]",jb="[object Date]",kb="[object Error]",lb="[object Function]",mb="[object Number]",nb="[object Object]",ob="[object RegExp]",pb="[object String]",qb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,sb=qb.call(arguments)==gb,tb=Error.prototype,ub=Object.prototype,vb=String.prototype,wb=ub.propertyIsEnumerable;try{eb=!(qb.call(document)==nb&&!({toString:0}+""))}catch(xb){eb=!0}var yb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],zb={};zb[hb]=zb[jb]=zb[mb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},zb[ib]=zb[pb]={constructor:!0,toString:!0,valueOf:!0},zb[kb]=zb[lb]=zb[ob]={constructor:!0,toString:!0},zb[nb]={constructor:!0};var Ab={};!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);Ab.enumErrorProps=wb.call(tb,"message")||wb.call(tb,"name"),Ab.enumPrototypes=wb.call(a,"prototype"),Ab.nonEnumArgs=0!=c,Ab.nonEnumShadows=!/valueOf/.test(b)}(1);var Bb=function(a){return a&&"object"==typeof a?qb.call(a)==gb:!1};sb||(Bb=function(a){return a&&"object"==typeof a?rb.call(a,"callee"):!1});{var Cb=Q.internals.isEqual=function(a,b){return h(a,b,[],[])},Db=Array.prototype.slice,Eb=({}.hasOwnProperty,this.inherits=Q.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Fb=Q.internals.addProperties=function(a){for(var b=Db.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};Q.internals.addRef=function(a,b){return new Lc(function(c){return new Kb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Db.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Db.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Db.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Gb=Object("a"),Hb="a"!=Gb[0]||!(0 in Gb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Hb&&{}.toString.call(this)==pb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=lb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Hb&&{}.toString.call(this)==pb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=lb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==hb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Ib=Q.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Jb=Ib.prototype;Jb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Jb.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)}}},Jb.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)}}},Jb.peek=function(){return this.items[0].value},Jb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Jb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Jb.enqueue=function(a){var b=this.length++;this.items[b]=new k(Ib.count++,a),this.percolate(b)},Jb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Ib.count=0;var Kb=Q.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Lb=Kb.prototype;Lb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Lb.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},Lb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Lb.toArray=function(){return this.disposables.slice(0)};var Mb=Q.Disposable=function(a){this.isDisposed=!1,this.action=a||R};Mb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Nb=Mb.create=function(a){return new Mb(a)},Ob=Mb.empty={dispose:R},Pb=Q.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Qb=Q.SerialDisposable=Pb,Rb=(Q.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Ob:new a(this)},b}(),Q.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 Pb});Rb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Rb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Rb.prototype.isCancelled=function(){return this.disposable.isDisposed},Rb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Sb=Q.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Ob}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=U,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Tb=Sb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Kb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Ob});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Kb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Ob});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Sb.prototype),function(){Sb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Sb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof L.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=L.setInterval(function(){d=c(d)},b);return Nb(function(){L.clearInterval(e)})}}(Sb.prototype);var Ub,Vb=Sb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Tb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Sb(U,a,b,c)}(),Wb=Sb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Sb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Sb.normalize(c),g=new Rb(this,b,d,f);if(e)e.enqueue(g);else{e=new Ib(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Sb(U,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Xb=(Q.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 Pb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),R),Yb=function(){var a,b=R;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!L.setTimeout)throw new Error("No concurrency detected!");a=L.setTimeout,b=L.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Zb=Yb.setTimeout,$b=Yb.clearTimeout;!function(){function a(){if(!L.postMessage||L.importScripts)return!1;var a=!1,b=L.onmessage;return L.onmessage=function(){a=!0},L.postMessage("","*"),L.onmessage=b,a}var b=RegExp("^"+String(qb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=P&&O&&P.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=P&&O&&P.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Ub=c,Xb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Ub=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};L.addEventListener?L.addEventListener("message",h,!1):L.attachEvent("onmessage",h,!1),Ub=function(a){var b=g++;f[b]=a,L.postMessage(e+b,"*")}}else if(L.MessageChannel){var i=new L.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Ub=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in L&&"onreadystatechange"in L.document.createElement("script")?Ub=function(a){var b=L.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},L.document.documentElement.appendChild(b)}:(Ub=function(a){return Zb(a,0)},Xb=$b)}();var _b=Sb.timeout=function(){function a(a,b){var c=this,d=new Pb,e=Ub(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Kb(d,Nb(function(){Xb(e)}))}function b(a,b,c){var d=this,e=Sb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Pb,g=Zb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Kb(f,Nb(function(){$b(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Sb(U,a,b,c)}(),ac=Q.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 S(a)||(a=Vb),new Lc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),bc=ac.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new ac("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),cc=ac.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new ac("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),dc=ac.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new ac("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),ec=Q.internals.Enumerator=function(a){this._next=a};ec.prototype.next=function(){return this._next()},ec.prototype[ab]=function(){return this};var fc=Q.internals.Enumerable=function(a){this._iterator=a};fc.prototype[ab]=function(){return this._iterator()},fc.prototype.concat=function(){var a=this;return new Lc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError(d)}var e,f=new Qb,g=Vb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Y(h)&&(h=Ec(h));var i=new Pb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Kb(f,g,Nb(function(){e=!0}))})},fc.prototype.catchError=function(){var a=this;return new Lc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError(d)}var e,f,g=new Qb,h=Vb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Y(i)&&(i=Ec(i));var j=new Pb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Kb(g,h,Nb(function(){e=!0}))})};var gc=fc.repeat=function(a,b){return null==b&&(b=-1),new fc(function(){var c=b;return new ec(function(){return 0===c?bb:(c>0&&c--,{done:!1,value:a})})})},hc=fc.of=function(a,b,c){return b||(b=T),new fc(function(){var d=-1;return new ec(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:bb})})},ic=Q.Observer=function(){};ic.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ic.prototype.asObserver=function(){return new mc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var jc=ic.create=function(a,b,c){return a||(a=R),b||(b=X),c||(c=R),new mc(a,b,c)};ic.fromNotifier=function(a,b){return new mc(function(c){return a.call(b,bc(c))},function(c){return a.call(b,cc(c))},function(){return a.call(b,dc())})};var kc,lc=Q.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Eb(b,a),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}(ic),mc=Q.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Eb(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}(lc),nc=Q.Observable=function(){function a(a){this._subscribe=a}return kc=a.prototype,kc.subscribe=kc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:jc(a,b,c))},kc.subscribeOnNext=function(a,b){return this._subscribe(jc(2===arguments.length?function(c){a.call(b,c)}:a))},kc.subscribeOnError=function(a,b){return this._subscribe(jc(null,2===arguments.length?function(c){a.call(b,c)}:a))},kc.subscribeOnCompleted=function(a,b){return this._subscribe(jc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),oc=Q.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 Qb}return Eb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(lc);kc.toArray=function(){var a=this;return new Lc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},nc.create=nc.createWithDisposable=function(a){return new Lc(a)};var pc=nc.defer=function(a){return new Lc(function(b){var c;try{c=a()}catch(d){return vc(d).subscribe(b)}return Y(c)&&(c=Ec(c)),c.subscribe(b)})},qc=nc.empty=function(a){return S(a)||(a=Vb),new Lc(function(b){return a.schedule(function(){b.onCompleted()})})},rc=Math.pow(2,53)-1;l.prototype[ab]=function(){return new m(this._s)},m.prototype[ab]=function(){return this},m.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return bb},n.prototype[ab]=function(){return new o(this._a)},o.prototype[ab]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return bb};{var sc=nc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Z(b))throw new Error("mapFn when provided must be a function");S(d)||(d=Wb);var e=Object(a),f=q(e);return new Lc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Z(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},tc=nc.fromArray=function(a,b){return fb("fromArray","from"),S(b)||(b=Wb),new Lc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};nc.never=function(){return new Lc(function(){return Ob})}}nc.of=function(){return u(null,arguments)},nc.ofWithScheduler=function(a){return u(a,Db.call(arguments,1))},nc.range=function(a,b,c){return S(c)||(c=Wb),new Lc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},nc.repeat=function(a,b,c){return S(c)||(c=Wb),uc(a,c).repeat(null==b?-1:b)};var uc=nc["return"]=nc.just=function(a,b){return S(b)||(b=Vb),new Lc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};nc.returnValue=function(){return fb("returnValue","return or just"),uc.apply(null,arguments)};var vc=nc["throw"]=nc.throwException=nc.throwError=function(a,b){return S(b)||(b=Vb),new Lc(function(c){return b.schedule(function(){c.onError(a)})})};kc["catch"]=kc.catchError=function(a){return"function"==typeof a?v(this,a):wc([this,a])},kc.catchException=function(a){return fb("catchException","catch or catchError"),this.catchError(a)};var wc=nc.catchError=nc["catch"]=function(){return hc(i(arguments,0)).catchError()};nc.catchException=function(){return fb("catchException","catch or catchError"),wc.apply(null,arguments)},kc.combineLatest=function(){var a=Db.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),xc.apply(this,a)};var xc=nc.combineLatest=function(){var a=Db.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Lc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(T))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(T)&&c.onCompleted()}function e(a){k[a]=!0,k.every(T)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Pb;Y(f)&&(f=Ec(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Kb(m)})};kc.concat=function(){var a=Db.call(arguments,0);return a.unshift(this),yc.apply(this,a)};var yc=nc.concat=function(){return hc(i(arguments,0)).concat()};kc.concatAll=function(){return this.merge(1)},kc.concatObservable=function(){return fb("concatObservable","concatAll"),this.merge(1)},kc.merge=function(a){if("number"!=typeof a)return zc(this,a);var b=this;return new Lc(function(c){function d(a){var b=new Pb;f.add(b),Y(a)&&(a=Ec(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Kb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var zc=nc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Db.call(arguments,1)):(a=Vb,b=Db.call(arguments,0)):(a=Vb,b=Db.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),u(a,b).mergeAll()};kc.mergeAll=function(){var a=this;return new Lc(function(b){var c=new Kb,d=!1,e=new Pb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Pb;c.add(e),Y(a)&&(a=Ec(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},kc.mergeObservable=function(){return fb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},kc.skipUntil=function(a){var b=this;return new Lc(function(c){var d=!1,e=new Kb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Y(a)&&(a=Ec(a));var f=new Pb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()
},c.onError.bind(c),function(){f.dispose()})),e})},kc["switch"]=kc.switchLatest=function(){var a=this;return new Lc(function(b){var c=!1,d=new Qb,e=!1,f=0,g=a.subscribe(function(a){var g=new Pb,h=++f;c=!0,d.setDisposable(g),Y(a)&&(a=Ec(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Kb(g,d)})},kc.takeUntil=function(a){var b=this;return new Lc(function(c){return Y(a)&&(a=Ec(a)),new Kb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),R))})},kc.zip=function(){if(Array.isArray(arguments[0]))return w.apply(this,arguments);var a=this,b=Db.call(arguments),c=b.pop();return b.unshift(a),new Lc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(T)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Pb;Y(c)&&(c=Ec(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Kb(k)})},nc.zip=function(){var a=Db.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},nc.zipArray=function(){var a=i(arguments,0);return new Lc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(T))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(T)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Pb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Kb(h);return k.add(Nb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},kc.asObservable=function(){return new Lc(this.subscribe.bind(this))},kc.dematerialize=function(){var a=this;return new Lc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},kc.distinctUntilChanged=function(a,b){var c=this;return a||(a=T),b||(b=V),new Lc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},kc["do"]=kc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Lc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},kc.doAction=function(){return fb("doAction","do or tap"),this.tap.apply(this,arguments)},kc.doOnNext=kc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},kc.doOnError=kc.tapOnError=function(a,b){return this.tap(R,2===arguments.length?function(c){a.call(b,c)}:a)},kc.doOnCompleted=kc.tapOnCompleted=function(a,b){return this.tap(R,null,2===arguments.length?function(){a.call(b)}:a)},kc["finally"]=kc.ensure=function(a){var b=this;return new Lc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Nb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},kc.finallyAction=function(a){return fb("finallyAction","finally or ensure"),this.ensure(a)},kc.ignoreElements=function(){var a=this;return new Lc(function(b){return a.subscribe(R,b.onError.bind(b),b.onCompleted.bind(b))})},kc.materialize=function(){var a=this;return new Lc(function(b){return a.subscribe(function(a){b.onNext(bc(a))},function(a){b.onNext(cc(a)),b.onCompleted()},function(){b.onNext(dc()),b.onCompleted()})})},kc.repeat=function(a){return gc(this,a).concat()},kc.retry=function(a){return gc(this,a).catchError()},kc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Lc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},kc.skipLast=function(a){var b=this;return new Lc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},kc.startWith=function(){var a,b,c=0;return arguments.length&&S(arguments[0])?(b=arguments[0],c=1):b=Vb,a=Db.call(arguments,c),hc([tc(a,b),this]).concat()},kc.takeLast=function(a){var b=this;return new Lc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},kc.selectConcat=kc.concatMap=function(a,b,c){return Z(a)&&Z(b)?this.concatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ec(e)),(db(e)||cb(e))&&(e=sc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Z(a)?x(this,a,c):x(this,function(){return a})},kc.select=kc.map=function(a,b){var c=Z(a)?a:function(){return a},d=this;return new Lc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},kc.pluck=function(a){return this.map(function(b){return b[a]})},kc.selectMany=kc.flatMap=function(a,b,c){return Z(a)&&Z(b)?this.flatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ec(e)),(db(e)||cb(e))&&(e=sc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Z(a)?y(this,a,c):y(this,function(){return a})},kc.selectSwitch=kc.flatMapLatest=kc.switchMap=function(a,b){return this.select(a,b).switchLatest()},kc.skip=function(a){if(0>a)throw new Error($);var b=this;return new Lc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},kc.skipWhile=function(a,b){var c=this;return new Lc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},kc.take=function(a,b){if(0>a)throw new RangeError($);if(0===a)return qc(b);var c=this;return new Lc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},kc.takeWhile=function(a,b){var c=this;return new Lc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},kc.where=kc.filter=function(a,b){var c=this;return new Lc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},nc.fromCallback=function(a,b,c){return function(){var d=Db.call(arguments,0);return new Lc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},nc.fromNodeCallback=function(a,b,c){return function(){var d=Db.call(arguments,0);return new Lc(function(e){function f(a){if(a)return void e.onError(a);var b=Db.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},Q.config.useNativeEvents=!1;var Ac=L.angular&&angular.element?angular.element:L.jQuery?L.jQuery:L.Zepto?L.Zepto:null,Bc=!!L.Ember&&"function"==typeof L.Ember.addListener,Cc=!!L.Backbone&&!!L.Backbone.Marionette;nc.fromEvent=function(a,b,c){if(a.addListener)return Dc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!Q.config.useNativeEvents){if(Cc)return Dc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Bc)return Dc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(Ac){var d=Ac(a);return Dc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Lc(function(d){return B(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Dc=nc.fromEventPattern=function(a,b,c){return new Lc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Nb(function(){b&&b(e,f)})}).publish().refCount()},Ec=nc.fromPromise=function(a){return pc(function(){var b=new Q.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};kc.toPromise=function(a){if(a||(a=Q.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},nc.startAsync=function(a){var b;try{b=a()}catch(c){return vc(c)}return Ec(b)},kc.multicast=function(a,b){var c=this;return"function"==typeof a?new Lc(function(d){var e=c.multicast(a());return new Kb(b(e).subscribe(d),e.connect())}):new Fc(c,a)},kc.publish=function(a){return a&&Z(a)?this.multicast(function(){return new Oc},a):this.multicast(new Oc)},kc.share=function(){return this.publish().refCount()},kc.publishLast=function(a){return a&&Z(a)?this.multicast(function(){return new Pc},a):this.multicast(new Pc)},kc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Rc(b)},a):this.multicast(new Rc(a))},kc.shareValue=function(a){return this.publishValue(a).refCount()},kc.replay=function(a,b,c,d){return a&&Z(a)?this.multicast(function(){return new Sc(b,c,d)},a):this.multicast(new Sc(b,c,d))},kc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Fc=Q.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Kb(f.subscribe(c),Nb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Eb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Lc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(nc),Gc=nc.interval=function(a,b){return F(a,a,S(b)?b:_b)};nc.timer=function(b,c,d){var e;return S(d)||(d=_b),c!==a&&"number"==typeof c?e=c:S(c)&&(d=c),b instanceof Date&&e===a?C(b.getTime(),d):b instanceof Date&&e!==a?(e=c,D(b.getTime(),e,d)):e===a?E(b,d):F(b,e,d)}}kc.delay=function(a,b){return S(b)||(b=_b),a instanceof Date?H(this,a.getTime(),b):G(this,a,b)},kc.debounce=kc.throttleWithTimeout=function(a,b){S(b)||(b=_b);var c=this;return new Lc(function(d){var e,f=new Qb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Pb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Kb(i,f)})},kc.throttle=function(a,b){return fb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},kc.timestamp=function(a){return S(a)||(a=_b),this.map(function(b){return{value:b,timestamp:a.now()}})},kc.sample=kc.throttleLatest=function(a,b){return S(b)||(b=_b),"number"==typeof a?I(this,Gc(a,b)):I(this,a)},kc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=vc(new Error(b||"Timeout"))),S(c)||(c=_b);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Lc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Y(b)&&(b=Ec(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Pb,j=new Qb,k=!1,l=new Qb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Kb(j,l)})},kc.throttleFirst=function(a,b){S(b)||(b=_b);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Lc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Hc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Ob,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Ob)});return new Kb(c,d,e)}function c(c,d){this.source=c,this.controller=new Oc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Eb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(nc);kc.pausable=function(a){return new Hc(this,a)};var Ic=function(b){function c(b){var c,d=[],e=J(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Oc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Eb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(nc);kc.pausableBuffered=function(a){return new Ic(this,a)},kc.controlled=function(a){return null==a&&(a=!0),new Jc(this,a)};var Jc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Kc(d),this.source=c.multicast(this.subject).refCount()}return Eb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(nc),Kc=Q.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Oc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Ob,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Ob}return Eb(d,a),Fb(d.prototype,ic,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Ob):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Ob),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Ob:(this.requestedCount=a,this.requestedDisposable=Nb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Ob},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(nc);kc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Lc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Lc=Q.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Nb(a):Ob}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Mc(a);return Wb.scheduleRequired()?Wb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Eb(c,a),c}(nc),Mc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Pb}Eb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(lc),Nc=function(a,b){this.subject=a,this.observer=b};Nc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Oc=Q.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Ob):(a.onCompleted(),Ob):(this.observers.push(a),new Nc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Eb(d,a),Fb(d.prototype,ic,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Qc(a,b)},d}(nc),Pc=Q.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Nc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Ob}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Eb(d,a),Fb(d.prototype,ic,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(nc),Qc=Q.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Eb(b,a),Fb(b.prototype,ic,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(nc),Rc=Q.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Nc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Ob}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Eb(d,a),Fb(d.prototype,ic,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(nc),Sc=Q.ReplaySubject=function(a){function c(a,b){return Nb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new oc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Wb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Eb(e,a),Fb(e.prototype,ic,{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(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(nc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(L.Rx=Q,define(function(){return Q})):M&&N?O?(N.exports=Q).Rx=Q:M.Rx=Q:L.Rx=Q}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(fb)}function c(a,b){if(gb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(kb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+kb+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return console.log(ib,jb,bd),c===ib&&d>=jb&&bd>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(gb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ib=d[0],d[1]}}function h(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 i(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;Kb.nonEnumArgs&&a.length&&Lb(a)&&(a=Nb.call(a));var c=Kb.enumPrototypes&&"function"==typeof a,d=Kb.enumErrorProps&&(a===Eb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Kb.nonEnumShadows&&a!==Fb){var f=a.constructor,g=-1,h=Ib.length;if(a===(f&&f.prototype))var j=a===Gb?Ab:a===Eb?vb:Bb.call(a),k=Jb[j];for(;++g<h;)e=Ib[g],k&&k[e]||!Cb.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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 g=Bb.call(a),h=Bb.call(b);if(g==rb&&(g=yb),h==rb&&(h=yb),g!=h)return!1;switch(g){case tb:case ub:return+a==+b;case xb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case zb:case Ab:return a==String(b)}var i=g==sb;if(!i){if(g!=yb||!Kb.nodeClass&&(m(a)||m(b)))return!1;var j=!Kb.argsObject&&Lb(a)?Object:a.constructor,k=!Kb.argsObject&&Lb(b)?Object:b.constructor;if(!(j==k||Cb.call(a,"constructor")&&Cb.call(b,"constructor")||db(j)&&j instanceof j&&db(k)&&k instanceof k||!("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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Cb.call(f,e)?(p++,q=Cb.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Cb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Nb.call(a)}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(){this._s=s}function t(){this._s=s,this._l=s.length,this._i=0}function u(a){this._a=a}function v(a){this._a=a,this._l=z(a),this._i=0}function w(a){return"number"==typeof a&&R.isFinite(a)}function x(b){var c,d=b[lb];if(!d&&"string"==typeof b)return c=new r(b),c[lb]();if(!d&&b.length!==a)return c=new u(b),c[lb]();if(!d)throw new TypeError("Object is not iterable");return b[lb]()}function y(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function z(a){var b=+a.length;return isNaN(b)?0:0!==b&&w(b)?(b=y(b)*Math.floor(Math.abs(b)),0>=b?0:b>Bc?Bc:b):b}function A(a,b){return Y(a)||(a=ec),new Vc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function B(a,b){return new Vc(function(c){var d=new Zb,e=new $b;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}cb(f)&&(f=Oc(f)),d=new Zb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function C(a,b){var c=this;return new Vc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function D(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return cb(f)&&(f=Oc(f)),(ob(f)||nb(f))&&(f=Cc(f)),f}).concatAll()}function E(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return cb(f)&&(f=Oc(f)),(ob(f)||nb(f))&&(f=Cc(f)),f}).mergeAll()}function F(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=R.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function G(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Xb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(F(a))};return a.attachEvent("on"+b,d),Xb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Xb(function(){a["on"+b]=null})}function H(a,b,c){var d=new Ub;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(H(a.item(e),b,c));else a&&d.add(G(a,b,c));return d}function I(a,b){return new Vc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function J(a,b,c){return new Vc(function(d){var e=0,f=a,g=bc(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function K(a,b){return new Vc(function(c){return b.scheduleWithRelative(bc(a),function(){c.onNext(0),c.onCompleted()})})}function L(a,b,c){return a===b?new Vc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):zc(function(){return J(c.now()+a,b,c)})}function M(a,b,c){return new Vc(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.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Zb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Ub(e,g)})}function N(a,b,c){return zc(function(){return M(a,b-c.now(),c)})}function O(a,b){return new Vc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Ub(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function P(a,b,c){return new Vc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(Z))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Ub(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)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var Q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},R=Q[typeof window]&&window||this,S=Q[typeof exports]&&exports&&!exports.nodeType&&exports,T=Q[typeof module]&&module&&!module.nodeType&&module,U=T&&T.exports===S&&S,V=Q[typeof global]&&global;!V||V.global!==V&&V.window!==V||(R=V);var W={internals:{},config:{Promise:R.Promise},helpers:{}},X=W.helpers.noop=function(){},Y=(W.helpers.notDefined=function(a){return"undefined"==typeof a},W.helpers.isScheduler=function(a){return a instanceof W.Scheduler}),Z=W.helpers.identity=function(a){return a},$=(W.helpers.pluck=function(a){return function(b){return b[a]}},W.helpers.just=function(a){return function(){return a}},W.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),_=W.helpers.defaultComparer=function(a,b){return Mb(a,b)},ab=W.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},bb=(W.helpers.defaultKeySerializer=function(a){return a.toString()},W.helpers.defaultError=function(a){throw a}),cb=W.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},db=(W.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},W.helpers.not=function(a){return!a},W.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Bb.call(a)}),a}()),eb="Argument out of range",fb="Object has been disposed";W.config.longStackSupport=!1;var gb=!1;try{throw new Error}catch(hb){gb=!!hb.stack}var ib,jb=g(),kb="From previous event:",lb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";R.Set&&"function"==typeof(new R.Set)["@@iterator"]&&(lb="@@iterator");var mb=W.doneEnumerator={done:!0,value:a},nb=W.helpers.isIterable=function(b){return b[lb]!==a},ob=W.helpers.isArrayLike=function(b){return b&&b.length!==a};W.helpers.iterator=lb;var pb,qb=W.helpers.deprecate=function(){},rb="[object Arguments]",sb="[object Array]",tb="[object Boolean]",ub="[object Date]",vb="[object Error]",wb="[object Function]",xb="[object Number]",yb="[object Object]",zb="[object RegExp]",Ab="[object String]",Bb=Object.prototype.toString,Cb=Object.prototype.hasOwnProperty,Db=Bb.call(arguments)==rb,Eb=Error.prototype,Fb=Object.prototype,Gb=String.prototype,Hb=Fb.propertyIsEnumerable;try{pb=!(Bb.call(document)==yb&&!({toString:0}+""))}catch(hb){pb=!0}var Ib=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Jb={};Jb[sb]=Jb[ub]=Jb[xb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Jb[tb]=Jb[Ab]={constructor:!0,toString:!0,valueOf:!0},Jb[vb]=Jb[wb]=Jb[zb]={constructor:!0,toString:!0},Jb[yb]={constructor:!0};var Kb={};!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);Kb.enumErrorProps=Hb.call(Eb,"message")||Hb.call(Eb,"name"),Kb.enumPrototypes=Hb.call(a,"prototype"),Kb.nonEnumArgs=0!=c,Kb.nonEnumShadows=!/valueOf/.test(b)}(1);var Lb=function(a){return a&&"object"==typeof a?Bb.call(a)==rb:!1};Db||(Lb=function(a){return a&&"object"==typeof a?Cb.call(a,"callee"):!1});{var Mb=W.internals.isEqual=function(a,b){return n(a,b,[],[])},Nb=Array.prototype.slice,Ob=({}.hasOwnProperty,this.inherits=W.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Pb=W.internals.addProperties=function(a){for(var b=Nb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};W.internals.addRef=function(a,b){return new Vc(function(c){return new Ub(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Nb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Nb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Nb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Qb=Object("a"),Rb="a"!=Qb[0]||!(0 in Qb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Rb&&{}.toString.call(this)==Ab?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=wb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Rb&&{}.toString.call(this)==Ab?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=wb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==sb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Sb=W.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Tb=Sb.prototype;Tb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Tb.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)}}},Tb.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)}}},Tb.peek=function(){return this.items[0].value},Tb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Tb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Tb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Sb.count++,a),this.percolate(b)},Tb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Sb.count=0;var Ub=W.CompositeDisposable=function(){this.disposables=o(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Vb=Ub.prototype;Vb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Vb.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},Vb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Vb.toArray=function(){return this.disposables.slice(0)};var Wb=W.Disposable=function(a){this.isDisposed=!1,this.action=a||X};Wb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Xb=Wb.create=function(a){return new Wb(a)},Yb=Wb.empty={dispose:X},Zb=W.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),$b=W.SerialDisposable=Zb,_b=(W.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Yb:new a(this)},b}(),W.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ab,this.disposable=new Zb});_b.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},_b.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},_b.prototype.isCancelled=function(){return this.disposable.isDisposed},_b.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ac=W.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Yb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),bc=ac.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Ub,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Yb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Ub,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Yb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(ac.prototype),function(){ac.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},ac.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof R.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=R.setInterval(function(){d=c(d)},b);return Xb(function(){R.clearInterval(e)})}}(ac.prototype);var cc,dc=ac.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=bc(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ac($,a,b,c)}(),ec=ac.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-ac.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+ac.normalize(c),g=new _b(this,b,d,f);if(e)e.enqueue(g);else{e=new Sb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new ac($,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),fc=(W.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 Zb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),X),gc=function(){var a,b=X;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!R.setTimeout)throw new Error("No concurrency detected!");a=R.setTimeout,b=R.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),hc=gc.setTimeout,ic=gc.clearTimeout;!function(){function a(){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}var b=RegExp("^"+String(Bb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=V&&U&&V.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=V&&U&&V.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)cc=c,fc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))cc=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};R.addEventListener?R.addEventListener("message",h,!1):R.attachEvent("onmessage",h,!1),cc=function(a){var b=g++;f[b]=a,R.postMessage(e+b,"*")}}else if(R.MessageChannel){var i=new R.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},cc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in R&&"onreadystatechange"in R.document.createElement("script")?cc=function(a){var b=R.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},R.document.documentElement.appendChild(b)}:(cc=function(a){return hc(a,0)},fc=ic)}();var jc=ac.timeout=function(){function a(a,b){var c=this,d=new Zb,e=cc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Ub(d,Xb(function(){fc(e)}))}function b(a,b,c){var d=this,e=ac.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Zb,g=hc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Ub(f,Xb(function(){ic(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ac($,a,b,c)}(),kc=W.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 Y(a)||(a=dc),new Vc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),lc=kc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new kc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),mc=kc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new kc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),nc=kc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new kc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),oc=W.internals.Enumerator=function(a){this._next=a};oc.prototype.next=function(){return this._next()},oc.prototype[lb]=function(){return this};var pc=W.internals.Enumerable=function(a){this._iterator=a};pc.prototype[lb]=function(){return this._iterator()},pc.prototype.concat=function(){var a=this;return new Vc(function(b){var c;try{c=a[lb]()}catch(d){return void b.onError(d)}var e,f=new $b,g=dc.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;cb(h)&&(h=Oc(h));var i=new Zb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Ub(f,g,Xb(function(){e=!0}))})},pc.prototype.catchError=function(){var a=this;return new Vc(function(b){var c;try{c=a[lb]()}catch(d){return void b.onError(d)}var e,f,g=new $b,h=dc.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;cb(i)&&(i=Oc(i));var j=new Zb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Ub(g,h,Xb(function(){e=!0}))})};var qc=pc.repeat=function(a,b){return null==b&&(b=-1),new pc(function(){var c=b;return new oc(function(){return 0===c?mb:(c>0&&c--,{done:!1,value:a})})})},rc=pc.of=function(a,b,c){return b||(b=Z),new pc(function(){var d=-1;return new oc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:mb})})},sc=W.Observer=function(){};sc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},sc.prototype.asObserver=function(){return new wc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var tc=sc.create=function(a,b,c){return a||(a=X),b||(b=bb),c||(c=X),new wc(a,b,c)};sc.fromNotifier=function(a,b){return new wc(function(c){return a.call(b,lc(c))},function(c){return a.call(b,mc(c))},function(){return a.call(b,nc())})};var uc,vc=W.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Ob(b,a),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}(sc),wc=W.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Ob(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}(vc),xc=W.Observable=function(){function a(a){if(W.config.longStackSupport&&gb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){b.onError=function(a){c(d,a),b.onError(a)},a(b)}}this._subscribe=a}return uc=a.prototype,uc.subscribe=uc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:tc(a,b,c))},uc.subscribeOnNext=function(a,b){return this._subscribe(tc(2===arguments.length?function(c){a.call(b,c)}:a))},uc.subscribeOnError=function(a,b){return this._subscribe(tc(null,2===arguments.length?function(c){a.call(b,c)}:a))},uc.subscribeOnCompleted=function(a,b){return this._subscribe(tc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),yc=W.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 $b}return Ob(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(vc);uc.toArray=function(){var a=this;return new Vc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},xc.create=xc.createWithDisposable=function(a,b){return new Vc(a,b)};var zc=xc.defer=function(a){return new Vc(function(b){var c;try{c=a()}catch(d){return Fc(d).subscribe(b)}return cb(c)&&(c=Oc(c)),c.subscribe(b)})},Ac=xc.empty=function(a){return Y(a)||(a=dc),new Vc(function(b){return a.schedule(function(){b.onCompleted()})})},Bc=Math.pow(2,53)-1;r.prototype[lb]=function(){return new t(this._s)},t.prototype[lb]=function(){return this},t.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return mb},u.prototype[lb]=function(){return new v(this._a)},v.prototype[lb]=function(){return this},v.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return mb};{var Cc=xc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!db(b))throw new Error("mapFn when provided must be a function");Y(d)||(d=ec);var e=Object(a),f=x(e);return new Vc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&db(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},Dc=xc.fromArray=function(a,b){return qb("fromArray","from"),Y(b)||(b=ec),new Vc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};xc.never=function(){return new Vc(function(){return Yb})}}xc.of=function(){return A(null,arguments)},xc.ofWithScheduler=function(a){return A(a,Nb.call(arguments,1))},xc.range=function(a,b,c){return Y(c)||(c=ec),new Vc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},xc.repeat=function(a,b,c){return Y(c)||(c=ec),Ec(a,c).repeat(null==b?-1:b)};var Ec=xc["return"]=xc.just=function(a,b){return Y(b)||(b=dc),new Vc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};xc.returnValue=function(){return qb("returnValue","return or just"),Ec.apply(null,arguments)};var Fc=xc["throw"]=xc.throwException=xc.throwError=function(a,b){return Y(b)||(b=dc),new Vc(function(c){return b.schedule(function(){c.onError(a)})})};uc["catch"]=uc.catchError=function(a){return"function"==typeof a?B(this,a):Gc([this,a])},uc.catchException=function(a){return qb("catchException","catch or catchError"),this.catchError(a)};var Gc=xc.catchError=xc["catch"]=function(){return rc(o(arguments,0)).catchError()};xc.catchException=function(){return qb("catchException","catch or catchError"),Gc.apply(null,arguments)},uc.combineLatest=function(){var a=Nb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Hc.apply(this,a)};var Hc=xc.combineLatest=function(){var a=Nb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Vc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(Z))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(Z)&&c.onCompleted()}function e(a){j[a]=!0,j.every(Z)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new Zb;cb(f)&&(f=Oc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),l[b]=g}(m);return new Ub(l)})};uc.concat=function(){var a=Nb.call(arguments,0);return a.unshift(this),Ic.apply(this,a)};var Ic=xc.concat=function(){return rc(o(arguments,0)).concat()};uc.concatAll=function(){return this.merge(1)},uc.concatObservable=function(){return qb("concatObservable","concatAll"),this.merge(1)},uc.merge=function(a){if("number"!=typeof a)return Jc(this,a);var b=this;return new Vc(function(c){function d(a){var b=new Zb;f.add(b),cb(a)&&(a=Oc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())
}))}var e=0,f=new Ub,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var Jc=xc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Nb.call(arguments,1)):(a=dc,b=Nb.call(arguments,0)):(a=dc,b=Nb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),A(a,b).mergeAll()};uc.mergeAll=function(){var a=this;return new Vc(function(b){var c=new Ub,d=!1,e=new Zb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Zb;c.add(e),cb(a)&&(a=Oc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},uc.mergeObservable=function(){return qb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},uc.skipUntil=function(a){var b=this;return new Vc(function(c){var d=!1,e=new Ub(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));cb(a)&&(a=Oc(a));var f=new Zb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},uc["switch"]=uc.switchLatest=function(){var a=this;return new Vc(function(b){var c=!1,d=new $b,e=!1,f=0,g=a.subscribe(function(a){var g=new Zb,h=++f;c=!0,d.setDisposable(g),cb(a)&&(a=Oc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Ub(g,d)})},uc.takeUntil=function(a){var b=this;return new Vc(function(c){return cb(a)&&(a=Oc(a)),new Ub(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),X))})},uc.zip=function(){if(Array.isArray(arguments[0]))return C.apply(this,arguments);var a=this,b=Nb.call(arguments),c=b.pop();return b.unshift(a),new Vc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(Z)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=p(g,function(){return[]}),i=p(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new Zb;cb(c)&&(c=Oc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new Ub(j)})},xc.zip=function(){var a=Nb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},xc.zipArray=function(){var a=o(arguments,0);return new Vc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(Z))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Z)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Zb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Ub(h);return j.add(Xb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},uc.asObservable=function(){return new Vc(this.subscribe.bind(this))},uc.dematerialize=function(){var a=this;return new Vc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},uc.distinctUntilChanged=function(a,b){var c=this;return a||(a=Z),b||(b=_),new Vc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},uc["do"]=uc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Vc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},uc.doAction=function(){return qb("doAction","do or tap"),this.tap.apply(this,arguments)},uc.doOnNext=uc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},uc.doOnError=uc.tapOnError=function(a,b){return this.tap(X,2===arguments.length?function(c){a.call(b,c)}:a)},uc.doOnCompleted=uc.tapOnCompleted=function(a,b){return this.tap(X,null,2===arguments.length?function(){a.call(b)}:a)},uc["finally"]=uc.ensure=function(a){var b=this;return new Vc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Xb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},uc.finallyAction=function(a){return qb("finallyAction","finally or ensure"),this.ensure(a)},uc.ignoreElements=function(){var a=this;return new Vc(function(b){return a.subscribe(X,b.onError.bind(b),b.onCompleted.bind(b))})},uc.materialize=function(){var a=this;return new Vc(function(b){return a.subscribe(function(a){b.onNext(lc(a))},function(a){b.onNext(mc(a)),b.onCompleted()},function(){b.onNext(nc()),b.onCompleted()})})},uc.repeat=function(a){return qc(this,a).concat()},uc.retry=function(a){return qc(this,a).catchError()},uc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Vc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},uc.skipLast=function(a){var b=this;return new Vc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},uc.startWith=function(){var a,b,c=0;return arguments.length&&Y(arguments[0])?(b=arguments[0],c=1):b=dc,a=Nb.call(arguments,c),rc([Dc(a,b),this]).concat()},uc.takeLast=function(a){var b=this;return new Vc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},uc.selectConcat=uc.concatMap=function(a,b,c){return db(a)&&db(b)?this.concatMap(function(c,d){var e=a(c,d);return cb(e)&&(e=Oc(e)),(ob(e)||nb(e))&&(e=Cc(e)),e.map(function(a,e){return b(c,a,d,e)})}):db(a)?D(this,a,c):D(this,function(){return a})},uc.select=uc.map=function(a,b){var c=db(a)?a:function(){return a},d=this;return new Vc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},uc.pluck=function(a){return this.map(function(b){return b[a]})},uc.selectMany=uc.flatMap=function(a,b,c){return db(a)&&db(b)?this.flatMap(function(c,d){var e=a(c,d);return cb(e)&&(e=Oc(e)),(ob(e)||nb(e))&&(e=Cc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):db(a)?E(this,a,c):E(this,function(){return a})},uc.selectSwitch=uc.flatMapLatest=uc.switchMap=function(a,b){return this.select(a,b).switchLatest()},uc.skip=function(a){if(0>a)throw new Error(eb);var b=this;return new Vc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},uc.skipWhile=function(a,b){var c=this;return new Vc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},uc.take=function(a,b){if(0>a)throw new RangeError(eb);if(0===a)return Ac(b);var c=this;return new Vc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},uc.takeWhile=function(a,b){var c=this;return new Vc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},uc.where=uc.filter=function(a,b){var c=this;return new Vc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},xc.fromCallback=function(a,b,c){return function(){var d=Nb.call(arguments,0);return new Vc(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return void e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},xc.fromNodeCallback=function(a,b,c){return function(){var d=Nb.call(arguments,0);return new Vc(function(e){function f(a){if(a)return void e.onError(a);var b=Nb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},W.config.useNativeEvents=!1;var Kc=R.angular&&angular.element?angular.element:R.jQuery?R.jQuery:R.Zepto?R.Zepto:null,Lc=!!R.Ember&&"function"==typeof R.Ember.addListener,Mc=!!R.Backbone&&!!R.Backbone.Marionette;xc.fromEvent=function(a,b,c){if(a.addListener)return Nc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!W.config.useNativeEvents){if(Mc)return Nc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Lc)return Nc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(Kc){var d=Kc(a);return Nc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Vc(function(d){return H(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Nc=xc.fromEventPattern=function(a,b,c){return new Vc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Xb(function(){b&&b(e,f)})}).publish().refCount()},Oc=xc.fromPromise=function(a){return zc(function(){var b=new W.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};uc.toPromise=function(a){if(a||(a=W.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},xc.startAsync=function(a){var b;try{b=a()}catch(c){return Fc(c)}return Oc(b)},uc.multicast=function(a,b){var c=this;return"function"==typeof a?new Vc(function(d){var e=c.multicast(a());return new Ub(b(e).subscribe(d),e.connect())}):new Pc(c,a)},uc.publish=function(a){return a&&db(a)?this.multicast(function(){return new Yc},a):this.multicast(new Yc)},uc.share=function(){return this.publish().refCount()},uc.publishLast=function(a){return a&&db(a)?this.multicast(function(){return new Zc},a):this.multicast(new Zc)},uc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new _c(b)},a):this.multicast(new _c(a))},uc.shareValue=function(a){return this.publishValue(a).refCount()},uc.replay=function(a,b,c,d){return a&&db(a)?this.multicast(function(){return new ad(b,c,d)},a):this.multicast(new ad(b,c,d))},uc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Pc=W.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Ub(f.subscribe(c),Xb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Ob(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Vc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(xc),Qc=xc.interval=function(a,b){return L(a,a,Y(b)?b:jc)};xc.timer=function(b,c,d){var e;return Y(d)||(d=jc),c!==a&&"number"==typeof c?e=c:Y(c)&&(d=c),b instanceof Date&&e===a?I(b.getTime(),d):b instanceof Date&&e!==a?(e=c,J(b.getTime(),e,d)):e===a?K(b,d):L(b,e,d)}}uc.delay=function(a,b){return Y(b)||(b=jc),a instanceof Date?N(this,a.getTime(),b):M(this,a,b)},uc.debounce=uc.throttleWithTimeout=function(a,b){Y(b)||(b=jc);var c=this;return new Vc(function(d){var e,f=new $b,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Zb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Ub(i,f)})},uc.throttle=function(a,b){return qb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},uc.timestamp=function(a){return Y(a)||(a=jc),this.map(function(b){return{value:b,timestamp:a.now()}})},uc.sample=uc.throttleLatest=function(a,b){return Y(b)||(b=jc),"number"==typeof a?O(this,Qc(a,b)):O(this,a)},uc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Fc(new Error(b||"Timeout"))),Y(c)||(c=jc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Vc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(cb(b)&&(b=Oc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Zb,j=new $b,k=!1,l=new $b;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Ub(j,l)})},uc.throttleFirst=function(a,b){Y(b)||(b=jc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Vc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Rc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Yb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Yb)});return new Ub(c,d,e)}function c(c,d){this.source=c,this.controller=new Yc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Ob(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(xc);uc.pausable=function(a){return new Rc(this,a)};var Sc=function(b){function c(b){var c,d=[],e=P(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Yc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Ob(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(xc);uc.pausableBuffered=function(a){return new Sc(this,a)},uc.controlled=function(a){return null==a&&(a=!0),new Tc(this,a)};var Tc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Uc(d),this.source=c.multicast(this.subject).refCount()}return Ob(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(xc),Uc=W.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Yc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Yb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Yb}return Ob(d,a),Pb(d.prototype,sc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Yb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Yb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Yb:(this.requestedCount=a,this.requestedDisposable=Xb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Yb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(xc);uc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Vc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Vc=W.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Xb(a):Yb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Wc(a);return ec.scheduleRequired()?ec.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Ob(c,a),c}(xc),Wc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Zb}Ob(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(vc),Xc=function(a,b){this.subject=a,this.observer=b};Xc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Yc=W.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Yb):(a.onCompleted(),Yb):(this.observers.push(a),new Xc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Ob(d,a),Pb(d.prototype,sc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new $c(a,b)},d}(xc),Zc=W.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Xc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Yb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Ob(d,a),Pb(d.prototype,sc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(xc),$c=W.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Ob(b,a),Pb(b.prototype,sc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(xc),_c=W.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Xc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Yb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Ob(d,a),Pb(d.prototype,sc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(xc),ad=W.ReplaySubject=function(a){function c(a,b){return Xb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new yc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||ec,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Ob(e,a),Pb(e.prototype,sc,{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(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(xc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(R.Rx=W,define(function(){return W})):S&&T?U?(T.exports=W).Rx=W:S.Rx=W:R.Rx=W;var bd=g()}).call(this);
//# sourceMappingURL=rx.lite.compat.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error($)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;zb.nonEnumArgs&&a.length&&Ab(a)&&(a=Cb.call(a));var d=zb.enumPrototypes&&"function"==typeof a,e=zb.enumErrorProps&&(a===sb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(zb.nonEnumShadows&&a!==tb){var g=a.constructor,h=-1,i=xb.length;if(a===(g&&g.prototype))var j=a===ub?ob:a===sb?jb:pb.call(a),k=yb[j];for(;++h<i;)f=xb[h],k&&k[f]||!qb.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=pb.call(a),k=pb.call(b);if(j==fb&&(j=mb),k==fb&&(k=mb),j!=k)return!1;switch(j){case hb:case ib:return+a==+b;case lb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case nb:case ob:return a==String(b)}var l=j==gb;if(!l){if(j!=mb||!zb.nodeClass&&(g(a)||g(b)))return!1;var m=!zb.argsObject&&Ab(a)?Object:a.constructor,n=!zb.argsObject&&Ab(b)?Object:b.constructor;if(!(m==n||qb.call(a,"constructor")&&qb.call(b,"constructor")||Y(m)&&m instanceof m&&Y(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=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return qb.call(f,e)?(p++,q=qb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return qb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Cb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(){this._s=s}function m(){this._s=s,this._l=s.length,this._i=0}function n(a){this._a=a}function o(a){this._a=a,this._l=t(a),this._i=0}function p(a){return"number"==typeof a&&K.isFinite(a)}function q(b){var c,d=b[_];if(!d&&"string"==typeof b)return c=new l(b),c[_]();if(!d&&b.length!==a)return c=new n(b),c[_]();if(!d)throw new TypeError("Object is not iterable");return b[_]()}function r(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function t(a){var b=+a.length;return isNaN(b)?0:0!==b&&p(b)?(b=r(b)*Math.floor(Math.abs(b)),0>=b?0:b>oc?oc:b):b}function u(a,b){return R(a)||(a=Tb),new Ic(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function v(a,b){return new Ic(function(c){var d=new Mb,e=new Nb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}X(f)&&(f=Bc(f)),d=new Mb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function w(a,b){var c=this;return new Ic(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function x(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return X(f)&&(f=Bc(f)),(cb(f)||bb(f))&&(f=pc(f)),f}).concatAll()}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return X(f)&&(f=Bc(f)),(cb(f)||bb(f))&&(f=pc(f)),f}).mergeAll()}function z(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Kb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function A(a,b,c){var d=new Hb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(A(a.item(e),b,c));else a&&d.add(z(a,b,c));return d}function B(a,b){return new Ic(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function C(a,b,c){return new Ic(function(d){var e=0,f=a,g=Qb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function D(a,b){return new Ic(function(c){return b.scheduleWithRelative(Qb(a),function(){c.onNext(0),c.onCompleted()})})}function E(a,b,c){return a===b?new Ic(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):mc(function(){return C(c.now()+a,b,c)})}function F(a,b,c){return new Ic(function(d){var e,f=!1,g=new Nb,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.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Mb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Hb(e,g)})}function G(a,b,c){return mc(function(){return F(a,b-c.now(),c)})}function H(a,b){return new Ic(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Hb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function I(a,b,c){return new Ic(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(S))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Hb(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)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},K=J[typeof window]&&window||this,L=J[typeof exports]&&exports&&!exports.nodeType&&exports,M=J[typeof module]&&module&&!module.nodeType&&module,N=M&&M.exports===L&&L,O=J[typeof global]&&global;!O||O.global!==O&&O.window!==O||(K=O);var P={internals:{},config:{Promise:K.Promise},helpers:{}},Q=P.helpers.noop=function(){},R=(P.helpers.notDefined=function(a){return"undefined"==typeof a},P.helpers.isScheduler=function(a){return a instanceof P.Scheduler}),S=P.helpers.identity=function(a){return a},T=(P.helpers.pluck=function(a){return function(b){return b[a]}},P.helpers.just=function(a){return function(){return a}},P.helpers.defaultNow=Date.now),U=P.helpers.defaultComparer=function(a,b){return Bb(a,b)},V=P.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},W=(P.helpers.defaultKeySerializer=function(a){return a.toString()},P.helpers.defaultError=function(a){throw a}),X=P.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Y=(P.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},P.helpers.not=function(a){return!a},P.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==pb.call(a)}),a}()),Z="Argument out of range",$="Object has been disposed",_="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";K.Set&&"function"==typeof(new K.Set)["@@iterator"]&&(_="@@iterator");var ab=P.doneEnumerator={done:!0,value:a},bb=P.helpers.isIterable=function(b){return b[_]!==a},cb=P.helpers.isArrayLike=function(b){return b&&b.length!==a};P.helpers.iterator=_;var db,eb=P.helpers.deprecate=function(){},fb="[object Arguments]",gb="[object Array]",hb="[object Boolean]",ib="[object Date]",jb="[object Error]",kb="[object Function]",lb="[object Number]",mb="[object Object]",nb="[object RegExp]",ob="[object String]",pb=Object.prototype.toString,qb=Object.prototype.hasOwnProperty,rb=pb.call(arguments)==fb,sb=Error.prototype,tb=Object.prototype,ub=String.prototype,vb=tb.propertyIsEnumerable;try{db=!(pb.call(document)==mb&&!({toString:0}+""))}catch(wb){db=!0}var xb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yb={};yb[gb]=yb[ib]=yb[lb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},yb[hb]=yb[ob]={constructor:!0,toString:!0,valueOf:!0},yb[jb]=yb[kb]=yb[nb]={constructor:!0,toString:!0},yb[mb]={constructor:!0};var zb={};!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);zb.enumErrorProps=vb.call(sb,"message")||vb.call(sb,"name"),zb.enumPrototypes=vb.call(a,"prototype"),zb.nonEnumArgs=0!=c,zb.nonEnumShadows=!/valueOf/.test(b)}(1);var Ab=function(a){return a&&"object"==typeof a?pb.call(a)==fb:!1};rb||(Ab=function(a){return a&&"object"==typeof a?qb.call(a,"callee"):!1});{var Bb=P.internals.isEqual=function(a,b){return h(a,b,[],[])},Cb=Array.prototype.slice,Db=({}.hasOwnProperty,this.inherits=P.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Eb=P.internals.addProperties=function(a){for(var b=Cb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};P.internals.addRef=function(a,b){return new Ic(function(c){return new Hb(b.getDisposable(),a.subscribe(c))})}}k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Fb=P.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Gb=Fb.prototype;Gb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Gb.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)}}},Gb.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)}}},Gb.peek=function(){return this.items[0].value},Gb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Gb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Gb.enqueue=function(a){var b=this.length++;this.items[b]=new k(Fb.count++,a),this.percolate(b)},Gb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Fb.count=0;var Hb=P.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Ib=Hb.prototype;Ib.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Ib.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},Ib.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Ib.toArray=function(){return this.disposables.slice(0)};var Jb=P.Disposable=function(a){this.isDisposed=!1,this.action=a||Q};Jb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Kb=Jb.create=function(a){return new Jb(a)},Lb=Jb.empty={dispose:Q},Mb=P.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Nb=P.SerialDisposable=Mb,Ob=(P.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Lb:new a(this)},b}(),P.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||V,this.disposable=new Mb});Ob.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Ob.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Ob.prototype.isCancelled=function(){return this.disposable.isDisposed},Ob.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Pb=P.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Lb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=T,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Qb=Pb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Hb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Lb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Hb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Lb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Pb.prototype),function(){Pb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Pb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof K.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=K.setInterval(function(){d=c(d)},b);return Kb(function(){K.clearInterval(e)})}}(Pb.prototype);var Rb,Sb=Pb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Qb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Pb(T,a,b,c)}(),Tb=Pb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Pb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Pb.normalize(c),g=new Ob(this,b,d,f);if(e)e.enqueue(g);else{e=new Fb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Pb(T,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ub=(P.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 Mb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Q),Vb=function(){var a,b=Q;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!K.setTimeout)throw new Error("No concurrency detected!");a=K.setTimeout,b=K.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Wb=Vb.setTimeout,Xb=Vb.clearTimeout;!function(){function a(){if(!K.postMessage||K.importScripts)return!1;var a=!1,b=K.onmessage;return K.onmessage=function(){a=!0},K.postMessage("","*"),K.onmessage=b,a}var b=RegExp("^"+String(pb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=O&&N&&O.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=O&&N&&O.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Rb=c,Ub=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Rb=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};K.addEventListener?K.addEventListener("message",h,!1):K.attachEvent("onmessage",h,!1),Rb=function(a){var b=g++;f[b]=a,K.postMessage(e+b,"*")}}else if(K.MessageChannel){var i=new K.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Rb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in K&&"onreadystatechange"in K.document.createElement("script")?Rb=function(a){var b=K.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},K.document.documentElement.appendChild(b)}:(Rb=function(a){return Wb(a,0)},Ub=Xb)}();var Yb=Pb.timeout=function(){function a(a,b){var c=this,d=new Mb,e=Rb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Hb(d,Kb(function(){Ub(e)}))}function b(a,b,c){var d=this,e=Pb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Mb,g=Wb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Hb(f,Kb(function(){Xb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Pb(T,a,b,c)}(),Zb=P.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 R(a)||(a=Sb),new Ic(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),$b=Zb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Zb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),_b=Zb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Zb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),ac=Zb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Zb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),bc=P.internals.Enumerator=function(a){this._next=a};bc.prototype.next=function(){return this._next()},bc.prototype[_]=function(){return this};var cc=P.internals.Enumerable=function(a){this._iterator=a};cc.prototype[_]=function(){return this._iterator()},cc.prototype.concat=function(){var a=this;return new Ic(function(b){var c;try{c=a[_]()}catch(d){return void b.onError(d)}var e,f=new Nb,g=Sb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;X(h)&&(h=Bc(h));var i=new Mb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Hb(f,g,Kb(function(){e=!0}))})},cc.prototype.catchError=function(){var a=this;return new Ic(function(b){var c;try{c=a[_]()}catch(d){return void b.onError(d)}var e,f,g=new Nb,h=Sb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;X(i)&&(i=Bc(i));var j=new Mb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Hb(g,h,Kb(function(){e=!0}))})};var dc=cc.repeat=function(a,b){return null==b&&(b=-1),new cc(function(){var c=b;return new bc(function(){return 0===c?ab:(c>0&&c--,{done:!1,value:a})})})},ec=cc.of=function(a,b,c){return b||(b=S),new cc(function(){var d=-1;return new bc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:ab})})},fc=P.Observer=function(){};fc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},fc.prototype.asObserver=function(){return new jc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var gc=fc.create=function(a,b,c){return a||(a=Q),b||(b=W),c||(c=Q),new jc(a,b,c)};fc.fromNotifier=function(a,b){return new jc(function(c){return a.call(b,$b(c))},function(c){return a.call(b,_b(c))},function(){return a.call(b,ac())})};var hc,ic=P.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Db(b,a),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}(fc),jc=P.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Db(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}(ic),kc=P.Observable=function(){function a(a){this._subscribe=a}return hc=a.prototype,hc.subscribe=hc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:gc(a,b,c))},hc.subscribeOnNext=function(a,b){return this._subscribe(gc(2===arguments.length?function(c){a.call(b,c)}:a))},hc.subscribeOnError=function(a,b){return this._subscribe(gc(null,2===arguments.length?function(c){a.call(b,c)}:a))},hc.subscribeOnCompleted=function(a,b){return this._subscribe(gc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),lc=P.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 Nb}return Db(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(ic);hc.toArray=function(){var a=this;return new Ic(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},kc.create=kc.createWithDisposable=function(a){return new Ic(a)};var mc=kc.defer=function(a){return new Ic(function(b){var c;try{c=a()}catch(d){return sc(d).subscribe(b)}return X(c)&&(c=Bc(c)),c.subscribe(b)})},nc=kc.empty=function(a){return R(a)||(a=Sb),new Ic(function(b){return a.schedule(function(){b.onCompleted()})})},oc=Math.pow(2,53)-1;l.prototype[_]=function(){return new m(this._s)},m.prototype[_]=function(){return this},m.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return ab},n.prototype[_]=function(){return new o(this._a)},o.prototype[_]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return ab};{var pc=kc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Y(b))throw new Error("mapFn when provided must be a function");R(d)||(d=Tb);var e=Object(a),f=q(e);return new Ic(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Y(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},qc=kc.fromArray=function(a,b){return eb("fromArray","from"),R(b)||(b=Tb),new Ic(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};kc.never=function(){return new Ic(function(){return Lb})}}kc.of=function(){return u(null,arguments)},kc.ofWithScheduler=function(a){return u(a,Cb.call(arguments,1))},kc.range=function(a,b,c){return R(c)||(c=Tb),new Ic(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},kc.repeat=function(a,b,c){return R(c)||(c=Tb),rc(a,c).repeat(null==b?-1:b)};var rc=kc["return"]=kc.just=function(a,b){return R(b)||(b=Sb),new Ic(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};kc.returnValue=function(){return eb("returnValue","return or just"),rc.apply(null,arguments)};var sc=kc["throw"]=kc.throwException=kc.throwError=function(a,b){return R(b)||(b=Sb),new Ic(function(c){return b.schedule(function(){c.onError(a)})})};hc["catch"]=hc.catchError=function(a){return"function"==typeof a?v(this,a):tc([this,a])},hc.catchException=function(a){return eb("catchException","catch or catchError"),this.catchError(a)};var tc=kc.catchError=kc["catch"]=function(){return ec(i(arguments,0)).catchError()};kc.catchException=function(){return eb("catchException","catch or catchError"),tc.apply(null,arguments)},hc.combineLatest=function(){var a=Cb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),uc.apply(this,a)};var uc=kc.combineLatest=function(){var a=Cb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Ic(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(S))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(S)&&c.onCompleted()}function e(a){k[a]=!0,k.every(S)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Mb;X(f)&&(f=Bc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Hb(m)})};hc.concat=function(){var a=Cb.call(arguments,0);return a.unshift(this),vc.apply(this,a)};var vc=kc.concat=function(){return ec(i(arguments,0)).concat()};hc.concatAll=function(){return this.merge(1)},hc.concatObservable=function(){return eb("concatObservable","concatAll"),this.merge(1)},hc.merge=function(a){if("number"!=typeof a)return wc(this,a);var b=this;return new Ic(function(c){function d(a){var b=new Mb;f.add(b),X(a)&&(a=Bc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Hb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var wc=kc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Cb.call(arguments,1)):(a=Sb,b=Cb.call(arguments,0)):(a=Sb,b=Cb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),u(a,b).mergeAll()};hc.mergeAll=function(){var a=this;return new Ic(function(b){var c=new Hb,d=!1,e=new Mb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Mb;c.add(e),X(a)&&(a=Bc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},hc.mergeObservable=function(){return eb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},hc.skipUntil=function(a){var b=this;return new Ic(function(c){var d=!1,e=new Hb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));X(a)&&(a=Bc(a));var f=new Mb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},hc["switch"]=hc.switchLatest=function(){var a=this;return new Ic(function(b){var c=!1,d=new Nb,e=!1,f=0,g=a.subscribe(function(a){var g=new Mb,h=++f;c=!0,d.setDisposable(g),X(a)&&(a=Bc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Hb(g,d)})},hc.takeUntil=function(a){var b=this;return new Ic(function(c){return X(a)&&(a=Bc(a)),new Hb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),Q))})},hc.zip=function(){if(Array.isArray(arguments[0]))return w.apply(this,arguments);var a=this,b=Cb.call(arguments),c=b.pop();return b.unshift(a),new Ic(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(S)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Mb;X(c)&&(c=Bc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Hb(k)})},kc.zip=function(){var a=Cb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},kc.zipArray=function(){var a=i(arguments,0);return new Ic(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(S))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(S)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Mb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Hb(h);return k.add(Kb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},hc.asObservable=function(){return new Ic(this.subscribe.bind(this))},hc.dematerialize=function(){var a=this;return new Ic(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},hc.distinctUntilChanged=function(a,b){var c=this;return a||(a=S),b||(b=U),new Ic(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},hc["do"]=hc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Ic(function(a){return e.subscribe(function(b){try{d(b)
}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},hc.doAction=function(){return eb("doAction","do or tap"),this.tap.apply(this,arguments)},hc.doOnNext=hc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},hc.doOnError=hc.tapOnError=function(a,b){return this.tap(Q,2===arguments.length?function(c){a.call(b,c)}:a)},hc.doOnCompleted=hc.tapOnCompleted=function(a,b){return this.tap(Q,null,2===arguments.length?function(){a.call(b)}:a)},hc["finally"]=hc.ensure=function(a){var b=this;return new Ic(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Kb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},hc.finallyAction=function(a){return eb("finallyAction","finally or ensure"),this.ensure(a)},hc.ignoreElements=function(){var a=this;return new Ic(function(b){return a.subscribe(Q,b.onError.bind(b),b.onCompleted.bind(b))})},hc.materialize=function(){var a=this;return new Ic(function(b){return a.subscribe(function(a){b.onNext($b(a))},function(a){b.onNext(_b(a)),b.onCompleted()},function(){b.onNext(ac()),b.onCompleted()})})},hc.repeat=function(a){return dc(this,a).concat()},hc.retry=function(a){return dc(this,a).catchError()},hc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Ic(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},hc.skipLast=function(a){var b=this;return new Ic(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},hc.startWith=function(){var a,b,c=0;return arguments.length&&R(arguments[0])?(b=arguments[0],c=1):b=Sb,a=Cb.call(arguments,c),ec([qc(a,b),this]).concat()},hc.takeLast=function(a){var b=this;return new Ic(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},hc.selectConcat=hc.concatMap=function(a,b,c){return Y(a)&&Y(b)?this.concatMap(function(c,d){var e=a(c,d);return X(e)&&(e=Bc(e)),(cb(e)||bb(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Y(a)?x(this,a,c):x(this,function(){return a})},hc.select=hc.map=function(a,b){var c=Y(a)?a:function(){return a},d=this;return new Ic(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},hc.pluck=function(a){return this.map(function(b){return b[a]})},hc.selectMany=hc.flatMap=function(a,b,c){return Y(a)&&Y(b)?this.flatMap(function(c,d){var e=a(c,d);return X(e)&&(e=Bc(e)),(cb(e)||bb(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Y(a)?y(this,a,c):y(this,function(){return a})},hc.selectSwitch=hc.flatMapLatest=hc.switchMap=function(a,b){return this.select(a,b).switchLatest()},hc.skip=function(a){if(0>a)throw new Error(Z);var b=this;return new Ic(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},hc.skipWhile=function(a,b){var c=this;return new Ic(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},hc.take=function(a,b){if(0>a)throw new RangeError(Z);if(0===a)return nc(b);var c=this;return new Ic(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},hc.takeWhile=function(a,b){var c=this;return new Ic(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},hc.where=hc.filter=function(a,b){var c=this;return new Ic(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},kc.fromCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Ic(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},kc.fromNodeCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Ic(function(e){function f(a){if(a)return void e.onError(a);var b=Cb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},P.config.useNativeEvents=!1;var xc=K.angular&&angular.element?angular.element:K.jQuery?K.jQuery:K.Zepto?K.Zepto:null,yc=!!K.Ember&&"function"==typeof K.Ember.addListener,zc=!!K.Backbone&&!!K.Backbone.Marionette;kc.fromEvent=function(a,b,c){if(a.addListener)return Ac(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!P.config.useNativeEvents){if(zc)return Ac(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(yc)return Ac(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(xc){var d=xc(a);return Ac(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Ic(function(d){return A(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Ac=kc.fromEventPattern=function(a,b,c){return new Ic(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Kb(function(){b&&b(e,f)})}).publish().refCount()},Bc=kc.fromPromise=function(a){return mc(function(){var b=new P.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};hc.toPromise=function(a){if(a||(a=P.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},kc.startAsync=function(a){var b;try{b=a()}catch(c){return sc(c)}return Bc(b)},hc.multicast=function(a,b){var c=this;return"function"==typeof a?new Ic(function(d){var e=c.multicast(a());return new Hb(b(e).subscribe(d),e.connect())}):new Cc(c,a)},hc.publish=function(a){return a&&Y(a)?this.multicast(function(){return new Lc},a):this.multicast(new Lc)},hc.share=function(){return this.publish().refCount()},hc.publishLast=function(a){return a&&Y(a)?this.multicast(function(){return new Mc},a):this.multicast(new Mc)},hc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Oc(b)},a):this.multicast(new Oc(a))},hc.shareValue=function(a){return this.publishValue(a).refCount()},hc.replay=function(a,b,c,d){return a&&Y(a)?this.multicast(function(){return new Pc(b,c,d)},a):this.multicast(new Pc(b,c,d))},hc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Cc=P.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Hb(f.subscribe(c),Kb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Db(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Ic(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(kc),Dc=kc.interval=function(a,b){return E(a,a,R(b)?b:Yb)};kc.timer=function(b,c,d){var e;return R(d)||(d=Yb),c!==a&&"number"==typeof c?e=c:R(c)&&(d=c),b instanceof Date&&e===a?B(b.getTime(),d):b instanceof Date&&e!==a?(e=c,C(b.getTime(),e,d)):e===a?D(b,d):E(b,e,d)}}hc.delay=function(a,b){return R(b)||(b=Yb),a instanceof Date?G(this,a.getTime(),b):F(this,a,b)},hc.debounce=hc.throttleWithTimeout=function(a,b){R(b)||(b=Yb);var c=this;return new Ic(function(d){var e,f=new Nb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Mb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Hb(i,f)})},hc.throttle=function(a,b){return eb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},hc.timestamp=function(a){return R(a)||(a=Yb),this.map(function(b){return{value:b,timestamp:a.now()}})},hc.sample=hc.throttleLatest=function(a,b){return R(b)||(b=Yb),"number"==typeof a?H(this,Dc(a,b)):H(this,a)},hc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=sc(new Error(b||"Timeout"))),R(c)||(c=Yb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Ic(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(X(b)&&(b=Bc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Mb,j=new Nb,k=!1,l=new Nb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Hb(j,l)})},hc.throttleFirst=function(a,b){R(b)||(b=Yb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Ic(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Ec=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Lb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Lb)});return new Hb(c,d,e)}function c(c,d){this.source=c,this.controller=new Lc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Db(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(kc);hc.pausable=function(a){return new Ec(this,a)};var Fc=function(b){function c(b){var c,d=[],e=I(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Lc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Db(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(kc);hc.pausableBuffered=function(a){return new Fc(this,a)},hc.controlled=function(a){return null==a&&(a=!0),new Gc(this,a)};var Gc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Hc(d),this.source=c.multicast(this.subject).refCount()}return Db(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(kc),Hc=P.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Lc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Lb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Lb}return Db(d,a),Eb(d.prototype,fc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Lb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Lb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Lb:(this.requestedCount=a,this.requestedDisposable=Kb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Lb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(kc);hc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Ic(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Ic=P.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Kb(a):Lb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Jc(a);return Tb.scheduleRequired()?Tb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Db(c,a),c}(kc),Jc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Mb}Db(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(ic),Kc=function(a,b){this.subject=a,this.observer=b};Kc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Lc=P.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Lb):(a.onCompleted(),Lb):(this.observers.push(a),new Kc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Nc(a,b)},d}(kc),Mc=P.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Kc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Lb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(kc),Nc=P.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Db(b,a),Eb(b.prototype,fc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(kc),Oc=P.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Kc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Lb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(kc),Pc=P.ReplaySubject=function(a){function c(a,b){return Kb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new lc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Tb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Db(e,a),Eb(e.prototype,fc,{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(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(kc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K.Rx=P,define(function(){return P})):L&&M?N?(M.exports=P).Rx=P:L.Rx=P:K.Rx=P}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(eb)}function c(a,b){if(fb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(jb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+jb+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return console.log(hb,ib,$c),c===hb&&d>=ib&&$c>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(fb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return hb=d[0],d[1]}}function h(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 i(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;Jb.nonEnumArgs&&a.length&&Kb(a)&&(a=Mb.call(a));var c=Jb.enumPrototypes&&"function"==typeof a,d=Jb.enumErrorProps&&(a===Db||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Jb.nonEnumShadows&&a!==Eb){var f=a.constructor,g=-1,h=Hb.length;if(a===(f&&f.prototype))var j=a===Fb?zb:a===Db?ub:Ab.call(a),k=Ib[j];for(;++g<h;)e=Hb[g],k&&k[e]||!Bb.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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 g=Ab.call(a),h=Ab.call(b);if(g==qb&&(g=xb),h==qb&&(h=xb),g!=h)return!1;switch(g){case sb:case tb:return+a==+b;case wb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case yb:case zb:return a==String(b)}var i=g==rb;if(!i){if(g!=xb||!Jb.nodeClass&&(m(a)||m(b)))return!1;var j=!Jb.argsObject&&Kb(a)?Object:a.constructor,k=!Jb.argsObject&&Kb(b)?Object:b.constructor;if(!(j==k||Bb.call(a,"constructor")&&Bb.call(b,"constructor")||cb(j)&&j instanceof j&&cb(k)&&k instanceof k||!("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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Bb.call(f,e)?(p++,q=Bb.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Bb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Mb.call(a)}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(){this._s=s}function t(){this._s=s,this._l=s.length,this._i=0}function u(a){this._a=a}function v(a){this._a=a,this._l=z(a),this._i=0}function w(a){return"number"==typeof a&&Q.isFinite(a)}function x(b){var c,d=b[kb];if(!d&&"string"==typeof b)return c=new r(b),c[kb]();if(!d&&b.length!==a)return c=new u(b),c[kb]();if(!d)throw new TypeError("Object is not iterable");return b[kb]()}function y(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function z(a){var b=+a.length;return isNaN(b)?0:0!==b&&w(b)?(b=y(b)*Math.floor(Math.abs(b)),0>=b?0:b>yc?yc:b):b}function A(a,b){return X(a)||(a=bc),new Sc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function B(a,b){return new Sc(function(c){var d=new Wb,e=new Xb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}bb(f)&&(f=Lc(f)),d=new Wb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function C(a,b){var c=this;return new Sc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function D(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return bb(f)&&(f=Lc(f)),(nb(f)||mb(f))&&(f=zc(f)),f}).concatAll()}function E(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return bb(f)&&(f=Lc(f)),(nb(f)||mb(f))&&(f=zc(f)),f}).mergeAll()}function F(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Ub(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function G(a,b,c){var d=new Rb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(G(a.item(e),b,c));else a&&d.add(F(a,b,c));return d}function H(a,b){return new Sc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function I(a,b,c){return new Sc(function(d){var e=0,f=a,g=$b(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function J(a,b){return new Sc(function(c){return b.scheduleWithRelative($b(a),function(){c.onNext(0),c.onCompleted()})})}function K(a,b,c){return a===b?new Sc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):wc(function(){return I(c.now()+a,b,c)})}function L(a,b,c){return new Sc(function(d){var e,f=!1,g=new Xb,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.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Wb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Rb(e,g)})}function M(a,b,c){return wc(function(){return L(a,b-c.now(),c)})}function N(a,b){return new Sc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Rb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function O(a,b,c){return new Sc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(Y))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Rb(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)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q=P[typeof window]&&window||this,R=P[typeof exports]&&exports&&!exports.nodeType&&exports,S=P[typeof module]&&module&&!module.nodeType&&module,T=S&&S.exports===R&&R,U=P[typeof global]&&global;!U||U.global!==U&&U.window!==U||(Q=U);var V={internals:{},config:{Promise:Q.Promise},helpers:{}},W=V.helpers.noop=function(){},X=(V.helpers.notDefined=function(a){return"undefined"==typeof a},V.helpers.isScheduler=function(a){return a instanceof V.Scheduler}),Y=V.helpers.identity=function(a){return a},Z=(V.helpers.pluck=function(a){return function(b){return b[a]}},V.helpers.just=function(a){return function(){return a}},V.helpers.defaultNow=Date.now),$=V.helpers.defaultComparer=function(a,b){return Lb(a,b)},_=V.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ab=(V.helpers.defaultKeySerializer=function(a){return a.toString()},V.helpers.defaultError=function(a){throw a}),bb=V.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},cb=(V.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},V.helpers.not=function(a){return!a},V.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ab.call(a)}),a}()),db="Argument out of range",eb="Object has been disposed";V.config.longStackSupport=!1;var fb=!1;try{throw new Error}catch(gb){fb=!!gb.stack}var hb,ib=g(),jb="From previous event:",kb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Q.Set&&"function"==typeof(new Q.Set)["@@iterator"]&&(kb="@@iterator");var lb=V.doneEnumerator={done:!0,value:a},mb=V.helpers.isIterable=function(b){return b[kb]!==a},nb=V.helpers.isArrayLike=function(b){return b&&b.length!==a};V.helpers.iterator=kb;var ob,pb=V.helpers.deprecate=function(){},qb="[object Arguments]",rb="[object Array]",sb="[object Boolean]",tb="[object Date]",ub="[object Error]",vb="[object Function]",wb="[object Number]",xb="[object Object]",yb="[object RegExp]",zb="[object String]",Ab=Object.prototype.toString,Bb=Object.prototype.hasOwnProperty,Cb=Ab.call(arguments)==qb,Db=Error.prototype,Eb=Object.prototype,Fb=String.prototype,Gb=Eb.propertyIsEnumerable;try{ob=!(Ab.call(document)==xb&&!({toString:0}+""))}catch(gb){ob=!0}var Hb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ib={};Ib[rb]=Ib[tb]=Ib[wb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ib[sb]=Ib[zb]={constructor:!0,toString:!0,valueOf:!0},Ib[ub]=Ib[vb]=Ib[yb]={constructor:!0,toString:!0},Ib[xb]={constructor:!0};var Jb={};!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);Jb.enumErrorProps=Gb.call(Db,"message")||Gb.call(Db,"name"),Jb.enumPrototypes=Gb.call(a,"prototype"),Jb.nonEnumArgs=0!=c,Jb.nonEnumShadows=!/valueOf/.test(b)}(1);var Kb=function(a){return a&&"object"==typeof a?Ab.call(a)==qb:!1};Cb||(Kb=function(a){return a&&"object"==typeof a?Bb.call(a,"callee"):!1});{var Lb=V.internals.isEqual=function(a,b){return n(a,b,[],[])},Mb=Array.prototype.slice,Nb=({}.hasOwnProperty,this.inherits=V.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Ob=V.internals.addProperties=function(a){for(var b=Mb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};V.internals.addRef=function(a,b){return new Sc(function(c){return new Rb(b.getDisposable(),a.subscribe(c))})}}q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Pb=V.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Qb=Pb.prototype;Qb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Qb.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)}}},Qb.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)}}},Qb.peek=function(){return this.items[0].value},Qb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Qb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Qb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Pb.count++,a),this.percolate(b)},Qb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Pb.count=0;var Rb=V.CompositeDisposable=function(){this.disposables=o(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Sb=Rb.prototype;Sb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Sb.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},Sb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Sb.toArray=function(){return this.disposables.slice(0)};var Tb=V.Disposable=function(a){this.isDisposed=!1,this.action=a||W};Tb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Ub=Tb.create=function(a){return new Tb(a)},Vb=Tb.empty={dispose:W},Wb=V.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Xb=V.SerialDisposable=Wb,Yb=(V.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Vb:new a(this)},b}(),V.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||_,this.disposable=new Wb});Yb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Yb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Yb.prototype.isCancelled=function(){return this.disposable.isDisposed},Yb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Zb=V.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Vb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Z,a.normalize=function(a){return 0>a&&(a=0),a},a}(),$b=Zb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Rb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Vb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Rb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Vb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Zb.prototype),function(){Zb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Zb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Q.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=Q.setInterval(function(){d=c(d)},b);return Ub(function(){Q.clearInterval(e)})}}(Zb.prototype);var _b,ac=Zb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=$b(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Zb(Z,a,b,c)}(),bc=Zb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Zb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Zb.normalize(c),g=new Yb(this,b,d,f);if(e)e.enqueue(g);else{e=new Pb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Zb(Z,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),cc=(V.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 Wb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),W),dc=function(){var a,b=W;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!Q.setTimeout)throw new Error("No concurrency detected!");a=Q.setTimeout,b=Q.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),ec=dc.setTimeout,fc=dc.clearTimeout;!function(){function a(){if(!Q.postMessage||Q.importScripts)return!1;var a=!1,b=Q.onmessage;return Q.onmessage=function(){a=!0},Q.postMessage("","*"),Q.onmessage=b,a}var b=RegExp("^"+String(Ab).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=U&&T&&U.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=U&&T&&U.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)_b=c,cc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))_b=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};Q.addEventListener?Q.addEventListener("message",h,!1):Q.attachEvent("onmessage",h,!1),_b=function(a){var b=g++;f[b]=a,Q.postMessage(e+b,"*")}}else if(Q.MessageChannel){var i=new Q.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},_b=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in Q&&"onreadystatechange"in Q.document.createElement("script")?_b=function(a){var b=Q.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},Q.document.documentElement.appendChild(b)}:(_b=function(a){return ec(a,0)},cc=fc)}();var gc=Zb.timeout=function(){function a(a,b){var c=this,d=new Wb,e=_b(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Rb(d,Ub(function(){cc(e)}))}function b(a,b,c){var d=this,e=Zb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Wb,g=ec(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Rb(f,Ub(function(){fc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Zb(Z,a,b,c)}(),hc=V.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 X(a)||(a=ac),new Sc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ic=hc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new hc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),jc=hc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new hc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),kc=hc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new hc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),lc=V.internals.Enumerator=function(a){this._next=a};lc.prototype.next=function(){return this._next()},lc.prototype[kb]=function(){return this};var mc=V.internals.Enumerable=function(a){this._iterator=a};mc.prototype[kb]=function(){return this._iterator()},mc.prototype.concat=function(){var a=this;return new Sc(function(b){var c;try{c=a[kb]()}catch(d){return void b.onError(d)}var e,f=new Xb,g=ac.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;bb(h)&&(h=Lc(h));var i=new Wb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Rb(f,g,Ub(function(){e=!0}))})},mc.prototype.catchError=function(){var a=this;return new Sc(function(b){var c;try{c=a[kb]()}catch(d){return void b.onError(d)}var e,f,g=new Xb,h=ac.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;bb(i)&&(i=Lc(i));var j=new Wb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Rb(g,h,Ub(function(){e=!0}))})};var nc=mc.repeat=function(a,b){return null==b&&(b=-1),new mc(function(){var c=b;return new lc(function(){return 0===c?lb:(c>0&&c--,{done:!1,value:a})})})},oc=mc.of=function(a,b,c){return b||(b=Y),new mc(function(){var d=-1;return new lc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:lb})})},pc=V.Observer=function(){};pc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},pc.prototype.asObserver=function(){return new tc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var qc=pc.create=function(a,b,c){return a||(a=W),b||(b=ab),c||(c=W),new tc(a,b,c)};pc.fromNotifier=function(a,b){return new tc(function(c){return a.call(b,ic(c))},function(c){return a.call(b,jc(c))},function(){return a.call(b,kc())})};var rc,sc=V.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Nb(b,a),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}(pc),tc=V.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Nb(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}(sc),uc=V.Observable=function(){function a(a){if(V.config.longStackSupport&&fb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){b.onError=function(a){c(d,a),b.onError(a)},a(b)}}this._subscribe=a}return rc=a.prototype,rc.subscribe=rc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:qc(a,b,c))},rc.subscribeOnNext=function(a,b){return this._subscribe(qc(2===arguments.length?function(c){a.call(b,c)}:a))},rc.subscribeOnError=function(a,b){return this._subscribe(qc(null,2===arguments.length?function(c){a.call(b,c)}:a))},rc.subscribeOnCompleted=function(a,b){return this._subscribe(qc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),vc=V.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 Xb}return Nb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(sc);rc.toArray=function(){var a=this;return new Sc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},uc.create=uc.createWithDisposable=function(a,b){return new Sc(a,b)};var wc=uc.defer=function(a){return new Sc(function(b){var c;try{c=a()}catch(d){return Cc(d).subscribe(b)}return bb(c)&&(c=Lc(c)),c.subscribe(b)})},xc=uc.empty=function(a){return X(a)||(a=ac),new Sc(function(b){return a.schedule(function(){b.onCompleted()})})},yc=Math.pow(2,53)-1;r.prototype[kb]=function(){return new t(this._s)},t.prototype[kb]=function(){return this},t.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return lb},u.prototype[kb]=function(){return new v(this._a)},v.prototype[kb]=function(){return this},v.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return lb};{var zc=uc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!cb(b))throw new Error("mapFn when provided must be a function");X(d)||(d=bc);var e=Object(a),f=x(e);return new Sc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&cb(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},Ac=uc.fromArray=function(a,b){return pb("fromArray","from"),X(b)||(b=bc),new Sc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};uc.never=function(){return new Sc(function(){return Vb})}}uc.of=function(){return A(null,arguments)},uc.ofWithScheduler=function(a){return A(a,Mb.call(arguments,1))},uc.range=function(a,b,c){return X(c)||(c=bc),new Sc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},uc.repeat=function(a,b,c){return X(c)||(c=bc),Bc(a,c).repeat(null==b?-1:b)};var Bc=uc["return"]=uc.just=function(a,b){return X(b)||(b=ac),new Sc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};uc.returnValue=function(){return pb("returnValue","return or just"),Bc.apply(null,arguments)};var Cc=uc["throw"]=uc.throwException=uc.throwError=function(a,b){return X(b)||(b=ac),new Sc(function(c){return b.schedule(function(){c.onError(a)})})};rc["catch"]=rc.catchError=function(a){return"function"==typeof a?B(this,a):Dc([this,a])},rc.catchException=function(a){return pb("catchException","catch or catchError"),this.catchError(a)};var Dc=uc.catchError=uc["catch"]=function(){return oc(o(arguments,0)).catchError()};uc.catchException=function(){return pb("catchException","catch or catchError"),Dc.apply(null,arguments)},rc.combineLatest=function(){var a=Mb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Ec.apply(this,a)};var Ec=uc.combineLatest=function(){var a=Mb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Sc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(Y))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(Y)&&c.onCompleted()}function e(a){j[a]=!0,j.every(Y)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new Wb;bb(f)&&(f=Lc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),l[b]=g}(m);return new Rb(l)})};rc.concat=function(){var a=Mb.call(arguments,0);return a.unshift(this),Fc.apply(this,a)};var Fc=uc.concat=function(){return oc(o(arguments,0)).concat()};rc.concatAll=function(){return this.merge(1)},rc.concatObservable=function(){return pb("concatObservable","concatAll"),this.merge(1)},rc.merge=function(a){if("number"!=typeof a)return Gc(this,a);var b=this;return new Sc(function(c){function d(a){var b=new Wb;f.add(b),bb(a)&&(a=Lc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Rb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var Gc=uc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Mb.call(arguments,1)):(a=ac,b=Mb.call(arguments,0)):(a=ac,b=Mb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),A(a,b).mergeAll()};rc.mergeAll=function(){var a=this;return new Sc(function(b){var c=new Rb,d=!1,e=new Wb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Wb;c.add(e),bb(a)&&(a=Lc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},rc.mergeObservable=function(){return pb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},rc.skipUntil=function(a){var b=this;return new Sc(function(c){var d=!1,e=new Rb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));bb(a)&&(a=Lc(a));var f=new Wb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},rc["switch"]=rc.switchLatest=function(){var a=this;return new Sc(function(b){var c=!1,d=new Xb,e=!1,f=0,g=a.subscribe(function(a){var g=new Wb,h=++f;c=!0,d.setDisposable(g),bb(a)&&(a=Lc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Rb(g,d)})},rc.takeUntil=function(a){var b=this;return new Sc(function(c){return bb(a)&&(a=Lc(a)),new Rb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),W))})},rc.zip=function(){if(Array.isArray(arguments[0]))return C.apply(this,arguments);var a=this,b=Mb.call(arguments),c=b.pop();return b.unshift(a),new Sc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(Y)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=p(g,function(){return[]}),i=p(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new Wb;bb(c)&&(c=Lc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new Rb(j)})},uc.zip=function(){var a=Mb.call(arguments,0),b=a.shift();
return b.zip.apply(b,a)},uc.zipArray=function(){var a=o(arguments,0);return new Sc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(Y))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Y)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Wb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Rb(h);return j.add(Ub(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},rc.asObservable=function(){return new Sc(this.subscribe.bind(this))},rc.dematerialize=function(){var a=this;return new Sc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},rc.distinctUntilChanged=function(a,b){var c=this;return a||(a=Y),b||(b=$),new Sc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},rc["do"]=rc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Sc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},rc.doAction=function(){return pb("doAction","do or tap"),this.tap.apply(this,arguments)},rc.doOnNext=rc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},rc.doOnError=rc.tapOnError=function(a,b){return this.tap(W,2===arguments.length?function(c){a.call(b,c)}:a)},rc.doOnCompleted=rc.tapOnCompleted=function(a,b){return this.tap(W,null,2===arguments.length?function(){a.call(b)}:a)},rc["finally"]=rc.ensure=function(a){var b=this;return new Sc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Ub(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},rc.finallyAction=function(a){return pb("finallyAction","finally or ensure"),this.ensure(a)},rc.ignoreElements=function(){var a=this;return new Sc(function(b){return a.subscribe(W,b.onError.bind(b),b.onCompleted.bind(b))})},rc.materialize=function(){var a=this;return new Sc(function(b){return a.subscribe(function(a){b.onNext(ic(a))},function(a){b.onNext(jc(a)),b.onCompleted()},function(){b.onNext(kc()),b.onCompleted()})})},rc.repeat=function(a){return nc(this,a).concat()},rc.retry=function(a){return nc(this,a).catchError()},rc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Sc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},rc.skipLast=function(a){var b=this;return new Sc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},rc.startWith=function(){var a,b,c=0;return arguments.length&&X(arguments[0])?(b=arguments[0],c=1):b=ac,a=Mb.call(arguments,c),oc([Ac(a,b),this]).concat()},rc.takeLast=function(a){var b=this;return new Sc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},rc.selectConcat=rc.concatMap=function(a,b,c){return cb(a)&&cb(b)?this.concatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Lc(e)),(nb(e)||mb(e))&&(e=zc(e)),e.map(function(a,e){return b(c,a,d,e)})}):cb(a)?D(this,a,c):D(this,function(){return a})},rc.select=rc.map=function(a,b){var c=cb(a)?a:function(){return a},d=this;return new Sc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},rc.pluck=function(a){return this.map(function(b){return b[a]})},rc.selectMany=rc.flatMap=function(a,b,c){return cb(a)&&cb(b)?this.flatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Lc(e)),(nb(e)||mb(e))&&(e=zc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):cb(a)?E(this,a,c):E(this,function(){return a})},rc.selectSwitch=rc.flatMapLatest=rc.switchMap=function(a,b){return this.select(a,b).switchLatest()},rc.skip=function(a){if(0>a)throw new Error(db);var b=this;return new Sc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},rc.skipWhile=function(a,b){var c=this;return new Sc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},rc.take=function(a,b){if(0>a)throw new RangeError(db);if(0===a)return xc(b);var c=this;return new Sc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},rc.takeWhile=function(a,b){var c=this;return new Sc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},rc.where=rc.filter=function(a,b){var c=this;return new Sc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},uc.fromCallback=function(a,b,c){return function(){var d=Mb.call(arguments,0);return new Sc(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return void e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},uc.fromNodeCallback=function(a,b,c){return function(){var d=Mb.call(arguments,0);return new Sc(function(e){function f(a){if(a)return void e.onError(a);var b=Mb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},V.config.useNativeEvents=!1;var Hc=Q.angular&&angular.element?angular.element:Q.jQuery?Q.jQuery:Q.Zepto?Q.Zepto:null,Ic=!!Q.Ember&&"function"==typeof Q.Ember.addListener,Jc=!!Q.Backbone&&!!Q.Backbone.Marionette;uc.fromEvent=function(a,b,c){if(a.addListener)return Kc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!V.config.useNativeEvents){if(Jc)return Kc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Ic)return Kc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(Hc){var d=Hc(a);return Kc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Sc(function(d){return G(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Kc=uc.fromEventPattern=function(a,b,c){return new Sc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Ub(function(){b&&b(e,f)})}).publish().refCount()},Lc=uc.fromPromise=function(a){return wc(function(){var b=new V.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};rc.toPromise=function(a){if(a||(a=V.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},uc.startAsync=function(a){var b;try{b=a()}catch(c){return Cc(c)}return Lc(b)},rc.multicast=function(a,b){var c=this;return"function"==typeof a?new Sc(function(d){var e=c.multicast(a());return new Rb(b(e).subscribe(d),e.connect())}):new Mc(c,a)},rc.publish=function(a){return a&&cb(a)?this.multicast(function(){return new Vc},a):this.multicast(new Vc)},rc.share=function(){return this.publish().refCount()},rc.publishLast=function(a){return a&&cb(a)?this.multicast(function(){return new Wc},a):this.multicast(new Wc)},rc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Yc(b)},a):this.multicast(new Yc(a))},rc.shareValue=function(a){return this.publishValue(a).refCount()},rc.replay=function(a,b,c,d){return a&&cb(a)?this.multicast(function(){return new Zc(b,c,d)},a):this.multicast(new Zc(b,c,d))},rc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Mc=V.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Rb(f.subscribe(c),Ub(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Nb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Sc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(uc),Nc=uc.interval=function(a,b){return K(a,a,X(b)?b:gc)};uc.timer=function(b,c,d){var e;return X(d)||(d=gc),c!==a&&"number"==typeof c?e=c:X(c)&&(d=c),b instanceof Date&&e===a?H(b.getTime(),d):b instanceof Date&&e!==a?(e=c,I(b.getTime(),e,d)):e===a?J(b,d):K(b,e,d)}}rc.delay=function(a,b){return X(b)||(b=gc),a instanceof Date?M(this,a.getTime(),b):L(this,a,b)},rc.debounce=rc.throttleWithTimeout=function(a,b){X(b)||(b=gc);var c=this;return new Sc(function(d){var e,f=new Xb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Wb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Rb(i,f)})},rc.throttle=function(a,b){return pb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},rc.timestamp=function(a){return X(a)||(a=gc),this.map(function(b){return{value:b,timestamp:a.now()}})},rc.sample=rc.throttleLatest=function(a,b){return X(b)||(b=gc),"number"==typeof a?N(this,Nc(a,b)):N(this,a)},rc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Cc(new Error(b||"Timeout"))),X(c)||(c=gc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Sc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(bb(b)&&(b=Lc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Wb,j=new Xb,k=!1,l=new Xb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Rb(j,l)})},rc.throttleFirst=function(a,b){X(b)||(b=gc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Sc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Oc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Vb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Vb)});return new Rb(c,d,e)}function c(c,d){this.source=c,this.controller=new Vc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Nb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(uc);rc.pausable=function(a){return new Oc(this,a)};var Pc=function(b){function c(b){var c,d=[],e=O(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Vc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Nb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(uc);rc.pausableBuffered=function(a){return new Pc(this,a)},rc.controlled=function(a){return null==a&&(a=!0),new Qc(this,a)};var Qc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Rc(d),this.source=c.multicast(this.subject).refCount()}return Nb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(uc),Rc=V.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Vc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Vb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Vb}return Nb(d,a),Ob(d.prototype,pc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Vb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Vb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Vb:(this.requestedCount=a,this.requestedDisposable=Ub(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Vb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(uc);rc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Sc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Sc=V.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Ub(a):Vb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Tc(a);return bc.scheduleRequired()?bc.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Nb(c,a),c}(uc),Tc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Wb}Nb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(sc),Uc=function(a,b){this.subject=a,this.observer=b};Uc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Vc=V.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Vb):(a.onCompleted(),Vb):(this.observers.push(a),new Uc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Nb(d,a),Ob(d.prototype,pc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Xc(a,b)},d}(uc),Wc=V.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Uc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Vb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Nb(d,a),Ob(d.prototype,pc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(uc),Xc=V.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Nb(b,a),Ob(b.prototype,pc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(uc),Yc=V.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Uc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Vb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Nb(d,a),Ob(d.prototype,pc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(uc),Zc=V.ReplaySubject=function(a){function c(a,b){return Ub(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new vc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||bc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Nb(e,a),Ob(e.prototype,pc,{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(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(uc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Q.Rx=V,define(function(){return V})):R&&S?T?(S.exports=V).Rx=V:R.Rx=V:Q.Rx=V;var $c=g()}).call(this);
//# sourceMappingURL=rx.lite.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(T)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&tb(a)&&(a=vb.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===lb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==mb){var g=a.constructor,h=-1,i=qb.length;if(a===(g&&g.prototype))var j=a===nb?hb:a===lb?cb:ib.call(a),k=rb[j];for(;++h<i;)f=qb[h],k&&k[f]||!jb.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=ib.call(a),k=ib.call(b);if(j==$&&(j=fb),k==$&&(k=fb),j!=k)return!1;switch(j){case ab:case bb:return+a==+b;case eb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case gb:case hb:return a==String(b)}var l=j==_;if(!l){if(j!=fb||!sb.nodeClass&&(g(a)||g(b)))return!1;var m=!sb.argsObject&&tb(a)?Object:a.constructor,n=!sb.argsObject&&tb(b)?Object:b.constructor;if(!(m==n||jb.call(a,"constructor")&&jb.call(b,"constructor")||R(m)&&m instanceof m&&R(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=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return jb.call(f,e)?(p++,q=jb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return jb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:vb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&D.isFinite(a)}function r(b){var c,d=b[U];if(!d&&"string"==typeof b)return c=new m(b),c[U]();if(!d&&b.length!==a)return c=new o(b),c[U]();if(!d)throw new TypeError("Object is not iterable");return b[U]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>mc?mc:b):b}function v(a,b){return K(a)||(a=Ob),new xc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new xc(function(c){var d=new Gb,e=new Hb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Q(f)&&(f=jc(f)),d=new Gb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new xc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=jc(f)),(X(f)||W(f))&&(f=nc(f)),f}).concatAll()}function z(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function A(a){this.comparer=a,this.set=[]}function B(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=jc(f)),(X(f)||W(f))&&(f=nc(f)),f}).mergeAll()}var C={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},D=C[typeof window]&&window||this,E=C[typeof exports]&&exports&&!exports.nodeType&&exports,F=C[typeof module]&&module&&!module.nodeType&&module,G=F&&F.exports===E&&E,H=C[typeof global]&&global;!H||H.global!==H&&H.window!==H||(D=H);var I={internals:{},config:{Promise:D.Promise},helpers:{}},J=I.helpers.noop=function(){},K=(I.helpers.notDefined=function(a){return"undefined"==typeof a},I.helpers.isScheduler=function(a){return a instanceof I.Scheduler}),L=I.helpers.identity=function(a){return a},M=(I.helpers.pluck=function(a){return function(b){return b[a]}},I.helpers.just=function(a){return function(){return a}},I.helpers.defaultNow=Date.now),N=I.helpers.defaultComparer=function(a,b){return ub(a,b)},O=I.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},P=(I.helpers.defaultKeySerializer=function(a){return a.toString()},I.helpers.defaultError=function(a){throw a}),Q=I.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},R=(I.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},I.helpers.not=function(a){return!a},I.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ib.call(a)}),a}()),S="Argument out of range",T="Object has been disposed",U="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";D.Set&&"function"==typeof(new D.Set)["@@iterator"]&&(U="@@iterator");var V=I.doneEnumerator={done:!0,value:a},W=I.helpers.isIterable=function(b){return b[U]!==a},X=I.helpers.isArrayLike=function(b){return b&&b.length!==a};I.helpers.iterator=U;var Y,Z=I.helpers.deprecate=function(){},$="[object Arguments]",_="[object Array]",ab="[object Boolean]",bb="[object Date]",cb="[object Error]",db="[object Function]",eb="[object Number]",fb="[object Object]",gb="[object RegExp]",hb="[object String]",ib=Object.prototype.toString,jb=Object.prototype.hasOwnProperty,kb=ib.call(arguments)==$,lb=Error.prototype,mb=Object.prototype,nb=String.prototype,ob=mb.propertyIsEnumerable;try{Y=!(ib.call(document)==fb&&!({toString:0}+""))}catch(pb){Y=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[_]=rb[bb]=rb[eb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[ab]=rb[hb]={constructor:!0,toString:!0,valueOf:!0},rb[cb]=rb[db]=rb[gb]={constructor:!0,toString:!0},rb[fb]={constructor:!0};var sb={};!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);sb.enumErrorProps=ob.call(lb,"message")||ob.call(lb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1);var tb=function(a){return a&&"object"==typeof a?ib.call(a)==$:!1};kb||(tb=function(a){return a&&"object"==typeof a?jb.call(a,"callee"):!1});var ub=I.internals.isEqual=function(a,b){return h(a,b,[],[])},vb=Array.prototype.slice,wb=({}.hasOwnProperty,this.inherits=I.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),xb=I.internals.addProperties=function(a){for(var b=vb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},yb=I.internals.addRef=function(a,b){return new xc(function(c){return new Bb(b.getDisposable(),a.subscribe(c))})};k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var zb=I.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ab=zb.prototype;Ab.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ab.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)}}},Ab.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)}}},Ab.peek=function(){return this.items[0].value},Ab.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ab.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ab.enqueue=function(a){var b=this.length++;this.items[b]=new k(zb.count++,a),this.percolate(b)},Ab.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},zb.count=0;var Bb=I.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Cb=Bb.prototype;Cb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Cb.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},Cb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Cb.toArray=function(){return this.disposables.slice(0)};var Db=I.Disposable=function(a){this.isDisposed=!1,this.action=a||J};Db.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Eb=Db.create=function(a){return new Db(a)},Fb=Db.empty={dispose:J},Gb=I.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Hb=I.SerialDisposable=Gb,Ib=I.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Fb:new a(this)},b}();l.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Jb=I.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||O,this.disposable=new Gb};Jb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Jb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Jb.prototype.isCancelled=function(){return this.disposable.isDisposed},Jb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Kb=I.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Fb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=M,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Lb=Kb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Bb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Fb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Bb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Fb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Kb.prototype),function(){Kb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Kb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof D.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=D.setInterval(function(){d=c(d)},b);return Eb(function(){D.clearInterval(e)})}}(Kb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Tb(this,a)}}(Kb.prototype);var Mb,Nb=(I.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 Gb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Kb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Lb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Kb(M,a,b,c)}()),Ob=Kb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Kb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Kb.normalize(c),g=new Jb(this,b,d,f);if(e)e.enqueue(g);else{e=new zb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Kb(M,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Pb=J,Qb=function(){var a,b=J;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!D.setTimeout)throw new Error("No concurrency detected!");a=D.setTimeout,b=D.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Rb=Qb.setTimeout,Sb=Qb.clearTimeout;!function(){function a(){if(!D.postMessage||D.importScripts)return!1;var a=!1,b=D.onmessage;return D.onmessage=function(){a=!0},D.postMessage("","*"),D.onmessage=b,a}var b=RegExp("^"+String(ib).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=H&&G&&H.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=H&&G&&H.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Mb=c,Pb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Mb=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};D.addEventListener?D.addEventListener("message",h,!1):D.attachEvent("onmessage",h,!1),Mb=function(a){var b=g++;f[b]=a,D.postMessage(e+b,"*")}}else if(D.MessageChannel){var i=new D.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Mb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in D&&"onreadystatechange"in D.document.createElement("script")?Mb=function(a){var b=D.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},D.document.documentElement.appendChild(b)}:(Mb=function(a){return Rb(a,0)},Pb=Sb)}();var Tb=(Kb.timeout=function(){function a(a,b){var c=this,d=new Gb,e=Mb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Bb(d,Eb(function(){Pb(e)}))}function b(a,b,c){var d=this,e=Kb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Gb,g=Rb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Bb(f,Eb(function(){Sb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Kb(M,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return wb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Fb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Gb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Kb)),Ub=I.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 K(a)||(a=Nb),new xc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Vb=Ub.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Ub("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Wb=Ub.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Ub("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Xb=Ub.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Ub("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Yb=I.internals.Enumerator=function(a){this._next=a};Yb.prototype.next=function(){return this._next()},Yb.prototype[U]=function(){return this};var Zb=I.internals.Enumerable=function(a){this._iterator=a};Zb.prototype[U]=function(){return this._iterator()},Zb.prototype.concat=function(){var a=this;return new xc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f=new Hb,g=Nb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Q(h)&&(h=jc(h));var i=new Gb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Bb(f,g,Eb(function(){e=!0}))})},Zb.prototype.catchError=function(){var a=this;return new xc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f,g=new Hb,h=Nb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Q(i)&&(i=jc(i));var j=new Gb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Bb(g,h,Eb(function(){e=!0}))})};var $b=Zb.repeat=function(a,b){return null==b&&(b=-1),new Zb(function(){var c=b;return new Yb(function(){return 0===c?V:(c>0&&c--,{done:!1,value:a})})})},_b=Zb.of=function(a,b,c){return b||(b=L),new Zb(function(){var d=-1;return new Yb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:V})})},ac=I.Observer=function(){};ac.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ac.prototype.asObserver=function(){return new ec(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},ac.prototype.checked=function(){return new fc(this)};var bc=ac.create=function(a,b,c){return a||(a=J),b||(b=P),c||(c=J),new ec(a,b,c)};ac.fromNotifier=function(a,b){return new ec(function(c){return a.call(b,Vb(c))},function(c){return a.call(b,Wb(c))},function(){return a.call(b,Xb())})},ac.prototype.notifyOn=function(a){return new hc(a,this)};var cc,dc=I.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return wb(b,a),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}(ac),ec=I.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return wb(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}(dc),fc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}wb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},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}(ac),gc=I.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 Hb}return wb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(dc),hc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return wb(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}(gc),ic=I.Observable=function(){function a(a){this._subscribe=a}return cc=a.prototype,cc.subscribe=cc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:bc(a,b,c))},cc.subscribeOnNext=function(a,b){return this._subscribe(bc(2===arguments.length?function(c){a.call(b,c)}:a))},cc.subscribeOnError=function(a,b){return this._subscribe(bc(null,2===arguments.length?function(c){a.call(b,c)}:a))},cc.subscribeOnCompleted=function(a,b){return this._subscribe(bc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();cc.observeOn=function(a){var b=this;return new xc(function(c){return b.subscribe(new hc(a,c))})},cc.subscribeOn=function(a){var b=this;return new xc(function(c){var d=new Gb,e=new Hb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new l(a,b.subscribe(c)))})),e})};var jc=ic.fromPromise=function(a){return kc(function(){var b=new I.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};cc.toPromise=function(a){if(a||(a=I.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},cc.toArray=function(){var a=this;return new xc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},ic.create=ic.createWithDisposable=function(a){return new xc(a)};var kc=ic.defer=function(a){return new xc(function(b){var c;try{c=a()}catch(d){return rc(d).subscribe(b)}return Q(c)&&(c=jc(c)),c.subscribe(b)})},lc=ic.empty=function(a){return K(a)||(a=Nb),new xc(function(b){return a.schedule(function(){b.onCompleted()})})},mc=Math.pow(2,53)-1;m.prototype[U]=function(){return new n(this._s)},n.prototype[U]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return V},o.prototype[U]=function(){return new p(this._a)},p.prototype[U]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return V};var nc=ic.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!R(b))throw new Error("mapFn when provided must be a function");K(d)||(d=Ob);var e=Object(a),f=r(e);return new xc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&R(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},oc=ic.fromArray=function(a,b){return Z("fromArray","from"),K(b)||(b=Ob),new xc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};ic.generate=function(a,b,c,d,e){return K(e)||(e=Ob),new xc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var pc=ic.never=function(){return new xc(function(){return Fb})};ic.of=function(){return v(null,arguments)},ic.ofWithScheduler=function(a){return v(a,vb.call(arguments,1))},ic.range=function(a,b,c){return K(c)||(c=Ob),new xc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},ic.repeat=function(a,b,c){return K(c)||(c=Ob),qc(a,c).repeat(null==b?-1:b)};var qc=ic["return"]=ic.just=function(a,b){return K(b)||(b=Nb),new xc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};ic.returnValue=function(){return Z("returnValue","return or just"),qc.apply(null,arguments)};var rc=ic["throw"]=ic.throwException=ic.throwError=function(a,b){return K(b)||(b=Nb),new xc(function(c){return b.schedule(function(){c.onError(a)})})};ic.using=function(a,b){return new xc(function(c){var d,e,f=Fb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Bb(rc(g).subscribe(c),f)}return new Bb(e.subscribe(c),f)})},cc.amb=function(a){var b=this;return new xc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Gb,j=new Gb;return Q(a)&&(a=jc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Bb(i,j)})},ic.amb=function(){function a(a,b){return a.amb(b)}for(var b=pc(),c=i(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},cc["catch"]=cc.catchError=function(a){return"function"==typeof a?w(this,a):sc([this,a])},cc.catchException=function(a){return Z("catchException","catch or catchError"),this.catchError(a)};var sc=ic.catchError=ic["catch"]=function(){return _b(i(arguments,0)).catchError()};ic.catchException=function(){return Z("catchException","catch or catchError"),sc.apply(null,arguments)},cc.combineLatest=function(){var a=vb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),tc.apply(this,a)};var tc=ic.combineLatest=function(){var a=vb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new xc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(L))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(L)&&c.onCompleted()}function e(a){k[a]=!0,k.every(L)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Gb;Q(f)&&(f=jc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Bb(m)})};cc.concat=function(){var a=vb.call(arguments,0);return a.unshift(this),uc.apply(this,a)};var uc=ic.concat=function(){return _b(i(arguments,0)).concat()};cc.concatAll=function(){return this.merge(1)},cc.concatObservable=function(){return Z("concatObservable","concatAll"),this.merge(1)},cc.merge=function(a){if("number"!=typeof a)return vc(this,a);var b=this;return new xc(function(c){function d(a){var b=new Gb;f.add(b),Q(a)&&(a=jc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Bb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var vc=ic.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=vb.call(arguments,1)):(a=Nb,b=vb.call(arguments,0)):(a=Nb,b=vb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};cc.mergeAll=function(){var a=this;return new xc(function(b){var c=new Bb,d=!1,e=new Gb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Gb;c.add(e),Q(a)&&(a=jc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},cc.mergeObservable=function(){return Z("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},cc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return wc([this,a])};var wc=ic.onErrorResumeNext=function(){var a=i(arguments,0);return new xc(function(b){var c=0,d=new Hb,e=Nb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Q(f)&&(f=jc(f)),g=new Gb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Bb(d,e)})};cc.skipUntil=function(a){var b=this;return new xc(function(c){var d=!1,e=new Bb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Q(a)&&(a=jc(a));var f=new Gb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},cc["switch"]=cc.switchLatest=function(){var a=this;return new xc(function(b){var c=!1,d=new Hb,e=!1,f=0,g=a.subscribe(function(a){var g=new Gb,h=++f;
c=!0,d.setDisposable(g),Q(a)&&(a=jc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Bb(g,d)})},cc.takeUntil=function(a){var b=this;return new xc(function(c){return Q(a)&&(a=jc(a)),new Bb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),J))})},cc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=vb.call(arguments),c=b.pop();return b.unshift(a),new xc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(L)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Gb;Q(c)&&(c=jc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Bb(k)})},ic.zip=function(){var a=vb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},ic.zipArray=function(){var a=i(arguments,0);return new xc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(L))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(L)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Gb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Bb(h);return k.add(Eb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},cc.asObservable=function(){return new xc(this.subscribe.bind(this))},cc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},cc.dematerialize=function(){var a=this;return new xc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},cc.distinctUntilChanged=function(a,b){var c=this;return a||(a=L),b||(b=N),new xc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},cc["do"]=cc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new xc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},cc.doAction=function(){return Z("doAction","do or tap"),this.tap.apply(this,arguments)},cc.doOnNext=cc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},cc.doOnError=cc.tapOnError=function(a,b){return this.tap(J,2===arguments.length?function(c){a.call(b,c)}:a)},cc.doOnCompleted=cc.tapOnCompleted=function(a,b){return this.tap(J,null,2===arguments.length?function(){a.call(b)}:a)},cc["finally"]=cc.ensure=function(a){var b=this;return new xc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Eb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},cc.finallyAction=function(a){return Z("finallyAction","finally or ensure"),this.ensure(a)},cc.ignoreElements=function(){var a=this;return new xc(function(b){return a.subscribe(J,b.onError.bind(b),b.onCompleted.bind(b))})},cc.materialize=function(){var a=this;return new xc(function(b){return a.subscribe(function(a){b.onNext(Vb(a))},function(a){b.onNext(Wb(a)),b.onCompleted()},function(){b.onNext(Xb()),b.onCompleted()})})},cc.repeat=function(a){return $b(this,a).concat()},cc.retry=function(a){return $b(this,a).catchError()},cc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new xc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},cc.skipLast=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},cc.startWith=function(){var a,b,c=0;return arguments.length&&K(arguments[0])?(b=arguments[0],c=1):b=Nb,a=vb.call(arguments,c),_b([oc(a,b),this]).concat()},cc.takeLast=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},cc.takeLastBuffer=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},cc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(S);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(S);return new xc(function(d){function e(){var a=new Ac;i.push(a),d.onNext(yb(a,g))}var f=new Gb,g=new Ib(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})},cc.selectConcat=cc.concatMap=function(a,b,c){return R(a)&&R(b)?this.concatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=jc(e)),(X(e)||W(e))&&(e=nc(e)),e.map(function(a,e){return b(c,a,d,e)})}):R(a)?y(this,a,c):y(this,function(){return a})},cc.concatMapObserver=cc.selectConcatObserver=function(a,b,c,d){var e=this;return new xc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=jc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},cc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new xc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},A.prototype.push=function(a){var b=-1===z(this.set,a,this.comparer);return b&&this.set.push(a),b},cc.distinct=function(a,b){var c=this;return b||(b=N),new xc(function(d){var e=new A(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.select=cc.map=function(a,b){var c=R(a)?a:function(){return a},d=this;return new xc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},cc.pluck=function(a){return this.map(function(b){return b[a]})},cc.flatMapObserver=cc.selectManyObserver=function(a,b,c,d){var e=this;return new xc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=jc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},cc.selectMany=cc.flatMap=function(a,b,c){return R(a)&&R(b)?this.flatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=jc(e)),(X(e)||W(e))&&(e=nc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):R(a)?B(this,a,c):B(this,function(){return a})},cc.selectSwitch=cc.flatMapLatest=cc.switchMap=function(a,b){return this.select(a,b).switchLatest()},cc.skip=function(a){if(0>a)throw new Error(S);var b=this;return new xc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},cc.skipWhile=function(a,b){var c=this;return new xc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.take=function(a,b){if(0>a)throw new RangeError(S);if(0===a)return lc(b);var c=this;return new xc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},cc.takeWhile=function(a,b){var c=this;return new xc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},cc.where=cc.filter=function(a,b){var c=this;return new xc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new xc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var xc=I.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Eb(a):Fb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new yc(a);return Ob.scheduleRequired()?Ob.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return wb(c,a),c}(ic),yc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Gb}wb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(dc),zc=function(a,b){this.subject=a,this.observer=b};zc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Ac=I.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Fb):(a.onCompleted(),Fb):(this.observers.push(a),new zc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return wb(d,a),xb(d.prototype,ac,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Bc(a,b)},d}(ic),Bc=(I.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new zc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Fb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return wb(d,a),xb(d.prototype,ac,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(ic),I.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return wb(b,a),xb(b.prototype,ac,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(ic));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(D.Rx=I,define(function(){return I})):E&&F?G?(F.exports=I).Rx=I:E.Rx=I:D.Rx=I}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(Z)}function c(a,b){if($&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(cb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+cb+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return console.log(ab,bb,Mc),c===ab&&d>=bb&&Mc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if($)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ab=d[0],d[1]}}function h(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 i(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;Cb.nonEnumArgs&&a.length&&Db(a)&&(a=Fb.call(a));var c=Cb.enumPrototypes&&"function"==typeof a,d=Cb.enumErrorProps&&(a===wb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Cb.nonEnumShadows&&a!==xb){var f=a.constructor,g=-1,h=Ab.length;if(a===(f&&f.prototype))var j=a===yb?sb:a===wb?nb:tb.call(a),k=Bb[j];for(;++g<h;)e=Ab[g],k&&k[e]||!ub.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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 g=tb.call(a),h=tb.call(b);if(g==jb&&(g=qb),h==jb&&(h=qb),g!=h)return!1;switch(g){case lb:case mb:return+a==+b;case pb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case rb:case sb:return a==String(b)}var i=g==kb;if(!i){if(g!=qb||!Cb.nodeClass&&(m(a)||m(b)))return!1;var j=!Cb.argsObject&&Db(a)?Object:a.constructor,k=!Cb.argsObject&&Db(b)?Object:b.constructor;if(!(j==k||ub.call(a,"constructor")&&ub.call(b,"constructor")||X(j)&&j instanceof j&&X(k)&&k instanceof k||!("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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return ub.call(f,e)?(p++,q=ub.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return ub.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Fb.call(a)}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(){this._s=s}function u(){this._s=s,this._l=s.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&J.isFinite(a)}function y(b){var c,d=b[db];if(!d&&"string"==typeof b)return c=new t(b),c[db]();if(!d&&b.length!==a)return c=new v(b),c[db]();if(!d)throw new TypeError("Object is not iterable");return b[db]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>wc?wc:b):b}function B(a,b){return Q(a)||(a=Yb),new Hc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function C(a,b){return new Hc(function(c){var d=new Qb,e=new Rb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}W(f)&&(f=tc(f)),d=new Qb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function D(a,b){var c=this;return new Hc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function E(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return W(f)&&(f=tc(f)),(gb(f)||fb(f))&&(f=xc(f)),f}).concatAll()}function F(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function G(a){this.comparer=a,this.set=[]}function H(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return W(f)&&(f=tc(f)),(gb(f)||fb(f))&&(f=xc(f)),f}).mergeAll()}var I={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},J=I[typeof window]&&window||this,K=I[typeof exports]&&exports&&!exports.nodeType&&exports,L=I[typeof module]&&module&&!module.nodeType&&module,M=L&&L.exports===K&&K,N=I[typeof global]&&global;!N||N.global!==N&&N.window!==N||(J=N);var O={internals:{},config:{Promise:J.Promise},helpers:{}},P=O.helpers.noop=function(){},Q=(O.helpers.notDefined=function(a){return"undefined"==typeof a},O.helpers.isScheduler=function(a){return a instanceof O.Scheduler}),R=O.helpers.identity=function(a){return a},S=(O.helpers.pluck=function(a){return function(b){return b[a]}},O.helpers.just=function(a){return function(){return a}},O.helpers.defaultNow=Date.now),T=O.helpers.defaultComparer=function(a,b){return Eb(a,b)},U=O.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},V=(O.helpers.defaultKeySerializer=function(a){return a.toString()},O.helpers.defaultError=function(a){throw a}),W=O.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},X=(O.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},O.helpers.not=function(a){return!a},O.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==tb.call(a)}),a}()),Y="Argument out of range",Z="Object has been disposed";O.config.longStackSupport=!1;var $=!1;try{throw new Error}catch(_){$=!!_.stack}var ab,bb=g(),cb="From previous event:",db="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";J.Set&&"function"==typeof(new J.Set)["@@iterator"]&&(db="@@iterator");var eb=O.doneEnumerator={done:!0,value:a},fb=O.helpers.isIterable=function(b){return b[db]!==a},gb=O.helpers.isArrayLike=function(b){return b&&b.length!==a};O.helpers.iterator=db;var hb,ib=O.helpers.deprecate=function(){},jb="[object Arguments]",kb="[object Array]",lb="[object Boolean]",mb="[object Date]",nb="[object Error]",ob="[object Function]",pb="[object Number]",qb="[object Object]",rb="[object RegExp]",sb="[object String]",tb=Object.prototype.toString,ub=Object.prototype.hasOwnProperty,vb=tb.call(arguments)==jb,wb=Error.prototype,xb=Object.prototype,yb=String.prototype,zb=xb.propertyIsEnumerable;try{hb=!(tb.call(document)==qb&&!({toString:0}+""))}catch(_){hb=!0}var Ab=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bb={};Bb[kb]=Bb[mb]=Bb[pb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Bb[lb]=Bb[sb]={constructor:!0,toString:!0,valueOf:!0},Bb[nb]=Bb[ob]=Bb[rb]={constructor:!0,toString:!0},Bb[qb]={constructor:!0};var Cb={};!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);Cb.enumErrorProps=zb.call(wb,"message")||zb.call(wb,"name"),Cb.enumPrototypes=zb.call(a,"prototype"),Cb.nonEnumArgs=0!=c,Cb.nonEnumShadows=!/valueOf/.test(b)}(1);var Db=function(a){return a&&"object"==typeof a?tb.call(a)==jb:!1};vb||(Db=function(a){return a&&"object"==typeof a?ub.call(a,"callee"):!1});var Eb=O.internals.isEqual=function(a,b){return n(a,b,[],[])},Fb=Array.prototype.slice,Gb=({}.hasOwnProperty,this.inherits=O.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Hb=O.internals.addProperties=function(a){for(var b=Fb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},Ib=O.internals.addRef=function(a,b){return new Hc(function(c){return new Lb(b.getDisposable(),a.subscribe(c))})};q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Jb=O.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Kb=Jb.prototype;Kb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Kb.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)}}},Kb.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)}}},Kb.peek=function(){return this.items[0].value},Kb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Kb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Kb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Jb.count++,a),this.percolate(b)},Kb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Jb.count=0;var Lb=O.CompositeDisposable=function(){this.disposables=o(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Mb=Lb.prototype;Mb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Mb.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},Mb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Mb.toArray=function(){return this.disposables.slice(0)};var Nb=O.Disposable=function(a){this.isDisposed=!1,this.action=a||P};Nb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Ob=Nb.create=function(a){return new Nb(a)},Pb=Nb.empty={dispose:P},Qb=O.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Rb=O.SerialDisposable=Qb,Sb=O.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Pb:new a(this)},b}();r.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Tb=O.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||U,this.disposable=new Qb};Tb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Tb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Tb.prototype.isCancelled=function(){return this.disposable.isDisposed},Tb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Ub=O.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Pb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=S,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Vb=Ub.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Lb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Pb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Lb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Pb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Ub.prototype),function(){Ub.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Ub.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof J.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=J.setInterval(function(){d=c(d)},b);return Ob(function(){J.clearInterval(e)})}}(Ub.prototype),function(a){a.catchError=a["catch"]=function(a){return new bc(this,a)}}(Ub.prototype);var Wb,Xb=(O.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 Qb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Ub.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Vb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ub(S,a,b,c)}()),Yb=Ub.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Ub.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Ub.normalize(c),g=new Tb(this,b,d,f);if(e)e.enqueue(g);else{e=new Jb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Ub(S,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Zb=P,$b=function(){var a,b=P;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!J.setTimeout)throw new Error("No concurrency detected!");a=J.setTimeout,b=J.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),_b=$b.setTimeout,ac=$b.clearTimeout;!function(){function a(){if(!J.postMessage||J.importScripts)return!1;var a=!1,b=J.onmessage;return J.onmessage=function(){a=!0},J.postMessage("","*"),J.onmessage=b,a}var b=RegExp("^"+String(tb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=N&&M&&N.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=N&&M&&N.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Wb=c,Zb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Wb=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};J.addEventListener?J.addEventListener("message",h,!1):J.attachEvent("onmessage",h,!1),Wb=function(a){var b=g++;f[b]=a,J.postMessage(e+b,"*")}}else if(J.MessageChannel){var i=new J.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Wb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in J&&"onreadystatechange"in J.document.createElement("script")?Wb=function(a){var b=J.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},J.document.documentElement.appendChild(b)}:(Wb=function(a){return _b(a,0)},Zb=ac)}();var bc=(Ub.timeout=function(){function a(a,b){var c=this,d=new Qb,e=Wb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Lb(d,Ob(function(){Zb(e)}))}function b(a,b,c){var d=this,e=Ub.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Qb,g=_b(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Lb(f,Ob(function(){ac(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ub(S,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Gb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Pb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Qb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Ub)),cc=O.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return 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 Q(a)||(a=Xb),new Hc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),dc=cc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new cc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),ec=cc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new cc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),fc=cc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new cc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),gc=O.internals.Enumerator=function(a){this._next=a};gc.prototype.next=function(){return this._next()},gc.prototype[db]=function(){return this};var hc=O.internals.Enumerable=function(a){this._iterator=a};hc.prototype[db]=function(){return this._iterator()},hc.prototype.concat=function(){var a=this;return new Hc(function(b){var c;try{c=a[db]()}catch(d){return void b.onError(d)}var e,f=new Rb,g=Xb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;W(h)&&(h=tc(h));var i=new Qb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Lb(f,g,Ob(function(){e=!0}))})},hc.prototype.catchError=function(){var a=this;return new Hc(function(b){var c;try{c=a[db]()}catch(d){return void b.onError(d)}var e,f,g=new Rb,h=Xb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;W(i)&&(i=tc(i));var j=new Qb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Lb(g,h,Ob(function(){e=!0}))})};var ic=hc.repeat=function(a,b){return null==b&&(b=-1),new hc(function(){var c=b;return new gc(function(){return 0===c?eb:(c>0&&c--,{done:!1,value:a})})})},jc=hc.of=function(a,b,c){return b||(b=R),new hc(function(){var d=-1;return new gc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:eb})})},kc=O.Observer=function(){};kc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},kc.prototype.asObserver=function(){return new oc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},kc.prototype.checked=function(){return new pc(this)};var lc=kc.create=function(a,b,c){return a||(a=P),b||(b=V),c||(c=P),new oc(a,b,c)};kc.fromNotifier=function(a,b){return new oc(function(c){return a.call(b,dc(c))},function(c){return a.call(b,ec(c))},function(){return a.call(b,fc())})},kc.prototype.notifyOn=function(a){return new rc(a,this)};var mc,nc=O.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Gb(b,a),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}(kc),oc=O.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Gb(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}(nc),pc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Gb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},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}(kc),qc=O.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 Rb}return Gb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(nc),rc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Gb(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}(qc),sc=O.Observable=function(){function a(a){if(O.config.longStackSupport&&$){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){b.onError=function(a){c(d,a),b.onError(a)},a(b)}}this._subscribe=a}return mc=a.prototype,mc.subscribe=mc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:lc(a,b,c))},mc.subscribeOnNext=function(a,b){return this._subscribe(lc(2===arguments.length?function(c){a.call(b,c)}:a))},mc.subscribeOnError=function(a,b){return this._subscribe(lc(null,2===arguments.length?function(c){a.call(b,c)}:a))},mc.subscribeOnCompleted=function(a,b){return this._subscribe(lc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();mc.observeOn=function(a){var b=this;return new Hc(function(c){return b.subscribe(new rc(a,c))})},mc.subscribeOn=function(a){var b=this;return new Hc(function(c){var d=new Qb,e=new Rb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e})};var tc=sc.fromPromise=function(a){return uc(function(){var b=new O.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};mc.toPromise=function(a){if(a||(a=O.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},mc.toArray=function(){var a=this;return new Hc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},sc.create=sc.createWithDisposable=function(a,b){return new Hc(a,b)};var uc=sc.defer=function(a){return new Hc(function(b){var c;try{c=a()}catch(d){return Bc(d).subscribe(b)}return W(c)&&(c=tc(c)),c.subscribe(b)})},vc=sc.empty=function(a){return Q(a)||(a=Xb),new Hc(function(b){return a.schedule(function(){b.onCompleted()})})},wc=Math.pow(2,53)-1;t.prototype[db]=function(){return new u(this._s)},u.prototype[db]=function(){return this},u.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return eb},v.prototype[db]=function(){return new w(this._a)},w.prototype[db]=function(){return this},w.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return eb};var xc=sc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!X(b))throw new Error("mapFn when provided must be a function");Q(d)||(d=Yb);var e=Object(a),f=y(e);return new Hc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&X(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},yc=sc.fromArray=function(a,b){return ib("fromArray","from"),Q(b)||(b=Yb),new Hc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};sc.generate=function(a,b,c,d,e){return Q(e)||(e=Yb),new Hc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var zc=sc.never=function(){return new Hc(function(){return Pb})};sc.of=function(){return B(null,arguments)},sc.ofWithScheduler=function(a){return B(a,Fb.call(arguments,1))},sc.range=function(a,b,c){return Q(c)||(c=Yb),new Hc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},sc.repeat=function(a,b,c){return Q(c)||(c=Yb),Ac(a,c).repeat(null==b?-1:b)};var Ac=sc["return"]=sc.just=function(a,b){return Q(b)||(b=Xb),new Hc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};sc.returnValue=function(){return ib("returnValue","return or just"),Ac.apply(null,arguments)};var Bc=sc["throw"]=sc.throwException=sc.throwError=function(a,b){return Q(b)||(b=Xb),new Hc(function(c){return b.schedule(function(){c.onError(a)})})};sc.using=function(a,b){return new Hc(function(c){var d,e,f=Pb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Lb(Bc(g).subscribe(c),f)}return new Lb(e.subscribe(c),f)})},mc.amb=function(a){var b=this;return new Hc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Qb,j=new Qb;return W(a)&&(a=tc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Lb(i,j)})},sc.amb=function(){function a(a,b){return a.amb(b)}for(var b=zc(),c=o(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},mc["catch"]=mc.catchError=function(a){return"function"==typeof a?C(this,a):Cc([this,a])},mc.catchException=function(a){return ib("catchException","catch or catchError"),this.catchError(a)};var Cc=sc.catchError=sc["catch"]=function(){return jc(o(arguments,0)).catchError()};sc.catchException=function(){return ib("catchException","catch or catchError"),Cc.apply(null,arguments)},mc.combineLatest=function(){var a=Fb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Dc.apply(this,a)};var Dc=sc.combineLatest=function(){var a=Fb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Hc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(R))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(R)&&c.onCompleted()}function e(a){j[a]=!0,j.every(R)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new Qb;W(f)&&(f=tc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),l[b]=g}(m);return new Lb(l)})};mc.concat=function(){var a=Fb.call(arguments,0);return a.unshift(this),Ec.apply(this,a)};var Ec=sc.concat=function(){return jc(o(arguments,0)).concat()};mc.concatAll=function(){return this.merge(1)},mc.concatObservable=function(){return ib("concatObservable","concatAll"),this.merge(1)},mc.merge=function(a){if("number"!=typeof a)return Fc(this,a);var b=this;return new Hc(function(c){function d(a){var b=new Qb;f.add(b),W(a)&&(a=tc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Lb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var Fc=sc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Fb.call(arguments,1)):(a=Xb,b=Fb.call(arguments,0)):(a=Xb,b=Fb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),B(a,b).mergeAll()};mc.mergeAll=function(){var a=this;return new Hc(function(b){var c=new Lb,d=!1,e=new Qb;
return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Qb;c.add(e),W(a)&&(a=tc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},mc.mergeObservable=function(){return ib("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},mc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Gc([this,a])};var Gc=sc.onErrorResumeNext=function(){var a=o(arguments,0);return new Hc(function(b){var c=0,d=new Rb,e=Xb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],W(f)&&(f=tc(f)),g=new Qb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Lb(d,e)})};mc.skipUntil=function(a){var b=this;return new Hc(function(c){var d=!1,e=new Lb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));W(a)&&(a=tc(a));var f=new Qb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},mc["switch"]=mc.switchLatest=function(){var a=this;return new Hc(function(b){var c=!1,d=new Rb,e=!1,f=0,g=a.subscribe(function(a){var g=new Qb,h=++f;c=!0,d.setDisposable(g),W(a)&&(a=tc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Lb(g,d)})},mc.takeUntil=function(a){var b=this;return new Hc(function(c){return W(a)&&(a=tc(a)),new Lb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),P))})},mc.zip=function(){if(Array.isArray(arguments[0]))return D.apply(this,arguments);var a=this,b=Fb.call(arguments),c=b.pop();return b.unshift(a),new Hc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(R)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=p(g,function(){return[]}),i=p(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new Qb;W(c)&&(c=tc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new Lb(j)})},sc.zip=function(){var a=Fb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},sc.zipArray=function(){var a=o(arguments,0);return new Hc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(R))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(R)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Qb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Lb(h);return j.add(Ob(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},mc.asObservable=function(){return new Hc(this.subscribe.bind(this))},mc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},mc.dematerialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},mc.distinctUntilChanged=function(a,b){var c=this;return a||(a=R),b||(b=T),new Hc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},mc["do"]=mc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Hc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},mc.doAction=function(){return ib("doAction","do or tap"),this.tap.apply(this,arguments)},mc.doOnNext=mc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},mc.doOnError=mc.tapOnError=function(a,b){return this.tap(P,2===arguments.length?function(c){a.call(b,c)}:a)},mc.doOnCompleted=mc.tapOnCompleted=function(a,b){return this.tap(P,null,2===arguments.length?function(){a.call(b)}:a)},mc["finally"]=mc.ensure=function(a){var b=this;return new Hc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Ob(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},mc.finallyAction=function(a){return ib("finallyAction","finally or ensure"),this.ensure(a)},mc.ignoreElements=function(){var a=this;return new Hc(function(b){return a.subscribe(P,b.onError.bind(b),b.onCompleted.bind(b))})},mc.materialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){b.onNext(dc(a))},function(a){b.onNext(ec(a)),b.onCompleted()},function(){b.onNext(fc()),b.onCompleted()})})},mc.repeat=function(a){return ic(this,a).concat()},mc.retry=function(a){return ic(this,a).catchError()},mc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Hc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},mc.skipLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},mc.startWith=function(){var a,b,c=0;return arguments.length&&Q(arguments[0])?(b=arguments[0],c=1):b=Xb,a=Fb.call(arguments,c),jc([yc(a,b),this]).concat()},mc.takeLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},mc.takeLastBuffer=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},mc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(Y);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(Y);return new Hc(function(d){function e(){var a=new Kc;i.push(a),d.onNext(Ib(a,g))}var f=new Qb,g=new Sb(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})},mc.selectConcat=mc.concatMap=function(a,b,c){return X(a)&&X(b)?this.concatMap(function(c,d){var e=a(c,d);return W(e)&&(e=tc(e)),(gb(e)||fb(e))&&(e=xc(e)),e.map(function(a,e){return b(c,a,d,e)})}):X(a)?E(this,a,c):E(this,function(){return a})},mc.concatMapObserver=mc.selectConcatObserver=function(a,b,c,d){var e=this;return new Hc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}W(a)&&(a=tc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},mc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Hc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},G.prototype.push=function(a){var b=-1===F(this.set,a,this.comparer);return b&&this.set.push(a),b},mc.distinct=function(a,b){var c=this;return b||(b=T),new Hc(function(d){var e=new G(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},mc.select=mc.map=function(a,b){var c=X(a)?a:function(){return a},d=this;return new Hc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},mc.pluck=function(a){return this.map(function(b){return b[a]})},mc.flatMapObserver=mc.selectManyObserver=function(a,b,c,d){var e=this;return new Hc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}W(c)&&(c=tc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}W(a)&&(a=tc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},mc.selectMany=mc.flatMap=function(a,b,c){return X(a)&&X(b)?this.flatMap(function(c,d){var e=a(c,d);return W(e)&&(e=tc(e)),(gb(e)||fb(e))&&(e=xc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):X(a)?H(this,a,c):H(this,function(){return a})},mc.selectSwitch=mc.flatMapLatest=mc.switchMap=function(a,b){return this.select(a,b).switchLatest()},mc.skip=function(a){if(0>a)throw new Error(Y);var b=this;return new Hc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},mc.skipWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},mc.take=function(a,b){if(0>a)throw new RangeError(Y);if(0===a)return vc(b);var c=this;return new Hc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},mc.takeWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},mc.where=mc.filter=function(a,b){var c=this;return new Hc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},mc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Hc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Hc=O.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Ob(a):Pb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Ic(a);return Yb.scheduleRequired()?Yb.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Gb(c,a),c}(sc),Ic=function(a){function b(b){a.call(this),this.observer=b,this.m=new Qb}Gb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(nc),Jc=function(a,b){this.subject=a,this.observer=b};Jc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Kc=O.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Pb):(a.onCompleted(),Pb):(this.observers.push(a),new Jc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Gb(d,a),Hb(d.prototype,kc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Lc(a,b)},d}(sc),Lc=(O.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Jc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Pb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Gb(d,a),Hb(d.prototype,kc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(sc),O.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Gb(b,a),Hb(b.prototype,kc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(sc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(J.Rx=O,define(function(){return O})):K&&L?M?(L.exports=O).Rx=O:K.Rx=O:J.Rx=O;var Mc=g()}).call(this);
//# sourceMappingURL=rx.map

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

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

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

@@ -13,3 +13,4 @@ var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {

function AnonymousObservable(subscribe) {
function AnonymousObservable(subscribe, parent) {
this.source = parent;
if (!(this instanceof AnonymousObservable)) {

@@ -16,0 +17,0 @@ return new AnonymousObservable(subscribe);

@@ -45,3 +45,3 @@ var AutoDetachObserver = (function (__super__) {

AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); };
AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };

@@ -48,0 +48,0 @@ AutoDetachObserverPrototype.dispose = function () {

@@ -25,5 +25,5 @@ ;(function (undefined) {

config: {
Promise: root.Promise // Detect if promise exists
Promise: root.Promise,
},
helpers: { }
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
*
* @example

@@ -8,8 +7,7 @@ * var res = Rx.Observable.create(function (observer) { return function () { } );

* var res = Rx.Observable.create(function (observer) { } );
*
* @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 = Observable.createWithDisposable = function (subscribe) {
return new AnonymousObservable(subscribe);
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
return new AnonymousObservable(subscribe, parent);
};

@@ -14,8 +14,8 @@ /**

return new AnonymousObservable(function (observer) {
function handler(e) {
var results = e;
function handler() {
var results = arguments;
if (selector) {
try {
results = selector(arguments);
results = selector(results);
} catch (err) {

@@ -22,0 +22,0 @@ observer.onError(err);

var STACK_JUMP_SEPARATOR = "From previous event:";
function makeStackTraceLong(error, observer) {
function makeStackTraceLong(error, observable) {
// If possible, transform the error stack trace by removing Node and RxJS
// cruft, then concatenating with the stack trace of `observable`.
if (hasStacks &&
observer.stack &&
observable.stack &&
typeof error === "object" &&

@@ -14,3 +14,3 @@ error !== null &&

var stacks = [];
for (var o = observer; !!o; o = o.source) {
for (var o = observable; !!o; o = o.source) {
if (o.stack) {

@@ -40,2 +40,16 @@ stacks.unshift(o.stack);

function isInternalFrame(stackLine) {
var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
if (!fileNameAndLineNumber) {
return false;
}
var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
console.log(rFileName, rStartingLine, rEndingLine);
return fileName === rFileName &&
lineNumber >= rStartingLine &&
lineNumber <= rEndingLine;
}
function isNodeFrame(stackLine) {

@@ -42,0 +56,0 @@ return stackLine.indexOf("(module.js:") !== -1 ||

@@ -9,2 +9,20 @@ var observableProto;

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 self = this;
this._subscribe = function (observer) {
observer.onError = function (err) {
makeStackTraceLong(self, err);
observer.onError(err);
};
subscribe(observer);
};
}
this._subscribe = subscribe;

@@ -11,0 +29,0 @@ }

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is 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 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc