UNPKG

webappengine

Version:

A web application platform that can host multiple web apps running with Node.js.

3 lines 65.1 kB
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/ (function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(){try{return T.apply(this,arguments)}catch(a){return ja.e=a,ja}}function d(a){if(!ia(a))throw new TypeError("fn must be a function");return T=a,c}function e(a){throw a}function f(a,b){if(ka&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(oa)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+oa+"\n");a.stack=g(e)}}function g(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join("\n")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===ma&&d>=na&&Jc>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(ka)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=k(c);if(!d)return;return ma=d[0],d[1]}}function k(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(a){var b=[];if(!Wa(a))return b;Va.nonEnumArgs&&a.length&&Xa(a)&&(a=Za.call(a));var c=Va.enumPrototypes&&"function"==typeof a,d=Va.enumErrorProps&&(a===Pa||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Va.nonEnumShadows&&a!==Qa){var f=a.constructor,g=-1,h=Ba;if(a===(f&&f.prototype))var i=a===Ra?La:a===Pa?Ga:Ma.call(a),j=Ua[i];for(;++g<h;)e=Aa[g],j&&j[e]||!Na.call(a,e)||b.push(e)}return b}function m(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 n(a,b){return m(a,b,l)}function o(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function p(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ma.call(a),h=Ma.call(b);if(g==Ca&&(g=Ja),h==Ca&&(h=Ja),g!=h)return!1;switch(g){case Ea:case Fa:return+a==+b;case Ia:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ka:case La:return a==String(b)}var i=g==Da;if(!i){if(g!=Ja||!Va.nodeClass&&(o(a)||o(b)))return!1;var j=!Va.argsObject&&Xa(a)?Object:a.constructor,k=!Va.argsObject&&Xa(b)?Object:b.constructor;if(!(j==k||Na.call(a,"constructor")&&Na.call(b,"constructor")||ia(j)&&j instanceof j&&ia(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var m=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,m=b.length,q=m==l)for(;m--;){var r=b[m];if(!(q=p(a[m],r,c,d)))break}}else n(b,function(b,e,f){return Na.call(f,e)?(m++,q=Na.call(a,e)&&p(a[e],b,c,d)):void 0}),q&&n(a,function(a,b,c){return Na.call(c,b)?q=--m>-1:void 0});return c.pop(),d.pop(),q}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function s(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function t(a){this._s=a}function u(a){this._s=a,this._l=a.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&_.isFinite(a)}function y(b){var c,d=b[wa];if(!d&&"string"==typeof b)return c=new t(b),c[wa]();if(!d&&b.length!==a)return c=new v(b),c[wa]();if(!d)throw new TypeError("Object is not iterable");return b[wa]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>$b?$b:b):b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return ob(a)||(a=sb),new _b(b,a)}function D(a,b){this.observer=a,this.parent=b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return a.amb(b)}function G(a,b){return new Ec(function(c){var d=new ib,e=new jb;return e.setDisposable(d),d.setDisposable(a.subscribe(new kc(c,e,b))),e},a)}function H(){return!1}function I(a,b){var c=this;return new Ec(function(e){var f=0,g=a.length;return c.subscribe(function(c){if(g>f){var h=a[f++],i=d(b)(c,h);if(i===ja)return e.onError(i.e);e.onNext(i)}else e.onCompleted()},function(a){e.onError(a)},function(){e.onCompleted()})},c)}function H(){return!1}function J(){return[]}function H(){return!1}function K(){return[]}function L(a){return function(b){return a.subscribe(b)}}function M(a){return a.toArray()}function N(a){return a.length>0}function O(a,b,c){this.o=a,this.keyFn=b,this.comparer=c,this.hasCurrentKey=!1,this.currentKey=null,this.isStopped=!1}function P(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function Q(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function R(a){this.comparer=a,this.set=[]}function S(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}var T,U={"function":!0,object:!0},V=U[typeof exports]&&exports&&!exports.nodeType&&exports,W=U[typeof self]&&self.Object&&self,X=U[typeof window]&&window&&window.Object&&window,Y=U[typeof module]&&module&&!module.nodeType&&module,Z=Y&&Y.exports===V&&V,$=V&&Y&&"object"==typeof global&&global&&global.Object&&global,_=_=$||X!==(this&&this.window)&&X||W||this,aa={internals:{},config:{Promise:_.Promise},helpers:{}},ba=aa.helpers.noop=function(){},ca=aa.helpers.identity=function(a){return a},da=aa.helpers.defaultNow=Date.now,ea=aa.helpers.defaultComparer=function(a,b){return Ya(a,b)},fa=aa.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ga=(aa.helpers.defaultKeySerializer=function(a){return a.toString()},aa.helpers.defaultError=function(a){throw a}),ha=aa.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ia=aa.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ma.call(a)}),a}(),ja={e:{}};aa.config.longStackSupport=!1;var ka=!1,la=d(function(){throw new Error})();ka=!!la.e&&!!la.e.stack;var ma,na=j(),oa="From previous event:",pa=aa.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};pa.prototype=Error.prototype;var qa=aa.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};qa.prototype=Error.prototype;var ra=aa.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};ra.prototype=Error.prototype;var sa=aa.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};sa.prototype=Error.prototype;var ta=aa.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};ta.prototype=Error.prototype;var ua=aa.helpers.notImplemented=function(){throw new ta},va=aa.helpers.notSupported=function(){throw new sa},wa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";_.Set&&"function"==typeof(new _.Set)["@@iterator"]&&(wa="@@iterator");var xa=aa.doneEnumerator={done:!0,value:a};aa.helpers.isIterable=function(b){return b[wa]!==a},aa.helpers.isArrayLike=function(b){return b&&b.length!==a};aa.helpers.iterator=wa;var ya,za=aa.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},Aa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ba=Aa.length,Ca="[object Arguments]",Da="[object Array]",Ea="[object Boolean]",Fa="[object Date]",Ga="[object Error]",Ha="[object Function]",Ia="[object Number]",Ja="[object Object]",Ka="[object RegExp]",La="[object String]",Ma=Object.prototype.toString,Na=Object.prototype.hasOwnProperty,Oa=Ma.call(arguments)==Ca,Pa=Error.prototype,Qa=Object.prototype,Ra=String.prototype,Sa=Qa.propertyIsEnumerable;try{ya=!(Ma.call(document)==Ja&&!({toString:0}+""))}catch(Ta){ya=!0}var Ua={};Ua[Da]=Ua[Fa]=Ua[Ia]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ua[Ea]=Ua[La]={constructor:!0,toString:!0,valueOf:!0},Ua[Ga]=Ua[Ha]=Ua[Ka]={constructor:!0,toString:!0},Ua[Ja]={constructor:!0};var Va={};!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);Va.enumErrorProps=Sa.call(Pa,"message")||Sa.call(Pa,"name"),Va.enumPrototypes=Sa.call(a,"prototype"),Va.nonEnumArgs=0!=c,Va.nonEnumShadows=!/valueOf/.test(b)}(1);var Wa=aa.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Xa=function(a){return a&&"object"==typeof a?Ma.call(a)==Ca:!1};Oa||(Xa=function(a){return a&&"object"==typeof a?Na.call(a,"callee"):!1});var Ya=aa.internals.isEqual=function(a,b){return p(a,b,[],[])},Za=({}.hasOwnProperty,Array.prototype.slice),$a=this.inherits=aa.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},_a=aa.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},ab=aa.internals.addRef=function(a,b){return new Ec(function(c){return new bb(b.getDisposable(),a.subscribe(c))})},bb=aa.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!gb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},cb=bb.prototype;cb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},cb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},cb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var db=aa.Disposable=function(a){this.isDisposed=!1,this.action=a||ba};db.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var eb=db.create=function(a){return new db(a)},fb=db.empty={dispose:ba},gb=db.isDisposable=function(a){return a&&ia(a.dispose)},hb=db.checkDisposed=function(a){if(a.isDisposed)throw new qa},ib=aa.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};ib.prototype.getDisposable=function(){return this.current},ib.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},ib.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var jb=aa.SerialDisposable=function(){this.isDisposed=!1,this.current=null};jb.prototype.getDisposable=function(){return this.current},jb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},jb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var kb=aa.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?fb:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,s)};var lb=aa.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||fa,this.disposable=new ib};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=aa.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),fb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=da,a.normalize=function(a){return 0>a&&(a=0),a},a}(),nb=mb.normalize,ob=mb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),fb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new bb;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),fb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new bb;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(mb.prototype),function(a){mb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},mb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof _.setInterval)throw new sa;b=nb(b);var d=a,e=_.setInterval(function(){d=c(d)},b);return eb(function(){_.clearInterval(e)})}}(mb.prototype),function(a){a.catchError=a["catch"]=function(a){return new wb(this,a)}}(mb.prototype);var pb,qb,rb=(aa.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 ib;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),mb.immediate=function(){function a(a,b){return b(this,a)}return new mb(da,a,va,va)}()),sb=mb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,f){var g=new lb(this,b,f,this.now());if(c)c.push(g);else{c=[g];var h=d(a)();if(c=null,h===ja)return e(h.e)}return g.disposable}var c,f=new mb(da,b,va,va);return f.scheduleRequired=function(){return!c},f}(),tb=function(){var a,b=ba;if(_.setTimeout)a=_.setTimeout,b=_.clearTimeout;else{if(!_.WScript)throw new sa;a=function(a,b){_.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),ub=tb.setTimeout,vb=tb.clearTimeout;!function(){function a(b){if(h)ub(function(){a(b)},0);else{var c=g[b];if(c){h=!0;var f=d(c)();if(qb(b),h=!1,f===ja)return e(f.e)}}}function b(){if(!_.postMessage||_.importScripts)return!1;var a=!1,b=_.onmessage;return _.onmessage=function(){a=!0},_.postMessage("","*"),_.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,k.length)===k&&a(b.data.substring(k.length))}var f=1,g={},h=!1;qb=function(a){delete g[a]};var i=RegExp("^"+String(Ma).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),j="function"==typeof(j=$&&Z&&$.setImmediate)&&!i.test(j)&&j;if(ia(j))pb=function(b){var c=f++;return g[c]=b,j(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))pb=function(b){var c=f++;return g[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var k="ms.rx.schedule"+Math.random();_.addEventListener?_.addEventListener("message",c,!1):_.attachEvent?_.attachEvent("onmessage",c):_.onmessage=c,pb=function(a){var b=f++;return g[b]=a,_.postMessage(k+currentId,"*"),b}}else if(_.MessageChannel){var l=new _.MessageChannel;l.port1.onmessage=function(b){a(b.data)},pb=function(a){var b=f++;return g[b]=a,l.port2.postMessage(b),b}}else pb="document"in _&&"onreadystatechange"in _.document.createElement("script")?function(b){var c=_.document.createElement("script"),d=f++;return g[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},_.document.documentElement.appendChild(c),d}:function(b){var c=f++;return g[c]=b,ub(function(){a(c)},0),c}}();var wb=(mb.timeout=mb["default"]=function(){function a(a,b){var c=this,d=new ib,e=pb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new bb(d,eb(function(){qb(e)}))}function b(a,b,c){var d=this,e=mb.normalize(b),f=new ib;if(0===e)return d.scheduleWithState(a,c);var g=ub(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new bb(f,eb(function(){vb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new mb(da,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return $a(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.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 fb}}},e.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},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new ib;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},e}(mb)),xb=aa.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}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 ob(a)||(a=rb),new Ec(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),yb=xb.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){return new xb("N",d,null,a,b,c)}}(),zb=xb.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){return new xb("E",null,d,a,b,c)}}(),Ab=xb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new xb("C",null,null,a,b,c)}}(),Bb=aa.Observer=function(){};Bb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Bb.prototype.asObserver=function(){var a=this;return new Fb(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Bb.prototype.checked=function(){return new Gb(this)};var Cb=Bb.create=function(a,b,c){return a||(a=ba),b||(b=ga),c||(c=ba),new Fb(a,b,c)};Bb.fromNotifier=function(a,b){var c=za(a,b,1);return new Fb(function(a){return c(yb(a))},function(a){return c(zb(a))},function(){return c(Ab())})},Bb.prototype.notifyOn=function(a){return new Ib(a,this)},Bb.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Db,Eb=aa.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return $a(b,a),b.prototype.next=ua,b.prototype.error=ua,b.prototype.completed=ua,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=aa.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return $a(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}$a(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=d(this._observer.onNext).call(this._observer,a);this._state=0,b===ja&&e(b.e)},c.onError=function(a){this.checkAccess();var b=d(this._observer.onError).call(this._observer,a);this._state=2,b===ja&&e(b.e)},c.onCompleted=function(){this.checkAccess();var a=d(this._observer.onCompleted).call(this._observer);this._state=2,a===ja&&e(a.e)},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=aa.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 jb}return $a(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;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var f=d(c)();return f===ja?(a.queue=[],a.hasFaulted=!0,e(f.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Eb),Ib=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return $a(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Hb),Jb=aa.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function b(b){if(aa.config.longStackSupport&&ka){var c=d(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return Db=b.prototype,b.isObservable=function(a){return a&&ia(a.subscribe)},Db.subscribe=Db.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Cb(a,b,c))},Db.subscribeOnNext=function(a,b){return this._subscribe(Cb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Db.subscribeOnError=function(a,b){return this._subscribe(Cb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Db.subscribeOnCompleted=function(a,b){return this._subscribe(Cb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Kb=aa.ObservableBase=function(a){function b(a){return a&&ia(a.dispose)?a:ia(a)?eb(a):fb}function c(a,c){var f=c[0],g=c[1],h=d(g.subscribeCore).call(g,f);return h!==ja||f.fail(ja.e)?void f.setDisposable(b(h)):e(ja.e)}function f(a){var b=new Fc(a),d=[b,this];return sb.scheduleRequired()?sb.scheduleWithState(d,c):c(null,d),b}function g(){a.call(this,f)}return $a(g,a),g.prototype.subscribeCore=ua,g}(Jb),Lb=function(a){function b(b,c,d,e){this.resultSelector=aa.helpers.isFunction(d)?d:null,this.selector=aa.internals.bindCallback(aa.helpers.isFunction(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.isStopped=!1,this.o=a}return $a(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.onNext=function(a){if(!this.isStopped){var b=this.i++,c=d(this.selector)(a,b,this.source);if(c===ja)return this.o.onError(c.e);aa.helpers.isPromise(c)&&(c=aa.Observable.fromPromise(c)),(aa.helpers.isArrayLike(c)||aa.helpers.isIterable(c))&&(c=aa.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},b}(Kb),Mb=aa.internals.Enumerable=function(){},Nb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return $a(b,a),b.prototype.subscribeCore=function(a){var b,e=new jb,f=rb.scheduleRecursiveWithState(this.sources[wa](),function(f,g){if(!b){var h=d(f.next).call(f);if(h===ja)return a.onError(h.e);if(h.done)return a.onCompleted();var i=h.value;ha(i)&&(i=Ub(i));var j=new ib;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g,f)))}});return new bb(e,f,eb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Kb);Mb.prototype.concat=function(){return new Nb(this)};var Ob=function(a){function b(b){this.sources=b,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[wa](),e=new jb,f=rb.scheduleRecursiveWithState(null,function(f,g){if(!b){var h=d(c.next).call(c);if(h===ja)return a.onError(h.e);if(h.done)return null!==f?a.onError(f):a.onCompleted();var i=h.value;ha(i)&&(i=Ub(i));var j=new ib;e.setDisposable(j),j.setDisposable(i.subscribe(function(b){a.onNext(b)},g,function(){a.onCompleted()}))}});return new bb(e,f,eb(function(){b=!0}))},b}(Kb);Mb.prototype.catchError=function(){return new Ob(this)},Mb.prototype.catchErrorWhen=function(a){var b=this;return new Ec(function(c){var e,f,g=new Hc,h=new Hc,i=a(g),j=i.subscribe(h),k=b[wa](),l=new jb,m=rb.scheduleRecursive(function(a){if(!e){var b=d(k.next).call(k);if(b===ja)return c.onError(b.e);if(b.done)return void(f?c.onError(f):c.onCompleted());var i=b.value;ha(i)&&(i=Ub(i));var j=new ib,m=new ib;l.setDisposable(new bb(m,j)),j.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(h.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),g.onNext(b)},function(){c.onCompleted()}))}});return new bb(j,l,m,eb(function(){e=!0}))})};var Pb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return $a(b,a),b.prototype[wa]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?xa:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Mb),Qb=Mb.repeat=function(a,b){return new Pb(a,b)},Rb=function(a){function b(a,b,c){this.s=a,this.fn=b?za(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return $a(b,a),b.prototype[wa]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:xa},b}(Mb),Sb=Mb.of=function(a,b,c){return new Rb(a,b,c)};Db.observeOn=function(a){var b=this;return new Ec(function(c){return b.subscribe(new Ib(a,c))},b)},Db.subscribeOn=function(a){var b=this;return new Ec(function(c){var d=new ib,e=new jb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var Tb=function(a){function b(b){this.p=b,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),fb},b}(Kb),Ub=Jb.fromPromise=function(a){return new Tb(a)};Db.toPromise=function(a){if(a||(a=aa.config.Promise),!a)throw new sa("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Vb=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return $a(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Kb);Db.toArray=function(){return new Vb(this)},Jb.create=function(a,b){return new Ec(a,b)};var Wb=(Jb.defer=function(a){return new Ec(function(b){var c;try{c=a()}catch(d){return jc(d).subscribe(b)}return ha(c)&&(c=Ub(c)),c.subscribe(b)})},function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Kb)),Xb=Jb.empty=function(a){return ob(a)||(a=rb),new Wb(a)},Yb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new Zb(a,this);return b.run()},b}(Kb),Zb=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var g=d(c.next).call(c);if(g===ja)return e.onError(g.e);if(g.done)return e.onCompleted();var h=g.value;return ia(f)&&(h=d(f)(h,a),h===ja)?e.onError(h.e):(e.onNext(h),void b(a+1))}var b=Object(this.parent.iterable),c=y(b),e=this.o,f=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),$b=Math.pow(2,53)-1;t.prototype[wa]=function(){return new u(this._s)},u.prototype[wa]=function(){ return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:xa},v.prototype[wa]=function(){return new w(this._a)},w.prototype[wa]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:xa};var _b=(Jb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ia(b))throw new Error("mapFn when provided must be a function");if(b)var e=za(b,c,2);return ob(d)||(d=sb),new Yb(a,e,d)},function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Kb));B.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var ac=Jb.fromArray=function(a,b){return ob(b)||(b=sb),new _b(a,b)};Jb.generate=function(a,b,c,d,e){return ob(e)||(e=sb),new Ec(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var bc=function(a){function b(){a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){return fb},b}(Kb),cc=Jb.never=function(){return new bc};Jb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new _b(b,sb)},Jb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new _b(c,a)};var dc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Kb);D.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Jb.pairs=function(a,b){return b||(b=sb),new dc(a,b)};var ec=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new fc(a,this);return b.run()},b}(Kb),fc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Jb.range=function(a,b,c){return ob(c)||(c=sb),new ec(a,b,c)};var gc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Kb);E.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Jb.repeat=function(a,b,c){return ob(c)||(c=sb),new gc(a,b,c)};var hc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Kb),ic=(Jb["return"]=Jb.just=function(a,b){return ob(b)||(b=rb),new hc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Kb)),jc=Jb["throw"]=function(a,b){return ob(b)||(b=rb),new ic(a,b)};Jb.using=function(a,b){return new Ec(function(c){var e=fb,f=d(a)();if(f===ja)return new bb(jc(f.e).subscribe(c),e);f&&(e=f);var g=d(b)(f);return g===ja?new bb(jc(g.e).subscribe(c),e):new bb(g.subscribe(c),e)})},Db.amb=function(a){var b=this;return new Ec(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new ib,j=new ib;ha(a)&&(a=Ub(a));var k=Cb(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Cb(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new bb(i,j)})},Jb.amb=function(){var a,b=cc();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=F(b,a[d]);return b};var kc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return $a(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=d(this._fn)(a);if(b===ja)return this._o.onError(b.e);ha(b)&&(b=Ub(b));var c=new ib;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Eb);Db["catch"]=function(a){return ia(a)?G(this,a):lc([this,a])};var lc=Jb["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return Sb(a).catchError()};Db.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),mc.apply(this,b)};var mc=Jb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Ec(function(a){function c(b){if(h[b]=!0,i||(i=h.every(ca))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(ca)&&a.onCompleted()}function e(b){j[b]=!0,j.every(ca)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new ib;ha(f)&&(f=Ub(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new bb(l)},this)};Db.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),oc.apply(null,a)};var nc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new jb,c=this.sources,d=c.length,e=this.o,f=rb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ha(h)&&(h=Ub(h));var i=new ib;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new bb(b,f,eb(function(){a=!0}))},b}(Kb),oc=Jb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new nc(a)};Db.concatAll=function(){return this.merge(1)};var pc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new bb;return b.add(this.source.subscribe(new qc(a,this.maxConcurrent,b))),b},b}(Kb),qc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new ib;this.g.add(c),ha(a)&&(a=Ub(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Db.merge=function(a){return"number"!=typeof a?rc(this,a):new pc(this,a)};var rc=Jb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(ob(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=rb,b=0;d>b;b++)c.push(arguments[b]);else for(a=rb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()},sc=aa.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};sc.prototype=Error.prototype,Jb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=C(null,a);return new Ec(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new sc(g))}var c=new bb,e=new ib,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new ib;c.add(e),ha(d)&&(d=Ub(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var tc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new bb,d=new ib;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new ib;this.g.add(b),ha(a)&&(a=Ub(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Kb);Db.mergeAll=function(){return new tc(this)},Db.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return uc([this,a])};var uc=Jb.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Ec(function(b){var c=0,d=new jb,e=rb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ha(f)&&(f=Ub(f)),g=new ib,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new bb(d,e)})};Db.skipUntil=function(a){var b=this;return new Ec(function(c){var d=!1,e=new bb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ha(a)&&(a=Ub(a));var f=new ib;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var vc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return $a(b,a),b.prototype.subscribeCore=function(a){var b=new jb,d=this.source.subscribe(new c(a,b));return new bb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new ib,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ha(a)&&(a=Ub(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Kb);Db["switch"]=Db.switchLatest=function(){return new vc(this)};var wc=function(a){function b(b,c){this.source=b,this.other=ha(c)?Ub(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return $a(b,a),b.prototype.subscribeCore=function(a){return new bb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Kb);Db.takeUntil=function(a){return new wc(this,a)},Db.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=b.pop(),f=this;return Array.isArray(b[0])&&(b=b[0]),new Ec(function(a){for(var c=b.length,g=q(c,H),h=!1,i=new Array(c),j=new Array(c+1),k=0;c>k;k++)!function(c){var d=b[c],e=new ib;ha(d)&&(d=Ub(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(ca)},function(b){a.onError(b)},ba)),j[c]=e}(k);var l=new ib;return l.setDisposable(f.subscribe(function(b){var c=[b].concat(i);if(h){var f=d(e).apply(null,c);return f===ja?a.onError(f.e):void a.onNext(f)}},function(b){a.onError(b)},function(){a.onCompleted()})),j[c]=l,new bb(j)},this)},Db.zip=function(){if(Array.isArray(arguments[0]))return I.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=this,f=b.pop();return b.unshift(e),new Ec(function(a){for(var c=b.length,g=q(c,J),h=q(c,H),i=new Array(c),j=0;c>j;j++)!function(c){var j=b[c],k=new ib;ha(j)&&(j=Ub(j)),k.setDisposable(j.subscribe(function(b){if(g[c].push(b),g.every(function(a){return a.length>0})){var i=g.map(function(a){return a.shift()}),j=d(f).apply(e,i);if(j===ja)return a.onError(j.e);a.onNext(j)}else h.filter(function(a,b){return b!==c}).every(ca)&&a.onCompleted()},function(b){a.onError(b)},function(){h[c]=!0,h.every(ca)&&a.onCompleted()})),i[c]=k}(j);return new bb(i)},e)},Jb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Jb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Ec(function(b){for(var c=a.length,d=q(c,K),e=q(c,H),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new ib,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(ca))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(ca)&&b.onCompleted()}))}(g);return new bb(f)})},Db.asObservable=function(){return new Ec(L(this),this)},Db.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(M).filter(N)},Db.dematerialize=function(){var a=this;return new Ec(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var xc=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new O(a,this.keyFn,this.comparer))},b}(Kb);O.prototype.onNext=function(a){if(!this.isStopped){var b=a;return ia(this.keyFn)&&(b=d(this.keyFn)(a),b===ja)?this.o.onError(b.e):this.hasCurrentKey&&(comparerEquals=d(this.comparer)(this.currentKey,b),comparerEquals===ja)?this.o.onError(comparerEquals.e):void(this.hasCurrentKey&&comparerEquals||(this.hasCurrentKey=!0,this.currentKey=b,this.o.onNext(a)))}},O.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},O.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},O.prototype.dispose=funct