rxjs-rails 2.2.27 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -3
  3. data/lib/rxjs/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  5. data/vendor/assets/javascripts/rx.all.compat.js +1545 -1441
  6. data/vendor/assets/javascripts/rx.all.compat.min.js +3 -3
  7. data/vendor/assets/javascripts/rx.all.js +1545 -1441
  8. data/vendor/assets/javascripts/rx.all.min.js +3 -3
  9. data/vendor/assets/javascripts/rx.async.compat.js +149 -152
  10. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  11. data/vendor/assets/javascripts/rx.async.js +140 -143
  12. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  13. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  14. data/vendor/assets/javascripts/rx.binding.js +18 -18
  15. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  16. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  17. data/vendor/assets/javascripts/rx.compat.js +490 -339
  18. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  19. data/vendor/assets/javascripts/rx.core.compat.js +109 -141
  20. data/vendor/assets/javascripts/rx.core.compat.min.js +1 -1
  21. data/vendor/assets/javascripts/rx.core.js +109 -141
  22. data/vendor/assets/javascripts/rx.core.min.js +1 -1
  23. data/vendor/assets/javascripts/rx.experimental.js +129 -136
  24. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  25. data/vendor/assets/javascripts/rx.joinpatterns.js +59 -59
  26. data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
  27. data/vendor/assets/javascripts/rx.js +490 -339
  28. data/vendor/assets/javascripts/rx.lite.compat.js +1099 -954
  29. data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
  30. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  31. data/vendor/assets/javascripts/rx.lite.js +1099 -954
  32. data/vendor/assets/javascripts/rx.lite.min.js +2 -2
  33. data/vendor/assets/javascripts/rx.min.js +2 -2
  34. data/vendor/assets/javascripts/rx.testing.min.js +1 -1
  35. data/vendor/assets/javascripts/rx.time.js +715 -747
  36. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  37. data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
  38. metadata +11 -10
