UNPKG

webappengine

Version:

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

3 lines 74.9 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=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(){try{return da.apply(this,arguments)}catch(a){return va.e=a,va}}function d(a){if(!ua(a))throw new TypeError("fn must be a function");return da=a,c}function e(a){throw a}function f(a,b){if(wa&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Aa)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+Aa+"\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===ya&&d>=za&&ad>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(wa)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 ya=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(!gb(a))return b;fb.nonEnumArgs&&a.length&&hb(a)&&(a=jb.call(a));var c=fb.enumPrototypes&&"function"==typeof a,d=fb.enumErrorProps&&(a===_a||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(fb.nonEnumShadows&&a!==ab){var f=a.constructor,g=-1,h=Na;if(a===(f&&f.prototype))var i=a===bb?Xa:a===_a?Sa:Ya.call(a),j=eb[i];for(;++g<h;)e=Ma[g],j&&j[e]||!Za.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=Ya.call(a),h=Ya.call(b);if(g==Oa&&(g=Va),h==Oa&&(h=Va),g!=h)return!1;switch(g){case Qa:case Ra:return+a==+b;case Ua:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Wa:case Xa:return a==String(b)}var i=g==Pa;if(!i){if(g!=Va||!fb.nodeClass&&(o(a)||o(b)))return!1;var j=!fb.argsObject&&hb(a)?Object:a.constructor,k=!fb.argsObject&&hb(b)?Object:b.constructor;if(!(j==k||Za.call(a,"constructor")&&Za.call(b,"constructor")||ua(j)&&j instanceof j&&ua(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 Za.call(f,e)?(m++,q=Za.call(a,e)&&p(a[e],b,c,d)):void 0}),q&&n(a,function(a,b,c){return Za.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){this._s=a}function s(a){this._s=a,this._l=a.length,this._i=0}function t(a){this._a=a}function u(a){this._a=a,this._l=y(a),this._i=0}function v(a){return"number"==typeof a&&la.isFinite(a)}function w(b){var c,d=b[Ia];if(!d&&"string"==typeof b)return c=new r(b),c[Ia]();if(!d&&b.length!==a)return c=new t(b),c[Ia]();if(!d)throw new TypeError("Object is not iterable");return b[Ia]()}function x(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function y(a){var b=+a.length;return isNaN(b)?0:0!==b&&v(b)?(b=x(b)*Math.floor(Math.abs(b)),0>=b?0:b>hc?hc:b):b}function z(a,b){this.observer=a,this.parent=b}function A(a,b){return Ab(a)||(a=Eb),new ic(b,a)}function B(a,b){this.observer=a,this.parent=b}function C(a,b){this.observer=a,this.parent=b}function D(a,b){return new Uc(function(c){var d=new vb,e=new wb;return e.setDisposable(d),d.setDisposable(a.subscribe(new sc(c,e,b))),e},a)}function E(){return!1}function F(a,b){var c=this;return new Uc(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===va)return e.onError(i.e);e.onNext(i)}else e.onCompleted()},function(a){e.onError(a)},function(){e.onCompleted()})},c)}function E(){return!1}function G(){return[]}function E(){return!1}function H(){return[]}function I(a){return function(b){return a.subscribe(b)}}function J(a,b,c){this.o=a,this.keyFn=b,this.comparer=c,this.hasCurrentKey=!1,this.currentKey=null,this.isStopped=!1}function K(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 L(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}}function M(a,b,c,d){var e=new Yc;return d.push(N(e,b,c)),a.apply(b,d),e.asObservable()}function N(a,b,c){return function(){for(var e=arguments.length,f=new Array(e),g=0;e>g;g++)f[g]=arguments[g];if(ua(c)){if(f=d(c).apply(b,f),f===va)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function O(a,b,c,d){var e=new Yc;return d.push(P(e,b,c)),a.apply(b,d),e.asObservable()}function P(a,b,c){return function(){var e=arguments[0];if(e)return a.onError(e);for(var f=arguments.length,g=[],h=1;f>h;h++)g[h-1]=arguments[h];if(ua(c)){var g=d(c).apply(b,g);if(g===va)return a.onError(g.e);a.onNext(g)}else g.length<=1?a.onNext(g[0]):a.onNext(g);a.onCompleted()}}function Q(a){return window.StaticNodeList?a instanceof window.StaticNodeList||a instanceof window.NodeList:"[object NodeList]"==Object.prototype.toString.call(a)}function R(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=la.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function S(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function T(a,b,c){this._e=a,this._n="on"+b,this._fn=function(a){c(R(a))},this._e.attachEvent(this._n,this._fn),this.isDisposed=!1}function U(a,b,c){this._e=a,this._n="on"+b,this._e[this._n]=c,this.isDisposed=!1}function V(a,b,c){return a.addEventListener?new S(a,b,c):a.attachEvent?new T(a,b,c):U(a,b,c)}function W(a,b,c){var d=new ob;if(Q(a)||"[object HTMLCollection]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(W(a.item(e),b,c));else a&&d.add(V(a,b,c));return d}function X(a,b){return new Uc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function Y(a,b,c){return new Uc(function(d){var e=a,f=zb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function Z(a,b){return new Uc(function(c){return b.scheduleWithRelative(zb(a),function(){c.onNext(0),c.onCompleted()})})}function $(a,b,c){return a===b?new Uc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):cc(function(){return Y(c.now()+a,b,c)})}function _(a,b,c){return new Uc(function(d){var e,f=!1,g=new wb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new vb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new ob(e,g)},a)}function aa(a,b,c){return cc(function(){return _(a,b-c.now(),c)})}function ba(a,b){return new Uc(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new vb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new ob(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function ca(a,b,c){return new Uc(function(e){function f(a,b){if(k[b]=a,h[b]=!0,i||(i=h.every(oa))){if(g)return e.onError(g);var f=d(c).apply(null,k);if(f===va)return e.onError(f.e);e.onNext(f)}j&&k[1]&&e.onCompleted()}var g,h=[!1,!1],i=!1,j=!1,k=new Array(2);return new ob(a.subscribe(function(a){f(a,0)},function(a){k[1]?e.onError(a):g=a},function(){j=!0,k[1]&&e.onCompleted()}),b.subscribe(function(a){f(a,1)},function(a){e.onError(a)},function(){j=!0,f(!0,1)}))},a)}var da,ea={"function":!0,object:!0},fa=ea[typeof exports]&&exports&&!exports.nodeType&&exports,ga=ea[typeof self]&&self.Object&&self,ha=ea[typeof window]&&window&&window.Object&&window,ia=ea[typeof module]&&module&&!module.nodeType&&module,ja=ia&&ia.exports===fa&&fa,ka=fa&&ia&&"object"==typeof global&&global&&global.Object&&global,la=la=ka||ha!==(this&&this.window)&&ha||ga||this,ma={internals:{},config:{Promise:la.Promise},helpers:{}},na=ma.helpers.noop=function(){},oa=ma.helpers.identity=function(a){return a},pa=ma.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}(),qa=ma.helpers.defaultComparer=function(a,b){return ib(a,b)},ra=ma.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},sa=(ma.helpers.defaultKeySerializer=function(a){return a.toString()},ma.helpers.defaultError=function(a){throw a}),ta=ma.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ua=ma.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ya.call(a)}),a}(),va={e:{}};ma.config.longStackSupport=!1;var wa=!1,xa=d(function(){throw new Error})();wa=!!xa.e&&!!xa.e.stack;var ya,za=j(),Aa="From previous event:",Ba=ma.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};Ba.prototype=Error.prototype;var Ca=ma.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};Ca.prototype=Error.prototype;var Da=ma.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};Da.prototype=Error.prototype;var Ea=ma.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};Ea.prototype=Error.prototype;var Fa=ma.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};Fa.prototype=Error.prototype;var Ga=ma.helpers.notImplemented=function(){throw new Fa},Ha=ma.helpers.notSupported=function(){throw new Ea},Ia="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";la.Set&&"function"==typeof(new la.Set)["@@iterator"]&&(Ia="@@iterator");var Ja=ma.doneEnumerator={done:!0,value:a};ma.helpers.isIterable=function(b){return b[Ia]!==a},ma.helpers.isArrayLike=function(b){return b&&b.length!==a};ma.helpers.iterator=Ia;var Ka,La=ma.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)}},Ma=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Na=Ma.length,Oa="[object Arguments]",Pa="[object Array]",Qa="[object Boolean]",Ra="[object Date]",Sa="[object Error]",Ta="[object Function]",Ua="[object Number]",Va="[object Object]",Wa="[object RegExp]",Xa="[object String]",Ya=Object.prototype.toString,Za=Object.prototype.hasOwnProperty,$a=Ya.call(arguments)==Oa,_a=Error.prototype,ab=Object.prototype,bb=String.prototype,cb=ab.propertyIsEnumerable;try{Ka=!(Ya.call(document)==Va&&!({toString:0}+""))}catch(db){Ka=!0}var eb={};eb[Pa]=eb[Ra]=eb[Ua]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},eb[Qa]=eb[Xa]={constructor:!0,toString:!0,valueOf:!0},eb[Sa]=eb[Ta]=eb[Wa]={constructor:!0,toString:!0},eb[Va]={constructor:!0};var fb={};!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);fb.enumErrorProps=cb.call(_a,"message")||cb.call(_a,"name"),fb.enumPrototypes=cb.call(a,"prototype"),fb.nonEnumArgs=0!=c,fb.nonEnumShadows=!/valueOf/.test(b)}(1);var gb=ma.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},hb=function(a){return a&&"object"==typeof a?Ya.call(a)==Oa:!1};$a||(hb=function(a){return a&&"object"==typeof a?Za.call(a,"callee"):!1});var ib=ma.internals.isEqual=function(a,b){return p(a,b,[],[])},jb=({}.hasOwnProperty,Array.prototype.slice),kb=this.inherits=ma.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},lb=ma.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]}};ma.internals.addRef=function(a,b){return new Uc(function(c){return new ob(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=jb.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(jb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(jb.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 mb=Object("a"),nb="a"!=mb[0]||!(0 in mb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=nb&&{}.toString.call(this)==Xa?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Ta)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=nb&&{}.toString.call(this)==Xa?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Ta)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)==Pa}),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;Na>e;e++)a.call(c,Ma[e])&&f.push(Ma[e]);return f}}());var ob=ma.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(!tb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},pb=ob.prototype;pb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},pb.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},pb.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 qb=ma.Disposable=function(a){this.isDisposed=!1,this.action=a||na};qb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var rb=qb.create=function(a){return new qb(a)},sb=qb.empty={dispose:na},tb=qb.isDisposable=function(a){return a&&ua(a.dispose)},ub=qb.checkDisposed=function(a){if(a.isDisposed)throw new Ca},vb=ma.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};vb.prototype.getDisposable=function(){return this.current},vb.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()},vb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var wb=ma.SerialDisposable=function(){this.isDisposed=!1,this.current=null};wb.prototype.getDisposable=function(){return this.current},wb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},wb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var xb=(ma.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?sb:new a(this)},b}(),ma.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ra,this.disposable=new vb});xb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},xb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},xb.prototype.isCancelled=function(){return this.disposable.isDisposed},xb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var yb=ma.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(),sb}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=pa,a.normalize=function(a){return 0>a&&(a=0),a},a}(),zb=yb.normalize,Ab=yb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),sb}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 ob;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),sb}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 ob;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)}}(yb.prototype),function(a){yb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},yb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof la.setInterval)throw new Ea;b=zb(b);var d=a,e=la.setInterval(function(){d=c(d)},b);return rb(function(){la.clearInterval(e)})}}(yb.prototype);var Bb,Cb,Db=yb.immediate=function(){function a(a,b){return b(this,a)}return new yb(pa,a,Ha,Ha)}(),Eb=yb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,f){var g=new xb(this,b,f,this.now());if(c)c.push(g);else{c=[g];var h=d(a)();if(c=null,h===va)return e(h.e)}return g.disposable}var c,f=new yb(pa,b,Ha,Ha);return f.scheduleRequired=function(){return!c},f}(),Fb=(ma.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 vb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),function(){var a,b=na;if(la.setTimeout)a=la.setTimeout,b=la.clearTimeout;else{if(!la.WScript)throw new Ea;a=function(a,b){la.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}()),Gb=Fb.setTimeout,Hb=Fb.clearTimeout;!function(){function a(b){if(h)Gb(function(){a(b)},0);else{var c=g[b];if(c){h=!0;var f=d(c)();if(Cb(b),h=!1,f===va)return e(f.e)}}}function b(){if(!la.postMessage||la.importScripts)return!1;var a=!1,b=la.onmessage;return la.onmessage=function(){a=!0},la.postMessage("","*"),la.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;Cb=function(a){delete g[a]};var i=RegExp("^"+String(Ya).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),j="function"==typeof(j=ka&&ja&&ka.setImmediate)&&!i.test(j)&&j;if(ua(j))Bb=function(b){var c=f++;return g[c]=b,j(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Bb=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();la.addEventListener?la.addEventListener("message",c,!1):la.attachEvent?la.attachEvent("onmessage",c):la.onmessage=c,Bb=function(a){var b=f++;return g[b]=a,la.postMessage(k+currentId,"*"),b}}else if(la.MessageChannel){var l=new la.MessageChannel;l.port1.onmessage=function(b){a(b.data)},Bb=function(a){var b=f++;return g[b]=a,l.port2.postMessage(b),b}}else Bb="document"in la&&"onreadystatechange"in la.document.createElement("script")?function(b){var c=la.document.createElement("script"),d=f++;return g[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},la.document.documentElement.appendChild(c),d}:function(b){var c=f++;return g[c]=b,Gb(function(){a(c)},0),c}}();var Ib,Jb=yb.timeout=yb["default"]=function(){function a(a,b){var c=this,d=new vb,e=Bb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new ob(d,rb(function(){Cb(e)}))}function b(a,b,c){var d=this,e=yb.normalize(b),f=new vb;if(0===e)return d.scheduleWithState(a,c);var g=Gb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new ob(f,rb(function(){Hb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new yb(pa,a,b,c)}(),Kb=ma.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 Ab(a)||(a=Db),new Uc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Lb=Kb.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 Kb("N",d,null,a,b,c)}}(),Mb=Kb.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 Kb("E",null,d,a,b,c)}}(),Nb=Kb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new Kb("C",null,null,a,b,c)}}(),Ob=ma.Observer=function(){},Pb=Ob.create=function(a,b,c){return a||(a=na),b||(b=sa),c||(c=na),new Rb(a,b,c)},Qb=ma.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return kb(b,a),b.prototype.next=Ga,b.prototype.error=Ga,b.prototype.completed=Ga,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}(Ob),Rb=ma.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return kb(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}(Qb),Sb=ma.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(ma.config.longStackSupport&&wa){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 Ib=b.prototype,b.isObservable=function(a){return a&&ua(a.subscribe)},Ib.subscribe=Ib.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Pb(a,b,c))},Ib.subscribeOnNext=function(a,b){return this._subscribe(Pb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Ib.subscribeOnError=function(a,b){return this._subscribe(Pb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Ib.subscribeOnCompleted=function(a,b){return this._subscribe(Pb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Tb=ma.ObservableBase=function(a){function b(a){return a&&ua(a.dispose)?a:ua(a)?rb(a):sb}function c(a,c){var f=c[0],g=c[1],h=d(g.subscribeCore).call(g,f);return h!==va||f.fail(va.e)?void f.setDisposable(b(h)):e(va.e)}function f(a){var b=new Vc(a),d=[b,this];return Eb.scheduleRequired()?Eb.scheduleWithState(d,c):c(null,d),b}function g(){a.call(this,f)}return kb(g,a),g.prototype.subscribeCore=Ga,g}(Sb),Ub=function(a){function b(b,c,d,e){this.resultSelector=ma.helpers.isFunction(d)?d:null,this.selector=ma.internals.bindCallback(ma.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 kb(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===va)return this.o.onError(c.e);ma.helpers.isPromise(c)&&(c=ma.Observable.fromPromise(c)),(ma.helpers.isArrayLike(c)||ma.helpers.isIterable(c))&&(c=ma.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}(Tb),Vb=ma.internals.Enumerable=function(){},Wb=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 kb(b,a),b.prototype.subscribeCore=function(a){var b,e=new wb,f=Db.scheduleRecursiveWithState(this.sources[Ia](),function(f,g){if(!b){var h=d(f.next).call(f);if(h===va)return a.onError(h.e);if(h.done)return a.onCompleted();var i=h.value;ta(i)&&(i=Nc(i));var j=new vb;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g,f)))}});return new ob(e,f,rb(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}(Tb);Vb.prototype.concat=function(){return new Wb(this)};var Xb=function(a){function b(b){this.sources=b,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[Ia](),e=new wb,f=Db.scheduleRecursiveWithState(null,function(f,g){if(!b){var h=d(c.next).call(c);if(h===va)return a.onError(h.e);if(h.done)return null!==f?a.onError(f):a.onCompleted();var i=h.value;ta(i)&&(i=Nc(i));var j=new vb;e.setDisposable(j),j.setDisposable(i.subscribe(function(b){a.onNext(b)},g,function(){a.onCompleted()}))}});return new ob(e,f,rb(function(){b=!0}))},b}(Tb);Vb.prototype.catchError=function(){return new Xb(this)},Vb.prototype.catchErrorWhen=function(a){var b=this;return new Uc(function(c){var e,f,g=new Xc,h=new Xc,i=a(g),j=i.subscribe(h),k=b[Ia](),l=new wb,m=Db.scheduleRecursive(function(a){if(!e){var b=d(k.next).call(k);if(b===va)return c.onError(b.e);if(b.done)return void(f?c.onError(f):c.onCompleted());var i=b.value;ta(i)&&(i=Nc(i));var j=new vb,m=new vb;l.setDisposable(new ob(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 ob(j,l,m,rb(function(){e=!0}))})};var Yb=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 kb(b,a),b.prototype[Ia]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?Ja:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Vb),Zb=Vb.repeat=function(a,b){return new Yb(a,b)},$b=function(a){function b(a,b,c){this.s=a,this.fn=b?La(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return kb(b,a),b.prototype[Ia]=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]}:Ja},b}(Vb),_b=Vb.of=function(a,b,c){return new $b(a,b,c)},ac=ma.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 wb}return kb(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===va?(a.queue=[],a.hasFaulted=!0,e(f.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Qb),bc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return kb(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}(Tb);Ib.toArray=function(){return new bc(this)},Sb.create=function(a,b){return new Uc(a,b)};var cc=Sb.defer=function(a){return new Uc(function(b){var c;try{c=a()}catch(d){return rc(d).subscribe(b)}return ta(c)&&(c=Nc(c)),c.subscribe(b)})},dc=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 kb(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}(Tb),ec=Sb.empty=function(a){return Ab(a)||(a=Db),new dc(a)},fc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new gc(a,this);return b.run()},b}(Tb),gc=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===va)return e.onError(g.e);if(g.done)return e.onCompleted();var h=g.value;return ua(f)&&(h=d(f)(h,a),h===va)?e.onError(h.e):(e.onNext(h),void b(a+1))}var b=Object(this.parent.iterable),c=w(b),e=this.o,f=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),hc=Math.pow(2,53)-1;r.prototype[Ia]=function(){return new s(this._s)},s.prototype[Ia]=function(){return this},s.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:Ja},t.prototype[Ia]=function(){return new u(this._a)},u.prototype[Ia]=function(){return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:Ja};var ic=(Sb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ua(b))throw new Error("mapFn when provided must be a function");if(b)var e=La(b,c,2);return Ab(d)||(d=Eb),new fc(a,e,d)},function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new z(a,this);return b.run()},b}(Tb));z.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 jc=Sb.fromArray=function(a,b){return Ab(b)||(b=Eb),new ic(a,b)},kc=function(a){function b(){a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return sb},b}(Tb);Sb.never=function(){return new kc};Sb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new ic(b,Eb)},Sb.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 ic(c,a)};var lc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Tb);B.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)},Sb.pairs=function(a,b){return b||(b=Eb),new lc(a,b)};var mc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new nc(a,this);return b.run()},b}(Tb),nc=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}();Sb.range=function(a,b,c){return Ab(c)||(c=Eb),new mc(a,b,c)};var oc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(Tb);C.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)},Sb.repeat=function(a,b,c){return Ab(c)||(c=Eb),new oc(a,b,c)};var pc=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 kb(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}(Tb),qc=(Sb["return"]=Sb.just=function(a,b){return Ab(b)||(b=Db),new pc(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 kb(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}(Tb)),rc=Sb["throw"]=function(a,b){return Ab(b)||(b=Db),new qc(a,b)},sc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return kb(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===va)return this._o.onError(b.e);ta(b)&&(b=Nc(b));var c=new vb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Qb);Ib["catch"]=function(a){return ua(a)?D(this,a):tc([this,a])};var tc=Sb["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 _b(a).catchError()};Ib.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),uc.apply(this,b)};var uc=Sb.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 Uc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(oa))){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(oa)&&a.onCompleted()}function e(b){j[b]=!0,j.every(oa)&&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 vb;ta(f)&&(f=Nc(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 ob(l)},this)};Ib.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),wc.apply(null,a)};var vc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return kb(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 wb,c=this.sources,d=c.length,e=this.o,f=Db.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ta(h)&&(h=Nc(h));var i=new vb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new ob(b,f,rb(function(){a=!0}))},b}(Tb),wc=Sb.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 vc(a)};Ib.concatAll=function(){return this.merge(1)};var xc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new ob;return b.add(this.source.subscribe(new yc(a,this.maxConcurrent,b))),b},b}(Tb),yc=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 vb;this.g.add(c),ta(a)&&(a=Nc(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}();Ib.merge=function(a){return"number"!=typeof a?zc(this,a):new xc(this,a)};var zc=Sb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Ab(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Db,b=0;d>b;b++)c.push(arguments[b]);else for(a=Db,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),A(a,c).mergeAll()},Ac=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 kb(b,a),b.prototype.subscribeCore=function(a){var b=new ob,d=new vb;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 vb;this.g.add(b),ta(a)&&(a=Nc(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}(Tb);Ib.mergeAll=function(){return new Ac(this)};var Bc=ma.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Bc.prototype=Error.prototype,Sb.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=A(null,a);return new Uc(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new Bc(g))}var c=new ob,e=new vb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new vb;c.add(e),ta(d)&&(d=Nc(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})},Ib.skipUntil=function(a){var b=this;return new Uc(function(c){var d=!1,e=new ob(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ta(a)&&(a=Nc(a));var f=new vb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var Cc=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 kb(b,a),b.prototype.subscribeCore=function(a){var b=new wb,d=this.source.subscribe(new c(a,b));return new ob(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new vb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ta(a)&&(a=Nc(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}(Tb);Ib["switch"]=Ib.switchLatest=function(){return new Cc(this)};var Dc=function(a){function b(b,c){this.source=b,this.other=ta(c)?Nc(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return new ob(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}(Tb);Ib.takeUntil=function(a){return new Dc(this,a)},Ib.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 Uc(function(a){for(var c=b.length,g=q(c,E),h=!1,i=new Array(c),j=new Array(c+1),k=0;c>k;k++)!function(c){var d=b[c],e=new vb;ta(d)&&(d=Nc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(oa)},function(b){a.onError(b)},na)),j[c]=e}(k);var l=new vb;return l.setDisposable(f.subscribe(function(b){var c=[b].concat(i);if(h){var f=d(e).apply(null,c);return f===va?a.onError(f.e):void a.onNext(f)}},function(b){a.onError(b)},function(){a.onCompleted()})),j[c]=l,new ob(j)},this)},Ib.zip=function(){if(Array.isArray(arguments[0]))return F.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 Uc(function(a){for(var c=b.length,g=q(c,G),h=q(c,E),i=new Array(c),j=0;c>j;j++)!function(c){var j=b[c],k=new vb;ta(j)&&(j=Nc(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===va)return a.onError(j.e);a.onNext(j)}else h.filter(function(a,b){return b!==c}).every(oa)&&a.onCompleted()},function(b){a.onError(b)},function(){h[c]=!0,h.every(oa)&&a.onCompleted()})),i[c]=k}(j);return new ob(i)},e)},Sb.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)},Sb.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 Uc(function(b){for(var c=a.length,d=q(c,H),e=q(c,E),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new vb,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(oa))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(oa)&&b.onCompleted()}))}(g);return new ob(f)})},Ib.asObservable=function(){return new Uc(I(this),this)},Ib.dematerialize=function(){var a=this;return new Uc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var Ec=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer