/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/ (function(a){function b(a){return a&&a.Object===Object?a:null}function c(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function d(a){return function(){try{return a.apply(this,arguments)}catch(b){return Ya.e=b,Ya}}}function e(a){throw a}function f(a,b){if($a&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(cb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+cb+"\n");a.stack=g(e)}}function g(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join("\n")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===ab&&d>=bb&&Mg>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if($a)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=k(c);if(!d)return;return ab=d[0],d[1]}}function k(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 l(b,c,d,e,f,g){var h=Yb(b),i=h.length,j=Yb(c),k=j.length;if(i!==k&&!e)return!1;for(var l,m=i;m--;)if(l=h[m],!(e?l in c:Vb.call(c,l)))return!1;for(var n=e;++m<i;){l=h[m];var o,p=b[l],q=c[l];if(!(o===a?d(p,q,e,f,g):o))return!1;n||(n="constructor"===l)}if(!n){var r=b.constructor,s=c.constructor;if(r!==s&&"constructor"in b&&"constructor"in c&&!("function"==typeof r&&r instanceof r&&"function"==typeof s&&s instanceof s))return!1}return!0}function m(a,b,c){switch(c){case yb:case zb:return+a===+b;case Ab:return a.name===b.name&&a.message===b.message;case Db:return a!==+a?b!==+b:a===+b;case Fb:case Hb:return a===b+""}return!1}function n(a){return!!a&&"object"==typeof a}function o(a){return"number"==typeof a&&a>-1&&a%1===0&&Xb>=a}function p(a){return n(a)&&o(a.length)&&!!Tb[Wb.call(a)]}function q(a,b){for(var c=-1,d=a.length;++c<d;)if(b(a[c],c,a))return!0;return!1}function r(b,c,d,e,f,g){var h=-1,i=b.length,j=c.length;if(i!==j&&!(e&&j>i))return!1;for(;++h<i;){var k,l=b[h],m=c[h];if(k!==a){if(k)continue;return!1}if(e){if(!q(c,function(a){return l===a||d(l,a,e,f,g)}))return!1}else if(l!==m&&!d(l,m,e,f,g))return!1}return!0}function s(a,b,c,d,e,f){var g=$b(a),h=$b(b),i=xb,j=xb;g||(i=Wb.call(a),i===wb?i=Eb:i!==Eb&&(g=p(a))),h||(j=Wb.call(b),j===wb&&(j=Eb));var k=i===Eb&&!Zb(a),n=j===Eb&&!Zb(b),o=i===j;if(o&&!g&&!k)return m(a,b,i);if(!d){var q=k&&Vb.call(a,"__wrapped__"),s=n&&Vb.call(b,"__wrapped__");if(q||s)return c(q?a.value():a,s?b.value():b,d,e,f)}if(!o)return!1;e||(e=[]),f||(f=[]);for(var t=e.length;t--;)if(e[t]===a)return f[t]===b;e.push(a),f.push(b);var u=(g?r:l)(a,b,c,d,e,f);return e.pop(),f.pop(),u}function t(a,b,c,d,e){return a===b?!0:null==a||null==b||!aa(a)&&!n(b)?a!==a&&b!==b:s(a,b,t,c,d,e)}function u(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function v(a,b){this.id=a,this.value=b}function w(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function x(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function y(a){this._s=a,this.isDisposed=!1}function z(a){this._s=a}function A(a){this._s=a,this._l=a.length,this._i=0}function B(a){this._a=a}function C(a){this._a=a,this._l=G(a),this._i=0}function D(a){return"number"==typeof a&&Oa.isFinite(a)}function E(b){var c,d=b[pb];if(!d&&"string"==typeof b)return c=new z(b),c[pb]();if(!d&&b.length!==a)return c=new B(b),c[pb]();if(!d)throw new TypeError("Object is not iterable");return b[pb]()}function F(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function G(a){var b=+a.length;return isNaN(b)?0:0!==b&&D(b)?(b=F(b)*Math.floor(Math.abs(b)),0>=b?0:b>rd?rd:b):b}function H(a,b){return vc(a)||(a=Cc),new td(b,a)}function I(a,b){this.observer=a,this.parent=b}function J(a,b){return a.amb(b)}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function M(){return[]}function K(){return!1}function M(){return[]}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function N(a){return function(b){return a.subscribe(b)}}function O(a){return a.toArray()}function P(a){return a.length>0}function Q(a){return{"@@iterator":function(){return{next:function(){return{done:!1,value:a}}}}}}function Q(a){return{"@@iterator":function(){return{next:function(){return{done:!1,value:a}}}}}}function R(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function S(a){this.comparer=a,this.set=[]}function T(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function U(a){if(0===a.length)throw new jb;return a[0]}function V(a,b,c,d){var e=tb(b,c,3);return new Dg(function(b){return a.subscribe(new nf(b,a,e,d))},a)}function W(a){return a?Yc.isObservable(a)?a:Wa(a)?Yc.fromPromise(a):_(a)||$(a)?wf.call(this,a):Xa(a)?Z.call(this,a):sb(a)||rb(a)?X.call(this,a):aa(a)?Y.call(this,a):a:a}function X(a){return Yc.from(a).concatMap(function(a){return Yc.isObservable(a)||aa(a)?W.call(null,a):Pa.Observable.just(a)}).toArray()}function Y(b){function c(b,c){d[c]=a,f.push(b.map(function(a){d[c]=a}))}for(var d=new b.constructor,e=Object.keys(b),f=[],g=0,h=e.length;h>g;g++){var i=e[g],j=W.call(this,b[i]);j&&Yc.isObservable(j)?c(j,i):d[i]=b[i]}return Yc.forkJoin.apply(Yc,f).map(function(){return d})}function Z(a){var b=this;return new Dg(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function $(a){return Xa(a.next)&&Xa(a["throw"])}function _(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:$(b.prototype):!1}function aa(a){return Object==a.constructor}function ba(a,b,c,d){var e=new Ig;return d.push(ca(e,b,c)),a.apply(b,d),e.asObservable()}function ca(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(Xa(c)){if(e=Za(c).apply(b,e),e===Ya)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function da(a,b,c,d){var e=new Ig;return d.push(ea(e,b,c)),a.apply(b,d),e.asObservable()}function ea(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(Xa(c)){var f=Za(c).apply(b,f);if(f===Ya)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function fa(a){return Oa.StaticNodeList?a instanceof Oa.StaticNodeList||a instanceof Oa.NodeList:"[object NodeList]"===Object.prototype.toString.call(a)}function ga(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function ha(a,b,c){var d=new fc,e=Object.prototype.toString.call(a);if(fa(a)||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(ha(a.item(f),b,c));else a&&d.add(new ga(a,b,c));return d}function ia(a,b,c){return new Dg(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(Ra))){if(f)return d.onError(f);var e=Za(c).apply(null,j);if(e===Ya)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new pc(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function O(a){return a.toArray()}function ja(a,b){return a.groupJoin(this,b,pd,function(a,b){return b})}function ka(a){var b=this;return new Dg(function(c){var d=new Hg,e=new fc,f=new rc(e);return c.onNext(cc(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Wa(a)&&(a=jd(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Hg,c.onNext(cc(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function la(a){var b=this;return new Dg(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Wa(b)&&(b=jd(b));var i=new nc;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Qa,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Hg,c.onNext(cc(h,g)),d()}))}var e=new oc,f=new fc(e),g=new rc(f),h=new Hg;return c.onNext(cc(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function ma(a,b){return new Nf(a,b)}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function na(a){this.patterns=a}function oa(a,b){this.expression=a,this.selector=b}function pa(a){return function(b){a.onError(b)}}function qa(a,b){return function(){var c=Za(a.selector).apply(a,arguments);return c===Ya?b.onError(c.e):void b.onNext(c)}}function ra(a,b,c){var d=a.get(b);if(!d){var e=new Vf(b,c);return a.set(b,e),e}return d}function sa(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new Uf;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function ta(a,b){return new Wf(a,b)}function ua(a,b,c){return new Dg(function(d){var e=a,f=uc(b);return c.scheduleRecursiveFuture(0,e,function(a,b){if(f>0){var g=c.now();e=new Date(e.getTime()+f),e.getTime()<=g&&(e=new Date(g+f))}d.onNext(a),b(a+1,new Date(e))})})}function va(a,b,c){return a===b?new Dg(function(a){return c.schedulePeriodic(0,b,function(b){return a.onNext(b),b+1})}):md(function(){return ua(new Date(c.now()+a),b,c)})}function wa(a,b,c){return new Dg(function(d){var e,f=!1,g=new oc,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.error,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new nc,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveFuture(null,b,function(a,b){var e,g,k,l;if(null===h){j=!0;do k=null,i.length>0&&i[0].timestamp-c.now()<=0&&(k=i.shift().value),null!==k&&k.accept(d);while(null!==k);l=!1,g=0,i.length>0?(l=!0,g=Math.max(0,i[0].timestamp-c.now())):f=!1,e=h,j=!1,null!==e?d.onError(e):l&&b(null,g)}}))))}),new pc(e,g)},a)}function xa(a,b,c){return md(function(){return wa(a,b-c.now(),c)})}function ya(a,b,c){var d,e;return Xa(b)?e=b:(d=b,e=c),new Dg(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=Za(e)(a);if(c===Ya)return b.onError(c.e);var d=new nc;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new fc,h=!1,i=new oc;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new pc(i,g)},a)}function za(a,b){return new Dg(function(c){var d,e=!1,f=new oc,g=0,h=a.subscribe(function(a){var h=Za(b)(a);if(h===Ya)return c.onError(h.e);Wa(h)&&(h=jd(h)),e=!0,d=a,g++;var i=g,j=new nc;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new pc(h,f)},a)}function O(a){return a.toArray()}function O(a){return a.toArray()}function Aa(a,b,c,d){return Xa(b)&&(d=c,c=b,b=yd()),Yc.isObservable(d)||(d=Ed(new fg)),new Dg(function(e){function f(a){function b(){return l=c===k}var c=k,f=new nc;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(d.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new oc,i=new oc,j=new nc;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=Za(c)(a);if(b===Ya)return e.onError(b.e);f(Wa(b)?jd(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new pc(h,i)},a)}function Ba(a,b,c,d){return vc(c)&&(d=c,c=Ed(new fg)),c instanceof Error&&(c=Ed(c)),vc(d)||(d=Hc),Yc.isObservable(c)||(c=Ed(new fg)),new Dg(function(e){function f(){var a=g;k.setDisposable(d.scheduleFuture(null,b,function(){j=g===a,j&&(Wa(c)&&(c=jd(c)),i.setDisposable(c.subscribe(e)))}))}var g=0,h=new nc,i=new oc,j=!1,k=new oc;return i.setDisposable(h),f(),h.setDisposable(a.subscribe(function(a){j||(g++,e.onNext(a),f())},function(a){j||(g++,e.onError(a))},function(){j||(g++,e.onCompleted())})),new pc(i,k)},a)}function Ca(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}function Da(a){this.predicate=a}function Ea(a){this.predicate=a}function Fa(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return jc})}(g)}}var Ga={"function":!0,object:!0},Ha=Ga[typeof exports]&&exports&&!exports.nodeType?exports:null,Ia=Ga[typeof module]&&module&&!module.nodeType?module:null,Ja=b(Ha&&Ia&&"object"==typeof global&&global),Ka=b(Ga[typeof self]&&self),La=b(Ga[typeof window]&&window),Ma=Ia&&Ia.exports===Ha?Ha:null,Na=b(Ga[typeof this]&&this),Oa=Ja||La!==(Na&&Na.window)&&La||Ka||Na||Function("return this")(),Pa={internals:{},config:{Promise:Oa.Promise},helpers:{}},Qa=Pa.helpers.noop=function(){},Ra=Pa.helpers.identity=function(a){return a},Sa=Pa.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}(),Ta=Pa.helpers.defaultComparer=function(a,b){return _b(a,b)},Ua=Pa.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Va=(Pa.helpers.defaultKeySerializer=function(a){return a.toString()},Pa.helpers.defaultError=function(a){throw a}),Wa=Pa.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Xa=Pa.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==db.call(a)}),a}(),Ya={e:{}},Za=Pa.internals.tryCatch=function(a){if(!Xa(a))throw new TypeError("fn must be a function");return d(a)};Pa.config.longStackSupport=!1;var $a=!1,_a=Za(function(){throw new Error})();$a=!!_a.e&&!!_a.e.stack;var ab,bb=j(),cb="From previous event:",db=Object.prototype.toString,eb="[object Array]",fb="[object Function]",gb="[object String]";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 hb=Object("a"),ib="a"!==hb[0]||!(0 in hb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=ib&&db.call(this)===gb?this.split(""):b,d=c.length>>>0,e=arguments[1];if(db.call(a)!==fb)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=ib&&db.call(this)===gb?this.split(""):b,d=c.length>>>0,e=new Array(d),f=arguments[1];if(db.call(a)!==fb)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 db.call(a)===eb}),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&&d!==1/0&&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}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;vb>e;e++)a.call(c,ub[e])&&f.push(ub[e]);return f}}()),"function"!=typeof Object.create&&(Object.create=function(){function a(){}var b=Object.prototype.hasOwnProperty;return function(c){if("object"!=typeof c)throw new TypeError("Object prototype may only be an Object or null");a.prototype=c;var d=new a;if(a.prototype=null,arguments.length>1){var e=Object(arguments[1]);for(var f in e)b.call(e,f)&&(d[f]=e[f])}return d}}()),Oa.Element&&Oa.Element.prototype.attachEvent&&!Oa.Element.prototype.addEventListener&&function(){function a(a,b){Window.prototype[a]=HTMLDocument.prototype[a]=Element.prototype[a]=b}function b(){b.interval&&document.body&&(b.interval=clearInterval(b.interval),document.dispatchEvent(new CustomEvent("DOMContentLoaded")))}a("addEventListener",function(a,b){var c=this,d=c._c1_listeners=c._c1_listeners||{},e=d[a]=d[a]||[];c.attachEvent("on"+a,e.event=function(a){a||(a=Oa.event);var b=c.document&&c.document.documentElement||c.documentElement||{scrollLeft:0,scrollTop:0};switch(a.currentTarget=c,a.pageX=a.clientX+b.scrollLeft,a.pageY=a.clientY+b.scrollTop,a.preventDefault=function(){if(a.bubbledKeyCode=a.keyCode,a.ctrlKey)try{a.keyCode=0}catch(a){}a.defaultPrevented=!0,a.returnValue=!1,a.modified=!0,a.returnValue=!1},a.stopImmediatePropagation=function(){k=!1,a.cancelBubble=!0},a.stopPropagation=function(){a.cancelBubble=!0},a.relatedTarget=a.fromElement||null,a.target=a.srcElement||c,a.timeStamp=+new Date,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):""}var f={};for(var g in a)f[g]=a[g];for(var h,i=0,j=[].concat(e),k=!0;k&&(h=j[i]);++i)for(var l,m=0;l=e[m];++m)if(l===h){l.call(c,f);break}}),e.push(b)}),a("removeEventListener",function(a,b){for(var c,d=this,e=d._c1_listeners=d._c1_listeners||{},f=e[a]=e[a]||[],g=f.length-1;c=f[g];--g)if(c===b){f.splice(g,1);break}!f.length&&f.event&&d.detachEvent("on"+a,f.event)}),a("dispatchEvent",function(a){var b=this,c=a.type,d=b._c1_listeners=b._c1_listeners||{},e=d[c]=d[c]||[];try{return b.fireEvent("on"+c,a)}catch(f){return e.event&&e.event(a)}}),b.interval=setInterval(b,1),Oa.addEventListener("load",b)}(),(!Oa.CustomEvent||"object"==typeof Oa.CustomEvent)&&function(){function b(b,c){var d;c=c||{bubbles:!1,cancelable:!1,detail:a};try{document.createEvent?(d=document.createEvent("CustomEvent"),d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail)):document.createEventObject&&(d=document.createEventObject())}catch(e){d=document.createEvent("Event"),d.initEvent(b,c.bubbles,c.cancelable),d.detail=c.detail}return d}Oa.CustomEvent&&(b.prototype=Oa.CustomEvent.prototype),Oa.CustomEvent=b}();var jb=Pa.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};jb.prototype=Object.create(Error.prototype),jb.prototype.name="EmptyError";var kb=Pa.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};kb.prototype=Object.create(Error.prototype),kb.prototype.name="ObjectDisposedError";var lb=Pa.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};lb.prototype=Object.create(Error.prototype),lb.prototype.name="ArgumentOutOfRangeError";var mb=Pa.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};mb.prototype=Object.create(Error.prototype),mb.prototype.name="NotSupportedError";var nb=Pa.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};nb.prototype=Object.create(Error.prototype),nb.prototype.name="NotImplementedError";var ob=Pa.helpers.notImplemented=function(){throw new nb},pb=(Pa.helpers.notSupported=function(){throw new mb},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");Oa.Set&&"function"==typeof(new Oa.Set)["@@iterator"]&&(pb="@@iterator");var qb=Pa.doneEnumerator={done:!0,value:a},rb=Pa.helpers.isIterable=function(b){return b&&b[pb]!==a},sb=Pa.helpers.isArrayLike=function(b){return b&&b.length!==a};Pa.helpers.iterator=pb;var tb=Pa.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},ub=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],vb=ub.length,wb="[object Arguments]",xb="[object Array]",yb="[object Boolean]",zb="[object Date]",Ab="[object Error]",Bb="[object Function]",Cb="[object Map]",Db="[object Number]",Eb="[object Object]",Fb="[object RegExp]",Gb="[object Set]",Hb="[object String]",Ib="[object WeakMap]",Jb="[object ArrayBuffer]",Kb="[object Float32Array]",Lb="[object Float64Array]",Mb="[object Int8Array]",Nb="[object Int16Array]",Ob="[object Int32Array]",Pb="[object Uint8Array]",Qb="[object Uint8ClampedArray]",Rb="[object Uint16Array]",Sb="[object Uint32Array]",Tb={};Tb[Kb]=Tb[Lb]=Tb[Mb]=Tb[Nb]=Tb[Ob]=Tb[Pb]=Tb[Qb]=Tb[Rb]=Tb[Sb]=!0,Tb[wb]=Tb[xb]=Tb[Jb]=Tb[yb]=Tb[zb]=Tb[Ab]=Tb[Bb]=Tb[Cb]=Tb[Db]=Tb[Eb]=Tb[Fb]=Tb[Gb]=Tb[Hb]=Tb[Ib]=!1;var Ub=Object.prototype,Vb=Ub.hasOwnProperty,Wb=Ub.toString,Xb=Math.pow(2,53)-1,Yb=Object.keys||function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}(),aa=Pa.internals.isObject=function(a){var b=typeof a;return!!a&&("object"===b||"function"===b)},Zb=function(){try{Object({toString:0}+"")}catch(a){return function(){return!1}}return function(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}}(),$b=Array.isArray||function(a){return n(a)&&o(a.length)&&Wb.call(a)===xb},_b=Pa.internals.isEqual=function(a,b){return t(a,b)},ac=({}.hasOwnProperty,Array.prototype.slice,Pa.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),bc=Pa.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},cc=Pa.internals.addRef=function(a,b){return new Dg(function(c){return new pc(b.getDisposable(),a.subscribe(c))})};v.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var dc=Pa.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},ec=dc.prototype;ec.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},ec.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)}}},ec.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)}}},ec.peek=function(){return this.items[0].value},ec.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},ec.dequeue=function(){var a=this.peek();return this.removeAt(0),a},ec.enqueue=function(a){var b=this.length++;this.items[b]=new v(dc.count++,a),this.percolate(b)},ec.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},dc.count=0;var fc=Pa.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];this.disposables=c,this.isDisposed=!1,this.length=c.length},gc=fc.prototype;gc.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},gc.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},gc.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var hc=Pa.Disposable=function(a){this.isDisposed=!1,this.action=a||Qa};hc.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ic=hc.create=function(a){return new hc(a)},jc=hc.empty={dispose:Qa},kc=hc.isDisposable=function(a){return a&&Xa(a.dispose)},lc=hc.checkDisposed=function(a){if(a.isDisposed)throw new kb},mc=hc._fixup=function(a){return kc(a)?a:jc},nc=Pa.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};nc.prototype.getDisposable=function(){return this.current},nc.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},nc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var oc=Pa.SerialDisposable=function(){this.isDisposed=!1,this.current=null};oc.prototype.getDisposable=function(){return this.current},oc.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},oc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var pc=Pa.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};pc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var qc=Pa.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};qc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var rc=Pa.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?jc:new a(this)},b}();w.prototype.dispose=function(){this.scheduler.schedule(this,x)};var sc=Pa.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Ua,this.disposable=new nc};sc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},sc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},sc.prototype.isCancelled=function(){return this.disposable.isDisposed},sc.prototype.invokeCore=function(){return mc(this.action(this.scheduler,this.state))};var tc=Pa.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new nb},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new nb},a.now=Sa,a.prototype.now=Sa,a.normalize=function(a){return 0>a&&(a=0),a},a}(),uc=tc.normalize,vc=tc.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),jc}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new fc;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),jc}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new fc;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(tc.prototype),function(a){a.schedulePeriodic=function(a,b,c){if("undefined"==typeof Oa.setInterval)throw new mb;b=uc(b);var d=a,e=Oa.setInterval(function(){d=c(d)},b);return ic(function(){Oa.clearInterval(e)})}}(tc.prototype),function(a){a.catchError=a["catch"]=function(a){return new Ic(this,a)}}(tc.prototype);var wc,xc,yc=Pa.internals.SchedulePeriodicRecursive=function(){function a(a){return function(b,c){c(0,a._period);var d=Za(a._action)(a._state);d===Ya&&(a._cancel.dispose(),e(d.e)),a._state=d}}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 nc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a(this))),b},b}(),zc=function(a){function b(){a.call(this)}return ac(b,a),b.prototype.schedule=function(a,b){return mc(b(this,a))},b}(tc),Ac=tc.immediate=new zc,Bc=function(a){function b(){for(;d.length>0;){var a=d.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var d;return ac(c,a),c.prototype.schedule=function(a,c){var f=new sc(this,a,c,this.now());if(d)d.enqueue(f);else{d=new dc(4),d.enqueue(f);var g=Za(b)();d=null,g===Ya&&e(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!d},c}(tc),Cc=tc.currentThread=new Bc,Dc=function(){var a,b=Qa;if(Oa.setTimeout)a=Oa.setTimeout,b=Oa.clearTimeout;else{if(!Oa.WScript)throw new mb;a=function(a,b){Oa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),Ec=Dc.setTimeout,Fc=Dc.clearTimeout;!function(){function a(b){if(f)Ec(function(){a(b)},0);else{var c=d[b];if(c){f=!0;var g=Za(c)();xc(b),f=!1,g===Ya&&e(g.e)}}}function b(){if(!Oa.postMessage||Oa.importScripts)return!1;var a=!1,b=Oa.onmessage;return Oa.onmessage=function(){a=!0},Oa.postMessage("","*"),Oa.onmessage=b,a}var c=1,d={},f=!1;xc=function(a){delete d[a]};var g=new RegExp("^"+String(db).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=Ja&&Ma&&Ja.setImmediate)&&!g.test(h)&&h;if(Xa(h))wc=function(b){var e=c++;return d[e]=b,h(function(){a(e)}),e};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))wc=function(b){var e=c++;return d[e]=b,process.nextTick(function(){a(e)}),e};else if(b()){var i="ms.rx.schedule"+Math.random(),j=function(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))};Oa.addEventListener("message",j,!1),wc=function(a){var b=c++; return d[b]=a,Oa.postMessage(i+b,"*"),b}}else if(Oa.MessageChannel){var k=new Oa.MessageChannel;k.port1.onmessage=function(b){a(b.data)},wc=function(a){var b=c++;return d[b]=a,k.port2.postMessage(b),b}}else wc="document"in Oa&&"onreadystatechange"in Oa.document.createElement("script")?function(b){var e=Oa.document.createElement("script"),f=c++;return d[f]=b,e.onreadystatechange=function(){a(f),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},Oa.document.documentElement.appendChild(e),f}:function(b){var e=c++;return d[e]=b,Ec(function(){a(e)},0),e}}();var Gc=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){a.setDisposable(hc._fixup(b(c,d)))}}function d(a){this._id=a,this.isDisposed=!1}function e(a){this._id=a,this.isDisposed=!1}function f(a,b,c){return function(){b(a,c)}}return ac(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,xc(this._id))},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,Fc(this._id))},b.prototype.schedule=function(a,b){var e=new nc,f=wc(c(e,b,this,a));return new pc(e,new d(f))},b.prototype._scheduleFuture=function(a,b,d){if(0===b)return this.schedule(a,d);var f=new nc,g=Ec(c(f,d,this,a),b);return new pc(f,new e(g))},b.prototype.scheduleLongRunning=function(a,b){var c=ic(Qa);return wc(f(a,b,c)),c},b}(tc),Hc=tc["default"]=tc.async=new Gc,Ic=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return ac(b,a),b.prototype.schedule=function(a,b){return this._scheduler.schedule(a,this._wrap(b))},b.prototype._scheduleFuture=function(a,b,c){return this._scheduler.schedule(a,b,this._wrap(c))},b.prototype.now=function(){return this._scheduler.now()},b.prototype._clone=function(a){return new b(a,this._handler)},b.prototype._wrap=function(a){var b=this;return function(c,d){var f=Za(a)(b._getRecursiveWrapper(c),d);return f===Ya?(b._handler(f.e)||e(f.e),jc):mc(f)}},b.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},b.prototype.schedulePeriodic=function(a,b,c){var d=this,f=!1,g=new nc;return g.setDisposable(this._scheduler.schedulePeriodic(a,b,function(a){if(f)return null;var b=Za(c)(a);return b===Ya?(f=!0,d._handler(b.e)||e(b.e),g.dispose(),null):b})),g},b}(tc),Jc=Pa.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new nb},a.prototype._acceptObserver=function(a,b,c){throw new nb},a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObserver(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return vc(a)||(a=Ac),new Dg(function(c){return a.schedule(b,function(a,b){b._acceptObserver(c),"N"===b.kind&&c.onCompleted()})})},a}(),Kc=function(a){function b(a){this.value=a,this.kind="N"}return ac(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObserver=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(Jc),Lc=function(a){function b(a){this.error=a,this.kind="E"}return ac(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObserver=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(Jc),Mc=function(a){function b(){this.kind="C"}return ac(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObserver=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(Jc),Nc=Jc.createOnNext=function(a){return new Kc(a)},Oc=Jc.createOnError=function(a){return new Lc(a)},Pc=Jc.createOnCompleted=function(){return new Mc},Qc=Pa.Observer=function(){};Qc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Qc.prototype.asObserver=function(){var a=this;return new Uc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Qc.prototype.checked=function(){return new Vc(this)};var Rc=Qc.create=function(a,b,c){return a||(a=Qa),b||(b=Va),c||(c=Qa),new Uc(a,b,c)};Qc.fromNotifier=function(a,b){var c=tb(a,b,1);return new Uc(function(a){return c(Nc(a))},function(a){return c(Oc(a))},function(){return c(Pc())})},Qc.prototype.notifyOn=function(a){return new Xc(a,this)},Qc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Sc,Tc=Pa.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return ac(b,a),b.prototype.next=ob,b.prototype.error=ob,b.prototype.completed=ob,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}(Qc),Uc=Pa.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return ac(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}(Tc),Vc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}ac(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=Za(this._observer.onNext).call(this._observer,a);this._state=0,b===Ya&&e(b.e)},c.onError=function(a){this.checkAccess();var b=Za(this._observer.onError).call(this._observer,a);this._state=2,b===Ya&&e(b.e)},c.onCompleted=function(){this.checkAccess();var a=Za(this._observer.onCompleted).call(this._observer);this._state=2,a===Ya&&e(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Qc),Wc=Pa.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 oc}function c(a,b){return function(){a.onNext(b)}}function d(a,b){return function(){a.onError(b)}}function f(a){return function(){a.onCompleted()}}function g(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=Za(c)();return d===Ya?(a.queue=[],a.hasFaulted=!0,e(d.e)):void b(a)}return ac(b,a),b.prototype.next=function(a){this.queue.push(c(this.observer,a))},b.prototype.error=function(a){this.queue.push(d(this.observer,a))},b.prototype.completed=function(){this.queue.push(f(this.observer))},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,g))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Tc),Xc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return ac(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}(Wc),Yc=Pa.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function b(){if(Pa.config.longStackSupport&&$a){var b=this._subscribe,c=Za(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return Sc=b.prototype,b.isObservable=function(a){return a&&Xa(a.subscribe)},Sc.subscribe=Sc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Rc(a,b,c))},Sc.subscribeOnNext=function(a,b){return this._subscribe(Rc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Sc.subscribeOnError=function(a,b){return this._subscribe(Rc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Sc.subscribeOnCompleted=function(a,b){return this._subscribe(Rc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Zc=Pa.ObservableBase=function(a){function b(a){return a&&Xa(a.dispose)?a:Xa(a)?ic(a):jc}function c(a,c){var d=c[0],f=c[1],g=Za(f.subscribeCore).call(f,d);g!==Ya||d.fail(Ya.e)||e(Ya.e),d.setDisposable(b(g))}function d(){a.call(this)}return ac(d,a),d.prototype._subscribe=function(a){var b=new Eg(a),d=[b,this];return Cc.scheduleRequired()?Cc.schedule(d,c):c(null,d),b},d.prototype.subscribeCore=ob,d}(Yc),$c=Pa.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=Xa(d)?d:null,this.selector=tb(Xa(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.o=a,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},ac(c,Tc),c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.next=function(a){var b=this.i++,c=Za(this.selector)(a,b,this.source);return c===Ya?this.o.onError(c.e):(Wa(c)&&(c=jd(c)),(sb(c)||rb(c))&&(c=Yc.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onCompleted()},b}(Zc),_c=Pa.internals.Enumerable=function(){};y.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var ad=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=Za(a.e.next).call(a.e);if(c===Ya)return a.o.onError(c.e);if(c.done)return a.o.onCompleted();var e=c.value;Wa(e)&&(e=jd(e));var f=new nc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new oc,d={isDisposed:!1,o:a,subscription:b,e:this.sources[pb]()},e=Cc.scheduleRecursive(d,c);return new qc([b,e,new y(d)])},ac(d,Tc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.o.onError(a)},d.prototype.completed=function(){this._recurse(this._state)},b}(Zc);_c.prototype.concat=function(){return new ad(this)};var bd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=Za(a.e.next).call(a.e);if(c===Ya)return a.o.onError(c.e);if(c.done)return null!==a.lastError?a.o.onError(a.lastError):a.o.onCompleted();var e=c.value;Wa(e)&&(e=jd(e));var f=new nc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new oc,d={isDisposed:!1,e:this.sources[pb](),subscription:b,lastError:null,o:a},e=Cc.scheduleRecursive(d,c);return new qc([b,e,new y(d)])},ac(d,Tc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.lastError=a,this._recurse(this._state)},d.prototype.completed=function(){this._state.o.onCompleted()},b}(Zc);_c.prototype.catchError=function(){return new bd(this)};var cd=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return ac(b,a),b.prototype[pb]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?qb:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(_c),dd=_c.repeat=function(a,b){return new cd(a,b)},ed=function(a){function b(a,b,c){this.s=a,this.fn=b?tb(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return ac(b,a),b.prototype[pb]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:qb},b}(_c),fd=_c.of=function(a,b,c){return new ed(a,b,c)},gd=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Xc(this._s,a))},b}(Zc);Sc.observeOn=function(a){return new gd(this,a)};var hd=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new w(a,c.subscribe(e)))}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new nc,d=new oc;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(Zc);Sc.subscribeOn=function(a){return new hd(this,a)};var id=function(a){function b(b,c){this._p=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];c.onNext(d),c.onCompleted()}function d(a,b){var c=b[0],d=b[1];c.onError(d)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new nc,e=this,f=this._p;return Xa(f)&&(f=Za(f)(),f===Ya)?(a.onError(f.e),b):(f.then(function(d){b.setDisposable(e._s.schedule([a,d],c))},function(c){b.setDisposable(e._s.schedule([a,c],d))}),b)},b}(Zc),jd=Yc.fromPromise=function(a,b){return b||(b=Hc),new id(a,b)};Sc.toPromise=function(a){if(a||(a=Pa.config.Promise),!a)throw new mb("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d;b.subscribe(function(a){d=a},c,function(){a(d)})})};var kd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},ac(c,Tc),c.prototype.next=function(a){this.a.push(a)},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onNext(this.a),this.o.onCompleted()},b}(Zc);Sc.toArray=function(){return new kd(this)},Yc.create=function(a,b){return new Dg(a,b)};var ld=function(a){function b(b){this._f=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=Za(this._f)();return b===Ya?Ed(b.e).subscribe(a):(Wa(b)&&(b=jd(b)),b.subscribe(a))},b}(Zc),md=Yc.defer=function(a){return new ld(a)},nd=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.scheduler=b}function d(a,b){return b.onCompleted(),jc}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){var a=this.observer;return this.scheduler===Ac?d(null,a):this.scheduler.schedule(a,d)},b}(Zc),od=new nd(Ac),pd=Yc.empty=function(a){return vc(a)||(a=Ac),a===Ac?od:new nd(a)},qd=function(a){function b(b,c,d){this._iterable=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){var f=Za(b.next).call(b);if(f===Ya)return a.onError(f.e);if(f.done)return a.onCompleted();var g=f.value;return Xa(c)&&(g=Za(c)(g,d),g===Ya)?a.onError(g.e):(a.onNext(g),void e(d+1))}}return ac(b,a),b.prototype.subscribeCore=function(a){var b=Object(this._iterable),d=E(b);return this._scheduler.scheduleRecursive(0,c(a,d,this._fn))},b}(Zc),rd=Math.pow(2,53)-1;z.prototype[pb]=function(){return new A(this._s)},A.prototype[pb]=function(){return this},A.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:qb},B.prototype[pb]=function(){return new C(this._a)},C.prototype[pb]=function(){return this},C.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:qb};var sd=Yc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Xa(b))throw new Error("mapFn when provided must be a function");if(b)var e=tb(b,c,2);return vc(d)||(d=Cc),new qd(a,e,d)},td=function(a){function b(b,c){this._args=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b.length;return function(d,e){c>d?(a.onNext(b[d]),e(d+1)):a.onCompleted()}}return ac(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._args))},b}(Zc),ud=Yc.fromArray=function(a,b){return vc(b)||(b=Cc),new td(a,b)},vd=function(a){function b(b,c,d,e,f){this._initialState=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,a.call(this)}function c(a,b){if(a.first)a.first=!1;else if(a.newState=Za(a.self._itrFn)(a.newState),a.newState===Ya)return a.o.onError(a.newState.e);var c=Za(a.self._cndFn)(a.newState);if(c===Ya)return a.o.onError(c.e);if(c){var d=Za(a.self._resFn)(a.newState);if(d===Ya)return a.o.onError(d.e);a.o.onNext(d),b(a)}else a.o.onCompleted()}return ac(b,a),b.prototype.subscribeCore=function(a){var b={o:a,self:this,first:!0,newState:this._initialState};return this._s.scheduleRecursive(b,c)},b}(Zc);Yc.generate=function(a,b,c,d,e){return vc(e)||(e=Cc),new vd(a,b,c,d,e)},Yc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new td(b,Cc)},Yc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new td(c,a)};var wd=function(a){function b(){a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return jc},b}(Zc),xd=new wd,yd=Yc.never=function(){return xd},zd=function(a){function b(b,c){this._o=b,this._keys=Object.keys(b),this._scheduler=c,a.call(this)}function c(a,b,c){return function(d,e){if(d<c.length){var f=c[d];a.onNext([f,b[f]]),e(d+1)}else a.onCompleted()}}return ac(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._o,this._keys))},b}(Zc);Yc.pairs=function(a,b){return b||(b=Cc),new zd(a,b)};var Ad=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){b>d?(c.onNext(a+d),e(d+1)):c.onCompleted()}}return ac(b,a),b.prototype.subscribeCore=function(a){return this.scheduler.scheduleRecursive(0,c(this.start,this.rangeCount,a))},b}(Zc);Yc.range=function(a,b,c){return vc(c)||(c=Cc),new Ad(a,b,c)};var Bd=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new I(a,this);return b.run()},b}(Zc);I.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount,a)},Yc.repeat=function(a,b,c){return vc(c)||(c=Cc),new Bd(a,b,c)};var Cd=function(a){function b(b,c){this._value=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),jc}return ac(b,a),b.prototype.subscribeCore=function(a){var b=[this._value,a];return this._scheduler===Ac?c(null,b):this._scheduler.schedule(b,c)},b}(Zc),Dd=(Yc["return"]=Yc.just=function(a,b){return vc(b)||(b=Ac),new Cd(a,b)},function(a){function b(b,c){this._error=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onError(c),jc}return ac(b,a),b.prototype.subscribeCore=function(a){var b=[this._error,a];return this._scheduler===Ac?c(null,b):this._scheduler.schedule(b,c)},b}(Zc)),Ed=Yc["throw"]=function(a,b){return vc(b)||(b=Ac),new Dd(a,b)},Fd=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=jc,c=Za(this._resFn)();if(c===Ya)return new pc(Ed(c.e).subscribe(a),b);c&&(b=c);var d=Za(this._obsFn)(c);return d===Ya?new pc(Ed(d.e).subscribe(a),b):new pc(d.subscribe(a),b)},b}(Zc);Yc.using=function(a,b){return new Fd(a,b)},Sc.amb=function(a){var b=this;return new Dg(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new nc,j=new nc;Wa(a)&&(a=jd(a));var k=Rc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Rc(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new pc(i,j)})},Yc.amb=function(){var a,b=yd();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=J(b,a[d]);return b};var Gd=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new nc,c=new oc;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new Hd(a,c,this._fn))),c},b}(Zc),Hd=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=Za(this._fn)(a);if(b===Ya)return this._o.onError(b.e);Wa(b)&&(b=jd(b));var c=new nc;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Tc);Sc["catch"]=function(a){return Xa(a)?new Gd(this,a):Id([this,a])};var Id=Yc["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return fd(a).catchError()};Sc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Ld.apply(this,b)};var Jd=function(a){function b(b,c){this._params=b,this._cb=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){for(var b=this._params.length,c=new Array(b),d={hasValue:u(b,K),hasValueAll:!1,isDone:u(b,K),values:new Array(b)},e=0;b>e;e++){var f=this._params[e],g=new nc;c[e]=g,Wa(f)&&(f=jd(f)),g.setDisposable(f.subscribe(new Kd(a,e,this._cb,d)))}return new qc(c)},b}(Zc),Kd=function(a){function b(b,c,d,e){this._o=b,this._i=c,this._cb=d,this._state=e,a.call(this)}function c(a){return function(b,c){return c!==a}}return ac(b,a),b.prototype.next=function(a){if(this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll||(this._state.hasValueAll=this._state.hasValue.every(Ra))){var b=Za(this._cb).apply(null,this._state.values);if(b===Ya)return this._o.onError(b.e);this._o.onNext(b)}else this._state.isDone.filter(c(this._i)).every(Ra)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._state.isDone[this._i]=!0,this._state.isDone.every(Ra)&&this._o.onCompleted()},b}(Tc),Ld=Yc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Jd(b,d)};Sc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Od.apply(null,a)};var Md=function(a){function b(b,c){this._s=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._s.o.onNext(a)},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.i++,this._fn(this._s)},b}(Tc),Nd=function(a){function b(b){this._sources=b,a.call(this)}function c(a,b){if(!a.disposable.isDisposed){if(a.i===a.sources.length)return a.o.onCompleted();var c=a.sources[a.i];Wa(c)&&(c=jd(c));var d=new nc;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Md(a,b)))}}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new oc,d=ic(Qa),e={o:a,i:0,subscription:b,disposable:d,sources:this._sources},f=Ac.scheduleRecursive(e,c);return new qc([b,d,f])},b}(Zc),Od=Yc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new Nd(a)};Sc.concatAll=function(){return this.merge(1)};var Pd=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new fc;return b.add(this.source.subscribe(new Qd(a,this.maxConcurrent,b))),b},b}(Zc),Qd=function(a){function b(b,c,d){this.o=b,this.max=c,this.g=d,this.done=!1,this.q=[],this.activeCount=0,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return ac(b,a),b.prototype.handleSubscribe=function(a){var b=new nc;this.g.add(b),Wa(a)&&(a=jd(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.next=function(a){this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a)},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,0===this.activeCount&&this.o.onCompleted()},ac(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.q.length>0?this.parent.handleSubscribe(this.parent.q.shift()):(this.parent.activeCount--,this.parent.done&&0===this.parent.activeCount&&this.parent.o.onCompleted())},b}(Tc);Sc.merge=function(a){return"number"!=typeof a?Rd(this,a):new Pd(this,a)};var Rd=Yc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(vc(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Ac,b=0;d>b;b++)c.push(arguments[b]);else for(a=Ac,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),H(a,c).mergeAll()},Sd=function(a){function b(b){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new fc,c=new nc;return b.add(c),c.setDisposable(this.source.subscribe(new Td(a,b))),b},b}(Zc),Td=function(a){function b(b,c){this.o=b,this.g=c,this.done=!1,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=new nc;this.g.add(b),Wa(a)&&(a=jd(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,1===this.g.length&&this.o.onCompleted()},ac(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.done&&1===this.parent.g.length&&this.parent.o.onCompleted()},b}(Tc);Sc.mergeAll=function(){return new Sd(this)};var Ud=Pa.CompositeError=function(a){this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Ud.prototype=Object.create(Error.prototype),Ud.prototype.name="CompositeError";var Vd=function(a){function b(b){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new fc,c=new nc,d={isStopped:!1,errors:[],o:a};return b.add(c),c.setDisposable(this.source.subscribe(new Wd(b,d))),b},b}(Zc),Wd=function(a){function b(b,c){this._group=b,this._state=c,a.call(this)}function c(a,b){0===b.length?a.onCompleted():1===b.length?a.onError(b[0]):a.onError(new Ud(b))}function d(b,c,d){this._inner=b,this._group=c,this._state=d,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=new nc;this._group.add(b),Wa(a)&&(a=jd(a)),b.setDisposable(a.subscribe(new d(b,this._group,this._state)))},b.prototype.error=function(a){this._state.errors.push(a),this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},b.prototype.completed=function(){this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},ac(d,a),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.errors.push(a),this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},d.prototype.completed=function(){this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},b}(Tc);Yc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=H(null,a);return new Vd(d)},Sc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Zd([this,a])};var Xd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(a.pos<a.sources.length){var c=a.sources[a.pos++];Wa(c)&&(c=jd(c));var d=new nc;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Yd(a,b)))}else a.o.onCompleted()}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new oc,d={pos:0,subscription:b,o:a,sources:this.sources},e=Ac.scheduleRecursive(d,c);return new pc(b,e)},b}(Zc),Yd=function(a){function b(b,c){this._state=b,this._recurse=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._state.o.onNext(a)},b.prototype.error=function(){this._recurse(this._state)},b.prototype.completed=function(){this._recurse(this._state)},b}(Tc),Zd=Yc.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Xd(a)},$d=function(a){function b(b,c){this._s=b,this._o=Wa(c)?jd(c):c,this._open=!1,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new nc;b.setDisposable(this._s.subscribe(new _d(a,this))),Wa(this._o)&&(this._o=jd(this._o));var c=new nc;return c.setDisposable(this._o.subscribe(new ae(a,this,c))),new pc(b,c)},b}(Zc),_d=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._p._open&&this._o.onCompleted()},b}(Tc),ae=function(a){function b(b,c,d){this._o=b,this._p=c,this._r=d,a.call(this)}return ac(b,a),b.prototype.next=function(){this._p._open=!0,this._r.dispose()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._r.dispose()},b}(Tc);Sc.skipUntil=function(a){return new $d(this,a)};var be=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,Tc.call(this)}function d(a,b){this.parent=a,this.id=b,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new oc,d=this.source.subscribe(new c(a,b));return new pc(d,b)},ac(c,Tc),c.prototype.next=function(a){var b=new nc,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Wa(a)&&(a=jd(a)),b.setDisposable(a.subscribe(new d(this,c)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.stopped=!0,!this.hasLatest&&this.o.onCompleted()},ac(d,Tc),d.prototype.next=function(a){this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.error=function(a){this.parent.latest===this.id&&this.parent.o.onError(a)},d.prototype.completed=function(){this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.stopped&&this.parent.o.onCompleted())},b}(Zc);Sc["switch"]=Sc.switchLatest=function(){return new be(this)};var ce=function(a){function b(b,c){this.source=b,this.other=Wa(c)?jd(c):c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return new pc(this.source.subscribe(a),this.other.subscribe(new de(a)))},b}(Zc),de=function(a){function b(b){this._o=b,a.call(this)}return ac(b,a),b.prototype.next=function(){this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=Qa,b}(Tc);Sc.takeUntil=function(a){return new ce(this,a)};var ee=function(a){function b(b,c,d){this._s=b,this._ss=c,this._cb=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){for(var b=this._ss.length,c={hasValue:u(b,K),hasValueAll:!1,values:new Array(b)},d=this._ss.length,e=new Array(d+1),f=0;d>f;f++){var g=this._ss[f],h=new nc;Wa(g)&&(g=jd(g)),h.setDisposable(g.subscribe(new fe(a,f,c))),e[f]=h}var i=new nc;return i.setDisposable(this._s.subscribe(new ge(a,this._cb,c))),e[d]=i,new qc(e)},b}(Zc),fe=function(a){function b(b,c,d){this._o=b,this._i=c,this._state=d,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll=this._state.hasValue.every(Ra)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=Qa,b}(Tc),ge=function(a){function b(b,c,d){this._o=b,this._cb=c,this._state=d, a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=[a].concat(this._state.values);if(this._state.hasValueAll){var c=Za(this._cb).apply(null,b);return c===Ya?this._o.onError(c.e):void this._o.onNext(c)}},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.withLatestFrom=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new ee(this,b,d)};var he=function(a){function b(b,c){this._s=b,this._cb=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){for(var b=this._s.length,c=new Array(b),d=u(b,K),e=u(b,M),f=0;b>f;f++){var g=this._s[f],h=new nc;c[f]=h,Wa(g)&&(g=jd(g)),h.setDisposable(g.subscribe(new ie(a,f,this,e,d)))}return new qc(c)},b}(Zc),ie=function(a){function b(b,c,d,e,f){this._o=b,this._i=c,this._p=d,this._q=e,this._d=f,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return ac(b,a),b.prototype.next=function(a){if(this._q[this._i].push(a),this._q.every(c)){var b=this._q.map(d),f=Za(this._p._cb).apply(null,b);if(f===Ya)return this._o.onError(f.e);this._o.onNext(f)}else this._d.filter(e(this._i)).every(Ra)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._d[this._i]=!0,this._d.every(Ra)&&this._o.onCompleted()},b}(Tc);Sc.zip=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new he(b,d)},Yc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];Array.isArray(b[0])&&(b=Xa(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)};var je=function(a){function b(b,c){this.sources=b,this._cb=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){for(var b=this.sources,c=b.length,d=new Array(c),e={q:u(c,M),done:u(c,K),cb:this._cb,o:a},f=0;c>f;f++)!function(a){var c=b[a],f=new nc;(sb(c)||rb(c))&&(c=sd(c)),d[a]=f,f.setDisposable(c.subscribe(new ke(e,a)))}(f);return new qc(d)},b}(Zc),ke=function(a){function b(b,c){this._s=b,this._i=c,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return ac(b,a),b.prototype.next=function(a){if(this._s.q[this._i].push(a),this._s.q.every(c)){var b=this._s.q.map(d),f=Za(this._s.cb).apply(null,b);if(f===Ya)return this._s.o.onError(f.e);this._s.o.onNext(f)}else this._s.done.filter(e(this._i)).every(Ra)&&this._s.o.onCompleted()},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.done[this._i]=!0,this._s.done.every(Ra)&&this._s.o.onCompleted()},b}(Tc);Sc.zipIterable=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L,e=this;return b.unshift(e),new je(b,d)},Sc.asObservable=function(){return new Dg(N(this),this)},Sc.bufferWithCount=Sc.bufferCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(O).filter(P)};var le=function(a){function b(b){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new me(a))},b}(Zc),me=function(a){function b(b){this._o=b,a.call(this)}return ac(b,a),b.prototype.next=function(a){a.accept(this._o)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.dematerialize=function(){return new le(this)};var ne=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new oe(a,this.keyFn,this.comparer))},b}(Zc),oe=function(a){function b(b,c,d){this.o=b,this.keyFn=c,this.comparer=d,this.hasCurrentKey=!1,this.currentKey=null,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b,c=a;return Xa(this.keyFn)&&(c=Za(this.keyFn)(a),c===Ya)?this.o.onError(c.e):this.hasCurrentKey&&(b=Za(this.comparer)(this.currentKey,c),b===Ya)?this.o.onError(b.e):void(this.hasCurrentKey&&b||(this.hasCurrentKey=!0,this.currentKey=c,this.o.onNext(a)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.o.onCompleted()},b}(Tc);Sc.distinctUntilChanged=function(a,b){return b||(b=Ta),new ne(this,a,b)};var pe=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||Xa(b._oN)?Rc(b._oN||Qa,b._oE||Qa,b._oC||Qa):b._oN,this.isStopped=!1,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},ac(c,Tc),c.prototype.next=function(a){var b=Za(this.t.onNext).call(this.t,a);b===Ya&&this.o.onError(b.e),this.o.onNext(a)},c.prototype.error=function(a){var b=Za(this.t.onError).call(this.t,a);return b===Ya?this.o.onError(b.e):void this.o.onError(a)},c.prototype.completed=function(){var a=Za(this.t.onCompleted).call(this.t);return a===Ya?this.o.onError(a.e):void this.o.onCompleted()},b}(Zc);Sc["do"]=Sc.tap=Sc.doAction=function(a,b,c){return new pe(this,a,b,c)},Sc.doOnNext=Sc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Sc.doOnError=Sc.tapOnError=function(a,b){return this.tap(Qa,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Sc.doOnCompleted=Sc.tapOnCompleted=function(a,b){return this.tap(Qa,null,"undefined"!=typeof b?function(){a.call(b)}:a)};var qe=function(a){function b(b,c,d){this.source=b,this._fn=tb(c,d,0),a.call(this)}function c(a,b){this.isDisposed=!1,this._s=a,this._fn=b}return ac(b,a),b.prototype.subscribeCore=function(a){var b=Za(this.source.subscribe).call(this.source,a);return b===Ya&&(this._fn(),e(b.e)),new c(b,this._fn)},c.prototype.dispose=function(){if(!this.isDisposed){var a=Za(this._s.dispose).call(this._s);this._fn(),a===Ya&&e(a.e)}},b}(Zc);Sc["finally"]=function(a,b){return new qe(this,a,b)};var re=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Qa,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Zc);Sc.ignoreElements=function(){return new re(this)};var se=function(a){function b(b,c){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new te(a))},b}(Zc),te=function(a){function b(b){this._o=b,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._o.onNext(Nc(a))},b.prototype.error=function(a){this._o.onNext(Oc(a)),this._o.onCompleted()},b.prototype.completed=function(){this._o.onNext(Pc()),this._o.onCompleted()},b}(Tc);Sc.materialize=function(){return new se(this)},Sc.repeat=function(a){return dd(this,a).concat()},Sc.retry=function(a){return dd(this,a).catchError()};var ue=function(a){function b(a){return{isDisposed:!1,dispose:function(){this.isDisposed||(this.isDisposed=!0,a.isDisposed=!0)}}}function c(b,c){this.source=b,this._notifier=c,a.call(this)}return ac(c,a),c.prototype.subscribeCore=function(a){var c,d=new Hg,e=new Hg,f=this._notifier(d),g=f.subscribe(e),h=this.source["@@iterator"](),i={isDisposed:!1},j=new oc,k=Cc.scheduleRecursive(null,function(b,f){if(!i.isDisposed){var g=h.next();if(g.done)return void(c?a.onError(c):a.onCompleted());var k=g.value;Wa(k)&&(k=jd(k));var l=new nc,m=new nc;j.setDisposable(new pc(m,l)),l.setDisposable(k.subscribe(function(b){a.onNext(b)},function(b){m.setDisposable(e.subscribe(f,function(b){a.onError(b)},function(){a.onCompleted()})),d.onNext(b),l.dispose()},function(){a.onCompleted()}))}});return new qc([g,j,k,b(i)])},c}(Zc);Sc.retryWhen=function(a){return new ue(Q(this),a)};var ve=function(a){function b(a){return{isDisposed:!1,dispose:function(){this.isDisposed||(this.isDisposed=!0,a.isDisposed=!0)}}}function c(b,c){this.source=b,this._notifier=c,a.call(this)}return ac(c,a),c.prototype.subscribeCore=function(a){var c,d=new Hg,e=new Hg,f=this._notifier(d),g=f.subscribe(e),h=this.source["@@iterator"](),i={isDisposed:!1},j=new oc,k=Cc.scheduleRecursive(null,function(b,f){if(!i.isDisposed){var g=h.next();if(g.done)return void(c?a.onError(c):a.onCompleted());var k=g.value;Wa(k)&&(k=jd(k));var l=new nc,m=new nc;j.setDisposable(new pc(m,l)),l.setDisposable(k.subscribe(function(b){a.onNext(b)},function(b){a.onError(b)},function(){m.setDisposable(e.subscribe(f,function(b){a.onError(b)},function(){a.onCompleted()})),d.onNext(null),l.dispose()}))}});return new qc([g,j,k,b(i)])},c}(Zc);Sc.repeatWhen=function(a){return new ve(Q(this),a)};var we=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new xe(a,this))},b}(Zc),xe=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=Za(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?Za(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Ya?this._o.onError(this._a.e):(this._o.onNext(this._a),void this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._hv&&this._hs&&this._o.onNext(this._s),this._o.onCompleted()},b}(Tc);Sc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new we(this,c,b,a)};var ye=function(a){function b(b,c){this.source=b,this._c=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ze(a,this._c))},b}(Zc),ze=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return ac(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._o.onNext(this._q.shift())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.skipLast=function(a){if(0>a)throw new lb;return new ye(this,a)},Sc.startWith=function(){var a,b=0;arguments.length&&vc(arguments[0])?(a=arguments[0],b=1):a=Ac;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Od.apply(null,[ud(c,a),this])};var Ae=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return ac(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(;this._q.length>0;)this._o.onNext(this._q.shift());this._o.onCompleted()},b}(Tc);Sc.takeLast=function(a){if(0>a)throw new lb;var b=this;return new Dg(function(c){return b.subscribe(new Ae(c,a))},b)};var Be=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return ac(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(Tc);Sc.takeLastBuffer=function(a){if(0>a)throw new lb;var b=this;return new Dg(function(c){return b.subscribe(new Be(c,a))},b)},Sc.windowWithCount=Sc.windowCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new lb;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new lb;return new Dg(function(d){function e(){var a=new Hg;i.push(a),d.onNext(cc(a,g))}var f=new nc,g=new rc(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},Sc.flatMapConcat=Sc.concatMap=function(a,b,c){return new $c(this,a,b,c).merge(1)},Sc.concatMapObserver=Sc.selectConcatObserver=function(a,b,c,d){var e=this,f=tb(a,d,2),g=tb(b,d,1),h=tb(c,d,0);return new Dg(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Wa(d)&&(d=jd(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Wa(c)&&(c=jd(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Wa(b)&&(b=jd(b)),a.onNext(b),a.onCompleted()})},this).concatAll()};var Ce=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(this._d),this._o.onCompleted()},b}(Tc);Sc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Dg(function(a){return c.subscribe(new Ce(a,b))},c)},S.prototype.push=function(a){var b=-1===R(this.set,a,this.comparer);return b&&this.set.push(a),b};var De=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ee(a,this._keyFn,this._cmpFn))},b}(Zc),Ee=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new S(d),a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=a;return Xa(this._keyFn)&&(b=Za(this._keyFn)(a),b===Ya)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.distinct=function(a,b){return b||(b=Ta),new De(this,a,b)},Sc.groupBy=function(a,b){return this.groupByUntil(a,b,yd)},Sc.groupByUntil=function(b,c,d){var e=this;return new Dg(function(f){var g=new Uf,h=new fc,i=new rc(h),j=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(e){var k=Za(b)(e);if(k===Ya)return g.forEach(j(k.e)),f.onError(k.e);var l=!1,m=g.get(k);if(m===a&&(m=new Hg,g.set(k,m),l=!0),l){var n=new Gg(k,m,i),o=new Gg(k,m),p=Za(d)(o);if(p===Ya)return g.forEach(j(p.e)),f.onError(p.e);f.onNext(n);var q=new nc;h.add(q),q.setDisposable(p.take(1).subscribe(Qa,function(a){g.forEach(j(a)),f.onError(a)},function(){g["delete"](k)&&m.onCompleted(),h.remove(q)}))}var r=e;return Xa(c)&&(r=Za(c)(e),r===Ya)?(g.forEach(j(r.e)),f.onError(r.e)):void m.onNext(r)},function(a){g.forEach(j(a)),f.onError(a)},function(){g.forEach(function(a){a.onCompleted()}),f.onCompleted()})),i},e)};var Fe=function(a){function b(b,c,d){this.source=b,this.selector=tb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,Tc.call(this)}return ac(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},ac(d,Tc),d.prototype.next=function(a){var b=Za(this.selector)(a,this.i++,this.source);return b===Ya?this.o.onError(b.e):void this.o.onNext(b)},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Zc);Sc.map=Sc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Fe?this.internalMap(c,b):new Fe(this,c,b)},Sc.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(T(b,a))},Sc.flatMap=Sc.selectMany=Sc.mergeMap=function(a,b,c){return new $c(this,a,b,c).mergeAll()},Sc.flatMapObserver=Sc.selectManyObserver=function(a,b,c,d){var e=this;return new Dg(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)}Wa(c)&&(c=jd(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Wa(c)&&(c=jd(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Wa(a)&&(a=jd(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Sc.flatMapLatest=Sc.switchMap=function(a,b,c){return new $c(this,a,b,c).switchLatest()};var Ge=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._r=b,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},ac(c,Tc),c.prototype.next=function(a){this._r<=0?this._o.onNext(a):this._r--},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(Zc);Sc.skip=function(a){if(0>a)throw new lb;return new Ge(this,a)};var He=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ie(a,this))},b}(Zc),Ie=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!1,a.call(this)}return ac(b,a),b.prototype.next=function(a){if(!this._r){var b=Za(this._p._fn)(a,this._i++,this._p);if(b===Ya)return this._o.onError(b.e);this._r=!b}this._r&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.skipWhile=function(a,b){var c=tb(a,b,3);return new He(this,c)};var Je=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._c=b,this._r=b,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},ac(c,Tc),c.prototype.next=function(a){this._r-->0&&(this._o.onNext(a),this._r<=0&&this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(Zc);Sc.take=function(a,b){if(0>a)throw new lb;return 0===a?pd(b):new Je(this,a)};var Ke=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Le(a,this))},b}(Zc),Le=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!0,a.call(this)}return ac(b,a),b.prototype.next=function(a){return this._r&&(this._r=Za(this._p._fn)(a,this._i++,this._p),this._r===Ya)?this._o.onError(this._r.e):void(this._r?this._o.onNext(a):this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.takeWhile=function(a,b){var c=tb(a,b,3);return new Ke(this,c)};var Me=function(a){function b(b,c,d){this.source=b,this.predicate=tb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,Tc.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},ac(d,Tc),d.prototype.next=function(a){var b=Za(this.predicate)(a,this.i++,this.source);return b===Ya?this.o.onError(b.e):void(b&&this.o.onNext(a))},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Zc);Sc.filter=Sc.where=function(a,b){return this instanceof Me?this.internalFilter(a,b):new Me(this,a,b)};var Ne=function(a){function b(b,c,d){this.source=b,this._k=c,this._c=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Oe(a,this._k,this._c))},b}(Zc),Oe=function(a){function b(b,c,d){this._o=b,this._k=c,this._c=d,this._v=null,this._hv=!1,this._l=[],a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=Za(this._k)(a);if(b===Ya)return this._o.onError(b.e);var c=0;if(this._hv){if(c=Za(this._c)(b,this._v),c===Ya)return this._o.onError(c.e)}else this._hv=!0,this._v=b;c>0&&(this._v=b,this._l=[]),c>=0&&this._l.push(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._l),this._o.onCompleted()},b}(Tc),Pe=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Qe(a,this))},b}(Zc),Qe=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=Za(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?Za(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Ya?this._o.onError(this._a.e):void this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv&&this._o.onNext(this._a),!this._hv&&this._hs&&this._o.onNext(this._s),!this._hv&&!this._hs&&this._o.onError(new jb),this._o.onCompleted()},b}(Tc);Sc.reduce=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Pe(this,c,b,a)};var Re=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Se(a,this._fn,this.source))},b}(Zc),Se=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=Za(this._fn)(a,this._i++,this._s);return b===Ya?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Tc);Sc.some=function(a,b){var c=tb(a,b,3);return new Re(this,c)};var Te=function(a){function b(b){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ue(a))},b}(Zc),Ue=function(a){function b(b){this._o=b,a.call(this)}return ac(b,a),b.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(Tc);Sc.isEmpty=function(){return new Te(this)};var Ve=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new We(a,this._fn,this.source))},b}(Zc),We=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=Za(this._fn)(a,this._i++,this._s);return b===Ya?this._o.onError(b.e):void(Boolean(b)||(this._o.onNext(!1),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(Tc);Sc.every=function(a,b){var c=tb(a,b,3);return new Ve(this,c)};var Xe=function(a){function b(b,c,d){var e=+d||0;Math.abs(e)===1/0&&(e=0),this.source=b,this._elem=c,this._n=e,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(!1),a.onCompleted(),jc):this.source.subscribe(new Ye(a,this._elem,this._n))},b}(Zc),Ye=function(a){function b(b,c,d){this._o=b,this._elem=c,this._n=d,this._i=0,a.call(this)}function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}return ac(b,a),b.prototype.next=function(a){this._i++>=this._n&&c(a,this._elem)&&(this._o.onNext(!0),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Tc);Sc.includes=function(a,b){return new Xe(this,a,b)};var Ze=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new $e(a,this._fn,this.source))},b}(Zc),$e=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){if(this._fn){var b=Za(this._fn)(a,this._i++,this._s);if(b===Ya)return this._o.onError(b.e);Boolean(b)&&this._c++}else this._c++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Tc);Sc.count=function(a,b){var c=tb(a,b,3);return new Ze(this,c)};var _e=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),jc):this.source.subscribe(new af(a,this._e,this._n))},b}(Zc),af=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._o.onNext(this._i),this._o.onCompleted()),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(-1),this._o.onCompleted()},b}(Tc);Sc.indexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new _e(this,a,c)};var bf=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new cf(a,this._fn,this.source))},b}(Zc),cf=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){if(this._fn){var b=Za(this._fn)(a,this._i++,this._s);if(b===Ya)return this._o.onError(b.e);this._c+=b}else this._c+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Tc);Sc.sum=function(a,b){var c=tb(a,b,3);return new bf(this,c)},Sc.minBy=function(a,b){return b||(b=Ua),new Ne(this,a,function(a,c){return-1*b(a,c)})},Sc.min=function(a){return this.minBy(Ra,a).map(U)},Sc.maxBy=function(a,b){return b||(b=Ua),new Ne(this,a,b)},Sc.max=function(a){return this.maxBy(Ra,a).map(U)};var df=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ef(a,this._fn,this.source))},b}(Zc),ef=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._c=0,this._t=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){if(this._fn){var b=Za(this._fn)(a,this._c++,this._s);if(b===Ya)return this._o.onError(b.e);this._t+=b}else this._c++,this._t+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){return 0===this._c?this._o.onError(new jb):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(Tc);Sc.average=function(a,b){var c,d=this;return Xa(a)&&(c=tb(a,b,3)),new df(d,c)},Sc.sequenceEqual=function(a,b){var c=this;return b||(b=Ta),new Dg(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){if(h.length>0){var c=h.shift(),e=Za(b)(c,a);if(e===Ya)return d.onError(e.e);e||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(sb(a)||rb(a))&&(a=sd(a)),Wa(a)&&(a=jd(a));var j=a.subscribe(function(a){if(g.length>0){var c=g.shift(),f=Za(b)(c,a);if(f===Ya)return d.onError(f.e);f||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new pc(i,j)},c)};var ff=function(a){function b(b,c,d){this.source=b,this._i=c,this._d=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new gf(a,this._i,this._d))},b}(Zc),gf=function(b){function c(a,c,d){this._o=a,this._i=c,this._d=d,b.call(this)}return ac(c,b),c.prototype.next=function(a){0===this._i--&&(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._d===a?this._o.onError(new lb):(this._o.onNext(this._d),this._o.onCompleted())},c}(Tc);Sc.elementAt=function(a,b){if(0>a)throw new lb;return new ff(this,a,b)};var hf=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return ac(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=Za(this._obj.predicate)(a,this._i++,this._s);if(c===Ya)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);if(b){if(this._hv)return this._o.onError(new Error("Sequence contains more than one matching element"));this._hv=!0,this._v=a}},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new jb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Tc);Sc.single=function(a,b){var c={},d=this;if(c="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Xa(c.predicate)){var e=c.predicate;c.predicate=tb(e,c.thisArg,3)}return new Dg(function(a){return d.subscribe(new hf(a,c,d))},d)};var jf=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new kf(a,this._obj,this.source))},b}(Zc),kf=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,b.call(this)}return ac(c,b),c.prototype.next=function(a){if(this._obj.predicate){var b=Za(this._obj.predicate)(a,this._i++,this._s);if(b===Ya)return this._o.onError(b.e);Boolean(b)&&(this._o.onNext(a),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._obj.defaultValue===a?this._o.onError(new jb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Tc);Sc.first=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Xa(a.predicate)){var b=a.predicate;a.predicate=tb(b,a.thisArg,3)}return new jf(this,a)};var lf=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new mf(a,this._obj,this.source))},b}(Zc),mf=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return ac(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=Za(this._obj.predicate)(a,this._i++,this._s);if(c===Ya)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);b&&(this._hv=!0,this._v=a)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new jb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Tc);Sc.last=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Xa(a.predicate)){var b=a.predicate;a.predicate=tb(b,a.thisArg,3)}return new lf(this,a)};var nf=function(a){function b(b,c,d,e){this._o=b,this._s=c,this._cb=d,this._y=e,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=Za(this._cb)(a,this._i,this._s);return b===Ya?this._o.onError(b.e):void(b?(this._o.onNext(this._y?this._i:a),this._o.onCompleted()):this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._y&&this._o.onNext(-1),this._o.onCompleted()},b}(Tc);Sc.find=function(a,b){return V(this,a,b,!1)},Sc.findIndex=function(a,b){ return V(this,a,b,!0)};var of=function(a){function b(b){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new pf(a))},b}(Zc),pf=function(a){function b(b){this._o=b,this._s=new Oa.Set,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._s.add(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._s),this._o.onCompleted()},b}(Tc);Sc.toSet=function(){if("undefined"==typeof Oa.Set)throw new TypeError;return new of(this)};var qf=function(a){function b(b,c,d){this.source=b,this._k=c,this._e=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new rf(a,this._k,this._e))},b}(Zc),rf=function(a){function b(b,c,d){this._o=b,this._k=c,this._e=d,this._m=new Oa.Map,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=Za(this._k)(a);if(b===Ya)return this._o.onError(b.e);var c=a;return this._e&&(c=Za(this._e)(a),c===Ya)?this._o.onError(c.e):void this._m.set(b,c)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._m),this._o.onCompleted()},b}(Tc);Sc.toMap=function(a,b){if("undefined"==typeof Oa.Map)throw new TypeError;return new qf(this,a,b)};var sf=function(a){function b(b,c,d){this.source=b,this._b=c,this._e=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new tf(a,this._b,this._e))},b}(Zc),tf=function(a){function b(b,c,d){this._o=b,this._b=c,this._e=d,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._i>=this._b&&(this._e===this._i?this._o.onCompleted():this._o.onNext(a)),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.slice=function(a,b){var c=a||0;if(0>c)throw new Pa.ArgumentOutOfRangeError;if("number"==typeof b&&c>b)throw new Pa.ArgumentOutOfRangeError;return new sf(this,c,b)};var uf=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),jc):this.source.subscribe(new vf(a,this._e,this._n))},b}(Zc),vf=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._v=0,this._hv=!1,this._i=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._hv=!0,this._v=this._i),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?this._o.onNext(this._v):this._o.onNext(-1),this._o.onCompleted()},b}(Tc);Sc.lastIndexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new uf(this,a,c)},Yc.wrap=function(a){function b(){return Yc.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var wf=Yc.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new Dg(function(d){function e(b){var c=Za(a.next).call(a,b);return c===Ya?d.onError(c.e):void g(c)}function f(b){var c=Za(a.next).call(a,b);return c===Ya?d.onError(c.e):void g(c)}function g(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=W.call(b,a.value),g=null,i=!1;Yc.isObservable(c)?h.add(c.subscribe(function(a){i=!0,g=a},f,function(){i&&e(g)})):f(new TypeError("type not supported"))}var h=new fc;return Xa(a)&&(a=a.apply(b,c)),a&&Xa(a.next)?(e(),h):(d.onNext(a),d.onCompleted())})};Yc.start=function(a,b,c){return xf(a,b,c)()};var xf=Yc.toAsync=function(a,b,c){return vc(c)||(c=Hc),function(){var d=arguments,e=new Ig;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};Yc.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return ba(a,b,c,e)}},Yc.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return da(a,b,c,e)}},ga.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},Pa.config.useNativeEvents=!1;var yf=function(a){function b(b,c,d){this._el=b,this._n=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return Xa(b)&&(c=Za(b).apply(null,arguments),c===Ya)?a.onError(c.e):void a.onNext(c)}}return ac(b,a),b.prototype.subscribeCore=function(a){return ha(this._el,this._n,c(a,this._fn))},b}(Zc);Yc.fromEvent=function(a,b,c){return a.addListener?Af(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Pa.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new yf(a,b,c).publish().refCount():Af(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var zf=function(a){function b(b,c,d){this._add=b,this._del=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return Xa(b)&&(c=Za(b).apply(null,arguments),c===Ya)?a.onError(c.e):void a.onNext(c)}}function d(a,b,c){this._del=a,this._fn=b,this._ret=c,this.isDisposed=!1}return ac(b,a),b.prototype.subscribeCore=function(a){var b=c(a,this._fn),e=this._add(b);return new d(this._del,b,e)},d.prototype.dispose=function(){this.isDisposed||(Xa(this._del)&&this._del(this._fn,this._ret),this.isDisposed=!0)},b}(Zc),Af=Yc.fromEventPattern=function(a,b,c){return new zf(a,b,c).publish().refCount()};Yc.startAsync=function(a){var b=Za(a)();return b===Ya?Ed(b.e):jd(b)};var Bf=function(a){function b(b,c){this.source=b,this.controller=new Hg,this.paused=!0,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return ac(b,a),b.prototype._subscribe=function(a){var b=this.source.publish(),c=b.subscribe(a),d=jc,e=this.pauser.startWith(!this.paused).distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=jc)});return new qc([c,d,e])},b.prototype.pause=function(){this.paused=!0,this.controller.onNext(!1)},b.prototype.resume=function(){this.paused=!1,this.controller.onNext(!0)},b}(Yc);Sc.pausable=function(a){return new Bf(this,a)};var Cf=function(b){function c(a,c){this.source=a,this.controller=new Hg,this.paused=!0,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,b.call(this)}return ac(c,b),c.prototype._subscribe=function(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ia(this.source,this.pauser.startWith(!this.paused).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!==d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f},c.prototype.pause=function(){this.paused=!0,this.controller.onNext(!1)},c.prototype.resume=function(){this.paused=!1,this.controller.onNext(!0)},c}(Yc);Sc.pausableBuffered=function(a){return new Cf(this,a)};var Df=function(a){function b(b,c,d){a.call(this),this.subject=new Ef(c,d),this.source=b.multicast(this.subject).refCount()}return ac(b,a),b.prototype._subscribe=function(a){return this.source.subscribe(a)},b.prototype.request=function(a){return this.subject.request(null==a?-1:a)},b}(Yc),Ef=function(a){function b(b,c){null==b&&(b=!0),a.call(this),this.subject=new Hg,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=c||Cc}return ac(b,a),bc(b.prototype,Qc,{_subscribe:function(a){return this.subject.subscribe(a)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(Jc.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(Jc.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(Jc.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.schedule(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,ic(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),b}(Yc);Sc.controlled=function(a,b){return a&&vc(a)&&(b=a,a=!0),null==a&&(a=!0),new Df(this,a,b)};var Ff=function(a){function b(b){a.call(this),this.source=b}function c(a,b){return b.source.request(1)}ac(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new pc(this.subscription,Hc.schedule(this,c))};var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d,this.scheduleDisposable=null}function c(a,b){return b.observable.source.request(1)}return ac(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.scheduleDisposable=Hc.schedule(this,c)},b.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(Tc);return b}(Yc);Df.prototype.stopAndWait=function(){return new Ff(this)};var Gf=function(a){function b(b,c){a.call(this),this.source=b,this.windowSize=c}function c(a,b){return b.source.request(b.windowSize)}ac(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new pc(this.subscription,Hc.schedule(this,c))};var d=function(a){function b(b,c,d){this.observer=b,this.observable=c,this.cancel=d,this.received=0,this.scheduleDisposable=null,a.call(this)}function c(a,b){return b.observable.source.request(b.observable.windowSize)}return ac(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received&&(this.scheduleDisposable=Hc.schedule(this,c))},b.prototype.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(Tc);return b}(Yc);Df.prototype.windowed=function(a){return new Gf(this,a)},Sc.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(b)&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a};var Hf=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new pc(this._fn2(b).subscribe(a),b.connect())},b}(Zc);Sc.multicast=function(a,b){return Xa(a)?new Hf(this,a,b):new Kf(this,a)},Sc.publish=function(a){return a&&Xa(a)?this.multicast(function(){return new Hg},a):this.multicast(new Hg)},Sc.share=function(){return this.publish().refCount()},Sc.publishLast=function(a){return a&&Xa(a)?this.multicast(function(){return new Ig},a):this.multicast(new Ig)},Sc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Kg(b)},a):this.multicast(new Kg(a))},Sc.shareValue=function(a){return this.publishValue(a).refCount()},Sc.replay=function(a,b,c,d){return a&&Xa(a)?this.multicast(function(){return new Lg(b,c,d)},a):this.multicast(new Lg(b,c,d))},Sc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var If=function(a,b){this._s=a,this._o=b};If.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var Jf=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return ac(b,a),b.prototype.subscribeCore=function(a){var b=this.source.subscribe(a);return 1===++this._count&&(this._connectableSubscription=this.source.connect()),new c(this,b)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(Zc),Kf=Pa.ConnectableObservable=function(a){function b(b,c){this.source=b,this._connection=null,this._source=b.asObservable(),this._subject=c,a.call(this)}function c(a,b){this._p=a,this._s=b}return ac(b,a),c.prototype.dispose=function(){this._s&&(this._s.dispose(),this._s=null,this._p._connection=null)},b.prototype.connect=function(){if(!this._connection){if(this._subject.isStopped)return jc;var a=this._source.subscribe(this._subject);this._connection=new c(this,a)}return this._connection},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new Jf(this)},b}(Yc);Sc.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new Dg(function(b){return a().subscribe(b)})},Sc.join=function(a,b,c,d){var e=this;return new Dg(function(f){var g=new fc,h=!1,i=!1,j=0,k=0,l=new Uf,m=new Uf,n=function(a){f.onError(a)};return g.add(e.subscribe(function(a){var c=j++,e=new nc;l.set(c,a),g.add(e);var i=Za(b)(a);return i===Ya?f.onError(i.e):(e.setDisposable(i.take(1).subscribe(Qa,n,function(){l["delete"](c)&&0===l.size&&h&&f.onCompleted(),g.remove(e)})),void m.forEach(function(b){var c=Za(d)(a,b);return c===Ya?f.onError(c.e):void f.onNext(c)}))},n,function(){h=!0,(i||0===l.size)&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new nc;m.set(b,a),g.add(e);var h=Za(c)(a);return h===Ya?f.onError(h.e):(e.setDisposable(h.take(1).subscribe(Qa,n,function(){m["delete"](b)&&0===m.size&&i&&f.onCompleted(),g.remove(e)})),void l.forEach(function(b){var c=Za(d)(b,a);return c===Ya?f.onError(c.e):void f.onNext(c)}))},n,function(){i=!0,(h||0===m.size)&&f.onCompleted()})),g},e)},Sc.groupJoin=function(a,b,c,d){var e=this;return new Dg(function(f){function g(a){}var h=new fc,i=new rc(h),j=new Uf,k=new Uf,l=0,m=0,g=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(a){var c=new Hg,e=l++;j.set(e,c);var m=Za(d)(a,cc(c,i));if(m===Ya)return j.forEach(g(m.e)),f.onError(m.e);f.onNext(m),k.forEach(function(a){c.onNext(a)});var n=new nc;h.add(n);var o=Za(b)(a);return o===Ya?(j.forEach(g(o.e)),f.onError(o.e)):void n.setDisposable(o.take(1).subscribe(Qa,function(a){j.forEach(g(a)),f.onError(a)},function(){j["delete"](e)&&c.onCompleted(),h.remove(n)}))},function(a){j.forEach(g(a)),f.onError(a)},function(){f.onCompleted()})),h.add(a.subscribe(function(a){var b=m++;k.set(b,a);var d=new nc;h.add(d);var e=Za(c)(a);return e===Ya?(j.forEach(g(e.e)),f.onError(e.e)):(d.setDisposable(e.take(1).subscribe(Qa,function(a){j.forEach(g(a)),f.onError(a)},function(){k["delete"](b),h.remove(d)})),void j.forEach(function(b){b.onNext(a)}))},function(a){j.forEach(g(a)),f.onError(a)})),i},e)},Sc.buffer=function(){return this.window.apply(this,arguments).flatMap(O)},Sc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?ka.call(this,a):"function"==typeof a?la.call(this,a):ja.call(this,a,b)};var Lf=function(a){function b(b){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Mf(a))},b}(Zc),Mf=function(a){function b(b){this._o=b,this._p=null,this._hp=!1,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._hp?this._o.onNext([this._p,a]):this._hp=!0,this._p=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.pairwise=function(){return new Lf(this)},Sc.partition=function(a,b){var c=tb(a,b,3);return[this.filter(a,b),this.filter(function(a,b,d){return!c(a,b,d)})]};var Nf=function(a){function b(a,b){this.c=a,this.s=b}return ac(b,a),b.prototype[pb]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(_c);Sc.letBind=Sc.let=function(a){return a(this)},Yc["if"]=function(a,b,c){return md(function(){return c||(c=pd()),Wa(b)&&(b=jd(b)),Wa(c)&&(c=jd(c)),"function"==typeof c.now&&(c=pd(c)),a()?b:c})},Yc["for"]=Yc.forIn=function(a,b,c){return fd(a,b,c).concat()};var Of=Yc["while"]=Yc.whileDo=function(a,b){return Wa(b)&&(b=jd(b)),ma(a,b).concat()};Sc.doWhile=function(a){return Od([this,Of(a,this)])},Yc["case"]=function(a,b,c){return md(function(){Wa(c)&&(c=jd(c)),c||(c=pd()),vc(c)&&(c=pd(c));var d=b[a()];return Wa(d)&&(d=jd(d)),d||c})};var Pf=function(a){function b(b,c,d){this.source=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b){var c,d=a[0],e=a[1];if(!(d.q.length>0))return void(d.isAcquired=!1);c=d.q.shift();var f=new nc;d.d.add(f),f.setDisposable(c.subscribe(new Qf(d,e,f))),b([d,e])}return ac(b,a),b.prototype._ensureActive=function(a){var b=!1;a.q.length>0&&(b=!a.isAcquired,a.isAcquired=!0),b&&a.m.setDisposable(this._scheduler.scheduleRecursive([a,this],c))},b.prototype.subscribeCore=function(a){var b=new oc,c=new fc(b),d={q:[],m:b,d:c,activeCount:0,isAcquired:!1,o:a};return d.q.push(this.source),d.activeCount++,this._ensureActive(d),c},b}(Zc),Qf=function(a){function b(b,c,d){this._s=b,this._p=c,this._m1=d,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._s.o.onNext(a);var b=Za(this._p._fn)(a);return b===Ya?this._s.o.onError(b.e):(this._s.q.push(b),this._s.activeCount++,void this._p._ensureActive(this._s))},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.d.remove(this._m1),this._s.activeCount--,0===this._s.activeCount&&this._s.o.onCompleted()},b}(Tc);Sc.expand=function(a,b){return vc(b)||(b=Cc),new Pf(this,a,b)};var Rf=function(a){function b(b,c){this._sources=b,this._cb=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){if(0===this._sources.length)return a.onCompleted(),jc;for(var b=this._sources.length,c={finished:!1,hasResults:new Array(b),hasCompleted:new Array(b),results:new Array(b)},d=new fc,e=0,f=this._sources.length;f>e;e++){var g=this._sources[e];Wa(g)&&(g=jd(g)),d.add(g.subscribe(new Sf(a,c,e,this._cb,d)))}return d},b}(Zc),Sf=function(a){function b(b,c,d,e,f){this._o=b,this._s=c,this._i=d,this._cb=e,this._subs=f,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._s.finished||(this._s.hasResults[this._i]=!0,this._s.results[this._i]=a)},b.prototype.error=function(a){this._s.finished=!0,this._o.onError(a),this._subs.dispose()},b.prototype.completed=function(){if(!this._s.finished){if(!this._s.hasResults[this._i])return this._o.onCompleted();this._s.hasCompleted[this._i]=!0;for(var a=0;a<this._s.results.length;a++)if(!this._s.hasCompleted[a])return;this._s.finished=!0;var b=Za(this._cb).apply(null,this._s.results);if(b===Ya)return this._o.onError(b.e);this._o.onNext(b),this._o.onCompleted()}},b}(Tc);Yc.forkJoin=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Xa(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Rf(b,d)},Sc.forkJoin=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Yc.forkJoin.apply(null,b)},Sc.manySelect=Sc.extend=function(a,b){vc(b)||(b=Pa.Scheduler.immediate);var c=this;return md(function(){var d;return c.map(function(a){var b=new Tf(a);return d&&d.onNext(a),d=b,b}).tap(Qa,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Tf=function(a){function b(b){a.call(this),this.head=b,this.tail=new Ig}return ac(b,a),bc(b.prototype,Qc,{_subscribe:function(a){var b=new fc;return b.add(Cc.schedule(this,function(c,d){a.onNext(d.head),b.add(d.tail.mergeAll().subscribe(a))})),b},onCompleted:function(){this.onNext(Yc.empty())},onError:function(a){this.onNext(Yc["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),b}(Yc),Uf=Oa.Map||function(){function b(){this.size=0,this._values=[],this._keys=[]}return b.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1===c?a:this._values[c]},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},b.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},b}();na.prototype.and=function(a){return new na(this.patterns.concat(a))},na.prototype.thenDo=function(a){return new oa(this,a)},oa.prototype.activate=function(a,b,c){for(var d=[],e=pa(b),f=0,g=this.expression.patterns.length;g>f;f++)d.push(ra(a,this.expression.patterns[f],e));var h=new sa(d,qa(this,b),function(){for(var a=0,b=d.length;b>a;a++)d[a].removeActivePlan(h);c(h)});for(f=0,g=d.length;g>f;f++)d[f].addActivePlan(h);return h},sa.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},sa.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var Vf=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new nc,this.isDisposed=!1}ac(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.error);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Qa,c.completed=Qa,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(Tc);Sc.and=function(a){return new na([this,a])},Sc.thenDo=function(a){return new na([this]).thenDo(a)},Yc.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Dg(function(b){var c=[],d=new Uf,e=Rc(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){return Ed(h).subscribe(b)}var i=new fc;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var Wf=function(a){function b(b,c){this._dt=b,this._s=c,a.call(this)}function c(a,b){b.onNext(0),b.onCompleted()}return ac(b,a),b.prototype.subscribeCore=function(a){return this._s.scheduleFuture(a,this._dt,c)},b}(Zc),Xf=Yc.interval=function(a,b){return va(a,a,vc(b)?b:Hc)};Yc.timer=function(b,c,d){var e;return vc(d)||(d=Hc),null!=c&&"number"==typeof c?e=c:vc(c)&&(d=c),(b instanceof Date||"number"==typeof b)&&e===a?ta(b,d):b instanceof Date&&e!==a?ua(b,c,d):va(b,e,d)};Sc.delay=function(){var a=arguments[0];if("number"==typeof a||a instanceof Date){var b=a,c=arguments[1];return vc(c)||(c=Hc),b instanceof Date?xa(this,b,c):wa(this,b,c)}if(Yc.isObservable(a)||Xa(a))return ya(this,a,arguments[1]);throw new Error("Invalid arguments")};var Yf=function(a){function b(b,c,d){vc(d)||(d=Hc),this.source=b,this._dt=c,this._s=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new oc;return new pc(this.source.subscribe(new Zf(a,this._dt,this._s,b)),b)},b}(Zc),Zf=function(a){function b(b,c,d,e){this._o=b,this._d=c,this._scheduler=d,this._c=e,this._v=null,this._hv=!1,this._id=0,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._hv=!0,this._v=a;var b=++this._id,c=new nc;this._c.setDisposable(c),c.setDisposable(this._scheduler.scheduleFuture(this,this._d,function(c,d){d._hv&&d._id===b&&d._o.onNext(a),d._hv=!1}))},b.prototype.error=function(a){this._c.dispose(),this._o.onError(a),this._hv=!1,this._id++},b.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},b}(Tc);Sc.debounce=function(){if(Xa(arguments[0]))return za(this,arguments[0]);if("number"==typeof arguments[0])return new Yf(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},Sc.windowWithTime=Sc.windowTime=function(a,b,c){var d,e=this;return null==b&&(d=a),vc(c)||(c=Hc),"number"==typeof b?d=b:vc(b)&&(d=a,c=b),new Dg(function(b){function f(){var a=new nc,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleFuture(null,o,function(){if(g){var a=new Hg;k.push(a),b.onNext(cc(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new oc,m=0;return g=new fc(l),h=new rc(g),k.push(new Hg),b.onNext(cc(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},Sc.windowWithTimeOrCount=Sc.windowTimeOrCount=function(a,b,c){var d=this;return vc(c)||(c=Hc),new Dg(function(e){function f(b){var d=new nc;g.setDisposable(d),d.setDisposable(c.scheduleFuture(null,a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Hg,e.onNext(cc(l,i)),f(a)}}))}var g=new oc,h=new fc(g),i=new rc(h),j=0,k=0,l=new Hg;return e.onNext(cc(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new Hg,e.onNext(cc(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},Sc.bufferWithTime=Sc.bufferTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(O)},Sc.bufferWithTimeOrCount=Sc.bufferTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(O)};var $f=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new _f(a,this._s))},b}(Zc),_f=function(a){function b(b,c){this._o=b,this._s=c,this._l=c.now(),a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=this._s.now(),c=b-this._l;this._l=b,this._o.onNext({value:a,interval:c})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.timeInterval=function(a){return vc(a)||(a=Hc),new $f(this,a)};var ag=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new bg(a,this._s))},b}(Zc),bg=function(a){function b(b,c){this._o=b,this._s=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._o.onNext({value:a,timestamp:this._s.now()})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.timestamp=function(a){return vc(a)||(a=Hc),new ag(this,a)};var cg=function(a){function b(b,c){this.source=b,this._sampler=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b={o:a,atEnd:!1,value:null,hasValue:!1,sourceSubscription:new nc};return b.sourceSubscription.setDisposable(this.source.subscribe(new eg(b))),new pc(b.sourceSubscription,this._sampler.subscribe(new dg(b)))},b}(Zc),dg=function(a){function b(b){this._s=b,a.call(this)}return ac(b,a),b.prototype._handleMessage=function(){this._s.hasValue&&(this._s.hasValue=!1,this._s.o.onNext(this._s.value)),this._s.atEnd&&this._s.o.onCompleted()},b.prototype.next=function(){this._handleMessage()},b.prototype.error=function(a){this._s.onError(a)},b.prototype.completed=function(){this._handleMessage()},b}(Tc),eg=function(a){function b(b){this._s=b,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._s.hasValue=!0,this._s.value=a},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.atEnd=!0,this._s.sourceSubscription.dispose()},b}(Tc);Sc.sample=function(a,b){return vc(b)||(b=Hc),"number"==typeof a?new cg(this,Xf(a,b)):new cg(this,a)};var fg=Pa.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};fg.prototype=Object.create(Error.prototype),Sc.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return Ba(this,a,arguments[1],arguments[2]);if(Yc.isObservable(a)||Xa(a))return Aa(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")};var gg=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,a.call(this)}function c(a,b){if(a.hasResult&&a.o.onNext(a.result),a.first)a.first=!1;else if(a.newState=Za(a.self._itrFn)(a.newState),a.newState===Ya)return a.o.onError(a.newState.e);if(a.hasResult=Za(a.self._cndFn)(a.newState),a.hasResult===Ya)return a.o.onError(a.hasResult.e);if(a.hasResult){if(a.result=Za(a.self._resFn)(a.newState),a.result===Ya)return a.o.onError(a.result.e);var c=Za(a.self._timeFn)(a.newState);if(c===Ya)return a.o.onError(c.e);b(a,c)}else a.o.onCompleted()}return ac(b,a),b.prototype.subscribeCore=function(a){var b={o:a,self:this,newState:this._state,first:!0,hasResult:!1};return this._s.scheduleRecursiveFuture(b,new Date(this._s.now()),c)},b}(Zc);Yc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return vc(f)||(f=Hc),new gg(a,b,c,d,e,f)};var hg=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,a.call(this)}function c(a,b){if(a.hasResult&&a.o.onNext(a.result),a.first)a.first=!1;else if(a.newState=Za(a.self._itrFn)(a.newState),a.newState===Ya)return a.o.onError(a.newState.e);if(a.hasResult=Za(a.self._cndFn)(a.newState),a.hasResult===Ya)return a.o.onError(a.hasResult.e);if(a.hasResult){if(a.result=Za(a.self._resFn)(a.newState),a.result===Ya)return a.o.onError(a.result.e);var c=Za(a.self._timeFn)(a.newState);if(c===Ya)return a.o.onError(c.e);b(a,c)}else a.o.onCompleted()}return ac(b,a),b.prototype.subscribeCore=function(a){var b={o:a,self:this,newState:this._state,first:!0,hasResult:!1};return this._s.scheduleRecursiveFuture(b,0,c)},b}(Zc);Yc.generateWithRelativeTime=function(a,b,c,d,e,f){return vc(f)||(f=Hc),new hg(a,b,c,d,e,f)};var ig=function(a){function b(b,c,d){this.source=b,this._dt=c,this._s=d,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];e.setDisposable(c.subscribe(d))}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new oc;return b.setDisposable(this._s.scheduleFuture([this.source,a,b],this._dt,c)),b},b}(Zc);Sc.delaySubscription=function(a,b){return vc(b)||(b=Hc),new ig(this,a,b)};var jg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new kg(a,this))},b}(Zc),kg=function(a){function b(b,c){this._o=b, this._s=c._s,this._d=c._d,this._q=[],a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0&&a-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value);this._o.onCompleted()},b}(Tc);Sc.skipLastWithTime=function(a,b){return vc(b)||(b=Hc),new jg(this,a,b)};var lg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new mg(a,this._d,this._s))},b}(Zc),mg=function(a){function b(b,c,d){this._o=b,this._d=c,this._s=d,this._q=[],a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0;){var b=this._q.shift();a-b.interval<=this._d&&this._o.onNext(b.value)}this._o.onCompleted()},b}(Tc);Sc.takeLastWithTime=function(a,b){return vc(b)||(b=Hc),new lg(this,a,b)},Sc.takeLastBufferWithTime=function(a,b){var c=this;return vc(b)||(b=Hc),new Dg(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)};var ng=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}function c(a,b){b.onCompleted()}return ac(b,a),b.prototype.subscribeCore=function(a){return new pc(this._s.scheduleFuture(a,this._d,c),this.source.subscribe(a))},b}(Zc);Sc.takeWithTime=function(a,b){return vc(b)||(b=Hc),new ng(this,a,b)};var og=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,this._open=!1,a.call(this)}function c(a,b){b._open=!0}return ac(b,a),b.prototype.subscribeCore=function(a){return new pc(this._s.scheduleFuture(this,this._d,c),this.source.subscribe(new pg(a,this)))},b}(Zc),pg=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.skipWithTime=function(a,b){return vc(b)||(b=Hc),new og(this,a,b)};var qg=function(a){function b(b,c,d){this.source=b,this._st=c,this._s=d,a.call(this)}function c(a,b){b._open=!0}return ac(b,a),b.prototype.subscribeCore=function(a){return this._open=!1,new pc(this._s.scheduleFuture(this,this._st,c),this.source.subscribe(new rg(a,this)))},b}(Zc),rg=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Sc.skipUntilWithTime=function(a,b){return vc(b)||(b=Hc),new qg(this,a,b)},Sc.takeUntilWithTime=function(a,b){vc(b)||(b=Hc);var c=this;return new Dg(function(d){return new pc(b.scheduleFuture(d,a,function(a,b){b.onCompleted()}),c.subscribe(d))},c)},Sc.throttle=function(a,b){vc(b)||(b=Hc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Dg(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var sg=function(a){function b(b){this.source=b,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){var b=new nc,c=new fc,d={hasCurrent:!1,isStopped:!1,o:a,g:c};return c.add(b),b.setDisposable(this.source.subscribe(new tg(d))),c},b}(Zc),tg=function(a){function b(b){this._s=b,a.call(this)}function c(b,c){this._s=b,this._i=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){if(!this._s.hasCurrent){this._s.hasCurrent=!0,Wa(a)&&(a=jd(a));var b=new nc;this._s.g.add(b),b.setDisposable(a.subscribe(new c(this._s,b)))}},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.isStopped=!0,!this._s.hasCurrent&&1===this._s.g.length&&this._s.o.onCompleted()},ac(c,a),c.prototype.next=function(a){this._s.o.onNext(a)},c.prototype.error=function(a){this._s.o.onError(a)},c.prototype.completed=function(){this._s.g.remove(this._i),this._s.hasCurrent=!1,this._s.isStopped&&1===this._s.g.length&&this._s.o.onCompleted()},b}(Tc);Sc.switchFirst=function(){return new sg(this)},Sc.flatMapFirst=Sc.exhaustMap=function(a,b,c){return new $c(this,a,b,c).switchFirst()},Sc.flatMapWithMaxConcurrent=Sc.flatMapMaxConcurrent=function(a,b,c,d){return new $c(this,b,c,d).merge(a)};var ug=function(a){function b(b,c){this._o=b,this._xform=c,a.call(this)}return ac(b,a),b.prototype.next=function(a){var b=Za(this._xform["@@transducer/step"]).call(this._xform,this._o,a);b===Ya&&this._o.onError(b.e)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._xform["@@transducer/result"](this._o)},b}(Tc);Sc.transduce=function(a){var b=this;return new Dg(function(c){var d=a(Ca(c));return b.subscribe(new ug(c,d))},b)};var vg=Pa.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new dc(1024),a.call(this)}ac(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=ob,c.toAbsoluteTime=ob,c.toRelativeTime=ob,c.schedulePeriodic=function(a,b,c){var d=new yc(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new lb;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new lb;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new lb;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new sc(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},b}(tc);Pa.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Ua;a.call(this,d,e)}ac(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toAbsoluteTime=function(a){return new Date(a).getTime()},c.toRelativeTime=function(a){return a},b}(Pa.VirtualTimeScheduler),Da.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},Ea.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.error)};var wg=Pa.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new xg(a,new Da(b)):new xg(a,Jc.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new xg(a,new Ea(b)):new xg(a,Jc.createOnError(b))},onCompleted:function(a){return new xg(a,Jc.createOnCompleted())},subscribe:function(a,b){return new yg(a,b)}},xg=Pa.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||Ta};xg.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},xg.prototype.toString=function(){return this.value.toString()+"@"+this.time};var yg=Pa.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};yg.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},yg.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var zg=Pa.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};zg.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var Ag=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}ac(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new xg(this.scheduler.clock,Jc.createOnNext(a)))},c.onError=function(a){this.messages.push(new xg(this.scheduler.clock,Jc.createOnError(a)))},c.onCompleted=function(){this.messages.push(new xg(this.scheduler.clock,Jc.createOnCompleted()))},b}(Qc);Fa.prototype.then=function(b,c){var d=this;this.subscriptions.push(new yg(this.scheduler.clock));var e,f=this.subscriptions.length-1,g=Pa.Observer.create(function(c){var h=b(c);if(h&&"function"==typeof h.then)e=h;else{var i=d.scheduler.clock;e=new Fa(d.scheduler,[Pa.ReactiveTest.onNext(i,a),Pa.ReactiveTest.onCompleted(i)])}var j=d.observers.indexOf(g);d.observers.splice(j,1),d.subscriptions[f]=new yg(d.subscriptions[f].subscribe,d.scheduler.clock)},function(a){c(a);var b=d.observers.indexOf(g);d.observers.splice(b,1),d.subscriptions[f]=new yg(d.subscriptions[f].subscribe,d.scheduler.clock)});return this.observers.push(g),e||new Fa(this.scheduler,this.messages)};var Bg=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return jc})}(e)}return ac(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new yg(this.scheduler.clock));var c=this.subscriptions.length-1;return ic(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new yg(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(Yc),Cg=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return ac(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new yg(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new fc,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),jc}))}(c);return ic(function(){d.subscriptions[e]=new yg(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(Yc);Pa.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function c(){a.call(this,0,b)}return ac(c,a),c.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},c.prototype.add=function(a,b){return a+b},c.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},c.prototype.toRelativeTime=function(a){return a},c.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=wg.created),null==b.subscribed&&(b.subscribed=wg.subscribed),null==b.disposed&&(b.disposed=wg.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),jc}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),jc}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),jc}),this.start(),e},c.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Bg(this,a)},c.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Cg(this,a)},c.prototype.createResolvedPromise=function(a,b){return new Fa(this,[Pa.ReactiveTest.onNext(a,b),Pa.ReactiveTest.onCompleted(a)])},c.prototype.createRejectedPromise=function(a,b){return new Fa(this,[Pa.ReactiveTest.onError(a,b)])},c.prototype.createObserver=function(){return new Ag(this)},c}(vg);var Dg=Pa.AnonymousObservable=function(a){function b(a){return a&&Xa(a.dispose)?a:Xa(a)?ic(a):jc}function c(a,c){var d=c[0],f=c[1],g=Za(f.__subscribe).call(f,d);g!==Ya||d.fail(Ya.e)||e(Ya.e),d.setDisposable(b(g))}function d(b,c){this.source=c,this.__subscribe=b,a.call(this)}return ac(d,a),d.prototype._subscribe=function(a){var b=new Eg(a),d=[b,this];return Cc.scheduleRequired()?Cc.schedule(d,c):c(null,d),b},d}(Yc),Eg=function(a){function b(b){a.call(this),this.observer=b,this.m=new nc}ac(b,a);var c=b.prototype;return c.next=function(a){var b=Za(this.observer.onNext).call(this.observer,a);b===Ya&&(this.dispose(),e(b.e))},c.error=function(a){var b=Za(this.observer.onError).call(this.observer,a);this.dispose(),b===Ya&&e(b.e)},c.completed=function(){var a=Za(this.observer.onCompleted).call(this.observer);this.dispose(),a===Ya&&e(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Tc),Fg=function(a){function b(b,c){this._m=b,this._u=c,a.call(this)}return ac(b,a),b.prototype.subscribeCore=function(a){return new pc(this._m.getDisposable(),this._u.subscribe(a))},b}(Zc),Gg=function(a){function b(b,c,d){a.call(this),this.key=b,this.underlyingObservable=d?new Fg(d,c):c}return ac(b,a),b.prototype._subscribe=function(a){return this.underlyingObservable.subscribe(a)},b}(Yc),Hg=Pa.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return ac(b,a),bc(b.prototype,Qc.prototype,{_subscribe:function(a){return lc(this),this.isStopped?this.hasError?(a.onError(this.error),jc):(a.onCompleted(),jc):(this.observers.push(a),new If(this,a))},hasObservers:function(){return lc(this),this.observers.length>0},onCompleted:function(){if(lc(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(lc(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(lc(this),!this.isStopped)for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),b.create=function(a,b){return new Jg(a,b)},b}(Yc),Ig=Pa.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return ac(b,a),bc(b.prototype,Qc.prototype,{_subscribe:function(a){return lc(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),jc):(this.observers.push(a),new If(this,a))},hasObservers:function(){return lc(this),this.observers.length>0},onCompleted:function(){var a,b;if(lc(this),!this.isStopped){this.isStopped=!0;var d=c(this.observers),b=d.length;if(this.hasValue)for(a=0;b>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;b>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(lc(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){lc(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(Yc),Jg=Pa.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return ac(b,a),bc(b.prototype,Qc.prototype,{_subscribe:function(a){return this.observable.subscribe(a)},onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(Yc),Kg=Pa.BehaviorSubject=function(a){function b(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return ac(b,a),bc(b.prototype,Qc.prototype,{_subscribe:function(a){return lc(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),jc):(this.observers.push(a),a.onNext(this.value),new If(this,a))},getValue:function(){return lc(this),this.hasError&&e(this.error),this.value},hasObservers:function(){return lc(this),this.observers.length>0},onCompleted:function(){if(lc(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(lc(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(lc(this),!this.isStopped){this.value=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.error=null}}),b}(Yc),Lg=Pa.ReplaySubject=function(a){function b(a,b){return ic(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(b,c,d){this.bufferSize=null==b?e:b,this.windowSize=null==c?e:c,this.scheduler=d||Cc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var e=Math.pow(2,53)-1;return ac(d,a),bc(d.prototype,Qc.prototype,{_subscribe:function(a){lc(this);var c=new Wc(this.scheduler,a),d=b(this,c);this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d},hasObservers:function(){return lc(this),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(lc(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var d=0,e=c(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(lc(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var d=0,e=c(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(lc(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,d=c(this.observers),e=d.length;e>b;b++){var f=d[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),d}(Yc);Pa.Pauser=function(a){function b(){a.call(this)}return ac(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Hg),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Oa.Rx=Pa,define(function(){return Pa})):Ha&&Ia?Ma?(Ia.exports=Pa).Rx=Pa:Ha.Rx=Pa:Oa.Rx=Pa;var Mg=j()}).call(this); //# sourceMappingURL=rx.all.compat.map