rxjs-rails 2.3.9 → 2.3.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rxjs/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/rx.aggregates.js +174 -204
  4. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  5. data/vendor/assets/javascripts/rx.all.compat.js +1626 -1528
  6. data/vendor/assets/javascripts/rx.all.compat.min.js +3 -3
  7. data/vendor/assets/javascripts/rx.all.js +1624 -1526
  8. data/vendor/assets/javascripts/rx.all.min.js +3 -3
  9. data/vendor/assets/javascripts/rx.async.compat.js +241 -0
  10. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  11. data/vendor/assets/javascripts/rx.async.js +241 -0
  12. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  13. data/vendor/assets/javascripts/rx.backpressure.js +3 -3
  14. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  15. data/vendor/assets/javascripts/rx.binding.js +350 -378
  16. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  17. data/vendor/assets/javascripts/rx.coincidence.js +16 -21
  18. data/vendor/assets/javascripts/rx.compat.js +633 -683
  19. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  20. data/vendor/assets/javascripts/rx.js +633 -683
  21. data/vendor/assets/javascripts/rx.lite.compat.js +941 -1137
  22. data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
  23. data/vendor/assets/javascripts/rx.lite.extras.js +58 -74
  24. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  25. data/vendor/assets/javascripts/rx.lite.js +941 -1137
  26. data/vendor/assets/javascripts/rx.lite.min.js +2 -2
  27. data/vendor/assets/javascripts/rx.min.js +2 -2
  28. data/vendor/assets/javascripts/rx.time.js +182 -212
  29. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  30. metadata +10 -10
