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
5 lines (5 loc) · 63.9 KB
/
Copy pathrx.min.js
File metadata and controls
5 lines (5 loc) · 63.9 KB
1
2
3
4
5
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(a){return function(){try{return a.apply(this,arguments)}catch(b){return fa.e=b,fa}}}function d(a){throw a}function e(a,b){if(ha&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(la)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+la+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];g(f)||h(f)||!f||c.push(f)}return c.join("\n")}function g(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===ja&&d>=ka&&Mc>=d}function h(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function i(){if(ha)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return ja=d[0],d[1]}}function j(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function k(a){var b=[];if(!Va(a))return b;Ua.nonEnumArgs&&a.length&&Wa(a)&&(a=Ya.call(a));var c=Ua.enumPrototypes&&"function"==typeof a,d=Ua.enumErrorProps&&(a===Oa||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Ua.nonEnumShadows&&a!==Pa){var f=a.constructor,g=-1,h=Aa;if(a===(f&&f.prototype))var i=a===Qa?Ka:a===Oa?Fa:La.call(a),j=Ta[i];for(;++g<h;)e=za[g],j&&j[e]||!Ma.call(a,e)||b.push(e)}return b}function l(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 m(a,b){return l(a,b,k)}function n(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function o(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=La.call(a),h=La.call(b);if(g==Ba&&(g=Ia),h==Ba&&(h=Ia),g!=h)return!1;switch(g){case Da:case Ea:return+a==+b;case Ha:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ja:case Ka:return a==String(b)}var i=g==Ca;if(!i){if(g!=Ia||!Ua.nodeClass&&(n(a)||n(b)))return!1;var j=!Ua.argsObject&&Wa(a)?Object:a.constructor,k=!Ua.argsObject&&Wa(b)?Object:b.constructor;if(!(j==k||Ma.call(a,"constructor")&&Ma.call(b,"constructor")||ea(j)&&j instanceof j&&ea(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,p=b.length,q=p==l)for(;p--;){var r=b[p];if(!(q=o(a[p],r,c,d)))break}}else m(b,function(b,e,f){return Ma.call(f,e)?(p++,q=Ma.call(a,e)&&o(a[e],b,c,d)):void 0}),q&&m(a,function(a,b,c){return Ma.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function r(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function s(a){this._s=a}function t(a){this._s=a,this._l=a.length,this._i=0}function u(a){this._a=a}function v(a){this._a=a,this._l=z(a),this._i=0}function w(a){return"number"==typeof a&&X.isFinite(a)}function x(b){var c,d=b[ta];if(!d&&"string"==typeof b)return c=new s(b),c[ta]();if(!d&&b.length!==a)return c=new u(b),c[ta]();if(!d)throw new TypeError("Object is not iterable");return b[ta]()}function y(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function z(a){var b=+a.length;return isNaN(b)?0:0!==b&&w(b)?(b=y(b)*Math.floor(Math.abs(b)),0>=b?0:b>$b?$b:b):b}function A(a,b){this.observer=a,this.parent=b}function B(a,b){return nb(a)||(a=rb),new ac(b,a)}function C(a,b){this.observer=a,this.parent=b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return a.amb(b)}function F(a,b){return new Hc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.subscribe(new mc(c,e,b))),e},a)}function G(){return!1}function H(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function G(){return!1}function G(){return!1}function I(){return[]}function H(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function G(){return!1}function I(){return[]}function H(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function J(a){return function(b){return a.subscribe(b)}}function K(a){return a.toArray()}function L(a){return a.length>0}function M(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function N(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function O(a){this.comparer=a,this.set=[]}function P(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}}var Q={"function":!0,object:!0},R=Q[typeof exports]&&exports&&!exports.nodeType&&exports,S=Q[typeof self]&&self.Object&&self,T=Q[typeof window]&&window&&window.Object&&window,U=Q[typeof module]&&module&&!module.nodeType&&module,V=U&&U.exports===R&&R,W=R&&U&&"object"==typeof global&&global&&global.Object&&global,X=X=W||T!==(this&&this.window)&&T||S||this,Y={internals:{},config:{Promise:X.Promise},helpers:{}},Z=Y.helpers.noop=function(){},$=Y.helpers.identity=function(a){return a},_=Y.helpers.defaultNow=Date.now,aa=Y.helpers.defaultComparer=function(a,b){return Xa(a,b)},ba=Y.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ca=(Y.helpers.defaultKeySerializer=function(a){return a.toString()},Y.helpers.defaultError=function(a){throw a}),da=Y.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ea=Y.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==La.call(a)}),a}(),fa={e:{}},ga=Y.internals.tryCatch=function(a){if(!ea(a))throw new TypeError("fn must be a function");return c(a)};Y.config.longStackSupport=!1;var ha=!1,ia=ga(function(){throw new Error})();ha=!!ia.e&&!!ia.e.stack;var ja,ka=i(),la="From previous event:",ma=Y.EmptyError=function(){this.message="Sequence contains no elements.",this.name="EmptyError",Error.call(this)};ma.prototype=Object.create(Error.prototype);var na=Y.ObjectDisposedError=function(){this.message="Object has been disposed",this.name="ObjectDisposedError",Error.call(this)};na.prototype=Object.create(Error.prototype);var oa=Y.ArgumentOutOfRangeError=function(){this.message="Argument out of range",this.name="ArgumentOutOfRangeError",Error.call(this)};oa.prototype=Object.create(Error.prototype);var pa=Y.NotSupportedError=function(a){this.message=a||"This operation is not supported",this.name="NotSupportedError",Error.call(this)};pa.prototype=Object.create(Error.prototype);var qa=Y.NotImplementedError=function(a){this.message=a||"This operation is not implemented",this.name="NotImplementedError",Error.call(this)};qa.prototype=Object.create(Error.prototype);var ra=Y.helpers.notImplemented=function(){throw new qa},sa=Y.helpers.notSupported=function(){throw new pa},ta="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";X.Set&&"function"==typeof(new X.Set)["@@iterator"]&&(ta="@@iterator");var ua=Y.doneEnumerator={done:!0,value:a},va=Y.helpers.isIterable=function(b){return b[ta]!==a},wa=Y.helpers.isArrayLike=function(b){return b&&b.length!==a};Y.helpers.iterator=ta;var xa,ya=Y.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)}},za=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Aa=za.length,Ba="[object Arguments]",Ca="[object Array]",Da="[object Boolean]",Ea="[object Date]",Fa="[object Error]",Ga="[object Function]",Ha="[object Number]",Ia="[object Object]",Ja="[object RegExp]",Ka="[object String]",La=Object.prototype.toString,Ma=Object.prototype.hasOwnProperty,Na=La.call(arguments)==Ba,Oa=Error.prototype,Pa=Object.prototype,Qa=String.prototype,Ra=Pa.propertyIsEnumerable;try{xa=!(La.call(document)==Ia&&!({toString:0}+""))}catch(Sa){xa=!0}var Ta={};Ta[Ca]=Ta[Ea]=Ta[Ha]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ta[Da]=Ta[Ka]={constructor:!0,toString:!0,valueOf:!0},Ta[Fa]=Ta[Ga]=Ta[Ja]={constructor:!0,toString:!0},Ta[Ia]={constructor:!0};var Ua={};!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);Ua.enumErrorProps=Ra.call(Oa,"message")||Ra.call(Oa,"name"),Ua.enumPrototypes=Ra.call(a,"prototype"),Ua.nonEnumArgs=0!=c,Ua.nonEnumShadows=!/valueOf/.test(b)}(1);var Va=Y.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Wa=function(a){return a&&"object"==typeof a?La.call(a)==Ba:!1};Na||(Wa=function(a){return a&&"object"==typeof a?Ma.call(a,"callee"):!1});var Xa=Y.internals.isEqual=function(a,b){return o(a,b,[],[])},Ya=({}.hasOwnProperty,Array.prototype.slice),Za=Y.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},$a=Y.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]}},_a=Y.internals.addRef=function(a,b){return new Hc(function(c){return new ab(b.getDisposable(),a.subscribe(c))})},ab=Y.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!fb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},bb=ab.prototype;bb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},bb.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},bb.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 cb=Y.Disposable=function(a){this.isDisposed=!1,this.action=a||Z};cb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var db=cb.create=function(a){return new cb(a)},eb=cb.empty={dispose:Z},fb=cb.isDisposable=function(a){return a&&ea(a.dispose)},gb=cb.checkDisposed=function(a){if(a.isDisposed)throw new na},hb=Y.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};hb.prototype.getDisposable=function(){return this.current},hb.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()},hb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var ib=Y.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ib.prototype.getDisposable=function(){return this.current},ib.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},ib.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var jb=Y.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?eb:new a(this)},b}();q.prototype.dispose=function(){this.scheduler.scheduleWithState(this,r)};var kb=Y.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ba,this.disposable=new hb};kb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},kb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},kb.prototype.isCancelled=function(){return this.disposable.isDisposed},kb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var lb=Y.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(),eb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=_,a.normalize=function(a){return 0>a&&(a=0),a},a}(),mb=lb.normalize,nb=lb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),eb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new ab;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),eb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new ab;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(lb.prototype),function(a){lb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},lb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof X.setInterval)throw new pa;b=mb(b);var d=a,e=X.setInterval(function(){d=c(d)},b);return db(function(){X.clearInterval(e)})}}(lb.prototype),function(a){a.catchError=a["catch"]=function(a){return new vb(this,a)}}(lb.prototype);var ob,pb,qb=(Y.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 hb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),lb.immediate=function(){function a(a,b){return b(this,a)}return new lb(_,a,sa,sa)}()),rb=lb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,e){var f=new kb(this,b,e,this.now());if(c)c.push(f);else{c=[f];var g=ga(a)();if(c=null,g===fa)return d(g.e)}return f.disposable}var c,e=new lb(_,b,sa,sa);return e.scheduleRequired=function(){return!c},e}(),sb=function(){var a,b=Z;if(X.setTimeout)a=X.setTimeout,b=X.clearTimeout;else{if(!X.WScript)throw new pa;a=function(a,b){X.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),tb=sb.setTimeout,ub=sb.clearTimeout;!function(){function a(b){if(g)tb(function(){a(b)},0);else{var c=f[b];if(c){g=!0;var e=ga(c)();if(pb(b),g=!1,e===fa)return d(e.e)}}}function b(){if(!X.postMessage||X.importScripts)return!1;var a=!1,b=X.onmessage;return X.onmessage=function(){a=!0},X.postMessage("","*"),X.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,j.length)===j&&a(b.data.substring(j.length))}var e=1,f={},g=!1;pb=function(a){delete f[a]};var h=RegExp("^"+String(La).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=W&&V&&W.setImmediate)&&!h.test(i)&&i;if(ea(i))ob=function(b){var c=e++;return f[c]=b,i(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ob=function(b){var c=e++;return f[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var j="ms.rx.schedule"+Math.random();X.addEventListener?X.addEventListener("message",c,!1):X.attachEvent?X.attachEvent("onmessage",c):X.onmessage=c,ob=function(a){var b=e++;return f[b]=a,X.postMessage(j+currentId,"*"),b}}else if(X.MessageChannel){var k=new X.MessageChannel;k.port1.onmessage=function(b){a(b.data)},ob=function(a){var b=e++;return f[b]=a,k.port2.postMessage(b),b}}else ob="document"in X&&"onreadystatechange"in X.document.createElement("script")?function(b){var c=X.document.createElement("script"),d=e++;return f[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},X.document.documentElement.appendChild(c),d}:function(b){var c=e++;return f[c]=b,tb(function(){a(c)},0),c}}();var vb=(lb.timeout=lb["default"]=function(){function a(a,b){var c=this,d=new hb,e=ob(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new ab(d,db(function(){pb(e)}))}function b(a,b,c){var d=this,e=lb.normalize(b),f=new hb;if(0===e)return d.scheduleWithState(a,c);var g=tb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new ab(f,db(function(){ub(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new lb(_,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 Za(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 eb}}},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 hb;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}(lb)),wb=Y.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}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 nb(a)||(a=qb),new Hc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),xb=wb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new wb("N",d,null,a,b,c)}}(),yb=wb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new wb("E",null,d,a,b,c)}}(),zb=wb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new wb("C",null,null,a,b,c)}}(),Ab=Y.Observer=function(){};Ab.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Ab.prototype.asObserver=function(){var a=this;return new Eb(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Ab.prototype.checked=function(){return new Fb(this)};var Bb=Ab.create=function(a,b,c){return a||(a=Z),b||(b=ca),c||(c=Z),new Eb(a,b,c)};Ab.fromNotifier=function(a,b){var c=ya(a,b,1);return new Eb(function(a){return c(xb(a))},function(a){return c(yb(a))},function(){return c(zb())})},Ab.prototype.notifyOn=function(a){return new Hb(a,this)},Ab.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Cb,Db=Y.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Za(b,a),b.prototype.next=ra,b.prototype.error=ra,b.prototype.completed=ra,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}(Ab),Eb=Y.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Za(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}(Db),Fb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Za(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=ga(this._observer.onNext).call(this._observer,a);this._state=0,b===fa&&d(b.e)},c.onError=function(a){this.checkAccess();var b=ga(this._observer.onError).call(this._observer,a);this._state=2,b===fa&&d(b.e)},c.onCompleted=function(){this.checkAccess();var a=ga(this._observer.onCompleted).call(this._observer);this._state=2,a===fa&&d(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}(Ab),Gb=Y.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 ib}return Za(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var e=ga(c)();return e===fa?(a.queue=[],a.hasFaulted=!0,d(e.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Db),Hb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Za(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}(Gb),Ib=Y.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){e(b,a),d.call(c,b)},b.call(a,c)}}function b(b){if(Y.config.longStackSupport&&ha){var c=ga(d)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return Cb=b.prototype,b.isObservable=function(a){return a&&ea(a.subscribe)},Cb.subscribe=Cb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Bb(a,b,c))},Cb.subscribeOnNext=function(a,b){return this._subscribe(Bb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Cb.subscribeOnError=function(a,b){return this._subscribe(Bb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Cb.subscribeOnCompleted=function(a,b){return this._subscribe(Bb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Jb=Y.ObservableBase=function(a){function b(a){return a&&ea(a.dispose)?a:ea(a)?db(a):eb}function c(a,c){var e=c[0],f=c[1],g=ga(f.subscribeCore).call(f,e);return g!==fa||e.fail(fa.e)?void e.setDisposable(b(g)):d(fa.e)}function e(a){var b=new Ic(a),d=[b,this];return rb.scheduleRequired()?rb.scheduleWithState(d,c):c(null,d),b}function f(){a.call(this,e)}return Za(f,a),f.prototype.subscribeCore=ra,f}(Ib),Kb=function(a){function b(b,c,d,e){this.resultSelector=Y.helpers.isFunction(d)?d:null,this.selector=Y.internals.bindCallback(Y.helpers.isFunction(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.isStopped=!1,this.o=a}return Za(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},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.onNext=function(a){if(!this.isStopped){var b=this.i++,c=ga(this.selector)(a,b,this.source);if(c===fa)return this.o.onError(c.e);Y.helpers.isPromise(c)&&(c=Y.Observable.fromPromise(c)),(Y.helpers.isArrayLike(c)||Y.helpers.isIterable(c))&&(c=Y.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},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())},b}(Jb),Lb=Y.internals.Enumerable=function(){},Mb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){var b,d=new ib,e=qb.scheduleRecursiveWithState(this.sources[ta](),function(e,f){if(!b){var g=ga(e.next).call(e);if(g===fa)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;da(h)&&(h=Tb(h));var i=new hb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new ab(d,e,db(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Lb.prototype.concat=function(){return new Mb(this)};var Nb=function(a){function b(b){this.sources=b,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[ta](),d=new ib,e=qb.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=ga(c.next).call(c);if(g===fa)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;da(h)&&(h=Tb(h));var i=new hb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new ab(d,e,db(function(){b=!0}))},b}(Jb);Lb.prototype.catchError=function(){return new Nb(this)},Lb.prototype.catchErrorWhen=function(a){var b=this;return new Hc(function(c){var d,e,f=new Kc,g=new Kc,h=a(f),i=h.subscribe(g),j=b[ta](),k=new ib,l=qb.scheduleRecursive(function(a){if(!d){var b=ga(j.next).call(j);if(b===fa)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;da(h)&&(h=Tb(h));var i=new hb,l=new hb;k.setDisposable(new ab(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new ab(i,k,l,db(function(){d=!0}))})};var Ob=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 Za(b,a),b.prototype[ta]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?ua:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Lb),Pb=Lb.repeat=function(a,b){return new Ob(a,b)},Qb=function(a){function b(a,b,c){this.s=a,this.fn=b?ya(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Za(b,a),b.prototype[ta]=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]}:ua},b}(Lb),Rb=Lb.of=function(a,b,c){return new Qb(a,b,c)};Cb.observeOn=function(a){var b=this;return new Hc(function(c){return b.subscribe(new Hb(a,c))},b)},Cb.subscribeOn=function(a){var b=this;return new Hc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new q(a,b.subscribe(c)))})),e},b)};var Sb=function(a){function b(b){this.p=b,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),eb},b}(Jb),Tb=Ib.fromPromise=function(a){return new Sb(a)};Cb.toPromise=function(a){if(a||(a=Y.config.Promise),!a)throw new pa("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)})})};var Ub=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},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.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.toArray=function(){return new Ub(this)},Ib.create=function(a,b){return new Hc(a,b)};var Vb=(Ib.defer=function(a){return new Hc(function(b){var c;try{c=a()}catch(d){return lc(d).subscribe(b)}return da(c)&&(c=Tb(c)),c.subscribe(b)})},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(),eb}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){return this.scheduler.scheduleWithState(this.observer,d)},b}(Jb)),Wb=new Vb(qb),Xb=Ib.empty=function(a){return nb(a)||(a=qb),a===qb?Wb:new Vb(a)},Yb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new Zb(a,this);return b.run()},b}(Jb),Zb=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var f=ga(c.next).call(c);if(f===fa)return d.onError(f.e);if(f.done)return d.onCompleted();var g=f.value;return ea(e)&&(g=ga(e)(g,a),g===fa)?d.onError(g.e):(d.onNext(g),void b(a+1))}var b=Object(this.parent.iterable),c=x(b),d=this.o,e=this.parent.mapper;
return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),$b=Math.pow(2,53)-1;s.prototype[ta]=function(){return new t(this._s)},t.prototype[ta]=function(){return this},t.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ua},u.prototype[ta]=function(){return new v(this._a)},v.prototype[ta]=function(){return this},v.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ua};var _b=Ib.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ea(b))throw new Error("mapFn when provided must be a function");if(b)var e=ya(b,c,2);return nb(d)||(d=rb),new Yb(a,e,d)},ac=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new A(a,this);return b.run()},b}(Jb);A.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var bc=Ib.fromArray=function(a,b){return nb(b)||(b=rb),new ac(a,b)};Ib.generate=function(a,b,c,d,e){return nb(e)||(e=rb),new Hc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var cc=function(a){function b(){a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){return eb},b}(Jb),dc=new cc,ec=Ib.never=function(){return dc};Ib.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new ac(b,rb)},Ib.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 ac(c,a)};var fc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(Jb);C.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Ib.pairs=function(a,b){return b||(b=rb),new fc(a,b)};var gc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new hc(a,this);return b.run()},b}(Jb),hc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Ib.range=function(a,b,c){return nb(c)||(c=rb),new gc(a,b,c)};var ic=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Jb);D.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.scheduleRecursiveWithState(this.parent.repeatCount,a)},Ib.repeat=function(a,b,c){return nb(c)||(c=rb),new ic(a,b,c)};var jc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b,c){this.observer=a,this.value=b,this.scheduler=c}function d(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),eb}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.value,this.scheduler);return b.run()},c.prototype.run=function(){var a=[this.value,this.observer];return this.scheduler===qb?d(null,a):this.scheduler.scheduleWithState(a,d)},b}(Jb),kc=(Ib["return"]=Ib.just=function(a,b){return nb(b)||(b=qb),new jc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Jb)),lc=Ib["throw"]=function(a,b){return nb(b)||(b=qb),new kc(a,b)};Ib.using=function(a,b){return new Hc(function(c){var d=eb,e=ga(a)();if(e===fa)return new ab(lc(e.e).subscribe(c),d);e&&(d=e);var f=ga(b)(e);return f===fa?new ab(lc(f.e).subscribe(c),d):new ab(f.subscribe(c),d)})},Cb.amb=function(a){var b=this;return new Hc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new hb,j=new hb;da(a)&&(a=Tb(a));var k=Bb(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Bb(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 ab(i,j)})},Ib.amb=function(){var a,b=ec();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=E(b,a[d]);return b};var mc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Za(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=ga(this._fn)(a);if(b===fa)return this._o.onError(b.e);da(b)&&(b=Tb(b));var c=new hb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Db);Cb["catch"]=function(a){return ea(a)?F(this,a):nc([this,a])};var nc=Ib["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 Rb(a).catchError()};Cb.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),oc.apply(this,b)};var oc=Ib.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ea(b[a-1])?b.pop():H;return Array.isArray(b[0])&&(b=b[0]),new Hc(function(a){function c(b){if(g[b]=!0,h||(h=g.every($))){try{var c=d.apply(null,j)}catch(e){return a.onError(e)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every($)&&a.onCompleted()}function e(b){i[b]=!0,i.every($)&&a.onCompleted()}for(var f=b.length,g=p(f,G),h=!1,i=p(f,G),j=new Array(f),k=new Array(f),l=0;f>l;l++)!function(d){var f=b[d],g=new hb;da(f)&&(f=Tb(f)),g.setDisposable(f.subscribe(function(a){j[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),k[d]=g}(l);return new ab(k)},this)};Cb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),qc.apply(null,a)};var pc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new ib,c=this.sources,d=c.length,e=this.o,f=qb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];da(h)&&(h=Tb(h));var i=new hb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new ab(b,f,db(function(){a=!0}))},b}(Jb),qc=Ib.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 pc(a)};Cb.concatAll=function(){return this.merge(1)};var rc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new ab;return b.add(this.source.subscribe(new sc(a,this.maxConcurrent,b))),b},b}(Jb),sc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new hb;this.g.add(c),da(a)&&(a=Tb(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Cb.merge=function(a){return"number"!=typeof a?tc(this,a):new rc(this,a)};var tc=Ib.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(nb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=qb,b=0;d>b;b++)c.push(arguments[b]);else for(a=qb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),B(a,c).mergeAll()},uc=Y.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};uc.prototype=Error.prototype,Ib.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=B(null,a);return new Hc(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new uc(g))}var c=new ab,e=new hb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new hb;c.add(e),da(d)&&(d=Tb(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var vc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new ab,d=new hb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new hb;this.g.add(b),da(a)&&(a=Tb(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Jb);Cb.mergeAll=function(){return new vc(this)},Cb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return wc([this,a])};var wc=Ib.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Hc(function(b){var c=0,d=new ib,e=qb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],da(f)&&(f=Tb(f)),g=new hb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new ab(d,e)})};Cb.skipUntil=function(a){var b=this;return new Hc(function(c){var d=!1,e=new ab(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));da(a)&&(a=Tb(a));var f=new hb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var xc=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,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){var b=new ib,d=this.source.subscribe(new c(a,b));return new ab(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new hb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),da(a)&&(a=Tb(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Jb);Cb["switch"]=Cb.switchLatest=function(){return new xc(this)};var yc=function(a){function b(b,c){this.source=b,this.other=da(c)?Tb(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){return new ab(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.takeUntil=function(a){return new yc(this,a)},Cb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Hc(function(a){for(var c=b.length,f=p(c,G),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new hb;da(d)&&(d=Tb(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every($)},function(b){a.onError(b)},Z)),i[c]=e}(j);var k=new hb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=ga(d).apply(null,c);return e===fa?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new ab(i)},this)},Cb.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=ea(b[a-1])?b.pop():H;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new Hc(function(a){for(var c=b.length,f=p(c,I),g=p(c,G),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new hb;da(i)&&(i=Tb(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=ga(d).apply(e,h);if(i===fa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every($)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every($)&&a.onCompleted()})),h[c]=j}(i);return new ab(h)},e)},Ib.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=ea(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)},Cb.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=ea(b[a-1])?b.pop():H,e=this;return b.unshift(e),new Hc(function(a){for(var c=b.length,f=p(c,I),g=p(c,G),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new hb;(wa(i)||va(i))&&(i=_b(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=ga(d).apply(e,h);if(i===fa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every($)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every($)&&a.onCompleted()})),h[c]=j}(i);return new ab(h)},e)},Cb.asObservable=function(){return new Hc(J(this),this)},Cb.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(K).filter(L)},Cb.dematerialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var zc=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ac(a,this.keyFn,this.comparer))},b}(Jb),Ac=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 Za(b,a),b.prototype.next=function(a){var b,c=a;return ea(this.keyFn)&&(c=ga(this.keyFn)(a),c===fa)?this.o.onError(c.e):this.hasCurrentKey&&(b=ga(this.comparer)(this.currentKey,c),b===fa)?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}(Db);Cb.distinctUntilChanged=function(a,b){return b||(b=aa),new zc(this,a,b)};var Bc=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||ea(b._oN)?Bb(b._oN||Z,b._oE||Z,b._oC||Z):b._oN,this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype.onNext=function(a){if(!this.isStopped){var b=ga(this.t.onNext).call(this.t,a);b===fa&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=ga(this.t.onError).call(this.t,a);if(b===fa)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=ga(this.t.onCompleted).call(this.t);if(a===fa)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb["do"]=Cb.tap=Cb.doAction=function(a,b,c){return new Bc(this,a,b,c)},Cb.doOnNext=Cb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Cb.doOnError=Cb.tapOnError=function(a,b){return this.tap(Z,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Cb.doOnCompleted=Cb.tapOnCompleted=function(a,b){return this.tap(Z,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Cb["finally"]=function(a){var b=this;return new Hc(function(c){var e=ga(b.subscribe).call(b,c);return e===fa?(a(),d(e.e)):db(function(){var b=ga(e.dispose).call(e);a(),b===fa&&d(b.e)})},this)};var Cc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Z,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}(Jb);Cb.ignoreElements=function(){return new Cc(this)},Cb.materialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){b.onNext(xb(a))},function(a){b.onNext(yb(a)),b.onCompleted()},function(){b.onNext(zb()),b.onCompleted()})},a)},Cb.repeat=function(a){return Pb(this,a).concat()},Cb.retry=function(a){return Pb(this,a).catchError()},Cb.retryWhen=function(a){return Pb(this).catchErrorWhen(a)};var Dc=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Za(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this))},b}(Jb);M.prototype={onNext:function(a){return this.isStopped?void 0:(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.accumulation=ga(this.accumulator)(this.accumulation,a):(this.accumulation=this.hasSeed?ga(this.accumulator)(this.seed,a):a,this.hasAccumulation=!0),this.accumulation===fa?this.o.onError(this.accumulation.e):void this.o.onNext(this.accumulation))},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},Cb.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Dc(this,c,b,a)},Cb.skipLast=function(a){if(0>a)throw new oa;var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Cb.startWith=function(){var a,b=0;arguments.length&&nb(arguments[0])?(a=arguments[0],b=1):a=qb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Rb([bc(c,a),this]).concat()},Cb.takeLast=function(a){if(0>a)throw new oa;var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Cb.takeLastBuffer=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},Cb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new oa;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new oa;return new Hc(function(d){function e(){var a=new Kc;i.push(a),d.onNext(_a(a,g))}var f=new hb,g=new jb(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)},Cb.flatMapConcat=Cb.concatMap=function(a,b,c){return new Kb(this,a,b,c).merge(1)},Cb.concatMapObserver=Cb.selectConcatObserver=function(a,b,c,d){var e=this,f=ya(a,d,2),g=ya(b,d,1),h=ya(c,d,0);return new Hc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}da(d)&&(d=Tb(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}da(c)&&(c=Tb(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}da(b)&&(b=Tb(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Cb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Hc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},O.prototype.push=function(a){var b=-1===N(this.set,a,this.comparer);return b&&this.set.push(a),b},Cb.distinct=function(a,b){var c=this;return b||(b=aa),new Hc(function(d){var e=new O(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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var Ec=function(a){function b(b,c,d){this.source=b,this.selector=ya(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,this.isStopped=!1}return Za(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))},d.prototype.onNext=function(a){if(!this.isStopped){var b=ga(this.selector)(a,this.i++,this.source);return b===fa?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.map=Cb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Ec?this.internalMap(c,b):new Ec(this,c,b)},Cb.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(P(b,a))},Cb.flatMapObserver=Cb.selectManyObserver=function(a,b,c,d){var e=this;return new Hc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}da(c)&&(c=Tb(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}da(c)&&(c=Tb(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}da(a)&&(a=Tb(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Cb.flatMap=Cb.selectMany=function(a,b,c){return new Kb(this,a,b,c).mergeAll()},Y.Observable.prototype.flatMapLatest=function(a,b,c){return new Kb(this,a,b,c).switchLatest()};var Fc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Za(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},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.o.onError(a),!0)},b}(Jb);Cb.skip=function(a){if(0>a)throw new oa;return new Fc(this,a)},Cb.skipWhile=function(a,b){var c=this,d=ya(a,b,3);return new Hc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Cb.take=function(a,b){if(0>a)throw new oa;if(0===a)return Xb(b);var c=this;return new Hc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Cb.takeWhile=function(a,b){var c=this,d=ya(a,b,3);return new Hc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Gc=function(a){function b(b,c,d){this.source=b,this.predicate=ya(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,this.isStopped=!1}return Za(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)},d.prototype.onNext=function(a){if(!this.isStopped){var b=ga(this.predicate)(a,this.i++,this.source);return b===fa?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.filter=Cb.where=function(a,b){return this instanceof Gc?this.internalFilter(a,b):new Gc(this,a,b)},Cb.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Hc(function(d){var e=a(b(d));return c.subscribe(function(a){var b=ga(e["@@transducer/step"]).call(e,d,a);b===fa&&d.onError(b.e)},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Hc=Y.AnonymousObservable=function(a){function b(a){return a&&ea(a.dispose)?a:ea(a)?db(a):eb}function c(a,c){var e=c[0],f=c[1],g=ga(f.__subscribe).call(f,e);return g!==fa||e.fail(fa.e)?void e.setDisposable(b(g)):d(fa.e)}function e(a){var b=new Ic(a),d=[b,this];return rb.scheduleRequired()?rb.scheduleWithState(d,c):c(null,d),b}function f(b,c){this.source=c,this.__subscribe=b,a.call(this,e)}return Za(f,a),f}(Ib),Ic=function(a){function b(b){a.call(this),this.observer=b,this.m=new hb}Za(b,a);var c=b.prototype;return c.next=function(a){var b=ga(this.observer.onNext).call(this.observer,a);b===fa&&(this.dispose(),d(b.e))},c.error=function(a){var b=ga(this.observer.onError).call(this.observer,a);this.dispose(),b===fa&&d(b.e)},c.completed=function(){var a=ga(this.observer.onCompleted).call(this.observer);this.dispose(),a===fa&&d(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Db),Jc=function(a,b){this.subject=a,this.observer=b};Jc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Kc=Y.Subject=function(a){function c(a){return gb(this),this.isStopped?this.hasError?(a.onError(this.error),eb):(a.onCompleted(),eb):(this.observers.push(a),new Jc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Za(d,a),$a(d.prototype,Ab.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(gb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(gb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(gb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Lc(a,b)},d}(Ib),Lc=(Y.AsyncSubject=function(a){function c(a){return gb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),eb):(this.observers.push(a),new Jc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Za(d,a),
$a(d.prototype,Ab,{hasObservers:function(){return gb(this),this.observers.length>0},onCompleted:function(){var a,c;if(gb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(gb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){gb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Ib),Y.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Za(c,a),$a(c.prototype,Ab.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Ib));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X.Rx=Y,define(function(){return Y})):R&&U?V?(U.exports=Y).Rx=Y:R.Rx=Y:X.Rx=Y;var Mc=i()}).call(this);
//# sourceMappingURL=rx.map