text: /* Copyright (c) Microsoft, Inc. All rights reserved. See License.txt in the project root for license information.*/
  (function(a){function b(a){return a&&a.Object===Object?a:null}var c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType?exports:null,e=c[typeof module]&&module&&!module.nodeType?module:null,f=b(d&&e&&"object"==typeof global&&global),g=b(c[typeof self]&&self),h=b(c[typeof window]&&window),i=(e&&e.exports===d?d:null,b(c[typeof this]&&this)),j=f||h!==(i&&i.window)&&h||g||i||Function("return this")();"function"==typeof define&&define.amd?define(["rx-lite"],function(b,c){return a(j,c,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(j,module.exports,require("rx-lite")):j.Rx=a(j,{},j.Rx)}).call(this,function(a,b,c,d){function e(a,b,c,d){a&&(b&&(b.onNext(),b.onCompleted()),c?a.close(c,d):a.close())}function f(b){var c=a.MutationObserver||a.WebKitMutationObserver;return new c(b)}var g=(c.Observable,c.ObservableBase),h=c.internals.AbstractObserver,i=(c.Observer.create,c.Observable.create,c.Disposable.create,c.Disposable,c.CompositeDisposable,c.BinaryDisposable,c.SingleAssignmentDisposable,c.Subject),j=(c.Scheduler,c.DOM={}),k=({}.hasOwnProperty,c.helpers.noop,c.helpers.isFunction,c.internals.inherits),l=function(a){function b(b,c,d,e,f){this._state=b,this._url=c,this._protocol=d,this._open=e,this._close=f,a.call(this)}function c(a,b){return function c(d){a.onNext(d),a.onCompleted(),b.removeEventListener("open",c,!1)}}function d(a){return function(b){a.onNext(b)}}function f(a){return function(b){a.onError(b)}}function g(a){return function(b){return 1e3===b.code&&b.wasClean?void a.onCompleted():a.onError(b)}}function h(a,b,c,d,e){this._socket=a,this._msgFn=b,this._errFn=c,this._closeFn=d,this._close=e,this.isDisposed=!1}return k(b,a),h.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,e(this._socket,this._close),this._socket.removeEventListener("message",this._msgFn,!1),this._socket.removeEventListener("error",this._errFn,!1),this._socket.removeEventListener("close",this._closeFn,!1))},b.prototype.subscribeCore=function(a){this._state.socket=this._protocol?new WebSocket(this._url,this._protocol):new WebSocket(this._url);var b=c(this._open,this._state.socket),e=d(a),i=f(a),j=g(a);return this._open&&this._state.socket.addEventListener("open",b,!1),this._state.socket.addEventListener("message",e,!1),this._state.socket.addEventListener("error",i,!1),this._state.socket.addEventListener("close",j,!1),new h(this._state.socket,e,i,j,this._close)},b}(g),m=function(a){function b(b,c){this._state=b,this._close=c,a.call(this)}return k(b,a),b.prototype.next=function(a){this._state.socket&&this._state.socket.readyState===WebSocket.OPEN&&this._state.socket.send(a)},b.prototype.error=function(a){if(!a.code)throw new Error('no code specified. be sure to pass { code: ###, reason: "" } to onError()');e(this._state.socket,this._close,a.code,a.reason||"")},b.prototype.completed=function(){e(this._state.socket,this._close,1e3,"")},b}(h);j.fromWebSocket=function(a,b,c,d){if(!WebSocket)throw new TypeError("WebSocket not implemented in your runtime.");var e={socket:null};return i.create(new m(e,d),new l(e,a,b,c,d))};var n=function(a){function b(b){this._state=b,a.call(this)}return k(b,a),b.prototype.next=function(a){this._state.worker&&this._state.worker.postMessage(a)},b.prototype.error=function(a){throw a},b.prototype.completed=function(){},b}(h),o=function(b){function c(a,c){this._state=a,this._url=c,b.call(this)}function d(a){return function(b){a.onNext(b)}}function e(a){return function(b){a.onError(b)}}function f(a,b,c){this._w=a,this._msgFn=b,this._errFn=c,this.isDisposed=!1}return k(c,b),f.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._w.terminate(),this._w.removeEventListener("message",this._msgFn,!1),this._w.removeEventListener("error",this._errFn,!1))},c.prototype.subscribeCore=function(b){this._state.worker=new a.Worker(this._url);var c=d(b),g=e(b);return this._state.worker.addEventListener("message",c,!1),this._state.worker.addEventListener("error",g,!1),new f(this._state.worker,c,g)},c}(g);j.fromWorker=function(b){if(!a.Worker)throw new TypeError("Worker not implemented in your runtime.");var c={worker:null};return i.create(new n(c),new o(c,b))};var p=function(a){function b(b,c){this._target=b,this._options=c,a.call(this)}function c(a){this._m=a,this.isDisposed=!1}return k(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._m.disconnect())},b.prototype.subscribeCore=function(a){var b=f(function(b){a.onNext(b)});return b.observe(this._target,this._options),new c(b)},b}(g);j.fromMutationObserver=function(b,c){if(!a.MutationObserver&&!a.WebKitMutationObserver)throw new TypeError("MutationObserver not implemented in your runtime.");return new p(b,c)};var q=function(b){function c(a){this._opts=a,b.call(this)}return k(c,b),c.prototype.subscribeCore=function(b){a.navigator.geolocation.getCurrentPosition(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)},this._opts)},c}(g),r=function(b){function c(a){this._opts=a,b.call(this)}function d(a){this._id=a,this.isDisposed=!1}return k(c,b),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,a.navigator.geolocation.clearWatch(this._id))},c.prototype.subscribeCore=function(b){var c=a.navigator.geolocation.watchPosition(function(a){b.onNext(a)},function(a){b.onError(a)},this._opts);return new d(c)},c}(g);c.DOM.geolocation={getCurrentPosition:function(b){if(!a.navigator&&!a.navigation.geolocation)throw new TypeError("geolocation not available");return new q(b)},watchPosition:function(b){if(!a.navigator&&!a.navigation.geolocation)throw new TypeError("geolocation not available");return new r(b).publish().refCount()}};var s=function(b){function c(a,c,d,e){this._readerFn=a,this._file=c,this._progressObserver=d,this._encoding=e,b.call(this)}function d(a,b){return function(c){b&&b.onCompleted(),a.onNext(c.target.result),a.onCompleted()}}function e(a){return function(b){a.onError(b.target.error)}}function f(a){return function(b){a.onNext(b)}}function g(a,b,c,d,e){this._r=a,this._po=b,this._lFn=c,this._eFn=d,this._pFn=e,this.isDisposed=!1}return k(c,b),g.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._r.readyState===a.FileReader.LOADING&&this._r.abort(),this._r.removeEventListener("load",this._lFn,!1),this._r.removeEventListener("error",this._eFn,!1),this._po&&this._r.removeEventListener("progress",this._pFn,!1))},c.prototype.subscribeCore=function(b){var c=new a.FileReader,h=d(b,this._progressObserver),i=e(b),j=f(this._progressObserver);return c.addEventListener("load",h,!1),c.addEventListener("error",i,!1),this._progressObserver&&c.addEventListener("progress",j,!1),c[this._readerFn](this._file,this._encoding),new g(c,this._progressObserver,h,i,j)},c}(g);return j.fromReader=function(b,c){if(!a.FileReader)throw new TypeError("FileReader not implemented in your runtime.");return{asArrayBuffer:function(){return new s("readAsArrayBuffer",b,c)},asBinaryString:function(){return new s("readAsBinaryString",b,c)},asDataURL:function(){return new s("readAsDataURL",b,c)},asText:function(a){return new s("readAsText",b,c,a)}}},c});
  //# sourceMappingURL=rx.lite.dom.html.map