webappengine
Version:
A web application platform that can host multiple web apps running with Node.js.
3 lines • 67.6 kB
JavaScript
/* 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=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}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&&Lc>=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>ac?ac:b):b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return qb(a)||(a=ub),new bc(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 Gc(function(c){var d=new kb,e=new lb;return e.setDisposable(d),d.setDisposable(a.subscribe(new mc(c,e,b))),e},a)}function H(){return!1}function I(a,b){var c=this;return new Gc(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=function(){return Date.now?Date.now:function(){return+new Date}}(),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 Gc(function(c){return new db(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Za.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(Za.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Za.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var bb=Object("a"),cb="a"!=bb[0]||!(0 in bb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=cb&&{}.toString.call(this)==La?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Ha)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=cb&&{}.toString.call(this)==La?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Ha)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==Da}),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&&d!=1/0&&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}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;Ba>e;e++)a.call(c,Aa[e])&&f.push(Aa[e]);return f}}());var db=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(!ib(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.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;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 fb=aa.Disposable=function(a){this.isDisposed=!1,this.action=a||ba};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:ba},ib=fb.isDisposable=function(a){return a&&ia(a.dispose)},jb=fb.checkDisposed=function(a){if(a.isDisposed)throw new qa},kb=aa.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};kb.prototype.getDisposable=function(){return this.current},kb.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()},kb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var lb=aa.SerialDisposable=function(){this.isDisposed=!1,this.current=null};lb.prototype.getDisposable=function(){return this.current},lb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},lb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var mb=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?hb:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,s)};var nb=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 kb};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=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(),hb}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}(),pb=ob.normalize,qb=ob.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),hb}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 db;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),hb}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 db;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)}}(ob.prototype),function(a){ob.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},ob.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof _.setInterval)throw new sa;b=pb(b);var d=a,e=_.setInterval(function(){d=c(d)},b);return gb(function(){_.clearInterval(e)})}}(ob.prototype),function(a){a.catchError=a["catch"]=function(a){return new yb(this,a)}}(ob.prototype);var rb,sb,tb=(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 kb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),ob.immediate=function(){function a(a,b){return b(this,a)}return new ob(da,a,va,va)}()),ub=ob.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,f){var g=new nb(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 ob(da,b,va,va);return f.scheduleRequired=function(){return!c},f}(),vb=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}}(),wb=vb.setTimeout,xb=vb.clearTimeout;!function(){function a(b){if(h)wb(function(){a(b)},0);else{var c=g[b];if(c){h=!0;var f=d(c)();if(sb(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;sb=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))rb=function(b){var c=f++;return g[c]=b,j(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))rb=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,rb=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)},rb=function(a){var b=f++;return g[b]=a,l.port2.postMessage(b),b}}else rb="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,wb(function(){a(c)},0),c}}();var yb=(ob.timeout=ob["default"]=function(){function a(a,b){var c=this,d=new kb,e=rb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new db(d,gb(function(){sb(e)}))}function b(a,b,c){var d=this,e=ob.normalize(b),f=new kb;if(0===e)return d.scheduleWithState(a,c);var g=wb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new db(f,gb(function(){xb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ob(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 hb}}},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 kb;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}(ob)),zb=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 qb(a)||(a=tb),new Gc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ab=zb.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 zb("N",d,null,a,b,c)}}(),Bb=zb.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 zb("E",null,d,a,b,c)}}(),Cb=zb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new zb("C",null,null,a,b,c)}}(),Db=aa.Observer=function(){};Db.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Db.prototype.asObserver=function(){var a=this;return new Hb(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Db.prototype.checked=function(){return new Ib(this)};var Eb=Db.create=function(a,b,c){return a||(a=ba),b||(b=ga),c||(c=ba),new Hb(a,b,c)};Db.fromNotifier=function(a,b){var c=za(a,b,1);return new Hb(function(a){return c(Ab(a))},function(a){return c(Bb(a))},function(){return c(Cb())})},Db.prototype.notifyOn=function(a){return new Kb(a,this)},Db.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Fb,Gb=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}(Db),Hb=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}(Gb),Ib=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}(Db),Jb=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 lb}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}(Gb),Kb=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}(Jb),Lb=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 Fb=b.prototype,b.isObservable=function(a){return a&&ia(a.subscribe)},Fb.subscribe=Fb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Eb(a,b,c))},Fb.subscribeOnNext=function(a,b){return this._subscribe(Eb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnError=function(a,b){return this._subscribe(Eb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnCompleted=function(a,b){return this._subscribe(Eb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Mb=aa.ObservableBase=function(a){function b(a){return a&&ia(a.dispose)?a:ia(a)?gb(a):hb}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 Hc(a),d=[b,this];return ub.scheduleRequired()?ub.scheduleWithState(d,c):c(null,d),b}function g(){a.call(this,f)}return $a(g,a),g.prototype.subscribeCore=ua,g}(Lb),Nb=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}(Mb),Ob=aa.internals.Enumerable=function(){},Pb=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 lb,f=tb.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=Wb(i));var j=new kb;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g,f)))}});return new db(e,f,gb(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}(Mb);Ob.prototype.concat=function(){return new Pb(this)};var Qb=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 lb,f=tb.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=Wb(i));var j=new kb;e.setDisposable(j),j.setDisposable(i.subscribe(function(b){a.onNext(b)},g,function(){a.onCompleted()}))}});return new db(e,f,gb(function(){b=!0}))},b}(Mb);Ob.prototype.catchError=function(){return new Qb(this)},Ob.prototype.catchErrorWhen=function(a){var b=this;return new Gc(function(c){var e,f,g=new Jc,h=new Jc,i=a(g),j=i.subscribe(h),k=b[wa](),l=new lb,m=tb.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=Wb(i));var j=new kb,m=new kb;l.setDisposable(new db(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 db(j,l,m,gb(function(){e=!0}))})};var Rb=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}(Ob),Sb=Ob.repeat=function(a,b){return new Rb(a,b)},Tb=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}(Ob),Ub=Ob.of=function(a,b,c){return new Tb(a,b,c)};Fb.observeOn=function(a){var b=this;return new Gc(function(c){return b.subscribe(new Kb(a,c))},b)},Fb.subscribeOn=function(a){var b=this;return new Gc(function(c){var d=new kb,e=new lb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){
e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var Vb=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)}),hb},b}(Mb),Wb=Lb.fromPromise=function(a){return new Vb(a)};Fb.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 Xb=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}(Mb);Fb.toArray=function(){return new Xb(this)},Lb.create=function(a,b){return new Gc(a,b)};var Yb=(Lb.defer=function(a){return new Gc(function(b){var c;try{c=a()}catch(d){return lc(d).subscribe(b)}return ha(c)&&(c=Wb(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}(Mb)),Zb=Lb.empty=function(a){return qb(a)||(a=tb),new Yb(a)},$b=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 _b(a,this);return b.run()},b}(Mb),_b=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}(),ac=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 bc=(Lb.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 qb(d)||(d=ub),new $b(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}(Mb));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 cc=Lb.fromArray=function(a,b){return qb(b)||(b=ub),new bc(a,b)};Lb.generate=function(a,b,c,d,e){return qb(e)||(e=ub),new Gc(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 dc=function(a){function b(){a.call(this)}return $a(b,a),b.prototype.subscribeCore=function(a){return hb},b}(Mb),ec=Lb.never=function(){return new dc};Lb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new bc(b,ub)},Lb.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 bc(c,a)};var fc=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}(Mb);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)},Lb.pairs=function(a,b){return b||(b=ub),new fc(a,b)};var gc=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 hc(a,this);return b.run()},b}(Mb),hc=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}();Lb.range=function(a,b,c){return qb(c)||(c=ub),new gc(a,b,c)};var ic=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}(Mb);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)},Lb.repeat=function(a,b,c){return qb(c)||(c=ub),new ic(a,b,c)};var jc=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}(Mb),kc=(Lb["return"]=Lb.just=function(a,b){return qb(b)||(b=tb),new jc(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}(Mb)),lc=Lb["throw"]=function(a,b){return qb(b)||(b=tb),new kc(a,b)};Lb.using=function(a,b){return new Gc(function(c){var e=hb,f=d(a)();if(f===ja)return new db(lc(f.e).subscribe(c),e);f&&(e=f);var g=d(b)(f);return g===ja?new db(lc(g.e).subscribe(c),e):new db(g.subscribe(c),e)})},Fb.amb=function(a){var b=this;return new Gc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new kb,j=new kb;ha(a)&&(a=Wb(a));var k=Eb(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Eb(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 db(i,j)})},Lb.amb=function(){var a,b=ec();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 mc=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=Wb(b));var c=new kb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Gb);Fb["catch"]=function(a){return ia(a)?G(this,a):nc([this,a])};var nc=Lb["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 Ub(a).catchError()};Fb.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),oc.apply(this,b)};var oc=Lb.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 Gc(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 kb;ha(f)&&(f=Wb(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 db(l)},this)};Fb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),qc.apply(null,a)};var pc=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 lb,c=this.sources,d=c.length,e=this.o,f=tb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ha(h)&&(h=Wb(h));var i=new kb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new db(b,f,gb(function(){a=!0}))},b}(Mb),qc=Lb.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 pc(a)};Fb.concatAll=function(){return this.merge(1)};var rc=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 db;return b.add(this.source.subscribe(new sc(a,this.maxConcurrent,b))),b},b}(Mb),sc=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 kb;this.g.add(c),ha(a)&&(a=Wb(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}();Fb.merge=function(a){return"number"!=typeof a?tc(this,a):new rc(this,a)};var tc=Lb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(qb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=tb,b=0;d>b;b++)c.push(arguments[b]);else for(a=tb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()},uc=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 db,d=new kb;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 kb;this.g.add(b),ha(a)&&(a=Wb(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}(Mb);Fb.mergeAll=function(){return new uc(this)};var vc=aa.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};vc.prototype=Error.prototype,Lb.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 Gc(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new vc(g))}var c=new db,e=new kb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new kb;c.add(e),ha(d)&&(d=Wb(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})},Fb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return wc([this,a])};var wc=Lb.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 Gc(function(b){var c=0,d=new lb,e=tb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ha(f)&&(f=Wb(f)),g=new kb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new db(d,e)})};Fb.skipUntil=function(a){var b=this;return new Gc(function(c){var d=!1,e=new db(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ha(a)&&(a=Wb(a));var f=new kb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var xc=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 lb,d=this.source.subscribe(new c(a,b));return new db(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new kb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ha(a)&&(a=Wb(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}(Mb);Fb["switch"]=Fb.switchLatest=function(){return new xc(this)};var yc=function(a){function b(b,c){this.source=b,this.other=ha(c)?Wb(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 db(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}(Mb);Fb.takeUntil=function(a){return new yc(this,a)},Fb.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 Gc(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 kb;ha(d)&&(d=Wb(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 kb;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 db(j)},this)},Fb.zip=function(){if(Array.isArray(arguments[0]))return I.apply(this,arguments);for(var a=arguments.len