@@ -1,2 +1,2 @@
1
- (function(a){function b(){if(this.isDisposed)throw new Error(O)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;jb.nonEnumArgs&&a.length&&h(a)&&(a=lb.call(a));var d=jb.enumPrototypes&&"function"==typeof a,e=jb.enumErrorProps&&(a===db||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(jb.nonEnumShadows&&a!==eb){var g=a.constructor,i=-1,j=hb.length;if(a===(g&&g.prototype))var k=a===stringProto?_:a===db?W:ab.call(a),l=ib[k];for(;++i<j;)f=hb[i],l&&l[f]||!bb.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){return a&&"object"==typeof a?ab.call(a)==S:!1}function i(a){return"function"==typeof a||!1}function j(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,k=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=k&&"object"!=k))return!1;var l=ab.call(a),m=ab.call(b);if(l==S&&(l=Z),m==S&&(m=Z),l!=m)return!1;switch(l){case U:case V:return+a==+b;case Y:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case $:case _:return a==String(b)}var n=l==T;if(!n){if(l!=Z||!jb.nodeClass&&(g(a)||g(b)))return!1;var o=!jb.argsObject&&h(a)?Object:a.constructor,p=!jb.argsObject&&h(b)?Object:b.constructor;if(!(o==p||bb.call(a,"constructor")&&bb.call(b,"constructor")||i(o)&&o instanceof o&&i(p)&&p instanceof p||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(result=!0,c.push(a),d.push(b),n){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=j(a[r],s,c,d)))break}}else f(b,function(b,e,f){return bb.call(f,e)?(r++,result=bb.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return bb.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function k(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:lb.call(a)}function l(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(a){return"number"==typeof a&&z.isFinite(a)}function o(b){return b[P]!==a}function p(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function q(a){var b=+a.length;return isNaN(b)?0:0!==b&&n(b)?(b=p(b)*Math.floor(Math.abs(b)),0>=b?0:b>bc?bc:b):b}function r(a){return"[object Function]"===Object.prototype.toString.call(a)&&"function"==typeof a}function s(a,b){return new lc(function(c){var d=new zb,e=new SerialDisposable;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)}M(f)&&(f=$b(f)),d=new zb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function t(a,b){var c=this;return new lc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function u(a,b,c){return a.map(function(a,d){var e=b.call(c,a,d);return M(e)?$b(e):e}).concatAll()}function v(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function w(a){this.comparer=a,this.set=[]}function x(a,b,c){return a.map(function(a,d){var e=b.call(c,a,d);return M(e)?$b(e):e}).mergeObservable()}var y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},z=y[typeof window]&&window||this,A=y[typeof exports]&&exports&&!exports.nodeType&&exports,B=y[typeof module]&&module&&!module.nodeType&&module,C=B&&B.exports===A&&A,D=y[typeof global]&&global;!D||D.global!==D&&D.window!==D||(z=D);var E={internals:{},config:{Promise:z.Promise},helpers:{}},F=E.helpers.noop=function(){},G=(E.helpers.notDefined=function(a){return"undefined"==typeof a},E.helpers.isScheduler=function(a){return a instanceof E.Scheduler}),H=E.helpers.identity=function(a){return a},I=(E.helpers.pluck=function(a){return function(b){return b[a]}},E.helpers.just=function(a){return function(){return a}},E.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),J=E.helpers.defaultComparer=function(a,b){return kb(a,b)},K=E.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},L=(E.helpers.defaultKeySerializer=function(a){return a.toString()},E.helpers.defaultError=function(a){throw a}),M=E.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},N=(E.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},E.helpers.not=function(a){return!a},"Argument out of range"),O="Object has been disposed",P="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";z.Set&&"function"==typeof(new z.Set)["@@iterator"]&&(P="@@iterator");var Q,R={done:!0,value:a},S="[object Arguments]",T="[object Array]",U="[object Boolean]",V="[object Date]",W="[object Error]",X="[object Function]",Y="[object Number]",Z="[object Object]",$="[object RegExp]",_="[object String]",ab=Object.prototype.toString,bb=Object.prototype.hasOwnProperty,cb=ab.call(arguments)==S,db=Error.prototype,eb=Object.prototype,fb=eb.propertyIsEnumerable;try{Q=!(ab.call(document)==Z&&!({toString:0}+""))}catch(gb){Q=!0}var hb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ib={};ib[T]=ib[V]=ib[Y]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},ib[U]=ib[_]={constructor:!0,toString:!0,valueOf:!0},ib[W]=ib[X]=ib[$]={constructor:!0,toString:!0},ib[Z]={constructor:!0};var jb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);jb.enumErrorProps=fb.call(db,"message")||fb.call(db,"name"),jb.enumPrototypes=fb.call(a,"prototype"),jb.nonEnumArgs=0!=c,jb.nonEnumShadows=!/valueOf/.test(b)}(1),cb||(h=function(a){return a&&"object"==typeof a?bb.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&ab.call(a)==X});var kb=E.internals.isEqual=function(a,b){return j(a,b,[],[])},lb=Array.prototype.slice,mb=({}.hasOwnProperty,this.inherits=E.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),nb=E.internals.addProperties=function(a){for(var b=lb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},ob=E.internals.addRef=function(a,b){return new lc(function(c){return new ub(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=lb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(lb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(lb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var pb=Object("a"),qb="a"!=pb[0]||!(0 in pb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=qb&&{}.toString.call(this)==_?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=X)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=qb&&{}.toString.call(this)==_?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=X)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==T}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});var rb=function(a,b){this.id=a,this.value=b};rb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var sb=E.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},tb=sb.prototype;tb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},tb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},tb.heapify=function(b){if(b===a&&(b=0),!(b>=this.length||0>b)){var c=2*b+1,d=2*b+2,e=b;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==b){var f=this.items[b];this.items[b]=this.items[e],this.items[e]=f,this.heapify(e)}}},tb.peek=function(){return this.items[0].value},tb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},tb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},tb.enqueue=function(a){var b=this.length++;this.items[b]=new rb(sb.count++,a),this.percolate(b)},tb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},sb.count=0;var ub=E.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},vb=ub.prototype;vb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},vb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},vb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},vb.toArray=function(){return this.disposables.slice(0)};var wb=E.Disposable=function(a){this.isDisposed=!1,this.action=a||F};wb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var xb=wb.create=function(a){return new wb(a)},yb=wb.empty={dispose:F},zb=E.SingleAssignmentDisposable=SerialDisposable=E.SerialDisposable=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}(),Ab=E.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?yb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Bb=E.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||K,this.disposable=new zb};Bb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Bb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Bb.prototype.isCancelled=function(){return this.disposable.isDisposed},Bb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Cb=E.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),yb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=I,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Db=Cb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new ub,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),yb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new ub,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),yb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Cb.prototype),function(){Cb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Cb.prototype.schedulePeriodicWithState=function(a,b,c){var d=a,e=setInterval(function(){d=c(d)},b);return xb(function(){clearInterval(e)})}}(Cb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Ib(this,a)}}(Cb.prototype);var Eb,Fb=(E.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new zb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Cb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Db(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Cb(I,a,b,c)}()),Gb=Cb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Cb.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()+Cb.normalize(c),g=new Bb(this,b,d,f);if(e)e.enqueue(g);else{e=new sb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Cb(I,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Hb=F;!function(){function a(){if(!z.postMessage||z.importScripts)return!1;var a=!1,b=z.onmessage;return z.onmessage=function(){a=!0},z.postMessage("","*"),z.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(ab).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=D&&C&&D.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=D&&C&&D.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Eb=process.nextTick;else if("function"==typeof d)Eb=d,Hb=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;z.addEventListener?z.addEventListener("message",b,!1):z.attachEvent("onmessage",b,!1),Eb=function(a){var b=h++;g[b]=a,z.postMessage(f+b,"*")}}else if(z.MessageChannel){var i=new z.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Eb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in z&&"onreadystatechange"in z.document.createElement("script")?Eb=function(a){var b=z.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},z.document.documentElement.appendChild(b)}:(Eb=function(a){return setTimeout(a,0)},Hb=clearTimeout)}();var Ib=(Cb.timeout=function(){function a(a,b){var c=this,d=new zb,e=Eb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new ub(d,xb(function(){Hb(e)}))}function b(a,b,c){var d=this,e=Cb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new zb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new ub(f,xb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Cb(I,a,b,c)}(),function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return mb(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 yb}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new zb;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},f}(Cb)),Jb=E.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 G(a)||(a=Fb),new lc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Kb=Jb.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 Jb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Lb=Jb.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 Jb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Mb=Jb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Jb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Nb=E.internals.Enumerator=function(a){this._next=a};Nb.prototype.next=function(){return this._next()},Nb.prototype[P]=function(){return this};var Ob=E.internals.Enumerable=function(a){this._iterator=a};Ob.prototype[P]=function(){return this._iterator()},Ob.prototype.concat=function(){var a=this;return new lc(function(b){var c;try{c=a[P]()}catch(d){return void b.onError()}var e,f=new SerialDisposable,g=Fb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;M(h)&&(h=$b(h));var i=new zb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new ub(f,g,xb(function(){e=!0}))})},Ob.prototype.catchException=function(){var a=this;return new lc(function(b){var c;try{c=a[P]()}catch(d){return void b.onError()}var e,f,g=new SerialDisposable,h=Fb.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;M(i)&&(i=$b(i));var j=new zb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new ub(g,h,xb(function(){e=!0}))})};var Pb=Ob.repeat=function(a,b){return null==b&&(b=-1),new Ob(function(){var c=b;return new Nb(function(){return 0===c?R:(c>0&&c--,{done:!1,value:a})})})},Qb=Ob.forEach=function(a,b,c){return b||(b=H),new Ob(function(){var d=-1;return new Nb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:R})})},Rb=E.Observer=function(){};Rb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Rb.prototype.asObserver=function(){return new Vb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Rb.prototype.checked=function(){return new Wb(this)};var Sb=Rb.create=function(a,b,c){return a||(a=F),b||(b=L),c||(c=F),new Vb(a,b,c)};Rb.fromNotifier=function(a){return new Vb(function(b){return a(Kb(b))},function(b){return a(Lb(b))},function(){return a(Mb())})},Rb.notifyOn=function(a){return new Yb(a,this)};var Tb,Ub=E.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return mb(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}(Rb),Vb=E.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return mb(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}(Ub),Wb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}mb(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}(Rb),Xb=E.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 SerialDisposable}return mb(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}(Ub),Yb=function(a){function b(){a.apply(this,arguments)}return mb(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}(Xb),Zb=E.Observable=function(){function a(a){this._subscribe=a}return Tb=a.prototype,Tb.subscribe=Tb.forEach=function(a,b,c){var d="object"==typeof a?a:Sb(a,b,c);return this._subscribe(d)},a}();Tb.observeOn=function(a){var b=this;return new lc(function(c){return b.subscribe(new Yb(a,c))})},Tb.subscribeOn=function(a){var b=this;return new lc(function(c){var d=new zb,e=new SerialDisposable;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var $b=Zb.fromPromise=function(a){return _b(function(){var b=new E.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};Tb.toPromise=function(a){if(a||(a=E.config.Promise),!a)throw new Error("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},function(a){c(a)},function(){e&&a(d)})})},Tb.toArray=function(){var a=this;return new lc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},Zb.create=Zb.createWithDisposable=function(a){return new lc(a)};var _b=Zb.defer=function(a){return new lc(function(b){var c;try{c=a()}catch(d){return fc(d).subscribe(b)}return M(c)&&(c=$b(c)),c.subscribe(b)})},ac=Zb.empty=function(a){return G(a)||(a=Fb),new lc(function(b){return a.schedule(function(){b.onCompleted()})})},bc=Math.pow(2,53)-1;Zb.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");return G(d)||(d=Gb),new lc(function(e){var f=Object(a),g=o(f),h=g?0:q(f),i=g?f[P]():null,j=0;return d.scheduleRecursive(function(a){if(h>j||g){var d;if(g){var k=i.next();if(k.done)return void e.onCompleted();d=k.value}else d=f[j];if(b&&r(b))try{d=c?b.call(c,d,j):b(d,j)}catch(l){return void e.onError(l)}e.onNext(d),j++,a()}else e.onCompleted()})})};var cc=Zb.fromArray=function(a,b){return G(b)||(b=Gb),new lc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};Zb.generate=function(a,b,c,d,e){return G(e)||(e=Gb),new lc(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 dc=Zb.never=function(){return new lc(function(){return yb})};Zb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return cc(b)};Zb.ofWithScheduler=function(a){for(var b=arguments.length-1,c=new Array(b),d=0;b>d;d++)c[d]=arguments[d+1];return cc(c,a)};Zb.range=function(a,b,c){return G(c)||(c=Gb),new lc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Zb.repeat=function(a,b,c){return G(c)||(c=Gb),ec(a,c).repeat(null==b?-1:b)};var ec=Zb["return"]=Zb.returnValue=Zb.just=function(a,b){return G(b)||(b=Fb),new lc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},fc=Zb["throw"]=Zb.throwException=function(a,b){return G(b)||(b=Fb),new lc(function(c){return b.schedule(function(){c.onError(a)})})};Zb.using=function(a,b){return new lc(function(c){var d,e,f=yb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new ub(fc(g).subscribe(c),f)}return new ub(e.subscribe(c),f)})},Tb.amb=function(a){var b=this;return new lc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new zb,j=new zb;return M(a)&&(a=$b(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 ub(i,j)})},Zb.amb=function(){function a(a,b){return a.amb(b)}for(var b=dc(),c=k(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Tb["catch"]=Tb.catchException=function(a){return"function"==typeof a?s(this,a):gc([this,a])};var gc=Zb.catchException=Zb["catch"]=function(){var a=k(arguments,0);return Qb(a).catchException()};Tb.combineLatest=function(){var a=lb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),hc.apply(this,a)};var hc=Zb.combineLatest=function(){var a=lb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new lc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(H))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(H)&&c.onCompleted()}function e(a){j[a]=!0,j.every(H)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=l(g,f),i=!1,j=l(g,f),k=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new zb;M(f)&&(f=$b(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new ub(m)})};Tb.concat=function(){var a=lb.call(arguments,0);return a.unshift(this),ic.apply(this,a)};var ic=Zb.concat=function(){var a=k(arguments,0);return Qb(a).concat()};Tb.concatObservable=Tb.concatAll=function(){return this.merge(1)},Tb.merge=function(a){if("number"!=typeof a)return jc(this,a);var b=this;return new lc(function(c){function d(a){var b=new zb;f.add(b),M(a)&&(a=$b(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new ub,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var jc=Zb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=lb.call(arguments,1)):(a=Fb,b=lb.call(arguments,0)):(a=Fb,b=lb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),cc(b,a).mergeObservable()};Tb.mergeObservable=Tb.mergeAll=function(){var a=this;return new lc(function(b){var c=new ub,d=!1,e=new zb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new zb;c.add(e),M(a)&&(a=$b(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},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})},Tb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return kc([this,a])};var kc=Zb.onErrorResumeNext=function(){var a=k(arguments,0);return new lc(function(b){var c=0,d=new SerialDisposable,e=Fb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],M(f)&&(f=$b(f)),g=new zb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new ub(d,e)})};Tb.skipUntil=function(a){var b=this;return new lc(function(c){var d=!1,e=new ub(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));M(a)&&(a=$b(a));var f=new zb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Tb["switch"]=Tb.switchLatest=function(){var a=this;return new lc(function(b){var c=!1,d=new SerialDisposable,e=!1,f=0,g=a.subscribe(function(a){var g=new zb,h=++f;c=!0,d.setDisposable(g),M(a)&&(a=$b(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)
2
- },function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new ub(g,d)})},Tb.takeUntil=function(a){var b=this;return new lc(function(c){return M(a)&&(a=$b(a)),new ub(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),F))})},Tb.zip=function(){if(Array.isArray(arguments[0]))return t.apply(this,arguments);var a=this,b=lb.call(arguments),c=b.pop();return b.unshift(a),new lc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(H)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=l(g,function(){return[]}),i=l(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new zb;M(c)&&(c=$b(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new ub(j)})},Zb.zip=function(){var a=lb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Zb.zipArray=function(){var a=k(arguments,0);return new lc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(H))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(H)?void b.onCompleted():void 0}for(var e=a.length,f=l(e,function(){return[]}),g=l(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new zb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new ub(h);return j.add(xb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Tb.asObservable=function(){var a=this;return new lc(function(b){return a.subscribe(b)})},Tb.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})},Tb.dematerialize=function(){var a=this;return new lc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Tb.distinctUntilChanged=function(a,b){var c=this;return a||(a=H),b||(b=J),new lc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Tb["do"]=Tb.doAction=Tb.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new lc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b){try{b(c)}catch(d){a.onError(d)}a.onError(c)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},Tb["finally"]=Tb.finallyAction=function(a){var b=this;return new lc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return xb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Tb.ignoreElements=function(){var a=this;return new lc(function(b){return a.subscribe(F,b.onError.bind(b),b.onCompleted.bind(b))})},Tb.materialize=function(){var a=this;return new lc(function(b){return a.subscribe(function(a){b.onNext(Kb(a))},function(a){b.onNext(Lb(a)),b.onCompleted()},function(){b.onNext(Mb()),b.onCompleted()})})},Tb.repeat=function(a){return Pb(this,a).concat()},Tb.retry=function(a){return Pb(this,a).catchException()},Tb.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new lc(function(e){var f,g,h;return d.subscribe(function(d){try{h||(h=!0),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()})})},Tb.skipLast=function(a){var b=this;return new lc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},Tb.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=Fb,a=lb.call(arguments,c),Qb([cc(a,b),this]).concat()},Tb.takeLast=function(a){var b=this;return new lc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},Tb.takeLastBuffer=function(a){var b=this;return new lc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},Tb.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(N);if(1===arguments.length&&(b=a),0>=b)throw new Error(N);return new lc(function(d){var e=new zb,f=new Ab(e),g=0,h=[],i=function(){var a=new oc;h.push(a),d.onNext(ob(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&j%b===0&&(d=h.shift(),d.onCompleted()),g++,g%b===0&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},Tb.selectConcat=Tb.concatMap=function(a,b,c){return b?this.concatMap(function(c,d){var e=a(c,d),f=M(e)?$b(e):e;return f.map(function(a){return b(c,a,d)})}):"function"==typeof a?u(this,a,c):u(this,function(){return a})},Tb.concatMapObserver=Tb.selectConcatObserver=function(a,b,c,d){var e=this;return new lc(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)}M(c)&&(c=$b(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}M(c)&&(c=$b(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}M(a)&&(a=$b(a)),f.onNext(a),f.onCompleted()})}).concatAll()},Tb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new lc(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()})})},w.prototype.push=function(a){var b=-1===v(this.set,a,this.comparer);return b&&this.set.push(a),b},Tb.distinct=function(a,b){var c=this;return b||(b=J),new lc(function(d){var e=new w(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))})},Tb.select=Tb.map=function(a,b){var c=this;return new lc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Tb.pluck=function(a){return this.select(function(b){return b[a]})},Tb.selectMany=Tb.flatMap=function(a,b,c){return b?this.flatMap(function(c,d){var e=a(c,d),f=M(e)?$b(e):e;return f.map(function(a){return b(c,a,d)})},c):"function"==typeof a?x(this,a,c):x(this,function(){return a})},Tb.flatMapObserver=Tb.selectManyObserver=function(a,b,c,d){var e=this;return new lc(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)}M(c)&&(c=$b(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}M(c)&&(c=$b(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}M(a)&&(a=$b(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},Tb.selectSwitch=Tb.flatMapLatest=Tb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Tb.skip=function(a){if(0>a)throw new Error(N);var b=this;return new lc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Tb.skipWhile=function(a,b){var c=this;return new lc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Tb.take=function(a,b){if(0>a)throw new Error(N);if(0===a)return ac(b);var c=this;return new lc(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},Tb.takeWhile=function(a,b){var c=this;return new lc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Tb.where=Tb.filter=function(a,b){var c=this;return new lc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},Tb.exclusive=function(){var a=this;return new lc(function(b){var c=!1,d=!1,e=new zb,f=new ub;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,M(a)&&(a=$b(a));var e=new zb;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f})},Tb.exclusiveMap=function(a,b){var c=this;return new lc(function(d){var e=0,f=!1,g=!0,h=new zb,i=new ub;return i.add(h),h.setDisposable(c.subscribe(function(c){f||(f=!0,innerSubscription=new zb,i.add(innerSubscription),M(c)&&(c=$b(c)),innerSubscription.setDisposable(c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}d.onNext(g)},d.onError.bind(d),function(){i.remove(innerSubscription),f=!1,g&&1===i.length&&d.onCompleted()})))},d.onError.bind(d),function(){g=!0,1!==i.length||f||d.onCompleted()})),i})};var lc=E.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?xb(a):yb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new mc(a);return Gb.scheduleRequired()?Gb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return mb(c,a),c}(Zb),mc=function(a){function b(b){a.call(this),this.observer=b,this.m=new zb}mb(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.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Ub),nc=function(a,b){this.subject=a,this.observer=b};nc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var oc=E.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),yb):(a.onCompleted(),yb):(this.observers.push(a),new nc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return mb(d,a),nb(d.prototype,Rb,{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 pc(a,b)},d}(Zb),pc=(E.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new nc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),yb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return mb(d,a),nb(d.prototype,Rb,{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}(Zb),E.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return mb(b,a),nb(b.prototype,Rb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(Zb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(z.Rx=E,define(function(){return E})):A&&B?C?(B.exports=E).Rx=E:A.Rx=E:z.Rx=E}).call(this);
1
+ (function(a){function b(){if(this.isDisposed)throw new Error(P)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;kb.nonEnumArgs&&a.length&&h(a)&&(a=mb.call(a));var d=kb.enumPrototypes&&"function"==typeof a,e=kb.enumErrorProps&&(a===eb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(kb.nonEnumShadows&&a!==fb){var g=a.constructor,i=-1,j=ib.length;if(a===(g&&g.prototype))var k=a===stringProto?ab:a===eb?X:bb.call(a),l=jb[k];for(;++i<j;)f=ib[i],l&&l[f]||!cb.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){return a&&"object"==typeof a?bb.call(a)==T:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=bb.call(a),l=bb.call(b);if(k==T&&(k=$),l==T&&(l=$),k!=l)return!1;switch(k){case V:case W:return+a==+b;case Z:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case _:case ab:return a==String(b)}var m=k==U;if(!m){if(k!=$||!kb.nodeClass&&(g(a)||g(b)))return!1;var n=!kb.argsObject&&h(a)?Object:a.constructor,o=!kb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||cb.call(a,"constructor")&&cb.call(b,"constructor")||N(n)&&n instanceof n&&N(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0;if(result=!0,c.push(a),d.push(b),m){if(p=a.length,q=b.length,result=q==p)for(;q--;){var r=b[q];if(!(result=i(a[q],r,c,d)))break}}else f(b,function(b,e,f){return cb.call(f,e)?(q++,result=cb.call(a,e)&&i(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return cb.call(c,b)?result=--q>-1:void 0});return c.pop(),d.pop(),result}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:mb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(a){return"number"==typeof a&&z.isFinite(a)}function o(b){return b[Q]!==a}function p(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function q(a){var b=+a.length;return isNaN(b)?0:0!==b&&n(b)?(b=p(b)*Math.floor(Math.abs(b)),0>=b?0:b>fc?fc:b):b}function r(a){return"[object Function]"===Object.prototype.toString.call(a)&&"function"==typeof a}function s(a,b){return new pc(function(c){var d=new zb,e=new Ab;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)}M(f)&&(f=cc(f)),d=new zb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function t(a,b){var c=this;return new pc(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 u(a,b,c){return a.map(function(a,d){var e=b.call(c,a,d);return M(e)?cc(e):e}).concatAll()}function v(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function w(a){this.comparer=a,this.set=[]}function x(a,b,c){return a.map(function(a,d){var e=b.call(c,a,d);return M(e)?cc(e):e}).mergeObservable()}var y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},z=y[typeof window]&&window||this,A=y[typeof exports]&&exports&&!exports.nodeType&&exports,B=y[typeof module]&&module&&!module.nodeType&&module,C=B&&B.exports===A&&A,D=y[typeof global]&&global;!D||D.global!==D&&D.window!==D||(z=D);var E={internals:{},config:{Promise:z.Promise},helpers:{}},F=E.helpers.noop=function(){},G=(E.helpers.notDefined=function(a){return"undefined"==typeof a},E.helpers.isScheduler=function(a){return a instanceof E.Scheduler}),H=E.helpers.identity=function(a){return a},I=(E.helpers.pluck=function(a){return function(b){return b[a]}},E.helpers.just=function(a){return function(){return a}},E.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),J=E.helpers.defaultComparer=function(a,b){return lb(a,b)},K=E.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},L=(E.helpers.defaultKeySerializer=function(a){return a.toString()},E.helpers.defaultError=function(a){throw a}),M=E.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},N=(E.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},E.helpers.not=function(a){return!a},E.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==bb.call(a)}),a}()),O="Argument out of range",P="Object has been disposed",Q="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";z.Set&&"function"==typeof(new z.Set)["@@iterator"]&&(Q="@@iterator");var R,S={done:!0,value:a},T="[object Arguments]",U="[object Array]",V="[object Boolean]",W="[object Date]",X="[object Error]",Y="[object Function]",Z="[object Number]",$="[object Object]",_="[object RegExp]",ab="[object String]",bb=Object.prototype.toString,cb=Object.prototype.hasOwnProperty,db=bb.call(arguments)==T,eb=Error.prototype,fb=Object.prototype,gb=fb.propertyIsEnumerable;try{R=!(bb.call(document)==$&&!({toString:0}+""))}catch(hb){R=!0}var ib=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jb={};jb[U]=jb[W]=jb[Z]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},jb[V]=jb[ab]={constructor:!0,toString:!0,valueOf:!0},jb[X]=jb[Y]=jb[_]={constructor:!0,toString:!0},jb[$]={constructor:!0};var kb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);kb.enumErrorProps=gb.call(eb,"message")||gb.call(eb,"name"),kb.enumPrototypes=gb.call(a,"prototype"),kb.nonEnumArgs=0!=c,kb.nonEnumShadows=!/valueOf/.test(b)}(1),db||(h=function(a){return a&&"object"==typeof a?cb.call(a,"callee"):!1});var lb=E.internals.isEqual=function(a,b){return i(a,b,[],[])},mb=Array.prototype.slice,nb=({}.hasOwnProperty,this.inherits=E.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),ob=E.internals.addProperties=function(a){for(var b=mb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},pb=E.internals.addRef=function(a,b){return new pc(function(c){return new ub(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=mb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(mb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(mb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var qb=Object("a"),rb="a"!=qb[0]||!(0 in qb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=rb&&{}.toString.call(this)==ab?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Y)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=rb&&{}.toString.call(this)==ab?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Y)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==U}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var sb=E.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},tb=sb.prototype;tb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},tb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},tb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},tb.peek=function(){return this.items[0].value},tb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},tb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},tb.enqueue=function(a){var b=this.length++;this.items[b]=new l(sb.count++,a),this.percolate(b)},tb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},sb.count=0;var ub=E.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},vb=ub.prototype;vb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},vb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},vb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},vb.toArray=function(){return this.disposables.slice(0)};var wb=E.Disposable=function(a){this.isDisposed=!1,this.action=a||F};wb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var xb=wb.create=function(a){return new wb(a)},yb=wb.empty={dispose:F},zb=E.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}(),Ab=E.SerialDisposable=zb,Bb=E.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?yb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Cb=E.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||K,this.disposable=new zb};Cb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Cb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Cb.prototype.isCancelled=function(){return this.disposable.isDisposed},Cb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Db=E.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),yb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=I,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Eb=Db.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new ub,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),yb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new ub,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),yb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Db.prototype),function(){Db.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Db.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof z.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=z.setInterval(function(){d=c(d)},b);return xb(function(){z.clearInterval(e)})}}(Db.prototype),function(a){a.catchError=a["catch"]=function(a){return new Mb(this,a)}}(Db.prototype);var Fb,Gb=(E.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new zb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Db.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Eb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Db(I,a,b,c)}()),Hb=Db.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Db.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()+Db.normalize(c),g=new Cb(this,b,d,f);if(e)e.enqueue(g);else{e=new sb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Db(I,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ib=F,Jb=function(){var a,b=F;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!z.setTimeout)throw new Error("No concurrency detected!");a=z.setTimeout,b=z.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Kb=Jb.setTimeout,Lb=Jb.clearTimeout;!function(){function a(){if(!z.postMessage||z.importScripts)return!1;var a=!1,b=z.onmessage;return z.onmessage=function(){a=!0},z.postMessage("","*"),z.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(bb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=D&&C&&D.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=D&&C&&D.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Fb=process.nextTick;else if("function"==typeof d)Fb=d,Ib=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;z.addEventListener?z.addEventListener("message",b,!1):z.attachEvent("onmessage",b,!1),Fb=function(a){var b=h++;g[b]=a,z.postMessage(f+b,"*")}}else if(z.MessageChannel){var i=new z.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Fb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in z&&"onreadystatechange"in z.document.createElement("script")?Fb=function(a){var b=z.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},z.document.documentElement.appendChild(b)}:(Fb=function(a){return Kb(a,0)},Ib=Lb)}();var Mb=(Db.timeout=function(){function a(a,b){var c=this,d=new zb,e=Fb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new ub(d,xb(function(){Ib(e)}))}function b(a,b,c){var d=this,e=Db.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new zb,g=Kb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new ub(f,xb(function(){Lb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Db(I,a,b,c)}(),function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return nb(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 yb}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new zb;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},f}(Db)),Nb=E.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 G(a)||(a=Gb),new pc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ob=Nb.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 Nb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Pb=Nb.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 Nb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Qb=Nb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Nb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Rb=E.internals.Enumerator=function(a){this._next=a};Rb.prototype.next=function(){return this._next()},Rb.prototype[Q]=function(){return this};var Sb=E.internals.Enumerable=function(a){this._iterator=a};Sb.prototype[Q]=function(){return this._iterator()},Sb.prototype.concat=function(){var a=this;return new pc(function(b){var c;try{c=a[Q]()}catch(d){return void b.onError()}var e,f=new Ab,g=Gb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;M(h)&&(h=cc(h));var i=new zb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new ub(f,g,xb(function(){e=!0}))})},Sb.prototype.catchException=function(){var a=this;return new pc(function(b){var c;try{c=a[Q]()}catch(d){return void b.onError()}var e,f,g=new Ab,h=Gb.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;M(i)&&(i=cc(i));var j=new zb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new ub(g,h,xb(function(){e=!0}))})};var Tb=Sb.repeat=function(a,b){return null==b&&(b=-1),new Sb(function(){var c=b;return new Rb(function(){return 0===c?S:(c>0&&c--,{done:!1,value:a})})})},Ub=Sb.forEach=function(a,b,c){return b||(b=H),new Sb(function(){var d=-1;return new Rb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:S})})},Vb=E.Observer=function(){};Vb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Vb.prototype.asObserver=function(){return new Zb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Vb.prototype.checked=function(){return new $b(this)};var Wb=Vb.create=function(a,b,c){return a||(a=F),b||(b=L),c||(c=F),new Zb(a,b,c)};Vb.fromNotifier=function(a){return new Zb(function(b){return a(Ob(b))},function(b){return a(Pb(b))},function(){return a(Qb())})},Vb.notifyOn=function(a){return new ac(a,this)};var Xb,Yb=E.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return nb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Vb),Zb=E.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return nb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Yb),$b=function(a){function b(b){a.call(this),this._observer=b,this._state=0}nb(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}(Vb),_b=E.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 Ab}return nb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Yb),ac=function(a){function b(){a.apply(this,arguments)}return nb(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}(_b),bc=E.Observable=function(){function a(a){this._subscribe=a}return Xb=a.prototype,Xb.subscribe=Xb.forEach=function(a,b,c){var d="object"==typeof a?a:Wb(a,b,c);return this._subscribe(d)},a}();Xb.observeOn=function(a){var b=this;return new pc(function(c){return b.subscribe(new ac(a,c))})},Xb.subscribeOn=function(a){var b=this;return new pc(function(c){var d=new zb,e=new Ab;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var cc=bc.fromPromise=function(a){return dc(function(){var b=new E.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};Xb.toPromise=function(a){if(a||(a=E.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)})})},Xb.toArray=function(){var a=this;return new pc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},bc.create=bc.createWithDisposable=function(a){return new pc(a)};var dc=bc.defer=function(a){return new pc(function(b){var c;try{c=a()}catch(d){return jc(d).subscribe(b)}return M(c)&&(c=cc(c)),c.subscribe(b)})},ec=bc.empty=function(a){return G(a)||(a=Gb),new pc(function(b){return a.schedule(function(){b.onCompleted()})})},fc=Math.pow(2,53)-1;bc.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");return G(d)||(d=Hb),new pc(function(e){var f=Object(a),g=o(f),h=g?0:q(f),i=g?f[Q]():null,j=0;return d.scheduleRecursive(function(a){if(h>j||g){var d;if(g){var k=i.next();if(k.done)return void e.onCompleted();d=k.value}else d=f[j];if(b&&r(b))try{d=c?b.call(c,d,j):b(d,j)}catch(l){return void e.onError(l)}e.onNext(d),j++,a()}else e.onCompleted()})})};var gc=bc.fromArray=function(a,b){return G(b)||(b=Hb),new pc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};bc.generate=function(a,b,c,d,e){return G(e)||(e=Hb),new pc(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 hc=bc.never=function(){return new pc(function(){return yb})};bc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return gc(b)};bc.ofWithScheduler=function(a){for(var b=arguments.length-1,c=new Array(b),d=0;b>d;d++)c[d]=arguments[d+1];return gc(c,a)};bc.range=function(a,b,c){return G(c)||(c=Hb),new pc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},bc.repeat=function(a,b,c){return G(c)||(c=Hb),ic(a,c).repeat(null==b?-1:b)};var ic=bc["return"]=bc.returnValue=bc.just=function(a,b){return G(b)||(b=Gb),new pc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},jc=bc["throw"]=bc.throwException=bc.throwError=function(a,b){return G(b)||(b=Gb),new pc(function(c){return b.schedule(function(){c.onError(a)})})};bc.using=function(a,b){return new pc(function(c){var d,e,f=yb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new ub(jc(g).subscribe(c),f)}return new ub(e.subscribe(c),f)})},Xb.amb=function(a){var b=this;return new pc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new zb,j=new zb;return M(a)&&(a=cc(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 ub(i,j)})},bc.amb=function(){function a(a,b){return a.amb(b)}for(var b=hc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Xb["catch"]=Xb.catchException=function(a){return"function"==typeof a?s(this,a):kc([this,a])};var kc=bc.catchException=bc["catch"]=function(){var a=j(arguments,0);return Ub(a).catchException()};Xb.combineLatest=function(){var a=mb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),lc.apply(this,a)};var lc=bc.combineLatest=function(){var a=mb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new pc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(H))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(H)&&c.onCompleted()}function e(a){j[a]=!0,j.every(H)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new zb;M(f)&&(f=cc(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 ub(m)})};Xb.concat=function(){var a=mb.call(arguments,0);return a.unshift(this),mc.apply(this,a)};var mc=bc.concat=function(){var a=j(arguments,0);return Ub(a).concat()};Xb.concatObservable=Xb.concatAll=function(){return this.merge(1)},Xb.merge=function(a){if("number"!=typeof a)return nc(this,a);var b=this;return new pc(function(c){function d(a){var b=new zb;f.add(b),M(a)&&(a=cc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new ub,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var nc=bc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=mb.call(arguments,1)):(a=Gb,b=mb.call(arguments,0)):(a=Gb,b=mb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),gc(b,a).mergeObservable()};Xb.mergeObservable=Xb.mergeAll=function(){var a=this;return new pc(function(b){var c=new ub,d=!1,e=new zb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new zb;c.add(e),M(a)&&(a=cc(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})},Xb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return oc([this,a])};var oc=bc.onErrorResumeNext=function(){var a=j(arguments,0);return new pc(function(b){var c=0,d=new Ab,e=Gb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],M(f)&&(f=cc(f)),g=new zb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new ub(d,e)})};Xb.skipUntil=function(a){var b=this;return new pc(function(c){var d=!1,e=new ub(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));M(a)&&(a=cc(a));var f=new zb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()
2
+ },c.onError.bind(c),function(){f.dispose()})),e})},Xb["switch"]=Xb.switchLatest=function(){var a=this;return new pc(function(b){var c=!1,d=new Ab,e=!1,f=0,g=a.subscribe(function(a){var g=new zb,h=++f;c=!0,d.setDisposable(g),M(a)&&(a=cc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new ub(g,d)})},Xb.takeUntil=function(a){var b=this;return new pc(function(c){return M(a)&&(a=cc(a)),new ub(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),F))})},Xb.zip=function(){if(Array.isArray(arguments[0]))return t.apply(this,arguments);var a=this,b=mb.call(arguments),c=b.pop();return b.unshift(a),new pc(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(H)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new zb;M(c)&&(c=cc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new ub(j)})},bc.zip=function(){var a=mb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},bc.zipArray=function(){var a=j(arguments,0);return new pc(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(H))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(H)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new zb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new ub(h);return j.add(xb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Xb.asObservable=function(){return new pc(this.subscribe.bind(this))},Xb.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})},Xb.dematerialize=function(){var a=this;return new pc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Xb.distinctUntilChanged=function(a,b){var c=this;return a||(a=H),b||(b=J),new pc(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))})},Xb["do"]=Xb.doAction=Xb.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 pc(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)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},Xb["finally"]=Xb.finallyAction=function(a){var b=this;return new pc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return xb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Xb.ignoreElements=function(){var a=this;return new pc(function(b){return a.subscribe(F,b.onError.bind(b),b.onCompleted.bind(b))})},Xb.materialize=function(){var a=this;return new pc(function(b){return a.subscribe(function(a){b.onNext(Ob(a))},function(a){b.onNext(Pb(a)),b.onCompleted()},function(){b.onNext(Qb()),b.onCompleted()})})},Xb.repeat=function(a){return Tb(this,a).concat()},Xb.retry=function(a){return Tb(this,a).catchException()},Xb.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 pc(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()})})},Xb.skipLast=function(a){var b=this;return new pc(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))})},Xb.startWith=function(){var a,b,c=0;return arguments.length&&G(arguments[0])?(b=arguments[0],c=1):b=Gb,a=mb.call(arguments,c),Ub([gc(a,b),this]).concat()},Xb.takeLast=function(a){var b=this;return new pc(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()})})},Xb.takeLastBuffer=function(a){var b=this;return new pc(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()})})},Xb.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(O);if(1===arguments.length&&(b=a),0>=b)throw new Error(O);return new pc(function(d){var e=new zb,f=new Bb(e),g=0,h=[],i=function(){var a=new sc;h.push(a),d.onNext(pb(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&j%b===0&&(d=h.shift(),d.onCompleted()),g++,g%b===0&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},Xb.selectConcat=Xb.concatMap=function(a,b,c){return b?this.concatMap(function(c,d){var e=a(c,d),f=M(e)?cc(e):e;return f.map(function(a){return b(c,a,d)})}):"function"==typeof a?u(this,a,c):u(this,function(){return a})},Xb.concatMapObserver=Xb.selectConcatObserver=function(a,b,c,d){var e=this;return new pc(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)}M(c)&&(c=cc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}M(c)&&(c=cc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}M(a)&&(a=cc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},Xb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new pc(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()})})},w.prototype.push=function(a){var b=-1===v(this.set,a,this.comparer);return b&&this.set.push(a),b},Xb.distinct=function(a,b){var c=this;return b||(b=J),new pc(function(d){var e=new w(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))})},Xb.select=Xb.map=function(a,b){var c=this;return new pc(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)}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Xb.pluck=function(a){return this.map(function(b){return b[a]})},Xb.selectMany=Xb.flatMap=function(a,b,c){return b?this.flatMap(function(c,d){var e=a(c,d),f=M(e)?cc(e):e;return f.map(function(a){return b(c,a,d)})},c):"function"==typeof a?x(this,a,c):x(this,function(){return a})},Xb.flatMapObserver=Xb.selectManyObserver=function(a,b,c,d){var e=this;return new pc(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)}M(c)&&(c=cc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}M(c)&&(c=cc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}M(a)&&(a=cc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},Xb.selectSwitch=Xb.flatMapLatest=Xb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Xb.skip=function(a){if(0>a)throw new Error(O);var b=this;return new pc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Xb.skipWhile=function(a,b){var c=this;return new pc(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))})},Xb.take=function(a,b){if(0>a)throw new RangeError(O);if(0===a)return ec(b);var c=this;return new pc(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))})},Xb.takeWhile=function(a,b){var c=this;return new pc(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))})},Xb.where=Xb.filter=function(a,b){var c=this;return new pc(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))})},Xb.exclusive=function(){var a=this;return new pc(function(b){var c=!1,d=!1,e=new zb,f=new ub;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,M(a)&&(a=cc(a));var e=new zb;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f})},Xb.exclusiveMap=function(a,b){var c=this;return new pc(function(d){var e=0,f=!1,g=!0,h=new zb,i=new ub;return i.add(h),h.setDisposable(c.subscribe(function(c){f||(f=!0,innerSubscription=new zb,i.add(innerSubscription),M(c)&&(c=cc(c)),innerSubscription.setDisposable(c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}d.onNext(g)},d.onError.bind(d),function(){i.remove(innerSubscription),f=!1,g&&1===i.length&&d.onCompleted()})))},d.onError.bind(d),function(){g=!0,1!==i.length||f||d.onCompleted()})),i})};var pc=E.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?xb(a):yb}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 qc(a);return Hb.scheduleRequired()?Hb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return nb(c,a),c}(bc),qc=function(a){function b(b){a.call(this),this.observer=b,this.m=new zb}nb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Yb),rc=function(a,b){this.subject=a,this.observer=b};rc.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 sc=E.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),yb):(a.onCompleted(),yb):(this.observers.push(a),new rc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return nb(d,a),ob(d.prototype,Vb,{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 tc(a,b)},d}(bc),tc=(E.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new rc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),yb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return nb(d,a),ob(d.prototype,Vb,{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}(bc),E.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return nb(b,a),ob(b.prototype,Vb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(bc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(z.Rx=E,define(function(){return E})):A&&B?C?(B.exports=E).Rx=E:A.Rx=E:z.Rx=E}).call(this);