@@ -1 +1 @@
1
- (function(t){function e(){if(this.isDisposed)throw Error(A)}function n(t){var e=typeof t;return t&&("function"==e||"object"==e)||!1}function i(t){var e=[];if(!n(t))return e;G.nonEnumArgs&&t.length&&u(t)&&(t=U.call(t));var i=G.enumPrototypes&&"function"==typeof t,r=G.enumErrorProps&&(t===H||t instanceof Error);for(var s in t)i&&"prototype"==s||r&&("message"==s||"name"==s)||e.push(s);if(G.nonEnumShadows&&t!==L){var o=t.constructor,c=-1,h=K.length;if(t===(o&&o.prototype))var a=t===stringProto?M:t===H?N:F.call(t),l=Q[a];for(;h>++c;)s=K[c],l&&l[s]||!z.call(t,s)||e.push(s)}return e}function r(t,e,n){for(var i=-1,r=n(t),s=r.length;s>++i;){var o=r[i];if(e(t[o],o,t)===!1)break}return t}function s(t,e){return r(t,e,i)}function o(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function u(t){return t&&"object"==typeof t?F.call(t)==j:!1}function c(t){return"function"==typeof t||!1}function h(e,n,i,r){if(e===n)return 0!==e||1/e==1/n;var a=typeof e,l=typeof n;if(e===e&&(null==e||null==n||"function"!=a&&"object"!=a&&"function"!=l&&"object"!=l))return!1;var p=F.call(e),f=F.call(n);if(p==j&&(p=T),f==j&&(f=T),p!=f)return!1;switch(p){case W:case P:return+e==+n;case k:return e!=+e?n!=+n:0==e?1/e==1/n:e==+n;case I:case M:return e==n+""}var d=p==C;if(!d){if(p!=T||!G.nodeClass&&(o(e)||o(n)))return!1;var v=!G.argsObject&&u(e)?Object:e.constructor,b=!G.argsObject&&u(n)?Object:n.constructor;if(!(v==b||z.call(e,"constructor")&&z.call(n,"constructor")||c(v)&&v instanceof v&&c(b)&&b instanceof b||!("constructor"in e&&"constructor"in n)))return!1}i||(i=[]),r||(r=[]);for(var y=i.length;y--;)if(i[y]==e)return r[y]==n;var m=0;if(result=!0,i.push(e),r.push(n),d){if(y=e.length,m=n.length,result=m==y)for(;m--;){var g=n[m];if(!(result=h(e[m],g,i,r)))break}}else s(n,function(n,s,o){return z.call(o,s)?(m++,result=z.call(e,s)&&h(e[s],n,i,r)):t}),result&&s(e,function(e,n,i){return z.call(i,n)?result=--m>-1:t});return i.pop(),r.pop(),result}function a(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:U.call(t)}function l(t,e){this.scheduler=t,this.disposable=e,this.isDisposed=!1}var p={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},f=p[typeof window]&&window||this,d=p[typeof exports]&&exports&&!exports.nodeType&&exports,v=p[typeof module]&&module&&!module.nodeType&&module,b=v&&v.exports===d&&d,y=p[typeof global]&&global;!y||y.global!==y&&y.window!==y||(f=y);var m={internals:{},config:{Promise:f.Promise},helpers:{}},g=m.helpers.noop=function(){},w=m.helpers.identity=function(t){return t},S=(m.helpers.pluck=function(t){return function(e){return e[t]}},m.helpers.just=function(t){return function(){return t}},m.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),_=(m.helpers.defaultComparer=function(t,e){return J(t,e)},m.helpers.defaultSubComparer=function(t,e){return t>e?1:e>t?-1:0}),D=(m.helpers.defaultKeySerializer=function(t){return""+t},m.helpers.defaultError=function(t){throw t}),x=m.helpers.isPromise=function(t){return!!t&&"function"==typeof t.then&&t.then!==m.Observable.prototype.then};m.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},m.helpers.not=function(t){return!t};var A="Object has been disposed",E="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";f.Set&&"function"==typeof(new f.Set)["@@iterator"]&&(E="@@iterator");var O,R={done:!0,value:t},j="[object Arguments]",C="[object Array]",W="[object Boolean]",P="[object Date]",N="[object Error]",q="[object Function]",k="[object Number]",T="[object Object]",I="[object RegExp]",M="[object String]",F=Object.prototype.toString,z=Object.prototype.hasOwnProperty,V=F.call(arguments)==j,H=Error.prototype,L=Object.prototype,$=L.propertyIsEnumerable;try{O=!(F.call(document)==T&&!({toString:0}+""))}catch(B){O=!0}var K=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Q={};Q[C]=Q[P]=Q[k]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Q[W]=Q[M]={constructor:!0,toString:!0,valueOf:!0},Q[N]=Q[q]=Q[I]={constructor:!0,toString:!0},Q[T]={constructor:!0};var G={};(function(){var t=function(){this.x=1},e=[];t.prototype={valueOf:1,y:1};for(var n in new t)e.push(n);for(n in arguments);G.enumErrorProps=$.call(H,"message")||$.call(H,"name"),G.enumPrototypes=$.call(t,"prototype"),G.nonEnumArgs=0!=n,G.nonEnumShadows=!/valueOf/.test(e)})(1),V||(u=function(t){return t&&"object"==typeof t?z.call(t,"callee"):!1}),c(/x/)&&(c=function(t){return"function"==typeof t&&F.call(t)==q});var J=m.internals.isEqual=function(t,e){return h(t,e,[],[])},U=Array.prototype.slice;({}).hasOwnProperty;var X=this.inherits=m.internals.inherits=function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n},Y=m.internals.addProperties=function(t){for(var e=U.call(arguments,1),n=0,i=e.length;i>n;n++){var r=e[n];for(var s in r)t[s]=r[s]}};m.internals.addRef=function(t,e){return new ke(function(n){return new re(e.getDisposable(),t.subscribe(n))})},Function.prototype.bind||(Function.prototype.bind=function(t){var e=this,n=U.call(arguments,1),i=function(){function r(){}if(this instanceof i){r.prototype=e.prototype;var s=new r,o=e.apply(s,n.concat(U.call(arguments)));return Object(o)===o?o:s}return e.apply(t,n.concat(U.call(arguments)))};return i});var Z=Object("a"),te="a"!=Z[0]||!(0 in Z);Array.prototype.every||(Array.prototype.every=function(t){var e=Object(this),n=te&&{}.toString.call(this)==M?this.split(""):e,i=n.length>>>0,r=arguments[1];if({}.toString.call(t)!=q)throw new TypeError(t+" is not a function");for(var s=0;i>s;s++)if(s in n&&!t.call(r,n[s],s,e))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(t){var e=Object(this),n=te&&{}.toString.call(this)==M?this.split(""):e,i=n.length>>>0,r=Array(i),s=arguments[1];if({}.toString.call(t)!=q)throw new TypeError(t+" is not a function");for(var o=0;i>o;o++)o in n&&(r[o]=t.call(s,n[o],o,e));return r}),Array.prototype.filter||(Array.prototype.filter=function(t){for(var e,n=[],i=Object(this),r=0,s=i.length>>>0;s>r;r++)e=i[r],r in i&&t.call(arguments[1],e,r,i)&&n.push(e);return n}),Array.isArray||(Array.isArray=function(t){return Object.prototype.toString.call(t)==C}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){var e=Object(this),n=e.length>>>0;if(0===n)return-1;var i=0;if(arguments.length>1&&(i=Number(arguments[1]),i!==i?i=0:0!==i&&1/0!=i&&i!==-1/0&&(i=(i>0||-1)*Math.floor(Math.abs(i)))),i>=n)return-1;for(var r=i>=0?i:Math.max(n-Math.abs(i),0);n>r;r++)if(r in e&&e[r]===t)return r;return-1});var ee=function(t,e){this.id=t,this.value=e};ee.prototype.compareTo=function(t){var e=this.value.compareTo(t.value);return 0===e&&(e=this.id-t.id),e};var ne=m.internals.PriorityQueue=function(t){this.items=Array(t),this.length=0},ie=ne.prototype;ie.isHigherPriority=function(t,e){return 0>this.items[t].compareTo(this.items[e])},ie.percolate=function(t){if(!(t>=this.length||0>t)){var e=t-1>>1;if(!(0>e||e===t)&&this.isHigherPriority(t,e)){var n=this.items[t];this.items[t]=this.items[e],this.items[e]=n,this.percolate(e)}}},ie.heapify=function(e){if(e===t&&(e=0),!(e>=this.length||0>e)){var n=2*e+1,i=2*e+2,r=e;if(this.length>n&&this.isHigherPriority(n,r)&&(r=n),this.length>i&&this.isHigherPriority(i,r)&&(r=i),r!==e){var s=this.items[e];this.items[e]=this.items[r],this.items[r]=s,this.heapify(r)}}},ie.peek=function(){return this.items[0].value},ie.removeAt=function(t){this.items[t]=this.items[--this.length],delete this.items[this.length],this.heapify()},ie.dequeue=function(){var t=this.peek();return this.removeAt(0),t},ie.enqueue=function(t){var e=this.length++;this.items[e]=new ee(ne.count++,t),this.percolate(e)},ie.remove=function(t){for(var e=0;this.length>e;e++)if(this.items[e].value===t)return this.removeAt(e),!0;return!1},ne.count=0;var re=m.CompositeDisposable=function(){this.disposables=a(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},se=re.prototype;se.add=function(t){this.isDisposed?t.dispose():(this.disposables.push(t),this.length++)},se.remove=function(t){var e=!1;if(!this.isDisposed){var n=this.disposables.indexOf(t);-1!==n&&(e=!0,this.disposables.splice(n,1),this.length--,t.dispose())}return e},se.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var t=this.disposables.slice(0);this.disposables=[],this.length=0;for(var e=0,n=t.length;n>e;e++)t[e].dispose()}},se.clear=function(){var t=this.disposables.slice(0);this.disposables=[],this.length=0;for(var e=0,n=t.length;n>e;e++)t[e].dispose()},se.contains=function(t){return-1!==this.disposables.indexOf(t)},se.toArray=function(){return this.disposables.slice(0)};var oe=m.Disposable=function(t){this.isDisposed=!1,this.action=t||g};oe.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ue=oe.create=function(t){return new oe(t)},ce=oe.empty={dispose:g},he=function(){function t(t){this.isSingle=t,this.isDisposed=!1,this.current=null}var e=t.prototype;return e.getDisposable=function(){return this.current},e.setDisposable=function(t){if(this.current&&this.isSingle)throw Error("Disposable has already been assigned");var e,n=this.isDisposed;n||(e=this.current,this.current=t),e&&e.dispose(),n&&t&&t.dispose()},e.dispose=function(){var t;this.isDisposed||(this.isDisposed=!0,t=this.current,this.current=null),t&&t.dispose()},t}(),ae=m.SingleAssignmentDisposable=function(t){function e(){t.call(this,!0)}return X(e,t),e}(he),le=m.SerialDisposable=function(t){function e(){t.call(this,!1)}return X(e,t),e}(he);m.RefCountDisposable=function(){function t(t){this.disposable=t,this.disposable.count++,this.isInnerDisposed=!1}function e(t){this.underlyingDisposable=t,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return t.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()))},e.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},e.prototype.getDisposable=function(){return this.isDisposed?ce:new t(this)},e}(),l.prototype.dispose=function(){var t=this;this.scheduler.schedule(function(){t.isDisposed||(t.isDisposed=!0,t.disposable.dispose())})};var pe=m.internals.ScheduledItem=function(t,e,n,i,r){this.scheduler=t,this.state=e,this.action=n,this.dueTime=i,this.comparer=r||_,this.disposable=new ae};pe.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},pe.prototype.compareTo=function(t){return this.comparer(this.dueTime,t.dueTime)},pe.prototype.isCancelled=function(){return this.disposable.isDisposed},pe.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var fe=m.Scheduler=function(){function t(t,e,n,i){this.now=t,this._schedule=e,this._scheduleRelative=n,this._scheduleAbsolute=i}function e(t,e){var n=e.first,i=e.second,r=new re,s=function(e){i(e,function(e){var n=!1,i=!1,o=t.scheduleWithState(e,function(t,e){return n?r.remove(o):i=!0,s(e),ce});i||(r.add(o),n=!0)})};return s(n),r}function n(t,e,n){var i=e.first,r=e.second,s=new re,o=function(e){r(e,function(e,i){var r=!1,u=!1,c=t[n].call(t,e,i,function(t,e){return r?s.remove(c):u=!0,o(e),ce});u||(s.add(c),r=!0)})};return o(i),s}function i(t,e){return e(),ce}var r=t.prototype;return r.catchException=r["catch"]=function(t){return new ge(this,t)},r.schedulePeriodic=function(t,e){return this.schedulePeriodicWithState(null,t,function(){e()})},r.schedulePeriodicWithState=function(t,e,n){var i=t,r=setInterval(function(){i=n(i)},e);return ue(function(){clearInterval(r)})},r.schedule=function(t){return this._schedule(t,i)},r.scheduleWithState=function(t,e){return this._schedule(t,e)},r.scheduleWithRelative=function(t,e){return this._scheduleRelative(e,t,i)},r.scheduleWithRelativeAndState=function(t,e,n){return this._scheduleRelative(t,e,n)},r.scheduleWithAbsolute=function(t,e){return this._scheduleAbsolute(e,t,i)},r.scheduleWithAbsoluteAndState=function(t,e,n){return this._scheduleAbsolute(t,e,n)},r.scheduleRecursive=function(t){return this.scheduleRecursiveWithState(t,function(t,e){t(function(){e(t)})})},r.scheduleRecursiveWithState=function(t,n){return this.scheduleWithState({first:t,second:n},function(t,n){return e(t,n)})},r.scheduleRecursiveWithRelative=function(t,e){return this.scheduleRecursiveWithRelativeAndState(e,t,function(t,e){t(function(n){e(t,n)})})},r.scheduleRecursiveWithRelativeAndState=function(t,e,i){return this._scheduleRelative({first:t,second:i},e,function(t,e){return n(t,e,"scheduleWithRelativeAndState")})},r.scheduleRecursiveWithAbsolute=function(t,e){return this.scheduleRecursiveWithAbsoluteAndState(e,t,function(t,e){t(function(n){e(t,n)})})},r.scheduleRecursiveWithAbsoluteAndState=function(t,e,i){return this._scheduleAbsolute({first:t,second:i},e,function(t,e){return n(t,e,"scheduleWithAbsoluteAndState")})},t.now=S,t.normalize=function(t){return 0>t&&(t=0),t},t}(),de=fe.normalize;m.internals.SchedulePeriodicRecursive=function(){function t(t,e){e(0,this._period);try{this._state=this._action(this._state)}catch(n){throw this._cancel.dispose(),n}}function e(t,e,n,i){this._scheduler=t,this._state=e,this._period=n,this._action=i}return e.prototype.start=function(){var e=new ae;return this._cancel=e,e.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,t.bind(this))),e},e}();var ve,be=fe.immediate=function(){function t(t,e){return e(this,t)}function e(t,e,n){for(var i=de(i);i-this.now()>0;);return n(this,t)}function n(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}return new fe(S,t,e,n)}(),ye=fe.currentThread=function(){function t(t){for(var e;t.length>0;)if(e=t.dequeue(),!e.isCancelled()){for(;e.dueTime-fe.now()>0;);e.isCancelled()||e.invoke()}}function e(t,e){return this.scheduleWithRelativeAndState(t,0,e)}function n(e,n,i){var s=this.now()+fe.normalize(n),o=new pe(this,e,i,s);if(r)r.enqueue(o);else{r=new ne(4),r.enqueue(o);try{t(r)}catch(u){throw u}finally{r=null}}return o.disposable}function i(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}var r,s=new fe(S,e,n,i);return s.scheduleRequired=function(){return null===r},s.ensureTrampoline=function(t){return null===r?this.schedule(t):t()},s}(),me=g;(function(){function t(){if(!f.postMessage||f.importScripts)return!1;var t=!1,e=f.onmessage;return f.onmessage=function(){t=!0},f.postMessage("","*"),f.onmessage=e,t}function e(t){if("string"==typeof t.data&&t.data.substring(0,s.length)===s){var e=t.data.substring(s.length),n=o[e];n(),delete o[e]}}var n=RegExp("^"+(F+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=y&&b&&y.setImmediate)&&!n.test(i)&&i,r="function"==typeof(r=y&&b&&y.clearImmediate)&&!n.test(r)&&r;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ve=process.nextTick;else if("function"==typeof i)ve=i,me=r;else if(t()){var s="ms.rx.schedule"+Math.random(),o={},u=0;f.addEventListener?f.addEventListener("message",e,!1):f.attachEvent("onmessage",e,!1),ve=function(t){var e=u++;o[e]=t,f.postMessage(s+e,"*")}}else if(f.MessageChannel){var c=new f.MessageChannel,h={},a=0;c.port1.onmessage=function(t){var e=t.data,n=h[e];n(),delete h[e]},ve=function(t){var e=a++;h[e]=t,c.port2.postMessage(e)}}else"document"in f&&"onreadystatechange"in f.document.createElement("script")?ve=function(t){var e=f.document.createElement("script");e.onreadystatechange=function(){t(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},f.document.documentElement.appendChild(e)}:(ve=function(t){return setTimeout(t,0)},me=clearTimeout)})(),fe.timeout=function(){function t(t,e){var n=this,i=new ae,r=ve(function(){i.isDisposed||i.setDisposable(e(n,t))});return new re(i,ue(function(){me(r)}))}function e(t,e,n){var i=this,r=fe.normalize(e);if(0===r)return i.scheduleWithState(t,n);var s=new ae,o=setTimeout(function(){s.isDisposed||s.setDisposable(n(i,t))},r);return new re(s,ue(function(){clearTimeout(o)}))}function n(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}return new fe(S,t,e,n)}();var ge=function(t){function e(){return this._scheduler.now()}function n(t,e){return this._scheduler.scheduleWithState(t,this._wrap(e))}function i(t,e,n){return this._scheduler.scheduleWithRelativeAndState(t,e,this._wrap(n))}function r(t,e,n){return this._scheduler.scheduleWithAbsoluteAndState(t,e,this._wrap(n))}function s(s,o){this._scheduler=s,this._handler=o,this._recursiveOriginal=null,this._recursiveWrapper=null,t.call(this,e,n,i,r)}return X(s,t),s.prototype._clone=function(t){return new s(t,this._handler)},s.prototype._wrap=function(t){var e=this;return function(n,i){try{return t(e._getRecursiveWrapper(n),i)}catch(r){if(!e._handler(r))throw r;return ce}}},s.prototype._getRecursiveWrapper=function(t){if(this._recursiveOriginal!==t){this._recursiveOriginal=t;var e=this._clone(t);e._recursiveOriginal=t,e._recursiveWrapper=e,this._recursiveWrapper=e}return this._recursiveWrapper},s.prototype.schedulePeriodicWithState=function(t,e,n){var i=this,r=!1,s=new ae;return s.setDisposable(this._scheduler.schedulePeriodicWithState(t,e,function(t){if(r)return null;try{return n(t)}catch(e){if(r=!0,!i._handler(e))throw e;return s.dispose(),null}})),s},s}(fe),we=m.Notification=function(){function t(t,e){this.hasValue=null==e?!1:e,this.kind=t}var e=t.prototype;return e.accept=function(t,e,n){return 1===arguments.length&&"object"==typeof t?this._acceptObservable(t):this._accept(t,e,n)},e.toObservable=function(t){var e=this;return t||(t=be),new ke(function(n){return t.schedule(function(){e._acceptObservable(n),"N"===e.kind&&n.onCompleted()})})},t}(),Se=we.createOnNext=function(){function t(t){return t(this.value)}function e(t){return t.onNext(this.value)}function n(){return"OnNext("+this.value+")"}return function(i){var r=new we("N",!0);return r.value=i,r._accept=t,r._acceptObservable=e,r.toString=n,r}}(),_e=we.createOnError=function(){function t(t,e){return e(this.exception)}function e(t){return t.onError(this.exception)}function n(){return"OnError("+this.exception+")"}return function(i){var r=new we("E");return r.exception=i,r._accept=t,r._acceptObservable=e,r.toString=n,r}}(),De=we.createOnCompleted=function(){function t(t,e,n){return n()}function e(t){return t.onCompleted()}function n(){return"OnCompleted()"}return function(){var i=new we("C");return i._accept=t,i._acceptObservable=e,i.toString=n,i}}(),xe=m.internals.Enumerator=function(t){this._next=t};xe.prototype.next=function(){return this._next()},xe.prototype[E]=function(){return this};var Ae=m.internals.Enumerable=function(t){this._iterator=t};Ae.prototype[E]=function(){return this._iterator()},Ae.prototype.concat=function(){var e=this;return new ke(function(n){var i;try{i=e[E]()}catch(r){return n.onError(),t}var s,o=new le,u=be.scheduleRecursive(function(e){var r;if(!s){try{r=i.next()}catch(u){return n.onError(u),t}if(r.done)return n.onCompleted(),t;var c=r.value;x(c)&&(c=observableFromPromise(c));var h=new ae;o.setDisposable(h),h.setDisposable(c.subscribe(n.onNext.bind(n),n.onError.bind(n),function(){e()}))}});return new re(o,u,ue(function(){s=!0}))})},Ae.prototype.catchException=function(){var e=this;return new ke(function(n){var i;try{i=e[E]()}catch(r){return n.onError(),t}var s,o,u=new le,c=be.scheduleRecursive(function(e){if(!s){var r;try{r=i.next()}catch(c){return n.onError(c),t}if(r.done)return o?n.onError(o):n.onCompleted(),t;var h=r.value;x(h)&&(h=observableFromPromise(h));var a=new ae;u.setDisposable(a),a.setDisposable(h.subscribe(n.onNext.bind(n),function(t){o=t,e()},n.onCompleted.bind(n)))}});return new re(u,c,ue(function(){s=!0}))})},Ae.repeat=function(t,e){return null==e&&(e=-1),new Ae(function(){var n=e;return new xe(function(){return 0===n?R:(n>0&&n--,{done:!1,value:t})})})},Ae.forEach=function(t,e,n){return e||(e=w),new Ae(function(){var i=-1;return new xe(function(){return++i<t.length?{done:!1,value:e.call(n,t[i],i,t)}:R})})};var Ee=m.Observer=function(){};Ee.prototype.toNotifier=function(){var t=this;return function(e){return e.accept(t)}},Ee.prototype.asObserver=function(){return new Ce(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Ee.prototype.checked=function(){return new We(this)};var Oe=Ee.create=function(t,e,n){return t||(t=g),e||(e=D),n||(n=g),new Ce(t,e,n)};Ee.fromNotifier=function(t){return new Ce(function(e){return t(Se(e))},function(e){return t(_e(e))},function(){return t(De())})},Ee.notifyOn=function(t){return new Ne(t,this)};var Re,je=m.internals.AbstractObserver=function(t){function e(){this.isStopped=!1,t.call(this)}return X(e,t),e.prototype.onNext=function(t){this.isStopped||this.next(t)},e.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.error(t))},e.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},e.prototype.dispose=function(){this.isStopped=!0},e.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.error(t),!0)},e}(Ee),Ce=m.AnonymousObserver=function(t){function e(e,n,i){t.call(this),this._onNext=e,this._onError=n,this._onCompleted=i}return X(e,t),e.prototype.next=function(t){this._onNext(t)},e.prototype.error=function(t){this._onError(t)},e.prototype.completed=function(){this._onCompleted()},e}(je),We=function(t){function e(e){t.call(this),this._observer=e,this._state=0}X(e,t);var n=e.prototype;return n.onNext=function(t){this.checkAccess();try{this._observer.onNext(t)}catch(e){throw e}finally{this._state=0}},n.onError=function(t){this.checkAccess();try{this._observer.onError(t)}catch(e){throw e}finally{this._state=2}},n.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(t){throw t}finally{this._state=2}},n.checkAccess=function(){if(1===this._state)throw Error("Re-entrancy detected");if(2===this._state)throw Error("Observer completed");0===this._state&&(this._state=1)},e}(Ee),Pe=m.internals.ScheduledObserver=function(e){function n(t,n){e.call(this),this.scheduler=t,this.observer=n,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new le}return X(n,e),n.prototype.next=function(t){var e=this;this.queue.push(function(){e.observer.onNext(t)})},n.prototype.error=function(t){var e=this;this.queue.push(function(){e.observer.onError(t)})},n.prototype.completed=function(){var t=this;this.queue.push(function(){t.observer.onCompleted()})},n.prototype.ensureActive=function(){var e=!1,n=this;!this.hasFaulted&&this.queue.length>0&&(e=!this.isAcquired,this.isAcquired=!0),e&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(e){var i;if(!(n.queue.length>0))return n.isAcquired=!1,t;i=n.queue.shift();try{i()}catch(r){throw n.queue=[],n.hasFaulted=!0,r}e()}))},n.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposable.dispose()},n}(je),Ne=function(t){function e(){t.apply(this,arguments)}return X(e,t),e.prototype.next=function(e){t.prototype.next.call(this,e),this.ensureActive()},e.prototype.error=function(e){t.prototype.error.call(this,e),this.ensureActive()},e.prototype.completed=function(){t.prototype.completed.call(this),this.ensureActive()},e}(Pe),qe=m.Observable=function(){function t(t){this._subscribe=t}return Re=t.prototype,Re.subscribe=Re.forEach=function(t,e,n){var i="object"==typeof t?t:Oe(t,e,n);return this._subscribe(i)},t}(),ke=m.AnonymousObservable=function(e){function n(e){return e===t?e=ce:"function"==typeof e&&(e=ue(e)),e}function i(r){function s(t){var e=new Te(t);if(ye.scheduleRequired())ye.schedule(function(){try{e.setDisposable(n(r(e)))}catch(t){if(!e.fail(t))throw t}});else try{e.setDisposable(n(r(e)))}catch(i){if(!e.fail(i))throw i}return e}return this instanceof i?(e.call(this,s),t):new i(r)}return X(i,e),i}(qe),Te=function(t){function e(e){t.call(this),this.observer=e,this.m=new ae}X(e,t);var n=e.prototype;return n.next=function(t){var e=!1;try{this.observer.onNext(t),e=!0}catch(n){throw n}finally{e||this.dispose()}},n.error=function(t){try{this.observer.onError(t)}catch(e){throw e}finally{this.dispose()}},n.completed=function(){try{this.observer.onCompleted()}catch(t){throw t}finally{this.dispose()}},n.setDisposable=function(t){this.m.setDisposable(t)},n.getDisposable=function(){return this.m.getDisposable()},n.disposable=function(t){return arguments.length?this.getDisposable():setDisposable(t)},n.dispose=function(){t.prototype.dispose.call(this),this.m.dispose()},e}(je);(function(t){function e(t){return this.underlyingObservable.subscribe(t)}function n(n,i,r){t.call(this,e),this.key=n,this.underlyingObservable=r?new ke(function(t){return new re(r.getDisposable(),i.subscribe(t))}):i}return X(n,t),n})(qe);var Ie=function(t,e){this.subject=t,this.observer=e};Ie.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var t=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(t,1),this.observer=null}},m.Subject=function(t){function n(t){return e.call(this),this.isStopped?this.exception?(t.onError(this.exception),ce):(t.onCompleted(),ce):(this.observers.push(t),new Ie(this,t))}function i(){t.call(this,n),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return X(i,t),Y(i.prototype,Ee,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(e.call(this),!this.isStopped){var t=this.observers.slice(0);this.isStopped=!0;for(var n=0,i=t.length;i>n;n++)t[n].onCompleted();this.observers=[]}},onError:function(t){if(e.call(this),!this.isStopped){var n=this.observers.slice(0);this.isStopped=!0,this.exception=t;for(var i=0,r=n.length;r>i;i++)n[i].onError(t);this.observers=[]}},onNext:function(t){if(e.call(this),!this.isStopped)for(var n=this.observers.slice(0),i=0,r=n.length;r>i;i++)n[i].onNext(t)},dispose:function(){this.isDisposed=!0,this.observers=null}}),i.create=function(t,e){return new Me(t,e)},i}(qe),m.AsyncSubject=function(t){function n(t){if(e.call(this),!this.isStopped)return this.observers.push(t),new Ie(this,t);var n=this.exception,i=this.hasValue,r=this.value;return n?t.onError(n):i?(t.onNext(r),t.onCompleted()):t.onCompleted(),ce}function i(){t.call(this,n),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return X(i,t),Y(i.prototype,Ee,{hasObservers:function(){return e.call(this),this.observers.length>0},onCompleted:function(){var t,n,i;if(e.call(this),!this.isStopped){this.isStopped=!0;var r=this.observers.slice(0),s=this.value,o=this.hasValue;if(o)for(n=0,i=r.length;i>n;n++)t=r[n],t.onNext(s),t.onCompleted();else for(n=0,i=r.length;i>n;n++)r[n].onCompleted();this.observers=[]}},onError:function(t){if(e.call(this),!this.isStopped){var n=this.observers.slice(0);this.isStopped=!0,this.exception=t;for(var i=0,r=n.length;r>i;i++)n[i].onError(t);this.observers=[]}},onNext:function(t){e.call(this),this.isStopped||(this.value=t,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),i}(qe);var Me=function(t){function e(t){return this.observable.subscribe(t)}function n(n,i){t.call(this,e),this.observer=n,this.observable=i}return X(n,t),Y(n.prototype,Ee,{onCompleted:function(){this.observer.onCompleted()},onError:function(t){this.observer.onError(t)},onNext:function(t){this.observer.onNext(t)}}),n}(qe);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(f.Rx=m,define(function(){return m})):d&&v?b?(v.exports=m).Rx=m:d.Rx=m:f.Rx=m}).call(this);
1
+ (function(a){function b(){if(this.isDisposed)throw new Error(A)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;X.nonEnumArgs&&a.length&&h(a)&&(a=Z.call(a));var d=X.enumPrototypes&&"function"==typeof a,e=X.enumErrorProps&&(a===R||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(X.nonEnumShadows&&a!==S){var g=a.constructor,i=-1,j=V.length;if(a===(g&&g.prototype))var k=a===stringProto?N:a===R?I:O.call(a),l=W[k];for(;++i<j;)f=V[i],l&&l[f]||!P.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?O.call(a)==E:!1}function i(a){return"function"==typeof a||!1}function j(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,k=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=k&&"object"!=k))return!1;var l=O.call(a),m=O.call(b);if(l==E&&(l=L),m==E&&(m=L),l!=m)return!1;switch(l){case G:case H:return+a==+b;case K:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case M:case N:return a==String(b)}var n=l==F;if(!n){if(l!=L||!X.nodeClass&&(g(a)||g(b)))return!1;var o=!X.argsObject&&h(a)?Object:a.constructor,p=!X.argsObject&&h(b)?Object:b.constructor;if(!(o==p||P.call(a,"constructor")&&P.call(b,"constructor")||i(o)&&o instanceof o&&i(p)&&p instanceof p||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(result=!0,c.push(a),d.push(b),n){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=j(a[r],s,c,d)))break}}else f(b,function(b,e,f){return P.call(f,e)?(r++,result=P.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return P.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function k(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Z.call(a)}function l(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}var m={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=m[typeof window]&&window||this,o=m[typeof exports]&&exports&&!exports.nodeType&&exports,p=m[typeof module]&&module&&!module.nodeType&&module,q=p&&p.exports===o&&o,r=m[typeof global]&&global;!r||r.global!==r&&r.window!==r||(n=r);var s={internals:{},config:{Promise:n.Promise},helpers:{}},t=s.helpers.noop=function(){},u=(s.helpers.notDefined=function(a){return"undefined"==typeof a},s.helpers.isScheduler=function(a){return a instanceof s.Scheduler}),v=s.helpers.identity=function(a){return a},w=(s.helpers.pluck=function(a){return function(b){return b[a]}},s.helpers.just=function(a){return function(){return a}},s.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),x=(s.helpers.defaultComparer=function(a,b){return Y(a,b)},s.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0}),y=(s.helpers.defaultKeySerializer=function(a){return a.toString()},s.helpers.defaultError=function(a){throw a}),z=s.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then&&a.then!==s.Observable.prototype.then},A=(s.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},s.helpers.not=function(a){return!a},"Object has been disposed"),B="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";n.Set&&"function"==typeof(new n.Set)["@@iterator"]&&(B="@@iterator");var C,D={done:!0,value:a},E="[object Arguments]",F="[object Array]",G="[object Boolean]",H="[object Date]",I="[object Error]",J="[object Function]",K="[object Number]",L="[object Object]",M="[object RegExp]",N="[object String]",O=Object.prototype.toString,P=Object.prototype.hasOwnProperty,Q=O.call(arguments)==E,R=Error.prototype,S=Object.prototype,T=S.propertyIsEnumerable;try{C=!(O.call(document)==L&&!({toString:0}+""))}catch(U){C=!0}var V=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],W={};W[F]=W[H]=W[K]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},W[G]=W[N]={constructor:!0,toString:!0,valueOf:!0},W[I]=W[J]=W[M]={constructor:!0,toString:!0},W[L]={constructor:!0};var X={};!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);X.enumErrorProps=T.call(R,"message")||T.call(R,"name"),X.enumPrototypes=T.call(a,"prototype"),X.nonEnumArgs=0!=c,X.nonEnumShadows=!/valueOf/.test(b)}(1),Q||(h=function(a){return a&&"object"==typeof a?P.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&O.call(a)==J});{var Y=s.internals.isEqual=function(a,b){return j(a,b,[],[])},Z=Array.prototype.slice,$=({}.hasOwnProperty,this.inherits=s.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),_=s.internals.addProperties=function(a){for(var b=Z.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};s.internals.addRef=function(a,b){return new Kb(function(c){return new fb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Z.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(Z.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Z.call(arguments)))};return d});var ab=Object("a"),bb="a"!=ab[0]||!(0 in ab);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=bb&&{}.toString.call(this)==N?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=J)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=bb&&{}.toString.call(this)==N?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=J)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 Object.prototype.toString.call(a)==F}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});var cb=function(a,b){this.id=a,this.value=b};cb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var db=s.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},eb=db.prototype;eb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},eb.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)}}},eb.heapify=function(b){if(b===a&&(b=0),!(b>=this.length||0>b)){var c=2*b+1,d=2*b+2,e=b;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==b){var f=this.items[b];this.items[b]=this.items[e],this.items[e]=f,this.heapify(e)}}},eb.peek=function(){return this.items[0].value},eb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},eb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},eb.enqueue=function(a){var b=this.length++;this.items[b]=new cb(db.count++,a),this.percolate(b)},eb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},db.count=0;var fb=s.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},gb=fb.prototype;gb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},gb.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},gb.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()}},gb.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},gb.contains=function(a){return-1!==this.disposables.indexOf(a)},gb.toArray=function(){return this.disposables.slice(0)};var hb=s.Disposable=function(a){this.isDisposed=!1,this.action=a||t};hb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};{var ib=hb.create=function(a){return new hb(a)},jb=hb.empty={dispose:t},kb=function(){function a(a){this.isSingle=a,this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){if(this.current&&this.isSingle)throw new Error("Disposable has already been assigned");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}(),lb=s.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return $(b,a),b}(kb),mb=s.SerialDisposable=function(a){function b(){a.call(this,!1)}return $(b,a),b}(kb);s.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?jb:new a(this)},b}()}l.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var nb=s.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||x,this.disposable=new lb};nb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},nb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},nb.prototype.isCancelled=function(){return this.disposable.isDisposed},nb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ob,pb=s.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){var c=b.first,d=b.second,e=new fb,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),jb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new fb,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),jb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),jb}var e=a.prototype;return e.catchException=e["catch"]=function(a){return new ub(this,a)},e.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},e.schedulePeriodicWithState=function(a,b,c){var d=a,e=setInterval(function(){d=c(d)},b);return ib(function(){clearInterval(e)})},e.schedule=function(a){return this._schedule(a,d)},e.scheduleWithState=function(a,b){return this._schedule(a,b)},e.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,d)},e.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},e.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,d)},e.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},e.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},e.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},function(a,c){return b(a,c)})},e.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},e.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})},a.now=w,a.normalize=function(a){return 0>a&&(a=0),a},a}(),qb=pb.normalize,rb=(s.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 lb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),pb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=qb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new pb(w,a,b,c)}()),sb=pb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-pb.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()+pb.normalize(c),g=new nb(this,b,d,f);if(e)e.enqueue(g);else{e=new db(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 pb(w,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),tb=t;!function(){function a(){if(!n.postMessage||n.importScripts)return!1;var a=!1,b=n.onmessage;return n.onmessage=function(){a=!0},n.postMessage("","*"),n.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(O).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=r&&q&&r.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=r&&q&&r.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ob=process.nextTick;else if("function"==typeof d)ob=d,tb=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;n.addEventListener?n.addEventListener("message",b,!1):n.attachEvent("onmessage",b,!1),ob=function(a){var b=h++;g[b]=a,n.postMessage(f+b,"*")}}else if(n.MessageChannel){var i=new n.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},ob=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in n&&"onreadystatechange"in n.document.createElement("script")?ob=function(a){var b=n.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},n.document.documentElement.appendChild(b)}:(ob=function(a){return setTimeout(a,0)},tb=clearTimeout)}();var ub=(pb.timeout=function(){function a(a,b){var c=this,d=new lb,e=ob(function(){d.isDisposed||d.setDisposable(b(c,a))});return new fb(d,ib(function(){tb(e)}))}function b(a,b,c){var d=this,e=pb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new lb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new fb(f,ib(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new pb(w,a,b,c)}(),function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return $(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return jb}}},f.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new lb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},f}(pb)),vb=s.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 u(a)||(a=rb),new Kb(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),wb=vb.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 vb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),xb=vb.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 vb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),yb=vb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new vb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),zb=s.internals.Enumerator=function(a){this._next=a};zb.prototype.next=function(){return this._next()},zb.prototype[B]=function(){return this};var Ab=s.internals.Enumerable=function(a){this._iterator=a};Ab.prototype[B]=function(){return this._iterator()},Ab.prototype.concat=function(){var a=this;return new Kb(function(b){var c;try{c=a[B]()}catch(d){return void b.onError()}var e,f=new mb,g=rb.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;z(h)&&(h=observableFromPromise(h));var i=new lb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new fb(f,g,ib(function(){e=!0}))})},Ab.prototype.catchException=function(){var a=this;return new Kb(function(b){var c;try{c=a[B]()}catch(d){return void b.onError()}var e,f,g=new mb,h=rb.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;z(i)&&(i=observableFromPromise(i));var j=new lb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new fb(g,h,ib(function(){e=!0}))})};var Bb=(Ab.repeat=function(a,b){return null==b&&(b=-1),new Ab(function(){var c=b;return new zb(function(){return 0===c?D:(c>0&&c--,{done:!1,value:a})})})},Ab.forEach=function(a,b,c){return b||(b=v),new Ab(function(){var d=-1;return new zb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:D})})},s.Observer=function(){});Bb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Bb.prototype.asObserver=function(){return new Fb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Bb.prototype.checked=function(){return new Gb(this)};var Cb=Bb.create=function(a,b,c){return a||(a=t),b||(b=y),c||(c=t),new Fb(a,b,c)};Bb.fromNotifier=function(a){return new Fb(function(b){return a(wb(b))},function(b){return a(xb(b))},function(){return a(yb())})},Bb.notifyOn=function(a){return new Ib(a,this)};var Db,Eb=s.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return $(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}(Bb),Fb=s.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return $(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}(Eb),Gb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}$(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}(Bb),Hb=s.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 mb}return $(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}(Eb),Ib=function(a){function b(){a.apply(this,arguments)}return $(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}(Hb),Jb=s.Observable=function(){function a(a){this._subscribe=a}return Db=a.prototype,Db.subscribe=Db.forEach=function(a,b,c){var d="object"==typeof a?a:Cb(a,b,c);return this._subscribe(d)},a}(),Kb=s.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=jb:"function"==typeof a&&(a=ib(a)),a}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 Lb(a);return sb.scheduleRequired()?sb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return $(c,a),c}(Jb),Lb=function(a){function b(b){a.call(this),this.observer=b,this.m=new lb}$(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}(Eb),Mb=(function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Kb(function(a){return new fb(e.getDisposable(),d.subscribe(a))}):d}return $(c,a),c}(Jb),function(a,b){this.subject=a,this.observer=b});Mb.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 Nb=(s.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),jb):(a.onCompleted(),jb):(this.observers.push(a),new Mb(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return $(d,a),_(d.prototype,Bb,{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 Nb(a,b)},d}(Jb),s.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Mb(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(),jb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return $(d,a),_(d.prototype,Bb,{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}(Jb),function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return $(c,a),_(c.prototype,Bb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Jb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(n.Rx=s,define(function(){return s})):o&&p?q?(p.exports=s).Rx=s:o.Rx=s:n.Rx=s}).call(this);
@@ -31,6 +31,8 @@
31
31
 
32
32
  // Defaults
33
33
  var noop = Rx.helpers.noop = function () { },
34
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
35
+ isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; },
34
36
  identity = Rx.helpers.identity = function (x) { return x; },
35
37
  pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
36
38
  just = Rx.helpers.just = function (value) { return function () { return value; }; },
@@ -50,14 +52,13 @@
50
52
  function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } }
