text: (function(t,e){var n="object"==typeof exports&&exports,r=("object"==typeof module&&module&&module.exports==n&&module,"object"==typeof global&&global);r.global===r&&(window=r),"function"==typeof define&&define.amd?define(["rx","exports"],function(n,r){return t.Rx=e(t,r,n),t.Rx}):"object"==typeof module&&module&&module.exports===n?module.exports=e(t,module.exports,require("./rx")):t.Rx=e(t,{},t.Rx)})(this,function(t,e,n){function r(t,e,n){return t.addListener?(t.addListener(e,n),c(function(){t.removeListener(e,n)})):t.addEventListener?(t.addEventListener(e,n,!1),c(function(){t.removeEventListener(e,n,!1)})):undefined}function i(t,e,n){var o=new a;if(t&&t.length)for(var s=0,u=t.length;u>s;s++)o.add(i(t[s],e,n));else t&&o.add(r(t,e,n));return o}var o=n.Observable,s=n.Internals.AnonymousObservable,u=n.AsyncSubject,c=n.Disposable.create,a=n.CompositeDisposable,u=n.AsyncSubject;timeoutScheduler=n.Scheduler.timeout,slice=Array.prototype.slice,o.start=function(t,e,n){return l(t,e,n)()};var l=o.toAsync=function(t,e,n){return e||(e=timeoutScheduler),function(){var r=arguments,i=new u;return e.schedule(function(){var e;try{e=t.apply(n,r)}catch(o){return i.onError(o),undefined}i.onNext(e),i.onCompleted()}),i.asObservable()}};return o.fromCallback=function(t,e,n){return e||(e=timeoutScheduler),function(){var r=slice.call(arguments,0),i=new u;return e.schedule(function(){function e(){i.onNext(arguments),i.onCompleted()}r.push(e),t.apply(n,r)}),i.asObservable()}},o.fromNodeCallback=function(t,e,n){return e||(e=timeoutScheduler),function(){var r=slice.call(arguments,0),i=new u;return e.schedule(function(){function e(t){var e=slice.call(arguments,1);return t?(i.onError(t),undefined):(i.onNext(e),i.onCompleted(),undefined)}r.push(e),t.apply(n,r)}),i.asObservable()}},o.fromEvent=function(t,e){return new s(function(n){return i(t,e,function(t){n.onNext(t)})}).publish().refCount()},o.fromEventPattern=function(t,e){return new s(function(n){function r(t){n.onNext(t)}var i=t(r);return c(function(){e&&e(r,i)})}).publish().refCount()},o.fromPromise=function(t){var e=new u;return t.then(function(t){e.onNext(t),e.onCompleted()},function(t){e.onError(t)}),e.asObservable()},n});