rxjs-rails 2.3.14 → 2.3.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rxjs/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/rx.aggregates.js +325 -370
  4. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  5. data/vendor/assets/javascripts/rx.all.compat.js +1115 -930
  6. data/vendor/assets/javascripts/rx.all.compat.min.js +4 -3
  7. data/vendor/assets/javascripts/rx.all.js +1113 -928
  8. data/vendor/assets/javascripts/rx.all.min.js +3 -3
  9. data/vendor/assets/javascripts/rx.async.compat.js +16 -20
  10. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  11. data/vendor/assets/javascripts/rx.async.js +14 -18
  12. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  13. data/vendor/assets/javascripts/rx.backpressure.js +26 -10
  14. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  15. data/vendor/assets/javascripts/rx.binding.js +2 -14
  16. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  17. data/vendor/assets/javascripts/rx.coincidence.js +13 -13
  18. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  19. data/vendor/assets/javascripts/rx.compat.js +586 -378
  20. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  21. data/vendor/assets/javascripts/rx.experimental.js +37 -29
  22. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  23. data/vendor/assets/javascripts/rx.js +586 -378
  24. data/vendor/assets/javascripts/rx.lite.compat.js +632 -394
  25. data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
  26. data/vendor/assets/javascripts/rx.lite.extras.js +29 -25
  27. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  28. data/vendor/assets/javascripts/rx.lite.js +630 -392
  29. data/vendor/assets/javascripts/rx.lite.min.js +2 -2
  30. data/vendor/assets/javascripts/rx.min.js +2 -2
  31. data/vendor/assets/javascripts/rx.sorting.js +72 -0
  32. data/vendor/assets/javascripts/rx.sorting.min.js +3 -0
  33. data/vendor/assets/javascripts/rx.testing.js +116 -83
  34. data/vendor/assets/javascripts/rx.testing.min.js +1 -1
  35. data/vendor/assets/javascripts/rx.time.js +127 -101
  36. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  37. metadata +4 -2