51
53
 
52
54
  // Shim in iterator support
53
- var $iterator$ = (typeof Symbol === 'object' && Symbol.iterator) ||
55
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
54
56
  '_es6shim_iterator_';
55
- // Firefox ships a partial implementation using the name @@iterator.
56
- // https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14
57
- // So use that name if we detect it.
57
+ // Bug for mozilla version
58
58
  if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
59
59
  $iterator$ = '@@iterator';
60
60
  }
61
+
61
62
  var doneEnumerator = { done: true, value: undefined };
62
63
 
63
64
  /** `Object#toString` result shortcuts */
@@ -1394,140 +1395,111 @@
1394
1395
  return CatchScheduler;
1395
1396
  }(Scheduler));
1396
1397
 
1397
- /**
1398
- * Represents a notification to an observer.
1399
- */
1400
- var Notification = Rx.Notification = (function () {
1401
- function Notification(kind, hasValue) {
1402
- this.hasValue = hasValue == null ? false : hasValue;
1403
- this.kind = kind;
1404
- }
1405
-
1406
- var NotificationPrototype = Notification.prototype;
1407
-
1408
- /**
1409
- * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
1410
- *
1411
- * @memberOf Notification
1412
- * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
1413
- * @param {Function} onError Delegate to invoke for an OnError notification.
1414
- * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
1415
- * @returns {Any} Result produced by the observation.
1416
- */
1417
- NotificationPrototype.accept = function (observerOrOnNext, onError, onCompleted) {
1418
- if (arguments.length === 1 && typeof observerOrOnNext === 'object') {
1419
- return this._acceptObservable(observerOrOnNext);
1420
- }
1421
- return this._accept(observerOrOnNext, onError, onCompleted);
1422
- };
1423
-
1424
- /**
1425
- * Returns an observable sequence with a single notification.
1426
- *
1427
- * @memberOf Notification
1428
- * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
1429
- * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
1430
- */
1431
- NotificationPrototype.toObservable = function (scheduler) {
1432
- var notification = this;
1433
- scheduler || (scheduler = immediateScheduler);
1434
- return new AnonymousObservable(function (observer) {
1435
- return scheduler.schedule(function () {
1436
- notification._acceptObservable(observer);
1437
- if (notification.kind === 'N') {
1438
- observer.onCompleted();
1439
- }
1440
- });
1441
- });
1442
- };
1443
-
1444
- return Notification;
1445
- })();
1446
-
1447
- /**
1448
- * Creates an object that represents an OnNext notification to an observer.
1449
- * @param {Any} value The value contained in the notification.
1450
- * @returns {Notification} The OnNext notification containing the value.
1451
- */
1452
- var notificationCreateOnNext = Notification.createOnNext = (function () {
1453
-
1454
- function _accept (onNext) {
1455
- return onNext(this.value);
1456
- }
1457
-
1458
- function _acceptObservable(observer) {
1459
- return observer.onNext(this.value);
1460
- }
1461
-
1462
- function toString () {
1463
- return 'OnNext(' + this.value + ')';
1464
- }
1465
-
1466
- return function (value) {
1467
- var notification = new Notification('N', true);
1468
- notification.value = value;
1469
- notification._accept = _accept;
1470
- notification._acceptObservable = _acceptObservable;
1471
- notification.toString = toString;
1472
- return notification;
1473
- };
1474
- }());
1398
+ /**
1399
+ * Represents a notification to an observer.
1400
+ */
1401
+ var Notification = Rx.Notification = (function () {
1402
+ function Notification(kind, hasValue) {
1403
+ this.hasValue = hasValue == null ? false : hasValue;
1404
+ this.kind = kind;
1405
+ }
1475
1406
 
1476
1407
  /**
1477
- * Creates an object that represents an OnError notification to an observer.
1478
- * @param {Any} error The exception contained in the notification.
1479
- * @returns {Notification} The OnError notification containing the exception.
1408
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
1409
+ *
1410
+ * @memberOf Notification
1411
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
1412
+ * @param {Function} onError Delegate to invoke for an OnError notification.
1413
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
1414
+ * @returns {Any} Result produced by the observation.
1480
1415
  */
1481
- var notificationCreateOnError = Notification.createOnError = (function () {
1482
-
1483
- function _accept (onNext, onError) {
1484
- return onError(this.exception);
1485
- }
1486
-
1487
- function _acceptObservable(observer) {
1488
- return observer.onError(this.exception);
1489
- }
1490
-
1491
- function toString () {
1492
- return 'OnError(' + this.exception + ')';
1493
- }
1494
-
1495
- return function (exception) {
1496
- var notification = new Notification('E');
1497
- notification.exception = exception;
1498
- notification._accept = _accept;
1499
- notification._acceptObservable = _acceptObservable;
1500
- notification.toString = toString;
1501
- return notification;
1502
- };
1503
- }());
1416
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
1417
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
1418
+ this._acceptObservable(observerOrOnNext) :
1419
+ this._accept(observerOrOnNext, onError, onCompleted);
1420
+ };
1504
1421
 
1505
1422
  /**
1506
- * Creates an object that represents an OnCompleted notification to an observer.
1507
- * @returns {Notification} The OnCompleted notification.
1423
+ * Returns an observable sequence with a single notification.
1424
+ *
1425
+ * @memberOf Notifications
1426
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
1427
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
1508
1428
  */
1509
- var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
1429
+ Notification.prototype.toObservable = function (scheduler) {
1430
+ var notification = this;
1431
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
1432
+ return new AnonymousObservable(function (observer) {
1433
+ return scheduler.schedule(function () {
1434
+ notification._acceptObservable(observer);
1435
+ notification.kind === 'N' && observer.onCompleted();
1436
+ });
1437
+ });
1438
+ };
1510
1439
 
1511
- function _accept (onNext, onError, onCompleted) {
1512
- return onCompleted();
1513
- }
1440
+ return Notification;
1441
+ })();
1514
1442
 
