forked from Reactive-Extensions/RxJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrx.min.js
More file actions
4 lines (4 loc) · 44.6 KB
/
Copy pathrx.min.js
File metadata and controls
4 lines (4 loc) · 44.6 KB
1
2
3
4
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(T)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&tb(a)&&(a=vb.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===lb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==mb){var g=a.constructor,h=-1,i=qb.length;if(a===(g&&g.prototype))var j=a===nb?hb:a===lb?cb:ib.call(a),k=rb[j];for(;++h<i;)f=qb[h],k&&k[f]||!jb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=ib.call(a),k=ib.call(b);if(j==$&&(j=fb),k==$&&(k=fb),j!=k)return!1;switch(j){case ab:case bb:return+a==+b;case eb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case gb:case hb:return a==String(b)}var l=j==_;if(!l){if(j!=fb||!sb.nodeClass&&(g(a)||g(b)))return!1;var m=!sb.argsObject&&tb(a)?Object:a.constructor,n=!sb.argsObject&&tb(b)?Object:b.constructor;if(!(m==n||jb.call(a,"constructor")&&jb.call(b,"constructor")||R(m)&&m instanceof m&&R(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return jb.call(f,e)?(p++,q=jb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return jb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:vb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&D.isFinite(a)}function r(b){var c,d=b[U];if(!d&&"string"==typeof b)return c=new m(b),c[U]();if(!d&&b.length!==a)return c=new o(b),c[U]();if(!d)throw new TypeError("Object is not iterable");return b[U]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>mc?mc:b):b}function v(a,b){return K(a)||(a=Ob),new xc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new xc(function(c){var d=new Gb,e=new Hb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Q(f)&&(f=jc(f)),d=new Gb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new xc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=jc(f)),(X(f)||W(f))&&(f=nc(f)),f}).concatAll()}function z(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function A(a){this.comparer=a,this.set=[]}function B(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=jc(f)),(X(f)||W(f))&&(f=nc(f)),f}).mergeAll()}var C={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},D=C[typeof window]&&window||this,E=C[typeof exports]&&exports&&!exports.nodeType&&exports,F=C[typeof module]&&module&&!module.nodeType&&module,G=F&&F.exports===E&&E,H=C[typeof global]&&global;!H||H.global!==H&&H.window!==H||(D=H);var I={internals:{},config:{Promise:D.Promise},helpers:{}},J=I.helpers.noop=function(){},K=(I.helpers.notDefined=function(a){return"undefined"==typeof a},I.helpers.isScheduler=function(a){return a instanceof I.Scheduler}),L=I.helpers.identity=function(a){return a},M=(I.helpers.pluck=function(a){return function(b){return b[a]}},I.helpers.just=function(a){return function(){return a}},I.helpers.defaultNow=Date.now),N=I.helpers.defaultComparer=function(a,b){return ub(a,b)},O=I.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},P=(I.helpers.defaultKeySerializer=function(a){return a.toString()},I.helpers.defaultError=function(a){throw a}),Q=I.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},R=(I.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},I.helpers.not=function(a){return!a},I.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ib.call(a)}),a}()),S="Argument out of range",T="Object has been disposed",U="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";D.Set&&"function"==typeof(new D.Set)["@@iterator"]&&(U="@@iterator");var V=I.doneEnumerator={done:!0,value:a},W=I.helpers.isIterable=function(b){return b[U]!==a},X=I.helpers.isArrayLike=function(b){return b&&b.length!==a};I.helpers.iterator=U;var Y,Z=I.helpers.deprecate=function(){},$="[object Arguments]",_="[object Array]",ab="[object Boolean]",bb="[object Date]",cb="[object Error]",db="[object Function]",eb="[object Number]",fb="[object Object]",gb="[object RegExp]",hb="[object String]",ib=Object.prototype.toString,jb=Object.prototype.hasOwnProperty,kb=ib.call(arguments)==$,lb=Error.prototype,mb=Object.prototype,nb=String.prototype,ob=mb.propertyIsEnumerable;try{Y=!(ib.call(document)==fb&&!({toString:0}+""))}catch(pb){Y=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[_]=rb[bb]=rb[eb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[ab]=rb[hb]={constructor:!0,toString:!0,valueOf:!0},rb[cb]=rb[db]=rb[gb]={constructor:!0,toString:!0},rb[fb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(lb,"message")||ob.call(lb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1);var tb=function(a){return a&&"object"==typeof a?ib.call(a)==$:!1};kb||(tb=function(a){return a&&"object"==typeof a?jb.call(a,"callee"):!1});var ub=I.internals.isEqual=function(a,b){return h(a,b,[],[])},vb=Array.prototype.slice,wb=({}.hasOwnProperty,this.inherits=I.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),xb=I.internals.addProperties=function(a){for(var b=vb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},yb=I.internals.addRef=function(a,b){return new xc(function(c){return new Bb(b.getDisposable(),a.subscribe(c))})};k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var zb=I.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ab=zb.prototype;Ab.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ab.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Ab.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Ab.peek=function(){return this.items[0].value},Ab.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ab.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ab.enqueue=function(a){var b=this.length++;this.items[b]=new k(zb.count++,a),this.percolate(b)},Ab.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},zb.count=0;var Bb=I.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Cb=Bb.prototype;Cb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Cb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Cb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Cb.toArray=function(){return this.disposables.slice(0)};var Db=I.Disposable=function(a){this.isDisposed=!1,this.action=a||J};Db.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Eb=Db.create=function(a){return new Db(a)},Fb=Db.empty={dispose:J},Gb=I.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Hb=I.SerialDisposable=Gb,Ib=I.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Fb:new a(this)},b}();l.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Jb=I.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||O,this.disposable=new Gb};Jb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Jb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Jb.prototype.isCancelled=function(){return this.disposable.isDisposed},Jb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Kb=I.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Fb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=M,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Lb=Kb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Bb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Fb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Bb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Fb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Kb.prototype),function(){Kb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Kb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof D.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=D.setInterval(function(){d=c(d)},b);return Eb(function(){D.clearInterval(e)})}}(Kb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Tb(this,a)}}(Kb.prototype);var Mb,Nb=(I.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Gb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Kb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Lb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Kb(M,a,b,c)}()),Ob=Kb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Kb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Kb.normalize(c),g=new Jb(this,b,d,f);if(e)e.enqueue(g);else{e=new zb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Kb(M,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Pb=J,Qb=function(){var a,b=J;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!D.setTimeout)throw new Error("No concurrency detected!");a=D.setTimeout,b=D.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Rb=Qb.setTimeout,Sb=Qb.clearTimeout;!function(){function a(){if(!D.postMessage||D.importScripts)return!1;var a=!1,b=D.onmessage;return D.onmessage=function(){a=!0},D.postMessage("","*"),D.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(ib).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=H&&G&&H.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=H&&G&&H.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Mb=d,Pb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Mb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;D.addEventListener?D.addEventListener("message",b,!1):D.attachEvent("onmessage",b,!1),Mb=function(a){var b=h++;g[b]=a,D.postMessage(f+b,"*")}}else if(D.MessageChannel){var i=new D.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Mb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in D&&"onreadystatechange"in D.document.createElement("script")?Mb=function(a){var b=D.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},D.document.documentElement.appendChild(b)}:(Mb=function(a){return Rb(a,0)},Pb=Sb)}();var Tb=(Kb.timeout=function(){function a(a,b){var c=this,d=new Gb,e=Mb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Bb(d,Eb(function(){Pb(e)}))}function b(a,b,c){var d=this,e=Kb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Gb,g=Rb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Bb(f,Eb(function(){Sb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Kb(M,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return wb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Fb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Gb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Kb)),Ub=I.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return K(a)||(a=Nb),new xc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Vb=Ub.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Ub("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Wb=Ub.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Ub("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Xb=Ub.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Ub("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Yb=I.internals.Enumerator=function(a){this._next=a};Yb.prototype.next=function(){return this._next()},Yb.prototype[U]=function(){return this};var Zb=I.internals.Enumerable=function(a){this._iterator=a};Zb.prototype[U]=function(){return this._iterator()},Zb.prototype.concat=function(){var a=this;return new xc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f=new Hb,g=Nb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next(),console.log("current item"+d)}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Q(h)&&(h=jc(h));var i=new Gb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Bb(f,g,Eb(function(){e=!0}))})},Zb.prototype.catchError=function(){var a=this;return new xc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f,g=new Hb,h=Nb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Q(i)&&(i=jc(i));var j=new Gb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Bb(g,h,Eb(function(){e=!0}))})};var $b=Zb.repeat=function(a,b){return null==b&&(b=-1),new Zb(function(){var c=b;return new Yb(function(){return 0===c?V:(c>0&&c--,{done:!1,value:a})})})},_b=Zb.of=function(a,b,c){return new Zb(function(){var d=-1;return new Yb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:V})})},ac=I.Observer=function(){};ac.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ac.prototype.asObserver=function(){return new ec(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},ac.prototype.checked=function(){return new fc(this)};var bc=ac.create=function(a,b,c){return a||(a=J),b||(b=P),c||(c=J),new ec(a,b,c)};ac.fromNotifier=function(a,b){return new ec(function(c){return a.call(b,Vb(c))},function(c){return a.call(b,Wb(c))},function(){return a.call(b,Xb())})},ac.prototype.notifyOn=function(a){return new hc(a,this)};var cc,dc=I.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return wb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ac),ec=I.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return wb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(dc),fc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}wb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(ac),gc=I.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Hb}return wb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(dc),hc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return wb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(gc),ic=I.Observable=function(){function a(a){this._subscribe=a}return cc=a.prototype,cc.subscribe=cc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:bc(a,b,c))},cc.subscribeOnNext=function(a,b){return this._subscribe(bc(2===arguments.length?function(c){a.call(b,c)}:a))},cc.subscribeOnError=function(a,b){return this._subscribe(bc(null,2===arguments.length?function(c){a.call(b,c)}:a))},cc.subscribeOnCompleted=function(a,b){return this._subscribe(bc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();cc.observeOn=function(a){var b=this;return new xc(function(c){return b.subscribe(new hc(a,c))})},cc.subscribeOn=function(a){var b=this;return new xc(function(c){var d=new Gb,e=new Hb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new l(a,b.subscribe(c)))})),e})};var jc=ic.fromPromise=function(a){return kc(function(){var b=new I.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};cc.toPromise=function(a){if(a||(a=I.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},cc.toArray=function(){var a=this;return new xc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},ic.create=ic.createWithDisposable=function(a){return new xc(a)};var kc=ic.defer=function(a){return new xc(function(b){var c;try{c=a()}catch(d){return rc(d).subscribe(b)}return Q(c)&&(c=jc(c)),c.subscribe(b)})},lc=ic.empty=function(a){return K(a)||(a=Nb),new xc(function(b){return a.schedule(function(){b.onCompleted()})})},mc=Math.pow(2,53)-1;m.prototype[U]=function(){return new n(this._s)},n.prototype[U]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return V},o.prototype[U]=function(){return new p(this._a)},p.prototype[U]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return V};var nc=ic.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!R(b))throw new Error("mapFn when provided must be a function");K(d)||(d=Ob);var e=Object(a),f=r(e);return new xc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&R(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},oc=ic.fromArray=function(a,b){return Z("fromArray","from"),K(b)||(b=Ob),new xc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};ic.generate=function(a,b,c,d,e){return K(e)||(e=Ob),new xc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var pc=ic.never=function(){return new xc(function(){return Fb})};ic.of=function(){return v(null,arguments)},ic.ofWithScheduler=function(a){return v(a,vb.call(arguments,1))},ic.range=function(a,b,c){return K(c)||(c=Ob),new xc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},ic.repeat=function(a,b,c){return K(c)||(c=Ob),qc(a,c).repeat(null==b?-1:b)};var qc=ic["return"]=ic.just=function(a,b){return K(b)||(b=Nb),new xc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};ic.returnValue=function(){return Z("returnValue","return or just"),qc.apply(null,arguments)};var rc=ic["throw"]=ic.throwException=ic.throwError=function(a,b){return K(b)||(b=Nb),new xc(function(c){return b.schedule(function(){c.onError(a)})})};ic.using=function(a,b){return new xc(function(c){var d,e,f=Fb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Bb(rc(g).subscribe(c),f)}return new Bb(e.subscribe(c),f)})},cc.amb=function(a){var b=this;return new xc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Gb,j=new Gb;return Q(a)&&(a=jc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Bb(i,j)})},ic.amb=function(){function a(a,b){return a.amb(b)}for(var b=pc(),c=i(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},cc["catch"]=cc.catchError=function(a){return"function"==typeof a?w(this,a):sc([this,a])},cc.catchException=function(a){return Z("catchException","catch or catchError"),this.catchError(a)};var sc=ic.catchError=ic["catch"]=function(){return _b(i(arguments,0)).catchError()};ic.catchException=function(){return Z("catchException","catch or catchError"),sc.apply(null,arguments)},cc.combineLatest=function(){var a=vb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),tc.apply(this,a)};var tc=ic.combineLatest=function(){var a=vb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new xc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(L))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(L)&&c.onCompleted()}function e(a){k[a]=!0,k.every(L)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Gb;Q(f)&&(f=jc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Bb(m)})};cc.concat=function(){var a=vb.call(arguments,0);return a.unshift(this),uc.apply(this,a)};var uc=ic.concat=function(){return _b(i(arguments,0)).concat()};cc.concatAll=function(){return this.merge(1)},cc.concatObservable=function(){return Z("concatObservable","concatAll"),this.merge(1)},cc.merge=function(a){if("number"!=typeof a)return vc(this,a);var b=this;return new xc(function(c){function d(a){var b=new Gb;f.add(b),Q(a)&&(a=jc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Bb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var vc=ic.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=vb.call(arguments,1)):(a=Nb,b=vb.call(arguments,0)):(a=Nb,b=vb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};cc.mergeAll=function(){var a=this;return new xc(function(b){var c=new Bb,d=!1,e=new Gb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Gb;c.add(e),Q(a)&&(a=jc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},cc.mergeObservable=function(){return Z("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},cc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return wc([this,a])};var wc=ic.onErrorResumeNext=function(){var a=i(arguments,0);return new xc(function(b){var c=0,d=new Hb,e=Nb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Q(f)&&(f=jc(f)),g=new Gb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Bb(d,e)})};cc.skipUntil=function(a){var b=this;return new xc(function(c){var d=!1,e=new Bb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Q(a)&&(a=jc(a));var f=new Gb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},cc["switch"]=cc.switchLatest=function(){var a=this;return new xc(function(b){var c=!1,d=new Hb,e=!1,f=0,g=a.subscribe(function(a){var g=new Gb,h=++f;
c=!0,d.setDisposable(g),Q(a)&&(a=jc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Bb(g,d)})},cc.takeUntil=function(a){var b=this;return new xc(function(c){return Q(a)&&(a=jc(a)),new Bb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),J))})},cc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=vb.call(arguments),c=b.pop();return b.unshift(a),new xc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(L)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Gb;Q(c)&&(c=jc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Bb(k)})},ic.zip=function(){var a=vb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},ic.zipArray=function(){var a=i(arguments,0);return new xc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(L))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(L)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Gb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Bb(h);return k.add(Eb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},cc.asObservable=function(){return new xc(this.subscribe.bind(this))},cc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},cc.dematerialize=function(){var a=this;return new xc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},cc.distinctUntilChanged=function(a,b){var c=this;return a||(a=L),b||(b=N),new xc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},cc["do"]=cc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new xc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},cc.doAction=function(){return Z("doAction","do or tap"),this.tap.apply(this,arguments)},cc.doOnNext=cc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},cc.doOnError=cc.tapOnError=function(a,b){return this.tap(J,2===arguments.length?function(c){a.call(b,c)}:a)},cc.doOnCompleted=cc.tapOnCompleted=function(a,b){return this.tap(J,null,2===arguments.length?function(){a.call(b)}:a)},cc["finally"]=cc.ensure=function(a){var b=this;return new xc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Eb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},cc.finallyAction=function(a){return Z("finallyAction","finally or ensure"),this.ensure(a)},cc.ignoreElements=function(){var a=this;return new xc(function(b){return a.subscribe(J,b.onError.bind(b),b.onCompleted.bind(b))})},cc.materialize=function(){var a=this;return new xc(function(b){return a.subscribe(function(a){b.onNext(Vb(a))},function(a){b.onNext(Wb(a)),b.onCompleted()},function(){b.onNext(Xb()),b.onCompleted()})})},cc.repeat=function(a){return $b(this,a).concat()},cc.retry=function(a){return $b(this,a).catchError()},cc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new xc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},cc.skipLast=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},cc.startWith=function(){var a,b,c=0;return arguments.length&&K(arguments[0])?(b=arguments[0],c=1):b=Nb,a=vb.call(arguments,c),_b([oc(a,b),this]).concat()},cc.takeLast=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},cc.takeLastBuffer=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},cc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(S);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(S);return new xc(function(d){function e(){var a=new Ac;i.push(a),d.onNext(yb(a,g))}var f=new Gb,g=new Ib(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},cc.selectConcat=cc.concatMap=function(a,b,c){return R(a)&&R(b)?this.concatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=jc(e)),(X(e)||W(e))&&(e=nc(e)),e.map(function(a,e){return b(c,a,d,e)})}):R(a)?y(this,a,c):y(this,function(){return a})},cc.concatMapObserver=cc.selectConcatObserver=function(a,b,c,d){var e=this;return new xc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=jc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},cc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new xc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},A.prototype.push=function(a){var b=-1===z(this.set,a,this.comparer);return b&&this.set.push(a),b},cc.distinct=function(a,b){var c=this;return b||(b=N),new xc(function(d){var e=new A(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.select=cc.map=function(a,b){var c=R(a)?a:function(){return a},d=this;return new xc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},cc.pluck=function(a){return this.map(function(b){return b[a]})},cc.flatMapObserver=cc.selectManyObserver=function(a,b,c,d){var e=this;return new xc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=jc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},cc.selectMany=cc.flatMap=function(a,b,c){return R(a)&&R(b)?this.flatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=jc(e)),(X(e)||W(e))&&(e=nc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):R(a)?B(this,a,c):B(this,function(){return a})},cc.selectSwitch=cc.flatMapLatest=cc.switchMap=function(a,b){return this.select(a,b).switchLatest()},cc.skip=function(a){if(0>a)throw new Error(S);var b=this;return new xc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},cc.skipWhile=function(a,b){var c=this;return new xc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.take=function(a,b){if(0>a)throw new RangeError(S);if(0===a)return lc(b);var c=this;return new xc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},cc.takeWhile=function(a,b){var c=this;return new xc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},cc.where=cc.filter=function(a,b){var c=this;return new xc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new xc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var xc=I.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Eb(a):Fb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new yc(a);return Ob.scheduleRequired()?Ob.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return wb(c,a),c}(ic),yc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Gb}wb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(dc),zc=function(a,b){this.subject=a,this.observer=b};zc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Ac=I.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Fb):(a.onCompleted(),Fb):(this.observers.push(a),new zc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return wb(d,a),xb(d.prototype,ac,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Bc(a,b)},d}(ic),Bc=(I.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new zc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Fb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return wb(d,a),xb(d.prototype,ac,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(ic),I.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return wb(b,a),xb(b.prototype,ac,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(ic));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(D.Rx=I,define(function(){return I})):E&&F?G?(F.exports=I).Rx=I:E.Rx=I:D.Rx=I}).call(this);
//# sourceMappingURL=rx.map