@@ -1,4 +1,4 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){function b(){if(this.isDisposed)throw new Error(X)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&h(a)&&(a=ub.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===mb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==nb){var g=a.constructor,i=-1,j=qb.length;if(a===(g&&g.prototype))var k=a===stringProto?ib:a===mb?db:jb.call(a),l=rb[k];for(;++i<j;)f=qb[i],l&&l[f]||!kb.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?jb.call(a)==_:!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=jb.call(a),l=jb.call(b);if(k==_&&(k=gb),l==_&&(l=gb),k!=l)return!1;switch(k){case bb:case cb:return+a==+b;case fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case hb:case ib:return a==String(b)}var m=k==ab;if(!m){if(k!=gb||!sb.nodeClass&&(g(a)||g(b)))return!1;var n=!sb.argsObject&&h(a)?Object:a.constructor,o=!sb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||kb.call(a,"constructor")&&kb.call(b,"constructor")||V(n)&&n instanceof n&&V(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,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return kb.call(f,e)?(q++,r=kb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return kb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ub.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){return"number"==typeof a&&H.isFinite(a)}function n(b){return b[Y]!==a}function o(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function p(a){var b=+a.length;return isNaN(b)?0:0!==b&&m(b)?(b=o(b)*Math.floor(Math.abs(b)),0>=b?0:b>ic?ic:b):b}function q(a){return"[object Function]"===Object.prototype.toString.call(a)&&"function"==typeof a}function r(a,b){return new Cc(function(c){var d=new Gb,e=new Hb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}U(f)&&(f=vc(f)),d=new Gb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function s(a,b){var c=this;return new Cc(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 t(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return U(f)&&(f=vc(f)),(Array.isArray(f)||n(f))&&(f=jc(f)),f}).concatAll()}function u(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return U(f)&&(f=vc(f)),(Array.isArray(f)||n(f))&&(f=jc(f)),f}).mergeObservable()}function v(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=H.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function w(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Eb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(v(a))};return a.attachEvent("on"+b,d),Eb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Eb(function(){a["on"+b]=null})}function x(a,b,c){var d=new Bb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(x(a.item(e),b,c));else a&&d.add(w(a,b,c));return d}function y(a,b){return new Cc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function z(a,b,c){return new Cc(function(d){var e=0,f=a,g=Kb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function A(a,b){return new Cc(function(c){return b.scheduleWithRelative(Kb(a),function(){c.onNext(0),c.onCompleted()})})}function B(a,b,c){return a===b?new Cc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):gc(function(){return z(c.now()+a,b,c)})}function C(a,b,c){return new Cc(function(d){var e,f=!1,g=new Hb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Gb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Bb(e,g)})}function D(a,b,c){return gc(function(){return C(a,b-c.now(),c)})}function E(a,b){return new Cc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Bb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function F(a,b,c){return new Cc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(P))){try{e=c.apply(null,j)}catch(f){return void d.onError(f)}d.onNext(e)}else i&&d.onCompleted()}var f=2,g=[!1,!1],h=!1,i=!1,j=new Array(f);return new Bb(a.subscribe(function(a){e(a,0)},d.onError.bind(d),function(){i=!0,d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d)))})}var G={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},H=G[typeof window]&&window||this,I=G[typeof exports]&&exports&&!exports.nodeType&&exports,J=G[typeof module]&&module&&!module.nodeType&&module,K=J&&J.exports===I&&I,L=G[typeof global]&&global;!L||L.global!==L&&L.window!==L||(H=L);var M={internals:{},config:{Promise:H.Promise},helpers:{}},N=M.helpers.noop=function(){},O=(M.helpers.notDefined=function(a){return"undefined"==typeof a},M.helpers.isScheduler=function(a){return a instanceof M.Scheduler}),P=M.helpers.identity=function(a){return a},Q=(M.helpers.pluck=function(a){return function(b){return b[a]}},M.helpers.just=function(a){return function(){return a}},M.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),R=M.helpers.defaultComparer=function(a,b){return tb(a,b)},S=M.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},T=(M.helpers.defaultKeySerializer=function(a){return a.toString()},M.helpers.defaultError=function(a){throw a}),U=M.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},V=(M.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},M.helpers.not=function(a){return!a},M.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==jb.call(a)}),a}()),W="Argument out of range",X="Object has been disposed",Y="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";H.Set&&"function"==typeof(new H.Set)["@@iterator"]&&(Y="@@iterator");var Z=M.doneEnumerator={done:!0,value:a};M.iterator=Y;var $,_="[object Arguments]",ab="[object Array]",bb="[object Boolean]",cb="[object Date]",db="[object Error]",eb="[object Function]",fb="[object Number]",gb="[object Object]",hb="[object RegExp]",ib="[object String]",jb=Object.prototype.toString,kb=Object.prototype.hasOwnProperty,lb=jb.call(arguments)==_,mb=Error.prototype,nb=Object.prototype,ob=nb.propertyIsEnumerable;try{$=!(jb.call(document)==gb&&!({toString:0}+""))}catch(pb){$=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[ab]=rb[cb]=rb[fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[bb]=rb[ib]={constructor:!0,toString:!0,valueOf:!0},rb[db]=rb[eb]=rb[hb]={constructor:!0,toString:!0},rb[gb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(mb,"message")||ob.call(mb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1),lb||(h=function(a){return a&&"object"==typeof a?kb.call(a,"callee"):!1});{var tb=M.internals.isEqual=function(a,b){return i(a,b,[],[])},ub=Array.prototype.slice,vb=({}.hasOwnProperty,this.inherits=M.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),wb=M.internals.addProperties=function(a){for(var b=ub.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};M.internals.addRef=function(a,b){return new Cc(function(c){return new Bb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=ub.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(ub.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(ub.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 xb=Object("a"),yb="a"!=xb[0]||!(0 in xb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=yb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=eb)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=yb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=eb)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)==ab}),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 zb=M.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ab=zb.prototype;Ab.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ab.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Ab.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Ab.peek=function(){return this.items[0].value},Ab.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ab.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ab.enqueue=function(a){var b=this.length++;this.items[b]=new l(zb.count++,a),this.percolate(b)},Ab.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},zb.count=0;var Bb=M.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Cb=Bb.prototype;Cb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Cb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Cb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Cb.toArray=function(){return this.disposables.slice(0)};var Db=M.Disposable=function(a){this.isDisposed=!1,this.action=a||N};Db.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Eb=Db.create=function(a){return new Db(a)},Fb=Db.empty={dispose:N},Gb=M.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Hb=M.SerialDisposable=Gb,Ib=(M.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Fb:new a(this)},b}(),M.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||S,this.disposable=new Gb});Ib.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Ib.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Ib.prototype.isCancelled=function(){return this.disposable.isDisposed},Ib.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Jb=M.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Fb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Q,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Kb=Jb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Bb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Fb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Bb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Fb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Jb.prototype),function(){Jb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Jb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof H.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=H.setInterval(function(){d=c(d)},b);return Eb(function(){H.clearInterval(e)})}}(Jb.prototype);var Lb,Mb=Jb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Kb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(Q,a,b,c)}(),Nb=Jb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Jb.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()+Jb.normalize(c),g=new Ib(this,b,d,f);if(e)e.enqueue(g);else{e=new zb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Jb(Q,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ob=(M.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Gb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),N),Pb=function(){var a,b=N;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!H.setTimeout)throw new Error("No concurrency detected!");a=H.setTimeout,b=H.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Qb=Pb.setTimeout,Rb=Pb.clearTimeout;!function(){function a(){if(!H.postMessage||H.importScripts)return!1;var a=!1,b=H.onmessage;return H.onmessage=function(){a=!0},H.postMessage("","*"),H.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(jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=L&&K&&L.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=L&&K&&L.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Lb=process.nextTick;else if("function"==typeof d)Lb=d,Ob=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;H.addEventListener?H.addEventListener("message",b,!1):H.attachEvent("onmessage",b,!1),Lb=function(a){var b=h++;g[b]=a,H.postMessage(f+b,"*")}}else if(H.MessageChannel){var i=new H.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Lb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in H&&"onreadystatechange"in H.document.createElement("script")?Lb=function(a){var b=H.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},H.document.documentElement.appendChild(b)}:(Lb=function(a){return Qb(a,0)},Ob=Rb)}();var Sb=Jb.timeout=function(){function a(a,b){var c=this,d=new Gb,e=Lb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Bb(d,Eb(function(){Ob(e)}))}function b(a,b,c){var d=this,e=Jb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Gb,g=Qb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Bb(f,Eb(function(){Rb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(Q,a,b,c)}(),Tb=M.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 O(a)||(a=Mb),new Cc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ub=Tb.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 Tb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Vb=Tb.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 Tb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Wb=Tb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Tb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Xb=M.internals.Enumerator=function(a){this._next=a};Xb.prototype.next=function(){return this._next()},Xb.prototype[Y]=function(){return this};var Yb=M.internals.Enumerable=function(a){this._iterator=a};Yb.prototype[Y]=function(){return this._iterator()},Yb.prototype.concat=function(){var a=this;return new Cc(function(b){var c;try{c=a[Y]()}catch(d){return void b.onError()}var e,f=new Hb,g=Mb.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;U(h)&&(h=vc(h));var i=new Gb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Bb(f,g,Eb(function(){e=!0}))})},Yb.prototype.catchException=function(){var a=this;return new Cc(function(b){var c;try{c=a[Y]()}catch(d){return void b.onError()}var e,f,g=new Hb,h=Mb.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;U(i)&&(i=vc(i));var j=new Gb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Bb(g,h,Eb(function(){e=!0}))})};var Zb=Yb.repeat=function(a,b){return null==b&&(b=-1),new Yb(function(){var c=b;return new Xb(function(){return 0===c?Z:(c>0&&c--,{done:!1,value:a})})})},$b=Yb.of=function(a,b,c){return b||(b=P),new Yb(function(){var d=-1;return new Xb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:Z})})},_b=M.Observer=function(){};_b.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},_b.prototype.asObserver=function(){return new dc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var ac=_b.create=function(a,b,c){return a||(a=N),b||(b=T),c||(c=N),new dc(a,b,c)};_b.fromNotifier=function(a,b){return new dc(function(c){return a.call(b,Ub(c))},function(c){return a.call(b,Vb(c))},function(){return a.call(b,Wb())})};var bc,cc=M.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return vb(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}(_b),dc=M.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return vb(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}(cc),ec=M.Observable=function(){function a(a){this._subscribe=a}return bc=a.prototype,bc.subscribe=bc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ac(a,b,c))},bc.subscribeOnNext=function(a,b){return this._subscribe(ac(2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnError=function(a,b){return this._subscribe(ac(null,2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnCompleted=function(a,b){return this._subscribe(ac(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),fc=M.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Hb}return vb(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}(cc);bc.toArray=function(){var a=this;return new Cc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},ec.create=ec.createWithDisposable=function(a){return new Cc(a)};{var gc=ec.defer=function(a){return new Cc(function(b){var c;try{c=a()}catch(d){return mc(d).subscribe(b)}return U(c)&&(c=vc(c)),c.subscribe(b)})},hc=ec.empty=function(a){return O(a)||(a=Mb),new Cc(function(b){return a.schedule(function(){b.onCompleted()})})},ic=Math.pow(2,53)-1,jc=ec.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!q(b))throw new Error("mapFn when provided must be a function");return O(d)||(d=Nb),new Cc(function(e){var f=Object(a),g=n(f),h=g?0:p(f),i=g?f[Y]():null,j=0;return d.scheduleRecursive(function(a){if(h>j||g){var d;if(g){var k;try{k=i.next()}catch(l){return void e.onError(l)}if(k.done)return void e.onCompleted();d=k.value}else d=f.charAt?f.charAt(j):f[j];if(b&&q(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()})})},kc=ec.fromArray=function(a,b){return O(b)||(b=Nb),new Cc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};ec.never=function(){return new Cc(function(){return Fb})}}ec.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return kc(b)};ec.ofWithScheduler=function(a){for(var b=arguments.length-1,c=new Array(b),d=0;b>d;d++)c[d]=arguments[d+1];return kc(c,a)};ec.range=function(a,b,c){return O(c)||(c=Nb),new Cc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},ec.repeat=function(a,b,c){return O(c)||(c=Nb),lc(a,c).repeat(null==b?-1:b)};var lc=ec["return"]=ec.returnValue=ec.just=function(a,b){return O(b)||(b=Mb),new Cc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},mc=ec["throw"]=ec.throwException=ec.throwError=function(a,b){return O(b)||(b=Mb),new Cc(function(c){return b.schedule(function(){c.onError(a)})})};bc["catch"]=bc.catchError=bc.catchException=function(a){return"function"==typeof a?r(this,a):nc([this,a])};var nc=ec.catchException=ec.catchError=ec["catch"]=function(){return $b(j(arguments,0)).catchException()};bc.combineLatest=function(){var a=ub.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),oc.apply(this,a)};var oc=ec.combineLatest=function(){var a=ub.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Cc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(P))){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(P)&&c.onCompleted()}function e(a){j[a]=!0,j.every(P)&&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 Gb;U(f)&&(f=vc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Bb(m)})};bc.concat=function(){var a=ub.call(arguments,0);return a.unshift(this),pc.apply(this,a)};var pc=ec.concat=function(){return $b(j(arguments,0)).concat()};bc.concatObservable=bc.concatAll=function(){return this.merge(1)},bc.merge=function(a){if("number"!=typeof a)return qc(this,a);var b=this;return new Cc(function(c){function d(a){var b=new Gb;f.add(b),U(a)&&(a=vc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Bb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var qc=ec.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ub.call(arguments,1)):(a=Mb,b=ub.call(arguments,0)):(a=Mb,b=ub.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),kc(b,a).mergeObservable()};bc.mergeObservable=bc.mergeAll=function(){var a=this;return new Cc(function(b){var c=new Bb,d=!1,e=new Gb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Gb;c.add(e),U(a)&&(a=vc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},bc.skipUntil=function(a){var b=this;return new Cc(function(c){var d=!1,e=new Bb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));U(a)&&(a=vc(a));var f=new Gb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},bc["switch"]=bc.switchLatest=function(){var a=this;return new Cc(function(b){var c=!1,d=new Hb,e=!1,f=0,g=a.subscribe(function(a){var g=new Gb,h=++f;c=!0,d.setDisposable(g),U(a)&&(a=vc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Bb(g,d)})},bc.takeUntil=function(a){var b=this;return new Cc(function(c){return U(a)&&(a=vc(a)),new Bb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),N))})},bc.zip=function(){if(Array.isArray(arguments[0]))return s.apply(this,arguments);var a=this,b=ub.call(arguments),c=b.pop();return b.unshift(a),new Cc(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(P)&&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 Gb;
3
- U(c)&&(c=vc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Bb(j)})},ec.zip=function(){var a=ub.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},ec.zipArray=function(){var a=j(arguments,0);return new Cc(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(P))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(P)?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 Gb,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 Bb(h);return j.add(Eb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},bc.asObservable=function(){return new Cc(this.subscribe.bind(this))},bc.dematerialize=function(){var a=this;return new Cc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},bc.distinctUntilChanged=function(a,b){var c=this;return a||(a=P),b||(b=R),new Cc(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))})},bc["do"]=bc.doAction=bc.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 Cc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},bc.doOnNext=bc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnError=bc.tapOnError=function(a,b){return this.tap(N,2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnCompleted=bc.tapOnCompleted=function(a,b){return this.tap(N,null,2===arguments.length?function(){a.call(b)}:a)},bc["finally"]=bc.finallyAction=function(a){var b=this;return new Cc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Eb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},bc.ignoreElements=function(){var a=this;return new Cc(function(b){return a.subscribe(N,b.onError.bind(b),b.onCompleted.bind(b))})},bc.materialize=function(){var a=this;return new Cc(function(b){return a.subscribe(function(a){b.onNext(Ub(a))},function(a){b.onNext(Vb(a)),b.onCompleted()},function(){b.onNext(Wb()),b.onCompleted()})})},bc.repeat=function(a){return Zb(this,a).concat()},bc.retry=function(a){return Zb(this,a).catchException()},bc.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 Cc(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()})})},bc.skipLast=function(a){var b=this;return new Cc(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))})},bc.startWith=function(){var a,b,c=0;return arguments.length&&O(arguments[0])?(b=arguments[0],c=1):b=Mb,a=ub.call(arguments,c),$b([kc(a,b),this]).concat()},bc.takeLast=function(a){var b=this;return new Cc(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()})})},bc.selectConcat=bc.concatMap=function(a,b,c){return"function"==typeof a&&"function"==typeof b?this.concatMap(function(c,d){var e=a(c,d);return U(e)&&(e=vc(e)),(Array.isArray(e)||n(e))&&(e=jc(e)),e.map(function(a,e){return b(c,a,d,e)})}):"function"==typeof a?t(this,a,c):t(this,function(){return a})},bc.select=bc.map=function(a,b){var c=this;return new Cc(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))})},bc.pluck=function(a){return this.map(function(b){return b[a]})},bc.selectMany=bc.flatMap=function(a,b,c){return"function"==typeof a&&"function"==typeof b?this.flatMap(function(c,d){var e=a(c,d);return U(e)&&(e=vc(e)),(Array.isArray(e)||n(e))&&(e=jc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):"function"==typeof a?u(this,a,c):u(this,function(){return a})},bc.selectSwitch=bc.flatMapLatest=bc.switchMap=function(a,b){return this.select(a,b).switchLatest()},bc.skip=function(a){if(0>a)throw new Error(W);var b=this;return new Cc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},bc.skipWhile=function(a,b){var c=this;return new Cc(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))})},bc.take=function(a,b){if(0>a)throw new RangeError(W);if(0===a)return hc(b);var c=this;return new Cc(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))})},bc.takeWhile=function(a,b){var c=this;return new Cc(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))})},bc.where=bc.filter=function(a,b){var c=this;return new Cc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},ec.fromCallback=function(a,b,c){return function(){var d=ub.call(arguments,0);return new Cc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},ec.fromNodeCallback=function(a,b,c){return function(){var d=ub.call(arguments,0);return new Cc(function(e){function f(a){if(a)return void e.onError(a);var b=ub.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},M.config.useNativeEvents=!1;var rc=H.angular&&angular.element?angular.element:H.jQuery?H.jQuery:H.Zepto?H.Zepto:null,sc=!!H.Ember&&"function"==typeof H.Ember.addListener,tc=!!H.Backbone&&!!H.Backbone.Marionette;ec.fromEvent=function(a,b,c){if(a.addListener)return uc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!M.config.useNativeEvents){if(tc)return uc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(sc)return uc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(rc){var d=rc(a);return uc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Cc(function(d){return x(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var uc=ec.fromEventPattern=function(a,b,c){return new Cc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Eb(function(){b&&b(e,f)})}).publish().refCount()},vc=ec.fromPromise=function(a){return gc(function(){var b=new M.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};bc.toPromise=function(a){if(a||(a=M.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},ec.startAsync=function(a){var b;try{b=a()}catch(c){return mc(c)}return vc(b)},bc.multicast=function(a,b){var c=this;return"function"==typeof a?new Cc(function(d){var e=c.multicast(a());return new Bb(b(e).subscribe(d),e.connect())}):new wc(c,a)},bc.publish=function(a){return a&&V(a)?this.multicast(function(){return new Fc},a):this.multicast(new Fc)},bc.share=function(){return this.publish().refCount()},bc.publishLast=function(a){return a&&V(a)?this.multicast(function(){return new Gc},a):this.multicast(new Gc)},bc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Ic(b)},a):this.multicast(new Ic(a))},bc.shareValue=function(a){return this.publishValue(a).refCount()},bc.replay=function(a,b,c,d){return a&&V(a)?this.multicast(function(){return new Jc(b,c,d)},a):this.multicast(new Jc(b,c,d))},bc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var wc=M.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Bb(f.subscribe(c),Eb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return vb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Cc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(ec),xc=ec.interval=function(a,b){return B(a,a,O(b)?b:Sb)};ec.timer=function(b,c,d){var e;return O(d)||(d=Sb),c!==a&&"number"==typeof c?e=c:O(c)&&(d=c),b instanceof Date&&e===a?y(b.getTime(),d):b instanceof Date&&e!==a?(e=c,z(b.getTime(),e,d)):e===a?A(b,d):B(b,e,d)}}bc.delay=function(a,b){return O(b)||(b=Sb),a instanceof Date?D(this,a.getTime(),b):C(this,a,b)},bc.throttle=function(a,b){O(b)||(b=Sb);var c=this;return new Cc(function(d){var e,f=new Hb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Gb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Bb(i,f)})},bc.timestamp=function(a){return O(a)||(a=Sb),this.map(function(b){return{value:b,timestamp:a.now()}})},bc.sample=function(a,b){return O(b)||(b=Sb),"number"==typeof a?E(this,xc(a,b)):E(this,a)},bc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=mc(new Error(b||"Timeout"))),O(c)||(c=Sb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Cc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(U(b)&&(b=vc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Gb,j=new Hb,k=!1,l=new Hb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Bb(j,l)})};var yc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Fb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Fb)});return new Bb(c,d,e)}function c(c,d){this.source=c,this.controller=new Fc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return vb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(ec);bc.pausable=function(a){return new yc(this,a)};var zc=function(b){function c(b){var c,d=[],e=F(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Fc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return vb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(ec);bc.pausableBuffered=function(a){return new zc(this,a)},bc.controlled=function(a){return null==a&&(a=!0),new Ac(this,a)};var Ac=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Bc(d),this.source=c.multicast(this.subject).refCount()}return vb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(ec),Bc=M.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Fc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Fb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Fb}return vb(d,a),wb(d.prototype,_b,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Fb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Fb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Fb:(this.requestedCount=a,this.requestedDisposable=Eb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Fb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(ec);bc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Cc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Cc=M.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Eb(a):Fb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Dc(a);return Nb.scheduleRequired()?Nb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return vb(c,a),c}(ec),Dc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Gb}vb(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}(cc),Ec=function(a,b){this.subject=a,this.observer=b};Ec.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 Fc=M.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Fb):(a.onCompleted(),Fb):(this.observers.push(a),new Ec(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return vb(d,a),wb(d.prototype,_b,{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 Hc(a,b)},d}(ec),Gc=M.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Ec(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Fb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return vb(d,a),wb(d.prototype,_b,{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}(ec),Hc=M.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return vb(b,a),wb(b.prototype,_b,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(ec),Ic=M.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Ec(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Fb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return vb(d,a),wb(d.prototype,_b,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(ec),Jc=M.ReplaySubject=function(a){function c(a,b){return Eb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new fc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Nb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return vb(e,a),wb(e.prototype,_b,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(ec);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(H.Rx=M,define(function(){return M})):I&&J?K?(J.exports=M).Rx=M:I.Rx=M:H.Rx=M}).call(this);
2
+ (function(a){function b(){if(this.isDisposed)throw new Error(fb)}function c(a,b){if(gb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(kb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+kb+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return console.log(ib,jb,bd),c===ib&&d>=jb&&bd>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(gb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ib=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;Kb.nonEnumArgs&&a.length&&Lb(a)&&(a=Nb.call(a));var c=Kb.enumPrototypes&&"function"==typeof a,d=Kb.enumErrorProps&&(a===Eb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Kb.nonEnumShadows&&a!==Fb){var f=a.constructor,g=-1,h=Ib.length;if(a===(f&&f.prototype))var j=a===Gb?Ab:a===Eb?vb:Bb.call(a),k=Jb[j];for(;++g<h;)e=Ib[g],k&&k[e]||!Cb.call(a,e)||b.push(e)}return b}function k(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Bb.call(a),h=Bb.call(b);if(g==rb&&(g=yb),h==rb&&(h=yb),g!=h)return!1;switch(g){case tb:case ub:return+a==+b;case xb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case zb:case Ab:return a==String(b)}var i=g==sb;if(!i){if(g!=yb||!Kb.nodeClass&&(m(a)||m(b)))return!1;var j=!Kb.argsObject&&Lb(a)?Object:a.constructor,k=!Kb.argsObject&&Lb(b)?Object:b.constructor;if(!(j==k||Cb.call(a,"constructor")&&Cb.call(b,"constructor")||db(j)&&j instanceof j&&db(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Cb.call(f,e)?(p++,q=Cb.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Cb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Nb.call(a)}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(){this._s=s}function t(){this._s=s,this._l=s.length,this._i=0}function u(a){this._a=a}function v(a){this._a=a,this._l=z(a),this._i=0}function w(a){return"number"==typeof a&&R.isFinite(a)}function x(b){var c,d=b[lb];if(!d&&"string"==typeof b)return c=new r(b),c[lb]();if(!d&&b.length!==a)return c=new u(b),c[lb]();if(!d)throw new TypeError("Object is not iterable");return b[lb]()}function y(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function z(a){var b=+a.length;return isNaN(b)?0:0!==b&&w(b)?(b=y(b)*Math.floor(Math.abs(b)),0>=b?0:b>Bc?Bc:b):b}function A(a,b){return Y(a)||(a=ec),new Vc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function B(a,b){return new Vc(function(c){var d=new Zb,e=new $b;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}cb(f)&&(f=Oc(f)),d=new Zb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e},a)}function C(a,b){var c=this;return new Vc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))},c)}function D(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return cb(f)&&(f=Oc(f)),(ob(f)||nb(f))&&(f=Cc(f)),f}).concatAll()}function E(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return cb(f)&&(f=Oc(f)),(ob(f)||nb(f))&&(f=Cc(f)),f}).mergeAll()}function F(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=R.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function G(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Xb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(F(a))};return a.attachEvent("on"+b,d),Xb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Xb(function(){a["on"+b]=null})}function H(a,b,c){var d=new Ub;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(H(a.item(e),b,c));else a&&d.add(G(a,b,c));return d}function I(a,b){return new Vc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function J(a,b,c){return new Vc(function(d){var e=0,f=a,g=bc(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function K(a,b){return new Vc(function(c){return b.scheduleWithRelative(bc(a),function(){c.onNext(0),c.onCompleted()})})}function L(a,b,c){return a===b?new Vc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):zc(function(){return J(c.now()+a,b,c)})}function M(a,b,c){return new Vc(function(d){var e,f=!1,g=new $b,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Zb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Ub(e,g)},a)}function N(a,b,c){return zc(function(){return M(a,b-c.now(),c)})}function O(a,b){return new Vc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Ub(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))},a)}function P(a,b,c){return new Vc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(Z))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Ub(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var Q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},R=Q[typeof window]&&window||this,S=Q[typeof exports]&&exports&&!exports.nodeType&&exports,T=Q[typeof module]&&module&&!module.nodeType&&module,U=T&&T.exports===S&&S,V=Q[typeof global]&&global;!V||V.global!==V&&V.window!==V||(R=V);var W={internals:{},config:{Promise:R.Promise},helpers:{}},X=W.helpers.noop=function(){},Y=(W.helpers.notDefined=function(a){return"undefined"==typeof a},W.helpers.isScheduler=function(a){return a instanceof W.Scheduler}),Z=W.helpers.identity=function(a){return a},$=(W.helpers.pluck=function(a){return function(b){return b[a]}},W.helpers.just=function(a){return function(){return a}},W.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),_=W.helpers.defaultComparer=function(a,b){return Mb(a,b)},ab=W.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},bb=(W.helpers.defaultKeySerializer=function(a){return a.toString()},W.helpers.defaultError=function(a){throw a}),cb=W.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},db=(W.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},W.helpers.not=function(a){return!a},W.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Bb.call(a)}),a}()),eb="Argument out of range",fb="Object has been disposed";W.config.longStackSupport=!1;var gb=!1;try{throw new Error}catch(hb){gb=!!hb.stack}var ib,jb=g(),kb="From previous event:",lb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";R.Set&&"function"==typeof(new R.Set)["@@iterator"]&&(lb="@@iterator");var mb=W.doneEnumerator={done:!0,value:a},nb=W.helpers.isIterable=function(b){return b[lb]!==a},ob=W.helpers.isArrayLike=function(b){return b&&b.length!==a};W.helpers.iterator=lb;var pb,qb=W.helpers.deprecate=function(){},rb="[object Arguments]",sb="[object Array]",tb="[object Boolean]",ub="[object Date]",vb="[object Error]",wb="[object Function]",xb="[object Number]",yb="[object Object]",zb="[object RegExp]",Ab="[object String]",Bb=Object.prototype.toString,Cb=Object.prototype.hasOwnProperty,Db=Bb.call(arguments)==rb,Eb=Error.prototype,Fb=Object.prototype,Gb=String.prototype,Hb=Fb.propertyIsEnumerable;try{pb=!(Bb.call(document)==yb&&!({toString:0}+""))}catch(hb){pb=!0}var Ib=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Jb={};Jb[sb]=Jb[ub]=Jb[xb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Jb[tb]=Jb[Ab]={constructor:!0,toString:!0,valueOf:!0},Jb[vb]=Jb[wb]=Jb[zb]={constructor:!0,toString:!0},Jb[yb]={constructor:!0};var Kb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Kb.enumErrorProps=Hb.call(Eb,"message")||Hb.call(Eb,"name"),Kb.enumPrototypes=Hb.call(a,"prototype"),Kb.nonEnumArgs=0!=c,Kb.nonEnumShadows=!/valueOf/.test(b)}(1);var Lb=function(a){return a&&"object"==typeof a?Bb.call(a)==rb:!1};Db||(Lb=function(a){return a&&"object"==typeof a?Cb.call(a,"callee"):!1});{var Mb=W.internals.isEqual=function(a,b){return n(a,b,[],[])},Nb=Array.prototype.slice,Ob=({}.hasOwnProperty,this.inherits=W.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Pb=W.internals.addProperties=function(a){for(var b=Nb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};W.internals.addRef=function(a,b){return new Vc(function(c){return new Ub(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Nb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Nb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Nb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Qb=Object("a"),Rb="a"!=Qb[0]||!(0 in Qb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Rb&&{}.toString.call(this)==Ab?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=wb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Rb&&{}.toString.call(this)==Ab?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=wb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==sb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Sb=W.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Tb=Sb.prototype;Tb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Tb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Tb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Tb.peek=function(){return this.items[0].value},Tb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Tb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Tb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Sb.count++,a),this.percolate(b)},Tb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Sb.count=0;var Ub=W.CompositeDisposable=function(){this.disposables=o(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Vb=Ub.prototype;Vb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Vb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Vb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Vb.toArray=function(){return this.disposables.slice(0)};var Wb=W.Disposable=function(a){this.isDisposed=!1,this.action=a||X};Wb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Xb=Wb.create=function(a){return new Wb(a)},Yb=Wb.empty={dispose:X},Zb=W.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),$b=W.SerialDisposable=Zb,_b=(W.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Yb:new a(this)},b}(),W.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ab,this.disposable=new Zb});_b.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},_b.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},_b.prototype.isCancelled=function(){return this.disposable.isDisposed},_b.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ac=W.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Yb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),bc=ac.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Ub,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Yb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Ub,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Yb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(ac.prototype),function(){ac.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},ac.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof R.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=R.setInterval(function(){d=c(d)},b);return Xb(function(){R.clearInterval(e)})}}(ac.prototype);var cc,dc=ac.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=bc(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ac($,a,b,c)}(),ec=ac.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-ac.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+ac.normalize(c),g=new _b(this,b,d,f);if(e)e.enqueue(g);else{e=new Sb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new ac($,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),fc=(W.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Zb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),X),gc=function(){var a,b=X;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!R.setTimeout)throw new Error("No concurrency detected!");a=R.setTimeout,b=R.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),hc=gc.setTimeout,ic=gc.clearTimeout;!function(){function a(){if(!R.postMessage||R.importScripts)return!1;var a=!1,b=R.onmessage;return R.onmessage=function(){a=!0},R.postMessage("","*"),R.onmessage=b,a}var b=RegExp("^"+String(Bb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=V&&U&&V.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=V&&U&&V.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)cc=c,fc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))cc=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};R.addEventListener?R.addEventListener("message",h,!1):R.attachEvent("onmessage",h,!1),cc=function(a){var b=g++;f[b]=a,R.postMessage(e+b,"*")}}else if(R.MessageChannel){var i=new R.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},cc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in R&&"onreadystatechange"in R.document.createElement("script")?cc=function(a){var b=R.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},R.document.documentElement.appendChild(b)}:(cc=function(a){return hc(a,0)},fc=ic)}();var jc=ac.timeout=function(){function a(a,b){var c=this,d=new Zb,e=cc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Ub(d,Xb(function(){fc(e)}))}function b(a,b,c){var d=this,e=ac.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Zb,g=hc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Ub(f,Xb(function(){ic(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ac($,a,b,c)}(),kc=W.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Y(a)||(a=dc),new Vc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),lc=kc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new kc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),mc=kc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new kc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),nc=kc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new kc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),oc=W.internals.Enumerator=function(a){this._next=a};oc.prototype.next=function(){return this._next()},oc.prototype[lb]=function(){return this};var pc=W.internals.Enumerable=function(a){this._iterator=a};pc.prototype[lb]=function(){return this._iterator()},pc.prototype.concat=function(){var a=this;return new Vc(function(b){var c;try{c=a[lb]()}catch(d){return void b.onError(d)}var e,f=new $b,g=dc.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;cb(h)&&(h=Oc(h));var i=new Zb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Ub(f,g,Xb(function(){e=!0}))})},pc.prototype.catchError=function(){var a=this;return new Vc(function(b){var c;try{c=a[lb]()}catch(d){return void b.onError(d)}var e,f,g=new $b,h=dc.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;cb(i)&&(i=Oc(i));var j=new Zb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Ub(g,h,Xb(function(){e=!0}))})};var qc=pc.repeat=function(a,b){return null==b&&(b=-1),new pc(function(){var c=b;return new oc(function(){return 0===c?mb:(c>0&&c--,{done:!1,value:a})})})},rc=pc.of=function(a,b,c){return b||(b=Z),new pc(function(){var d=-1;return new oc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:mb})})},sc=W.Observer=function(){};sc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},sc.prototype.asObserver=function(){return new wc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var tc=sc.create=function(a,b,c){return a||(a=X),b||(b=bb),c||(c=X),new wc(a,b,c)};sc.fromNotifier=function(a,b){return new wc(function(c){return a.call(b,lc(c))},function(c){return a.call(b,mc(c))},function(){return a.call(b,nc())})};var uc,vc=W.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Ob(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(sc),wc=W.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Ob(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(vc),xc=W.Observable=function(){function a(a){if(W.config.longStackSupport&&gb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){b.onError=function(a){c(d,a),b.onError(a)},a(b)}}this._subscribe=a}return uc=a.prototype,uc.subscribe=uc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:tc(a,b,c))},uc.subscribeOnNext=function(a,b){return this._subscribe(tc(2===arguments.length?function(c){a.call(b,c)}:a))},uc.subscribeOnError=function(a,b){return this._subscribe(tc(null,2===arguments.length?function(c){a.call(b,c)}:a))},uc.subscribeOnCompleted=function(a,b){return this._subscribe(tc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),yc=W.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new $b}return Ob(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(vc);uc.toArray=function(){var a=this;return new Vc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})},a)},xc.create=xc.createWithDisposable=function(a,b){return new Vc(a,b)};var zc=xc.defer=function(a){return new Vc(function(b){var c;try{c=a()}catch(d){return Fc(d).subscribe(b)}return cb(c)&&(c=Oc(c)),c.subscribe(b)})},Ac=xc.empty=function(a){return Y(a)||(a=dc),new Vc(function(b){return a.schedule(function(){b.onCompleted()})})},Bc=Math.pow(2,53)-1;r.prototype[lb]=function(){return new t(this._s)},t.prototype[lb]=function(){return this},t.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return mb},u.prototype[lb]=function(){return new v(this._a)},v.prototype[lb]=function(){return this},v.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return mb};{var Cc=xc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!db(b))throw new Error("mapFn when provided must be a function");Y(d)||(d=ec);var e=Object(a),f=x(e);return new Vc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&db(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},Dc=xc.fromArray=function(a,b){return qb("fromArray","from"),Y(b)||(b=ec),new Vc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};xc.never=function(){return new Vc(function(){return Yb})}}xc.of=function(){return A(null,arguments)},xc.ofWithScheduler=function(a){return A(a,Nb.call(arguments,1))},xc.range=function(a,b,c){return Y(c)||(c=ec),new Vc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},xc.repeat=function(a,b,c){return Y(c)||(c=ec),Ec(a,c).repeat(null==b?-1:b)};var Ec=xc["return"]=xc.just=function(a,b){return Y(b)||(b=dc),new Vc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};xc.returnValue=function(){return qb("returnValue","return or just"),Ec.apply(null,arguments)};var Fc=xc["throw"]=xc.throwException=xc.throwError=function(a,b){return Y(b)||(b=dc),new Vc(function(c){return b.schedule(function(){c.onError(a)})})};uc["catch"]=uc.catchError=function(a){return"function"==typeof a?B(this,a):Gc([this,a])},uc.catchException=function(a){return qb("catchException","catch or catchError"),this.catchError(a)};var Gc=xc.catchError=xc["catch"]=function(){return rc(o(arguments,0)).catchError()};xc.catchException=function(){return qb("catchException","catch or catchError"),Gc.apply(null,arguments)},uc.combineLatest=function(){var a=Nb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Hc.apply(this,a)};var Hc=xc.combineLatest=function(){var a=Nb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Vc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(Z))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(Z)&&c.onCompleted()}function e(a){j[a]=!0,j.every(Z)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(b){var f=a[b],g=new Zb;cb(f)&&(f=Oc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),l[b]=g}(m);return new Ub(l)},this)};uc.concat=function(){var a=Nb.call(arguments,0);return a.unshift(this),Ic.apply(this,a)};var Ic=xc.concat=function(){return rc(o(arguments,0)).concat()};uc.concatAll=function(){return this.merge(1)},uc.concatObservable=function(){return qb("concatObservable","concatAll"),this.merge(1)},uc.merge=function(a){if("number"!=typeof a)return Jc(this,a);var b=this;return new Vc(function(c){function d(a){var b=new Zb;f.add(b),cb(a)&&(a=Oc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())
3
+ }))}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},b)};var Jc=xc.merge=function(){var a,b;return arguments[0]?Y(arguments[0])?(a=arguments[0],b=Nb.call(arguments,1)):(a=dc,b=Nb.call(arguments,0)):(a=dc,b=Nb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),A(a,b).mergeAll()};uc.mergeAll=function(){var a=this;return new Vc(function(b){var c=new Ub,d=!1,e=new Zb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Zb;c.add(e),cb(a)&&(a=Oc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},uc.mergeObservable=function(){return qb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},uc.skipUntil=function(a){var b=this;return new Vc(function(c){var d=!1,e=new Ub(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));cb(a)&&(a=Oc(a));var f=new Zb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e},b)},uc["switch"]=uc.switchLatest=function(){var a=this;return new Vc(function(b){var c=!1,d=new $b,e=!1,f=0,g=a.subscribe(function(a){var g=new Zb,h=++f;c=!0,d.setDisposable(g),cb(a)&&(a=Oc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Ub(g,d)},a)},uc.takeUntil=function(a){var b=this;return new Vc(function(c){return cb(a)&&(a=Oc(a)),new Ub(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),X))},b)},uc.zip=function(){if(Array.isArray(arguments[0]))return C.apply(this,arguments);var a=this,b=Nb.call(arguments),c=b.pop();return b.unshift(a),new Vc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(Z)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=p(g,function(){return[]}),i=p(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new Zb;cb(c)&&(c=Oc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new Ub(j)},a)},xc.zip=function(){var a=Nb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},xc.zipArray=function(){var a=o(arguments,0);return new Vc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(Z))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Z)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Zb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Ub(h);return j.add(Xb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},uc.asObservable=function(){return new Vc(this.subscribe.bind(this),this)},uc.dematerialize=function(){var a=this;return new Vc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))},this)},uc.distinctUntilChanged=function(a,b){var c=this;return a||(a=Z),b||(b=_),new Vc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))},this)},uc["do"]=uc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Vc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})},this)},uc.doAction=function(){return qb("doAction","do or tap"),this.tap.apply(this,arguments)},uc.doOnNext=uc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},uc.doOnError=uc.tapOnError=function(a,b){return this.tap(X,2===arguments.length?function(c){a.call(b,c)}:a)},uc.doOnCompleted=uc.tapOnCompleted=function(a,b){return this.tap(X,null,2===arguments.length?function(){a.call(b)}:a)},uc["finally"]=uc.ensure=function(a){var b=this;return new Vc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Xb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},uc.finallyAction=function(a){return qb("finallyAction","finally or ensure"),this.ensure(a)},uc.ignoreElements=function(){var a=this;return new Vc(function(b){return a.subscribe(X,b.onError.bind(b),b.onCompleted.bind(b))},a)},uc.materialize=function(){var a=this;return new Vc(function(b){return a.subscribe(function(a){b.onNext(lc(a))},function(a){b.onNext(mc(a)),b.onCompleted()},function(){b.onNext(nc()),b.onCompleted()})},a)},uc.repeat=function(a){return qc(this,a).concat()},uc.retry=function(a){return qc(this,a).catchError()},uc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Vc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},uc.skipLast=function(a){var b=this;return new Vc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))},b)},uc.startWith=function(){var a,b,c=0;return arguments.length&&Y(arguments[0])?(b=arguments[0],c=1):b=dc,a=Nb.call(arguments,c),rc([Dc(a,b),this]).concat()},uc.takeLast=function(a){var b=this;return new Vc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},uc.selectConcat=uc.concatMap=function(a,b,c){return db(a)&&db(b)?this.concatMap(function(c,d){var e=a(c,d);return cb(e)&&(e=Oc(e)),(ob(e)||nb(e))&&(e=Cc(e)),e.map(function(a,e){return b(c,a,d,e)})}):db(a)?D(this,a,c):D(this,function(){return a})},uc.select=uc.map=function(a,b){var c=db(a)?a:function(){return a},d=this;return new Vc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))},d)},uc.pluck=function(a){return this.map(function(b){return b[a]})},uc.selectMany=uc.flatMap=function(a,b,c){return db(a)&&db(b)?this.flatMap(function(c,d){var e=a(c,d);return cb(e)&&(e=Oc(e)),(ob(e)||nb(e))&&(e=Cc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):db(a)?E(this,a,c):E(this,function(){return a})},uc.selectSwitch=uc.flatMapLatest=uc.switchMap=function(a,b){return this.select(a,b).switchLatest()},uc.skip=function(a){if(0>a)throw new Error(eb);var b=this;return new Vc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))},b)},uc.skipWhile=function(a,b){var c=this;return new Vc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))},c)},uc.take=function(a,b){if(0>a)throw new RangeError(eb);if(0===a)return Ac(b);var c=this;return new Vc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))},c)},uc.takeWhile=function(a,b){var c=this;return new Vc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))},c)},uc.where=uc.filter=function(a,b){var c=this;return new Vc(function(d){var e=0;return c.subscribe(function(c){var f;try{f=a.call(b,c,e++,parent)}catch(g){return void d.onError(g)}f&&d.onNext(c)},d.onError.bind(d),d.onCompleted.bind(d))},c)},xc.fromCallback=function(a,b,c){return function(){var d=Nb.call(arguments,0);return new Vc(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return void e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},xc.fromNodeCallback=function(a,b,c){return function(){var d=Nb.call(arguments,0);return new Vc(function(e){function f(a){if(a)return void e.onError(a);var b=Nb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},W.config.useNativeEvents=!1;var Kc=R.angular&&angular.element?angular.element:R.jQuery?R.jQuery:R.Zepto?R.Zepto:null,Lc=!!R.Ember&&"function"==typeof R.Ember.addListener,Mc=!!R.Backbone&&!!R.Backbone.Marionette;xc.fromEvent=function(a,b,c){if(a.addListener)return Nc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!W.config.useNativeEvents){if(Mc)return Nc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Lc)return Nc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(Kc){var d=Kc(a);return Nc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Vc(function(d){return H(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Nc=xc.fromEventPattern=function(a,b,c){return new Vc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Xb(function(){b&&b(e,f)})}).publish().refCount()},Oc=xc.fromPromise=function(a){return zc(function(){var b=new W.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};uc.toPromise=function(a){if(a||(a=W.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},xc.startAsync=function(a){var b;try{b=a()}catch(c){return Fc(c)}return Oc(b)},uc.multicast=function(a,b){var c=this;return"function"==typeof a?new Vc(function(d){var e=c.multicast(a());return new Ub(b(e).subscribe(d),e.connect())},c):new Pc(c,a)},uc.publish=function(a){return a&&db(a)?this.multicast(function(){return new Yc},a):this.multicast(new Yc)},uc.share=function(){return this.publish().refCount()},uc.publishLast=function(a){return a&&db(a)?this.multicast(function(){return new Zc},a):this.multicast(new Zc)},uc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new _c(b)},a):this.multicast(new _c(a))},uc.shareValue=function(a){return this.publishValue(a).refCount()},uc.replay=function(a,b,c,d){return a&&db(a)?this.multicast(function(){return new ad(b,c,d)},a):this.multicast(new ad(b,c,d))},uc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Pc=W.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Ub(f.subscribe(c),Xb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Ob(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Vc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(xc),Qc=xc.interval=function(a,b){return L(a,a,Y(b)?b:jc)};xc.timer=function(b,c,d){var e;return Y(d)||(d=jc),c!==a&&"number"==typeof c?e=c:Y(c)&&(d=c),b instanceof Date&&e===a?I(b.getTime(),d):b instanceof Date&&e!==a?(e=c,J(b.getTime(),e,d)):e===a?K(b,d):L(b,e,d)}}uc.delay=function(a,b){return Y(b)||(b=jc),a instanceof Date?N(this,a.getTime(),b):M(this,a,b)},uc.debounce=uc.throttleWithTimeout=function(a,b){Y(b)||(b=jc);var c=this;return new Vc(function(d){var e,f=new $b,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Zb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Ub(i,f)},this)},uc.throttle=function(a,b){return qb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},uc.timestamp=function(a){return Y(a)||(a=jc),this.map(function(b){return{value:b,timestamp:a.now()}})},uc.sample=uc.throttleLatest=function(a,b){return Y(b)||(b=jc),"number"==typeof a?O(this,Qc(a,b)):O(this,a)},uc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Fc(new Error(b||"Timeout"))),Y(c)||(c=jc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Vc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(cb(b)&&(b=Oc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Zb,j=new $b,k=!1,l=new $b;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Ub(j,l)},d)},uc.throttleFirst=function(a,b){Y(b)||(b=jc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Vc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))},d)};var Rc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Yb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Yb)});return new Ub(c,d,e)}function c(c,d){this.source=c,this.controller=new Yc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Ob(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(xc);uc.pausable=function(a){return new Rc(this,a)};var Sc=function(b){function c(b){var c,d=[],e=P(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Yc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Ob(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(xc);uc.pausableBuffered=function(a){return new Sc(this,a)},uc.controlled=function(a){return null==a&&(a=!0),new Tc(this,a)};var Tc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Uc(d),this.source=c.multicast(this.subject).refCount()}return Ob(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(xc),Uc=W.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Yc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Yb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Yb}return Ob(d,a),Pb(d.prototype,sc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Yb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Yb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Yb:(this.requestedCount=a,this.requestedDisposable=Xb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Yb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(xc);uc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Vc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})},c)};var Vc=W.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Xb(a):Yb}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Wc(a);return ec.scheduleRequired()?ec.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return Ob(c,a),c}(xc),Wc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Zb}Ob(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(vc),Xc=function(a,b){this.subject=a,this.observer=b};Xc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Yc=W.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Yb):(a.onCompleted(),Yb):(this.observers.push(a),new Xc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Ob(d,a),Pb(d.prototype,sc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new $c(a,b)},d}(xc),Zc=W.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Xc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Yb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Ob(d,a),Pb(d.prototype,sc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(xc),$c=W.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Ob(b,a),Pb(b.prototype,sc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(xc),_c=W.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Xc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Yb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Ob(d,a),Pb(d.prototype,sc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(xc),ad=W.ReplaySubject=function(a){function c(a,b){return Xb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new yc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||ec,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Ob(e,a),Pb(e.prototype,sc,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(xc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(R.Rx=W,define(function(){return W})):S&&T?U?(T.exports=W).Rx=W:S.Rx=W:R.Rx=W;var bd=g()}).call(this);
4
4
  //# sourceMappingURL=rx.lite.compat.map
@@ -43,6 +43,7 @@
43
43
  internals = Rx.internals,
44
44
  helpers = Rx.helpers,
45
45
  ScheduledObserver = internals.ScheduledObserver,
46
+ SerialDisposable = Rx.SerialDisposable,
46
47
  SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
47
48
  CompositeDisposable = Rx.CompositeDisposable,
48
49
  RefCountDisposable = Rx.RefCountDisposable,
@@ -138,8 +139,9 @@
138
139
  var ObserveOnObserver = (function (__super__) {
139
140
  inherits(ObserveOnObserver, __super__);
140
141
 
141
- function ObserveOnObserver() {
142
- __super__.apply(this, arguments);
142
+ function ObserveOnObserver(scheduler, observer, cancel) {
143
+ __super__.call(this, scheduler, observer);
144
+ this._cancel = cancel;
143
145
  }
144
146
 
145
147
  ObserveOnObserver.prototype.next = function (value) {
@@ -157,6 +159,12 @@
157
159
  this.ensureActive();
158
160
  };
159
161
 
162
+ ObserveOnObserver.prototype.dispose = function () {
163
+ __super__.prototype.dispose.call(this);
164
+ this._cancel && this._cancel.dispose();
165
+ this._cancel = null;
166
+ };
167
+
160
168
  return ObserveOnObserver;
161
169
  })(ScheduledObserver);
162
170
 
@@ -173,7 +181,7 @@
173
181
  var source = this;
174
182
  return new AnonymousObservable(function (observer) {
175
183
  return source.subscribe(new ObserveOnObserver(scheduler, observer));
176
- });
184
+ }, source);
177
185
  };
178
186
 
179
187
  /**
@@ -195,7 +203,7 @@
195
203
  d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
196
204
  }));
197
205
  return d;
198
- });
206
+ }, source);
199
207
  };
200
208
 
201
209
  /**
@@ -443,20 +451,20 @@
443
451
  function (x) {
444
452
  for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
445
453
  var c = n - count + 1;
446
- c >=0 && c % skip === 0 && q.shift().onCompleted();
454
+ c >= 0 && c % skip === 0 && q.shift().onCompleted();
447
455
  ++n % skip === 0 && createWindow();
448
- },
456
+ },
449
457
  function (e) {
450
458
  while (q.length > 0) { q.shift().onError(e); }
451
459
  observer.onError(e);
452
- },
460
+ },
453
461
  function () {
454
462
  while (q.length > 0) { q.shift().onCompleted(); }
455
463
  observer.onCompleted();
456
464
  }
457
465
  ));
458
466
  return refCountDisposable;
459
- });
467
+ }, source);
460
468
  };
461
469
 
462
470
  /**
@@ -479,7 +487,7 @@
479
487
  observer.onNext(q);
480
488
  observer.onCompleted();
481
489
  });
482
- });
490
+ }, source);
483
491
  };
484
492
 
485
493
  /**
@@ -493,22 +501,18 @@
493
501
  * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
494
502
  */
495
503
  observableProto.defaultIfEmpty = function (defaultValue) {
496
- var source = this;
497
- if (defaultValue === undefined) {
498
- defaultValue = null;
499
- }
500
- return new AnonymousObservable(function (observer) {
501
- var found = false;
502
- return source.subscribe(function (x) {
503
- found = true;
504
- observer.onNext(x);
505
- }, observer.onError.bind(observer), function () {
506
- if (!found) {
507
- observer.onNext(defaultValue);
508
- }
509
- observer.onCompleted();
510
- });
504
+ var source = this;
505
+ defaultValue === undefined && (defaultValue = null);
506
+ return new AnonymousObservable(function (observer) {
507
+ var found = false;
508
+ return source.subscribe(function (x) {
509
+ found = true;
510
+ observer.onNext(x);
511
+ }, observer.onError.bind(observer), function () {
512
+ !found && observer.onNext(defaultValue);
513
+ observer.onCompleted();
511
514
  });
515
+ }, this);
512
516
  };
513
517
 
514
518
  // Swap out for Array.findIndex
@@ -561,7 +565,7 @@
561
565
  },
562
566
  observer.onError.bind(observer),
563
567
  observer.onCompleted.bind(observer));
564
- });
568
+ }, this);
565
569
  };