1515
- function _acceptObservable(observer) {
1516
- return observer.onCompleted();
1517
- }
1443
+ /**
1444
+ * Creates an object that represents an OnNext notification to an observer.
1445
+ * @param {Any} value The value contained in the notification.
1446
+ * @returns {Notification} The OnNext notification containing the value.
1447
+ */
1448
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
1449
+
1450
+ function _accept (onNext) { return onNext(this.value); }
1451
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
1452
+ function toString () { return 'OnNext(' + this.value + ')'; }
1453
+
1454
+ return function (value) {
1455
+ var notification = new Notification('N', true);
1456
+ notification.value = value;
1457
+ notification._accept = _accept;
1458
+ notification._acceptObservable = _acceptObservable;
1459
+ notification.toString = toString;
1460
+ return notification;
1461
+ };
1462
+ }());
1518
1463
 
1519
- function toString () {
1520
- return 'OnCompleted()';
1521
- }
1464
+ /**
1465
+ * Creates an object that represents an OnError notification to an observer.
1466
+ * @param {Any} error The exception contained in the notification.
1467
+ * @returns {Notification} The OnError notification containing the exception.
1468
+ */
1469
+ var notificationCreateOnError = Notification.createOnError = (function () {
1470
+
1471
+ function _accept (onNext, onError) { return onError(this.exception); }
1472
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
1473
+ function toString () { return 'OnError(' + this.exception + ')'; }
1474
+
1475
+ return function (exception) {
1476
+ var notification = new Notification('E');
1477
+ notification.exception = exception;
1478
+ notification._accept = _accept;
1479
+ notification._acceptObservable = _acceptObservable;
1480
+ notification.toString = toString;
1481
+ return notification;
1482
+ };
1483
+ }());
1522
1484
 
1523
- return function () {
1524
- var notification = new Notification('C');
1525
- notification._accept = _accept;
1526
- notification._acceptObservable = _acceptObservable;
1527
- notification.toString = toString;
1528
- return notification;
1529
- };
1530
- }());
1485
+ /**
1486
+ * Creates an object that represents an OnCompleted notification to an observer.
1487
+ * @returns {Notification} The OnCompleted notification.
1488
+ */
1489
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
1490
+
1491
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
1492
+ function _acceptObservable(observer) { return observer.onCompleted(); }
1493
+ function toString () { return 'OnCompleted()'; }
1494
+
1495
+ return function () {
1496
+ var notification = new Notification('C');
1497
+ notification._accept = _accept;
1498
+ notification._acceptObservable = _acceptObservable;
1499
+ notification.toString = toString;
1500
+ return notification;
1501
+ };
1502
+ }());
1531
1503
 
1532
1504
  var Enumerator = Rx.internals.Enumerator = function (next) {
1533
1505
  this._next = next;
@@ -2080,25 +2052,21 @@
2080
2052
  }
2081
2053
 
2082
2054
  function s(observer) {
2083
- var autoDetachObserver = new AutoDetachObserver(observer);
2084
- if (currentThreadScheduler.scheduleRequired()) {
2085
- currentThreadScheduler.schedule(function () {
2086
- try {
2087
- autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver)));
2088
- } catch (e) {
2089
- if (!autoDetachObserver.fail(e)) {
2090
- throw e;
2091
- }
2092
- }
2093
- });
2094
- } else {
2055
+ var setDisposable = function () {
2095
2056
  try {
2096
2057
  autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver)));
2097
2058
  } catch (e) {
2098
2059
  if (!autoDetachObserver.fail(e)) {
2099
2060
  throw e;
2100
- }
2061
+ }
2101
2062
  }
2063
+ };
2064
+
2065
+ var autoDetachObserver = new AutoDetachObserver(observer);
2066
+ if (currentThreadScheduler.scheduleRequired()) {
2067
+ currentThreadScheduler.schedule(setDisposable);
2068
+ } else {
2069
+ setDisposable();
2102
2070
  }
2103
2071
 
2104
2072
  return autoDetachObserver;