566
570
 
567
571
  return Rx;
@@ -1,3 +1,3 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:C.call(a)}function f(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function h(a){this.comparer=a,this.set=[]}var i=c.Observable,j=i.prototype,k=i.never,l=i.throwException,m=c.AnonymousObservable,n=c.Observer,o=c.Subject,p=c.internals,q=c.helpers,r=p.ScheduledObserver,s=c.SingleAssignmentDisposable,t=c.CompositeDisposable,u=c.RefCountDisposable,v=c.Disposable.empty,w=c.Scheduler.immediate,x=(q.defaultKeySerializer,c.internals.addRef),y=(q.identity,q.isPromise),z=p.inherits,A=(q.noop,q.isScheduler),B=i.fromPromise,C=Array.prototype.slice,D="Argument out of range";f.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var E=(function(a){function b(b){a.call(this),this._observer=b,this._state=0}z(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}(n),function(a){function b(){a.apply(this,arguments)}return z(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}(r));j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new E(a,c))})},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new s,e=new SerialDisposable;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new f(a,b.subscribe(c)))})),e})},i.generate=function(a,b,c,d,e){return A(e)||(e=currentThreadScheduler),new m(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()})})},i.using=function(a,b){return new m(function(c){var d,e,f=v;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new t(l(g).subscribe(c),f)}return new t(e.subscribe(c),f)})},j.amb=function(a){var b=this;return new m(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new s,j=new s;return y(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 t(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}for(var b=k(),c=e(arguments,0),d=0,f=c.length;f>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return F([this,a])};var F=i.onErrorResumeNext=function(){var a=e(arguments,0);return new m(function(b){var c=0,d=new SerialDisposable,e=w.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],y(f)&&(f=B(f)),g=new s,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new t(d,e)})};return j.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})},j.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(D);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(D);return new m(function(d){function e(){var a=new o;i.push(a),d.onNext(x(a,g))}var f=new s,g=new u(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},j.takeLastBuffer=function(a){var b=this;return new m(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()})})},j.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new m(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},c.onError.bind(c),function(){d||c.onNext(a),c.onCompleted()})})},h.prototype.push=function(a){var b=-1===g(this.set,a,this.comparer);return b&&this.set.push(a),b},j.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new m(function(d){var e=new h(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))})},c});
2
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:D.call(a)}function f(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function h(a){this.comparer=a,this.set=[]}var i=c.Observable,j=i.prototype,k=i.never,l=i.throwException,m=c.AnonymousObservable,n=c.Observer,o=c.Subject,p=c.internals,q=c.helpers,r=p.ScheduledObserver,s=c.SerialDisposable,t=c.SingleAssignmentDisposable,u=c.CompositeDisposable,v=c.RefCountDisposable,w=c.Disposable.empty,x=c.Scheduler.immediate,y=(q.defaultKeySerializer,c.internals.addRef),z=(q.identity,q.isPromise),A=p.inherits,B=(q.noop,q.isScheduler),C=i.fromPromise,D=Array.prototype.slice,E="Argument out of range";f.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var F=(function(a){function b(b){a.call(this),this._observer=b,this._state=0}A(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}(n),function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return A(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(r));j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new F(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new t,e=new s;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new f(a,b.subscribe(c)))})),e},b)},i.generate=function(a,b,c,d,e){return B(e)||(e=currentThreadScheduler),new m(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()})})},i.using=function(a,b){return new m(function(c){var d,e,f=w;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new u(l(g).subscribe(c),f)}return new u(e.subscribe(c),f)})},j.amb=function(a){var b=this;return new m(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new t,j=new t;return z(a)&&(a=C(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 u(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}for(var b=k(),c=e(arguments,0),d=0,f=c.length;f>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return G([this,a])};var G=i.onErrorResumeNext=function(){var a=e(arguments,0);return new m(function(b){var c=0,d=new s,e=x.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],z(f)&&(f=C(f)),g=new t,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new u(d,e)})};return j.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})},j.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(E);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(E);return new m(function(d){function e(){var a=new o;i.push(a),d.onNext(y(a,g))}var f=new t,g=new v(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},j.takeLastBuffer=function(a){var b=this;return new m(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()})},b)},j.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new m(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},c.onError.bind(c),function(){!d&&c.onNext(a),c.onCompleted()})},this)},h.prototype.push=function(a){var b=-1===g(this.set,a,this.comparer);return b&&this.set.push(a),b},j.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new m(function(d){var e=new h(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))},this)},c});
3
3
  //# sourceMappingURL=rx.lite.extras.map