@@ -1 +1 @@
1
- (function(t){function e(){if(this.isDisposed)throw Error(A)}function n(t){var e=typeof t;return t&&("function"==e||"object"==e)||!1}function i(t){var e=[];if(!n(t))return e;G.nonEnumArgs&&t.length&&u(t)&&(t=U.call(t));var i=G.enumPrototypes&&"function"==typeof t,r=G.enumErrorProps&&(t===H||t instanceof Error);for(var s in t)i&&"prototype"==s||r&&("message"==s||"name"==s)||e.push(s);if(G.nonEnumShadows&&t!==L){var o=t.constructor,c=-1,h=K.length;if(t===(o&&o.prototype))var a=t===stringProto?M:t===H?N:F.call(t),l=Q[a];for(;h>++c;)s=K[c],l&&l[s]||!z.call(t,s)||e.push(s)}return e}function r(t,e,n){for(var i=-1,r=n(t),s=r.length;s>++i;){var o=r[i];if(e(t[o],o,t)===!1)break}return t}function s(t,e){return r(t,e,i)}function o(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function u(t){return t&&"object"==typeof t?F.call(t)==C:!1}function c(t){return"function"==typeof t||!1}function h(e,n,i,r){if(e===n)return 0!==e||1/e==1/n;var a=typeof e,l=typeof n;if(e===e&&(null==e||null==n||"function"!=a&&"object"!=a&&"function"!=l&&"object"!=l))return!1;var p=F.call(e),f=F.call(n);if(p==C&&(p=T),f==C&&(f=T),p!=f)return!1;switch(p){case W:case P:return+e==+n;case k:return e!=+e?n!=+n:0==e?1/e==1/n:e==+n;case I:case M:return e==n+""}var d=p==j;if(!d){if(p!=T||!G.nodeClass&&(o(e)||o(n)))return!1;var v=!G.argsObject&&u(e)?Object:e.constructor,b=!G.argsObject&&u(n)?Object:n.constructor;if(!(v==b||z.call(e,"constructor")&&z.call(n,"constructor")||c(v)&&v instanceof v&&c(b)&&b instanceof b||!("constructor"in e&&"constructor"in n)))return!1}i||(i=[]),r||(r=[]);for(var y=i.length;y--;)if(i[y]==e)return r[y]==n;var m=0;if(result=!0,i.push(e),r.push(n),d){if(y=e.length,m=n.length,result=m==y)for(;m--;){var g=n[m];if(!(result=h(e[m],g,i,r)))break}}else s(n,function(n,s,o){return z.call(o,s)?(m++,result=z.call(e,s)&&h(e[s],n,i,r)):t}),result&&s(e,function(e,n,i){return z.call(i,n)?result=--m>-1:t});return i.pop(),r.pop(),result}function a(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:U.call(t)}function l(t,e){this.scheduler=t,this.disposable=e,this.isDisposed=!1}var p={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},f=p[typeof window]&&window||this,d=p[typeof exports]&&exports&&!exports.nodeType&&exports,v=p[typeof module]&&module&&!module.nodeType&&module,b=v&&v.exports===d&&d,y=p[typeof global]&&global;!y||y.global!==y&&y.window!==y||(f=y);var m={internals:{},config:{Promise:f.Promise},helpers:{}},g=m.helpers.noop=function(){},w=m.helpers.identity=function(t){return t},_=(m.helpers.pluck=function(t){return function(e){return e[t]}},m.helpers.just=function(t){return function(){return t}},m.helpers.defaultNow=Date.now),S=(m.helpers.defaultComparer=function(t,e){return J(t,e)},m.helpers.defaultSubComparer=function(t,e){return t>e?1:e>t?-1:0}),D=(m.helpers.defaultKeySerializer=function(t){return""+t},m.helpers.defaultError=function(t){throw t}),x=m.helpers.isPromise=function(t){return!!t&&"function"==typeof t.then&&t.then!==m.Observable.prototype.then};m.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},m.helpers.not=function(t){return!t};var A="Object has been disposed",E="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";f.Set&&"function"==typeof(new f.Set)["@@iterator"]&&(E="@@iterator");var O,R={done:!0,value:t},C="[object Arguments]",j="[object Array]",W="[object Boolean]",P="[object Date]",N="[object Error]",q="[object Function]",k="[object Number]",T="[object Object]",I="[object RegExp]",M="[object String]",F=Object.prototype.toString,z=Object.prototype.hasOwnProperty,V=F.call(arguments)==C,H=Error.prototype,L=Object.prototype,$=L.propertyIsEnumerable;try{O=!(F.call(document)==T&&!({toString:0}+""))}catch(B){O=!0}var K=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Q={};Q[j]=Q[P]=Q[k]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Q[W]=Q[M]={constructor:!0,toString:!0,valueOf:!0},Q[N]=Q[q]=Q[I]={constructor:!0,toString:!0},Q[T]={constructor:!0};var G={};(function(){var t=function(){this.x=1},e=[];t.prototype={valueOf:1,y:1};for(var n in new t)e.push(n);for(n in arguments);G.enumErrorProps=$.call(H,"message")||$.call(H,"name"),G.enumPrototypes=$.call(t,"prototype"),G.nonEnumArgs=0!=n,G.nonEnumShadows=!/valueOf/.test(e)})(1),V||(u=function(t){return t&&"object"==typeof t?z.call(t,"callee"):!1}),c(/x/)&&(c=function(t){return"function"==typeof t&&F.call(t)==q});var J=m.internals.isEqual=function(t,e){return h(t,e,[],[])},U=Array.prototype.slice;({}).hasOwnProperty;var X=this.inherits=m.internals.inherits=function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n},Y=m.internals.addProperties=function(t){for(var e=U.call(arguments,1),n=0,i=e.length;i>n;n++){var r=e[n];for(var s in r)t[s]=r[s]}};m.internals.addRef=function(t,e){return new Ne(function(n){return new ne(e.getDisposable(),t.subscribe(n))})};var Z=function(t,e){this.id=t,this.value=e};Z.prototype.compareTo=function(t){var e=this.value.compareTo(t.value);return 0===e&&(e=this.id-t.id),e};var te=m.internals.PriorityQueue=function(t){this.items=Array(t),this.length=0},ee=te.prototype;ee.isHigherPriority=function(t,e){return 0>this.items[t].compareTo(this.items[e])},ee.percolate=function(t){if(!(t>=this.length||0>t)){var e=t-1>>1;if(!(0>e||e===t)&&this.isHigherPriority(t,e)){var n=this.items[t];this.items[t]=this.items[e],this.items[e]=n,this.percolate(e)}}},ee.heapify=function(e){if(e===t&&(e=0),!(e>=this.length||0>e)){var n=2*e+1,i=2*e+2,r=e;if(this.length>n&&this.isHigherPriority(n,r)&&(r=n),this.length>i&&this.isHigherPriority(i,r)&&(r=i),r!==e){var s=this.items[e];this.items[e]=this.items[r],this.items[r]=s,this.heapify(r)}}},ee.peek=function(){return this.items[0].value},ee.removeAt=function(t){this.items[t]=this.items[--this.length],delete this.items[this.length],this.heapify()},ee.dequeue=function(){var t=this.peek();return this.removeAt(0),t},ee.enqueue=function(t){var e=this.length++;this.items[e]=new Z(te.count++,t),this.percolate(e)},ee.remove=function(t){for(var e=0;this.length>e;e++)if(this.items[e].value===t)return this.removeAt(e),!0;return!1},te.count=0;var ne=m.CompositeDisposable=function(){this.disposables=a(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},ie=ne.prototype;ie.add=function(t){this.isDisposed?t.dispose():(this.disposables.push(t),this.length++)},ie.remove=function(t){var e=!1;if(!this.isDisposed){var n=this.disposables.indexOf(t);-1!==n&&(e=!0,this.disposables.splice(n,1),this.length--,t.dispose())}return e},ie.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var t=this.disposables.slice(0);this.disposables=[],this.length=0;for(var e=0,n=t.length;n>e;e++)t[e].dispose()}},ie.clear=function(){var t=this.disposables.slice(0);this.disposables=[],this.length=0;for(var e=0,n=t.length;n>e;e++)t[e].dispose()},ie.contains=function(t){return-1!==this.disposables.indexOf(t)},ie.toArray=function(){return this.disposables.slice(0)};var re=m.Disposable=function(t){this.isDisposed=!1,this.action=t||g};re.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var se=re.create=function(t){return new re(t)},oe=re.empty={dispose:g},ue=function(){function t(t){this.isSingle=t,this.isDisposed=!1,this.current=null}var e=t.prototype;return e.getDisposable=function(){return this.current},e.setDisposable=function(t){if(this.current&&this.isSingle)throw Error("Disposable has already been assigned");var e,n=this.isDisposed;n||(e=this.current,this.current=t),e&&e.dispose(),n&&t&&t.dispose()},e.dispose=function(){var t;this.isDisposed||(this.isDisposed=!0,t=this.current,this.current=null),t&&t.dispose()},t}(),ce=m.SingleAssignmentDisposable=function(t){function e(){t.call(this,!0)}return X(e,t),e}(ue),he=m.SerialDisposable=function(t){function e(){t.call(this,!1)}return X(e,t),e}(ue);m.RefCountDisposable=function(){function t(t){this.disposable=t,this.disposable.count++,this.isInnerDisposed=!1}function e(t){this.underlyingDisposable=t,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return t.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()))},e.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},e.prototype.getDisposable=function(){return this.isDisposed?oe:new t(this)},e}(),l.prototype.dispose=function(){var t=this;this.scheduler.schedule(function(){t.isDisposed||(t.isDisposed=!0,t.disposable.dispose())})};var ae=m.internals.ScheduledItem=function(t,e,n,i,r){this.scheduler=t,this.state=e,this.action=n,this.dueTime=i,this.comparer=r||S,this.disposable=new ce};ae.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ae.prototype.compareTo=function(t){return this.comparer(this.dueTime,t.dueTime)},ae.prototype.isCancelled=function(){return this.disposable.isDisposed},ae.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var le=m.Scheduler=function(){function t(t,e,n,i){this.now=t,this._schedule=e,this._scheduleRelative=n,this._scheduleAbsolute=i}function e(t,e){var n=e.first,i=e.second,r=new ne,s=function(e){i(e,function(e){var n=!1,i=!1,o=t.scheduleWithState(e,function(t,e){return n?r.remove(o):i=!0,s(e),oe});i||(r.add(o),n=!0)})};return s(n),r}function n(t,e,n){var i=e.first,r=e.second,s=new ne,o=function(e){r(e,function(e,i){var r=!1,u=!1,c=t[n].call(t,e,i,function(t,e){return r?s.remove(c):u=!0,o(e),oe});u||(s.add(c),r=!0)})};return o(i),s}function i(t,e){return e(),oe}var r=t.prototype;return r.catchException=r["catch"]=function(t){return new ye(this,t)},r.schedulePeriodic=function(t,e){return this.schedulePeriodicWithState(null,t,function(){e()})},r.schedulePeriodicWithState=function(t,e,n){var i=t,r=setInterval(function(){i=n(i)},e);return se(function(){clearInterval(r)})},r.schedule=function(t){return this._schedule(t,i)},r.scheduleWithState=function(t,e){return this._schedule(t,e)},r.scheduleWithRelative=function(t,e){return this._scheduleRelative(e,t,i)},r.scheduleWithRelativeAndState=function(t,e,n){return this._scheduleRelative(t,e,n)},r.scheduleWithAbsolute=function(t,e){return this._scheduleAbsolute(e,t,i)},r.scheduleWithAbsoluteAndState=function(t,e,n){return this._scheduleAbsolute(t,e,n)},r.scheduleRecursive=function(t){return this.scheduleRecursiveWithState(t,function(t,e){t(function(){e(t)})})},r.scheduleRecursiveWithState=function(t,n){return this.scheduleWithState({first:t,second:n},function(t,n){return e(t,n)})},r.scheduleRecursiveWithRelative=function(t,e){return this.scheduleRecursiveWithRelativeAndState(e,t,function(t,e){t(function(n){e(t,n)})})},r.scheduleRecursiveWithRelativeAndState=function(t,e,i){return this._scheduleRelative({first:t,second:i},e,function(t,e){return n(t,e,"scheduleWithRelativeAndState")})},r.scheduleRecursiveWithAbsolute=function(t,e){return this.scheduleRecursiveWithAbsoluteAndState(e,t,function(t,e){t(function(n){e(t,n)})})},r.scheduleRecursiveWithAbsoluteAndState=function(t,e,i){return this._scheduleAbsolute({first:t,second:i},e,function(t,e){return n(t,e,"scheduleWithAbsoluteAndState")})},t.now=_,t.normalize=function(t){return 0>t&&(t=0),t},t}(),pe=le.normalize;m.internals.SchedulePeriodicRecursive=function(){function t(t,e){e(0,this._period);try{this._state=this._action(this._state)}catch(n){throw this._cancel.dispose(),n}}function e(t,e,n,i){this._scheduler=t,this._state=e,this._period=n,this._action=i}return e.prototype.start=function(){var e=new ce;return this._cancel=e,e.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,t.bind(this))),e},e}();var fe,de=le.immediate=function(){function t(t,e){return e(this,t)}function e(t,e,n){for(var i=pe(i);i-this.now()>0;);return n(this,t)}function n(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}return new le(_,t,e,n)}(),ve=le.currentThread=function(){function t(t){for(var e;t.length>0;)if(e=t.dequeue(),!e.isCancelled()){for(;e.dueTime-le.now()>0;);e.isCancelled()||e.invoke()}}function e(t,e){return this.scheduleWithRelativeAndState(t,0,e)}function n(e,n,i){var s=this.now()+le.normalize(n),o=new ae(this,e,i,s);if(r)r.enqueue(o);else{r=new te(4),r.enqueue(o);try{t(r)}catch(u){throw u}finally{r=null}}return o.disposable}function i(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}var r,s=new le(_,e,n,i);return s.scheduleRequired=function(){return null===r},s.ensureTrampoline=function(t){return null===r?this.schedule(t):t()},s}(),be=g;(function(){function t(){if(!f.postMessage||f.importScripts)return!1;var t=!1,e=f.onmessage;return f.onmessage=function(){t=!0},f.postMessage("","*"),f.onmessage=e,t}function e(t){if("string"==typeof t.data&&t.data.substring(0,s.length)===s){var e=t.data.substring(s.length),n=o[e];n(),delete o[e]}}var n=RegExp("^"+(F+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=y&&b&&y.setImmediate)&&!n.test(i)&&i,r="function"==typeof(r=y&&b&&y.clearImmediate)&&!n.test(r)&&r;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))fe=process.nextTick;else if("function"==typeof i)fe=i,be=r;else if(t()){var s="ms.rx.schedule"+Math.random(),o={},u=0;f.addEventListener?f.addEventListener("message",e,!1):f.attachEvent("onmessage",e,!1),fe=function(t){var e=u++;o[e]=t,f.postMessage(s+e,"*")}}else if(f.MessageChannel){var c=new f.MessageChannel,h={},a=0;c.port1.onmessage=function(t){var e=t.data,n=h[e];n(),delete h[e]},fe=function(t){var e=a++;h[e]=t,c.port2.postMessage(e)}}else"document"in f&&"onreadystatechange"in f.document.createElement("script")?fe=function(t){var e=f.document.createElement("script");e.onreadystatechange=function(){t(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},f.document.documentElement.appendChild(e)}:(fe=function(t){return setTimeout(t,0)},be=clearTimeout)})(),le.timeout=function(){function t(t,e){var n=this,i=new ce,r=fe(function(){i.isDisposed||i.setDisposable(e(n,t))});return new ne(i,se(function(){be(r)}))}function e(t,e,n){var i=this,r=le.normalize(e);if(0===r)return i.scheduleWithState(t,n);var s=new ce,o=setTimeout(function(){s.isDisposed||s.setDisposable(n(i,t))},r);return new ne(s,se(function(){clearTimeout(o)}))}function n(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}return new le(_,t,e,n)}();var ye=function(t){function e(){return this._scheduler.now()}function n(t,e){return this._scheduler.scheduleWithState(t,this._wrap(e))}function i(t,e,n){return this._scheduler.scheduleWithRelativeAndState(t,e,this._wrap(n))}function r(t,e,n){return this._scheduler.scheduleWithAbsoluteAndState(t,e,this._wrap(n))}function s(s,o){this._scheduler=s,this._handler=o,this._recursiveOriginal=null,this._recursiveWrapper=null,t.call(this,e,n,i,r)}return X(s,t),s.prototype._clone=function(t){return new s(t,this._handler)},s.prototype._wrap=function(t){var e=this;return function(n,i){try{return t(e._getRecursiveWrapper(n),i)}catch(r){if(!e._handler(r))throw r;return oe}}},s.prototype._getRecursiveWrapper=function(t){if(this._recursiveOriginal!==t){this._recursiveOriginal=t;var e=this._clone(t);e._recursiveOriginal=t,e._recursiveWrapper=e,this._recursiveWrapper=e}return this._recursiveWrapper},s.prototype.schedulePeriodicWithState=function(t,e,n){var i=this,r=!1,s=new ce;return s.setDisposable(this._scheduler.schedulePeriodicWithState(t,e,function(t){if(r)return null;try{return n(t)}catch(e){if(r=!0,!i._handler(e))throw e;return s.dispose(),null}})),s},s}(le),me=m.Notification=function(){function t(t,e){this.hasValue=null==e?!1:e,this.kind=t}var e=t.prototype;return e.accept=function(t,e,n){return 1===arguments.length&&"object"==typeof t?this._acceptObservable(t):this._accept(t,e,n)},e.toObservable=function(t){var e=this;return t||(t=de),new Ne(function(n){return t.schedule(function(){e._acceptObservable(n),"N"===e.kind&&n.onCompleted()})})},t}(),ge=me.createOnNext=function(){function t(t){return t(this.value)}function e(t){return t.onNext(this.value)}function n(){return"OnNext("+this.value+")"}return function(i){var r=new me("N",!0);return r.value=i,r._accept=t,r._acceptObservable=e,r.toString=n,r}}(),we=me.createOnError=function(){function t(t,e){return e(this.exception)}function e(t){return t.onError(this.exception)}function n(){return"OnError("+this.exception+")"}return function(i){var r=new me("E");return r.exception=i,r._accept=t,r._acceptObservable=e,r.toString=n,r}}(),_e=me.createOnCompleted=function(){function t(t,e,n){return n()}function e(t){return t.onCompleted()}function n(){return"OnCompleted()"}return function(){var i=new me("C");return i._accept=t,i._acceptObservable=e,i.toString=n,i}}(),Se=m.internals.Enumerator=function(t){this._next=t};Se.prototype.next=function(){return this._next()},Se.prototype[E]=function(){return this};var De=m.internals.Enumerable=function(t){this._iterator=t};De.prototype[E]=function(){return this._iterator()},De.prototype.concat=function(){var e=this;return new Ne(function(n){var i;try{i=e[E]()}catch(r){return n.onError(),t}var s,o=new he,u=de.scheduleRecursive(function(e){var r;if(!s){try{r=i.next()}catch(u){return n.onError(u),t}if(r.done)return n.onCompleted(),t;var c=r.value;x(c)&&(c=observableFromPromise(c));var h=new ce;o.setDisposable(h),h.setDisposable(c.subscribe(n.onNext.bind(n),n.onError.bind(n),function(){e()}))}});return new ne(o,u,se(function(){s=!0}))})},De.prototype.catchException=function(){var e=this;return new Ne(function(n){var i;try{i=e[E]()}catch(r){return n.onError(),t}var s,o,u=new he,c=de.scheduleRecursive(function(e){if(!s){var r;try{r=i.next()}catch(c){return n.onError(c),t}if(r.done)return o?n.onError(o):n.onCompleted(),t;var h=r.value;x(h)&&(h=observableFromPromise(h));var a=new ce;u.setDisposable(a),a.setDisposable(h.subscribe(n.onNext.bind(n),function(t){o=t,e()},n.onCompleted.bind(n)))}});return new ne(u,c,se(function(){s=!0}))})},De.repeat=function(t,e){return null==e&&(e=-1),new De(function(){var n=e;return new Se(function(){return 0===n?R:(n>0&&n--,{done:!1,value:t})})})},De.forEach=function(t,e,n){return e||(e=w),new De(function(){var i=-1;return new Se(function(){return++i<t.length?{done:!1,value:e.call(n,t[i],i,t)}:R})})};var xe=m.Observer=function(){};xe.prototype.toNotifier=function(){var t=this;return function(e){return e.accept(t)}},xe.prototype.asObserver=function(){return new Re(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},xe.prototype.checked=function(){return new Ce(this)};var Ae=xe.create=function(t,e,n){return t||(t=g),e||(e=D),n||(n=g),new Re(t,e,n)};xe.fromNotifier=function(t){return new Re(function(e){return t(ge(e))},function(e){return t(we(e))},function(){return t(_e())})},xe.notifyOn=function(t){return new We(t,this)};var Ee,Oe=m.internals.AbstractObserver=function(t){function e(){this.isStopped=!1,t.call(this)}return X(e,t),e.prototype.onNext=function(t){this.isStopped||this.next(t)},e.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.error(t))},e.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},e.prototype.dispose=function(){this.isStopped=!0},e.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.error(t),!0)},e}(xe),Re=m.AnonymousObserver=function(t){function e(e,n,i){t.call(this),this._onNext=e,this._onError=n,this._onCompleted=i}return X(e,t),e.prototype.next=function(t){this._onNext(t)},e.prototype.error=function(t){this._onError(t)},e.prototype.completed=function(){this._onCompleted()},e}(Oe),Ce=function(t){function e(e){t.call(this),this._observer=e,this._state=0}X(e,t);var n=e.prototype;return n.onNext=function(t){this.checkAccess();try{this._observer.onNext(t)}catch(e){throw e}finally{this._state=0}},n.onError=function(t){this.checkAccess();try{this._observer.onError(t)}catch(e){throw e}finally{this._state=2}},n.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(t){throw t}finally{this._state=2}},n.checkAccess=function(){if(1===this._state)throw Error("Re-entrancy detected");if(2===this._state)throw Error("Observer completed");0===this._state&&(this._state=1)},e}(xe),je=m.internals.ScheduledObserver=function(e){function n(t,n){e.call(this),this.scheduler=t,this.observer=n,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new he}return X(n,e),n.prototype.next=function(t){var e=this;this.queue.push(function(){e.observer.onNext(t)})},n.prototype.error=function(t){var e=this;this.queue.push(function(){e.observer.onError(t)})},n.prototype.completed=function(){var t=this;this.queue.push(function(){t.observer.onCompleted()})},n.prototype.ensureActive=function(){var e=!1,n=this;!this.hasFaulted&&this.queue.length>0&&(e=!this.isAcquired,this.isAcquired=!0),e&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(e){var i;if(!(n.queue.length>0))return n.isAcquired=!1,t;i=n.queue.shift();try{i()}catch(r){throw n.queue=[],n.hasFaulted=!0,r}e()}))},n.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposable.dispose()},n}(Oe),We=function(t){function e(){t.apply(this,arguments)}return X(e,t),e.prototype.next=function(e){t.prototype.next.call(this,e),this.ensureActive()},e.prototype.error=function(e){t.prototype.error.call(this,e),this.ensureActive()},e.prototype.completed=function(){t.prototype.completed.call(this),this.ensureActive()},e}(je),Pe=m.Observable=function(){function t(t){this._subscribe=t}return Ee=t.prototype,Ee.subscribe=Ee.forEach=function(t,e,n){var i="object"==typeof t?t:Ae(t,e,n);return this._subscribe(i)},t}(),Ne=m.AnonymousObservable=function(e){function n(e){return e===t?e=oe:"function"==typeof e&&(e=se(e)),e}function i(r){function s(t){var e=new qe(t);if(ve.scheduleRequired())ve.schedule(function(){try{e.setDisposable(n(r(e)))}catch(t){if(!e.fail(t))throw t}});else try{e.setDisposable(n(r(e)))}catch(i){if(!e.fail(i))throw i}return e}return this instanceof i?(e.call(this,s),t):new i(r)}return X(i,e),i}(Pe),qe=function(t){function e(e){t.call(this),this.observer=e,this.m=new ce}X(e,t);var n=e.prototype;return n.next=function(t){var e=!1;try{this.observer.onNext(t),e=!0}catch(n){throw n}finally{e||this.dispose()}},n.error=function(t){try{this.observer.onError(t)}catch(e){throw e}finally{this.dispose()}},n.completed=function(){try{this.observer.onCompleted()}catch(t){throw t}finally{this.dispose()}},n.setDisposable=function(t){this.m.setDisposable(t)},n.getDisposable=function(){return this.m.getDisposable()},n.disposable=function(t){return arguments.length?this.getDisposable():setDisposable(t)},n.dispose=function(){t.prototype.dispose.call(this),this.m.dispose()},e}(Oe);(function(t){function e(t){return this.underlyingObservable.subscribe(t)}function n(n,i,r){t.call(this,e),this.key=n,this.underlyingObservable=r?new Ne(function(t){return new ne(r.getDisposable(),i.subscribe(t))}):i}return X(n,t),n})(Pe);var ke=function(t,e){this.subject=t,this.observer=e};ke.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var t=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(t,1),this.observer=null}},m.Subject=function(t){function n(t){return e.call(this),this.isStopped?this.exception?(t.onError(this.exception),oe):(t.onCompleted(),oe):(this.observers.push(t),new ke(this,t))}function i(){t.call(this,n),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return X(i,t),Y(i.prototype,xe,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(e.call(this),!this.isStopped){var t=this.observers.slice(0);this.isStopped=!0;for(var n=0,i=t.length;i>n;n++)t[n].onCompleted();this.observers=[]}},onError:function(t){if(e.call(this),!this.isStopped){var n=this.observers.slice(0);this.isStopped=!0,this.exception=t;for(var i=0,r=n.length;r>i;i++)n[i].onError(t);this.observers=[]}},onNext:function(t){if(e.call(this),!this.isStopped)for(var n=this.observers.slice(0),i=0,r=n.length;r>i;i++)n[i].onNext(t)},dispose:function(){this.isDisposed=!0,this.observers=null}}),i.create=function(t,e){return new Te(t,e)},i}(Pe),m.AsyncSubject=function(t){function n(t){if(e.call(this),!this.isStopped)return this.observers.push(t),new ke(this,t);var n=this.exception,i=this.hasValue,r=this.value;return n?t.onError(n):i?(t.onNext(r),t.onCompleted()):t.onCompleted(),oe}function i(){t.call(this,n),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return X(i,t),Y(i.prototype,xe,{hasObservers:function(){return e.call(this),this.observers.length>0},onCompleted:function(){var t,n,i;if(e.call(this),!this.isStopped){this.isStopped=!0;var r=this.observers.slice(0),s=this.value,o=this.hasValue;if(o)for(n=0,i=r.length;i>n;n++)t=r[n],t.onNext(s),t.onCompleted();else for(n=0,i=r.length;i>n;n++)r[n].onCompleted();this.observers=[]}},onError:function(t){if(e.call(this),!this.isStopped){var n=this.observers.slice(0);this.isStopped=!0,this.exception=t;for(var i=0,r=n.length;r>i;i++)n[i].onError(t);this.observers=[]}},onNext:function(t){e.call(this),this.isStopped||(this.value=t,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),i}(Pe);var Te=function(t){function e(t){return this.observable.subscribe(t)}function n(n,i){t.call(this,e),this.observer=n,this.observable=i}return X(n,t),Y(n.prototype,xe,{onCompleted:function(){this.observer.onCompleted()},onError:function(t){this.observer.onError(t)},onNext:function(t){this.observer.onNext(t)}}),n}(Pe);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(f.Rx=m,define(function(){return m})):d&&v?b?(v.exports=m).Rx=m:d.Rx=m:f.Rx=m}).call(this);
1
+ (function(a){function b(){if(this.isDisposed)throw new Error(A)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;X.nonEnumArgs&&a.length&&h(a)&&(a=Z.call(a));var d=X.enumPrototypes&&"function"==typeof a,e=X.enumErrorProps&&(a===R||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(X.nonEnumShadows&&a!==S){var g=a.constructor,i=-1,j=V.length;if(a===(g&&g.prototype))var k=a===stringProto?N:a===R?I:O.call(a),l=W[k];for(;++i<j;)f=V[i],l&&l[f]||!P.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?O.call(a)==E:!1}function i(a){return"function"==typeof a||!1}function j(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,k=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=k&&"object"!=k))return!1;var l=O.call(a),m=O.call(b);if(l==E&&(l=L),m==E&&(m=L),l!=m)return!1;switch(l){case G:case H:return+a==+b;case K:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case M:case N:return a==String(b)}var n=l==F;if(!n){if(l!=L||!X.nodeClass&&(g(a)||g(b)))return!1;var o=!X.argsObject&&h(a)?Object:a.constructor,p=!X.argsObject&&h(b)?Object:b.constructor;if(!(o==p||P.call(a,"constructor")&&P.call(b,"constructor")||i(o)&&o instanceof o&&i(p)&&p instanceof p||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(result=!0,c.push(a),d.push(b),n){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=j(a[r],s,c,d)))break}}else f(b,function(b,e,f){return P.call(f,e)?(r++,result=P.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return P.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function k(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Z.call(a)}function l(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}var m={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=m[typeof window]&&window||this,o=m[typeof exports]&&exports&&!exports.nodeType&&exports,p=m[typeof module]&&module&&!module.nodeType&&module,q=p&&p.exports===o&&o,r=m[typeof global]&&global;!r||r.global!==r&&r.window!==r||(n=r);var s={internals:{},config:{Promise:n.Promise},helpers:{}},t=s.helpers.noop=function(){},u=(s.helpers.notDefined=function(a){return"undefined"==typeof a},s.helpers.isScheduler=function(a){return a instanceof s.Scheduler}),v=s.helpers.identity=function(a){return a},w=(s.helpers.pluck=function(a){return function(b){return b[a]}},s.helpers.just=function(a){return function(){return a}},s.helpers.defaultNow=Date.now),x=(s.helpers.defaultComparer=function(a,b){return Y(a,b)},s.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0}),y=(s.helpers.defaultKeySerializer=function(a){return a.toString()},s.helpers.defaultError=function(a){throw a}),z=s.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then&&a.then!==s.Observable.prototype.then},A=(s.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},s.helpers.not=function(a){return!a},"Object has been disposed"),B="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";n.Set&&"function"==typeof(new n.Set)["@@iterator"]&&(B="@@iterator");var C,D={done:!0,value:a},E="[object Arguments]",F="[object Array]",G="[object Boolean]",H="[object Date]",I="[object Error]",J="[object Function]",K="[object Number]",L="[object Object]",M="[object RegExp]",N="[object String]",O=Object.prototype.toString,P=Object.prototype.hasOwnProperty,Q=O.call(arguments)==E,R=Error.prototype,S=Object.prototype,T=S.propertyIsEnumerable;try{C=!(O.call(document)==L&&!({toString:0}+""))}catch(U){C=!0}var V=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],W={};W[F]=W[H]=W[K]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},W[G]=W[N]={constructor:!0,toString:!0,valueOf:!0},W[I]=W[J]=W[M]={constructor:!0,toString:!0},W[L]={constructor:!0};var X={};!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);X.enumErrorProps=T.call(R,"message")||T.call(R,"name"),X.enumPrototypes=T.call(a,"prototype"),X.nonEnumArgs=0!=c,X.nonEnumShadows=!/valueOf/.test(b)}(1),Q||(h=function(a){return a&&"object"==typeof a?P.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&O.call(a)==J});var Y=s.internals.isEqual=function(a,b){return j(a,b,[],[])},Z=Array.prototype.slice,$=({}.hasOwnProperty,this.inherits=s.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),_=s.internals.addProperties=function(a){for(var b=Z.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},ab=(s.internals.addRef=function(a,b){return new Ib(function(c){return new db(b.getDisposable(),a.subscribe(c))})},function(a,b){this.id=a,this.value=b});ab.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var bb=s.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},cb=bb.prototype;cb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},cb.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)}}},cb.heapify=function(b){if(b===a&&(b=0),!(b>=this.length||0>b)){var c=2*b+1,d=2*b+2,e=b;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==b){var f=this.items[b];this.items[b]=this.items[e],this.items[e]=f,this.heapify(e)}}},cb.peek=function(){return this.items[0].value},cb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},cb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},cb.enqueue=function(a){var b=this.length++;this.items[b]=new ab(bb.count++,a),this.percolate(b)},cb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},bb.count=0;var db=s.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},eb=db.prototype;eb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},eb.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},eb.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()}},eb.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},eb.contains=function(a){return-1!==this.disposables.indexOf(a)},eb.toArray=function(){return this.disposables.slice(0)};var fb=s.Disposable=function(a){this.isDisposed=!1,this.action=a||t};fb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};{var gb=fb.create=function(a){return new fb(a)},hb=fb.empty={dispose:t},ib=function(){function a(a){this.isSingle=a,this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){if(this.current&&this.isSingle)throw new Error("Disposable has already been assigned");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}(),jb=s.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return $(b,a),b}(ib),kb=s.SerialDisposable=function(a){function b(){a.call(this,!1)}return $(b,a),b}(ib);s.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?hb:new a(this)},b}()}l.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var lb=s.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||x,this.disposable=new jb};lb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},lb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},lb.prototype.isCancelled=function(){return this.disposable.isDisposed},lb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var mb,nb=s.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){var c=b.first,d=b.second,e=new db,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),hb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new db,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),hb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),hb}var e=a.prototype;return e.catchException=e["catch"]=function(a){return new sb(this,a)},e.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},e.schedulePeriodicWithState=function(a,b,c){var d=a,e=setInterval(function(){d=c(d)},b);return gb(function(){clearInterval(e)})},e.schedule=function(a){return this._schedule(a,d)},e.scheduleWithState=function(a,b){return this._schedule(a,b)},e.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,d)},e.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},e.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,d)},e.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},e.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},e.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},function(a,c){return b(a,c)})},e.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},e.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})},a.now=w,a.normalize=function(a){return 0>a&&(a=0),a},a}(),ob=nb.normalize,pb=(s.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 jb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),nb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=ob(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new nb(w,a,b,c)}()),qb=nb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-nb.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()+nb.normalize(c),g=new lb(this,b,d,f);if(e)e.enqueue(g);else{e=new bb(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 nb(w,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),rb=t;!function(){function a(){if(!n.postMessage||n.importScripts)return!1;var a=!1,b=n.onmessage;return n.onmessage=function(){a=!0},n.postMessage("","*"),n.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(O).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=r&&q&&r.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=r&&q&&r.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))mb=process.nextTick;else if("function"==typeof d)mb=d,rb=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;n.addEventListener?n.addEventListener("message",b,!1):n.attachEvent("onmessage",b,!1),mb=function(a){var b=h++;g[b]=a,n.postMessage(f+b,"*")}}else if(n.MessageChannel){var i=new n.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},mb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in n&&"onreadystatechange"in n.document.createElement("script")?mb=function(a){var b=n.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},n.document.documentElement.appendChild(b)}:(mb=function(a){return setTimeout(a,0)},rb=clearTimeout)}();var sb=(nb.timeout=function(){function a(a,b){var c=this,d=new jb,e=mb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new db(d,gb(function(){rb(e)}))}function b(a,b,c){var d=this,e=nb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new jb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new db(f,gb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new nb(w,a,b,c)}(),function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return $(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return hb}}},f.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new jb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},f}(nb)),tb=s.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 u(a)||(a=pb),new Ib(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=s.internals.Enumerator=function(a){this._next=a};xb.prototype.next=function(){return this._next()},xb.prototype[B]=function(){return this};var yb=s.internals.Enumerable=function(a){this._iterator=a};yb.prototype[B]=function(){return this._iterator()},yb.prototype.concat=function(){var a=this;return new Ib(function(b){var c;try{c=a[B]()}catch(d){return void b.onError()}var e,f=new kb,g=pb.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;z(h)&&(h=observableFromPromise(h));var i=new jb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new db(f,g,gb(function(){e=!0}))})},yb.prototype.catchException=function(){var a=this;return new Ib(function(b){var c;try{c=a[B]()}catch(d){return void b.onError()}var e,f,g=new kb,h=pb.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;z(i)&&(i=observableFromPromise(i));var j=new jb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new db(g,h,gb(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?D:(c>0&&c--,{done:!1,value:a})})})},yb.forEach=function(a,b,c){return b||(b=v),new yb(function(){var d=-1;return new xb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:D})})},s.Observer=function(){});zb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},zb.prototype.asObserver=function(){return new Db(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},zb.prototype.checked=function(){return new Eb(this)};var Ab=zb.create=function(a,b,c){return a||(a=t),b||(b=y),c||(c=t),new Db(a,b,c)};zb.fromNotifier=function(a){return new Db(function(b){return a(ub(b))},function(b){return a(vb(b))},function(){return a(wb())})},zb.notifyOn=function(a){return new Gb(a,this)};var Bb,Cb=s.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return $(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}(zb),Db=s.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return $(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}(Cb),Eb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}$(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}(zb),Fb=s.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 kb}return $(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}(Cb),Gb=function(a){function b(){a.apply(this,arguments)}return $(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}(Fb),Hb=s.Observable=function(){function a(a){this._subscribe=a}return Bb=a.prototype,Bb.subscribe=Bb.forEach=function(a,b,c){var d="object"==typeof a?a:Ab(a,b,c);return this._subscribe(d)},a}(),Ib=s.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=hb:"function"==typeof a&&(a=gb(a)),a}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 Jb(a);return qb.scheduleRequired()?qb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return $(c,a),c}(Hb),Jb=function(a){function b(b){a.call(this),this.observer=b,this.m=new jb}$(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}(Cb),Kb=(function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Ib(function(a){return new db(e.getDisposable(),d.subscribe(a))}):d}return $(c,a),c}(Hb),function(a,b){this.subject=a,this.observer=b});Kb.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 Lb=(s.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),hb):(a.onCompleted(),hb):(this.observers.push(a),new Kb(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return $(d,a),_(d.prototype,zb,{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 Lb(a,b)},d}(Hb),s.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Kb(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(),hb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return $(d,a),_(d.prototype,zb,{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}(Hb),function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return $(c,a),_(c.prototype,zb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Hb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(n.Rx=s,define(function(){return s})):o&&p?q?(p.exports=s).Rx=s:o.Rx=s:n.Rx=s}).call(this);