rxjs
Version:
Reactive Extensions for modern JavaScript
120 lines (118 loc) • 149 kB
JavaScript
/**
@license
Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt
**/
/**
@license
Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt
**/
/*
*****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
*****************************************************************************/
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(l,k,x){if(x.get||x.set)throw new TypeError("ES3 does not support getters and setters.");l!=Array.prototype&&l!=Object.prototype&&(l[k]=x.value)};$jscomp.getGlobal=function(l){return"undefined"!=typeof window&&window===l?l:"undefined"!=typeof global&&null!=global?global:l};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(l,k,x,B){if(k){x=$jscomp.global;l=l.split(".");for(B=0;B<l.length-1;B++){var q=l[B];q in x||(x[q]={});x=x[q]}l=l[l.length-1];B=x[l];k=k(B);k!=B&&null!=k&&$jscomp.defineProperty(x,l,{configurable:!0,writable:!0,value:k})}};$jscomp.polyfill("Object.setPrototypeOf",function(l){return l?l:"object"!=typeof"".__proto__?null:function(k,l){k.__proto__=l;if(k.__proto__!==l)throw new TypeError(k+" is not extensible");return k}},"es6","es5");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(l){return $jscomp.SYMBOL_PREFIX+(l||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var l=$jscomp.global.Symbol.iterator;l||(l=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[l]&&$jscomp.defineProperty(Array.prototype,l,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(l){var k=0;return $jscomp.iteratorPrototype(function(){return k<l.length?{done:!1,value:l[k++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(l){$jscomp.initSymbolIterator();l={next:l};l[$jscomp.global.Symbol.iterator]=function(){return this};return l};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(l,k){$jscomp.initSymbolIterator();l instanceof String&&(l+="");var x=0,B={next:function(){if(x<l.length){var q=x++;return{value:k(q,l[q]),done:!1}}B.next=function(){return{done:!0,value:void 0}};return B.next()}};B[Symbol.iterator]=function(){return B};return B};
$jscomp.polyfill("Array.prototype.values",function(l){return l?l:function(){return $jscomp.iteratorFromArray(this,function(k,l){return l})}},"es6","es3");$jscomp.polyfill("Array.prototype.keys",function(l){return l?l:function(){return $jscomp.iteratorFromArray(this,function(k){return k})}},"es6-impl","es3");
(function(l,k){"object"===typeof exports&&"undefined"!==typeof module?k(exports):"function"===typeof define&&define.amd?define(["exports"],k):k(l.Rx=l.Rx||{})})(this,function(l){function k(b,a){function c(){this.constructor=b}hd(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function x(b){return"function"===typeof b}function B(){try{return za.apply(this,arguments)}catch(b){return n.e=b,n}}function q(b){za=b;return B}function Aa(b){return b.reduce(function(a,c){return a.concat(c instanceof
R?c.errors:c)},[])}function id(){}function la(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return Ba(b)}function Ba(b){return b?1===b.length?b[0]:function(a){return b.reduce(function(c,a){return a(c)},a)}:id}function Ca(b){var a=b.subject;a.next(b.value);a.complete()}function jd(b){b.subject.error(b.err)}function kd(b){var a=this,c=b.source,e=b.subscriber;b=b.context;var d=c.callbackFunc,f=c.args,h=c.scheduler,g=c.subject;if(!g){var g=c.subject=new O,k=function ld(){for(var c=[],
b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=ld.source,b=e.selector,e=e.subject,d=c.shift();d?a.add(h.schedule(ma,0,{err:d,subject:e})):b?(c=q(b).apply(this,c),c===n?a.add(h.schedule(ma,0,{err:n.e,subject:e})):a.add(h.schedule(Da,0,{value:c,subject:e}))):a.add(h.schedule(Da,0,{value:1>=c.length?c[0]:c,subject:e}))};k.source=c;q(d).apply(b,f.concat(k))===n&&a.add(h.schedule(ma,0,{err:n.e,subject:g}))}a.add(g.subscribe(e))}function Da(b){var a=b.subject;a.next(b.value);a.complete()}function ma(b){b.subject.error(b.err)}
function A(b){return b&&"function"===typeof b.schedule}function Ea(b){return b&&"function"!==typeof b.subscribe&&"function"===typeof b.then}function r(b,a,c,e){var d=new Fa(b,c,e);if(d.closed)return null;if(a instanceof g)if(a._isScalar)d.next(a.value),d.complete();else return d.syncErrorThrowable=!0,a.subscribe(d);else if(a&&"number"===typeof a.length){b=0;for(c=a.length;b<c&&!d.closed;b++)d.next(a[b]);d.closed||d.complete()}else{if(Ea(a))return a.then(function(c){d.closed||(d.next(c),d.complete())},
function(c){return d.error(c)}).then(null,function(c){p.setTimeout(function(){throw c;})}),d;if(a&&"function"===typeof a[C]){a=a[C]();do{b=a.next();if(b.done){d.complete();break}d.next(b.value);if(d.closed)break}while(1)}else if(a&&"function"===typeof a[J])if(a=a[J](),"function"!==typeof a.subscribe)d.error(new TypeError("Provided object does not correctly implement Symbol.observable"));else return a.subscribe(new Fa(b,c,e));else d.error(new TypeError("You provided "+(null!=a&&"object"===typeof a?
"an invalid object":"'"+a+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable."))}return null}function Ga(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=null;"function"===typeof b[b.length-1]&&(c=b.pop());1===b.length&&E(b[0])&&(b=b[0].slice());return function(a){return a.lift.call(new G([a].concat(b)),new na(c))}}function Ha(b){var a=b.value;b=b.subscriber;b.closed||(b.next(a),b.complete())}function nd(b){var a=b.err;b=b.subscriber;
b.closed||b.error(a)}function Ia(b,a){void 0===a&&(a=0);return function(c){return c.lift(new od(b,a))}}function S(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return function(e){"number"===typeof a&&(c=a,a=null);return e.lift(new pd(b,a,c))}}function Ja(b){return b}function ba(b){void 0===b&&(b=Number.POSITIVE_INFINITY);return S(Ja,null,b)}function oa(){return ba(1)}function T(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return 1===b.length||2===b.length&&A(b[1])?Ka(b[0]):oa()(La.apply(void 0,
b))}function K(b){return!E(b)&&0<=b-parseFloat(b)+1}function Ma(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var a=Number.POSITIVE_INFINITY,c=null,e=b[b.length-1];A(e)?(c=b.pop(),1<b.length&&"number"===typeof b[b.length-1]&&(a=b.pop())):"number"===typeof e&&(a=b.pop());return null===c&&1===b.length&&b[0]instanceof g?b[0]:ba(a)(new G(b,c))}function Na(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];if(1===b.length)if(E(b[0]))b=b[0];else return b[0];return(new G(b)).lift(new qd)}
function Oa(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&E(b[0])&&(b=b[0]);return function(c){return c.lift(new Pa(b))}}function rd(b){var a=b.obj,c=b.keys,e=b.index,d=b.subscriber;e===b.length?d.complete():(c=c[e],d.next([c,a[c]]),b.index=e+1,this.schedule(b))}function ca(b){return b instanceof Date&&!isNaN(+b)}function Qa(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){return c.lift.call(Ra.apply(void 0,[c].concat(b)))}}function Ra(){for(var b=
[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=b[b.length-1];"function"===typeof a&&b.pop();return(new G(b)).lift(new Sa(a))}function U(b,a){return function(c){if("function"!==typeof b)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return c.lift(new sd(b,a))}}function td(b,a){void 0===a&&(a=null);return new L({method:"GET",url:b,headers:a})}function ud(b,a,c){return new L({method:"POST",url:b,body:a,headers:c})}function vd(b,a){return new L({method:"DELETE",
url:b,headers:a})}function wd(b,a,c){return new L({method:"PUT",url:b,body:a,headers:c})}function xd(b,a,c){return new L({method:"PATCH",url:b,body:a,headers:c})}function yd(b,a){return zd(new L({method:"GET",url:b,responseType:"json",headers:a}))}function Ta(b,a){switch(b){case "json":return"response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null");case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}}
function Ad(b){for(var a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];for(var c=a.length,e=0;e<c;e++){var d=a[e],f;for(f in d)d.hasOwnProperty(f)&&(b[f]=d[f])}return b}function Ua(b){return function(a){return a.lift(new Bd(b))}}function Va(b,a){void 0===a&&(a=null);return function(c){return c.lift(new Cd(b,a))}}function Wa(b){var a=arguments.length,c=u;A(arguments[arguments.length-1])&&(c=arguments[arguments.length-1],a--);var e=null;2<=a&&(e=arguments[1]);var d=Number.POSITIVE_INFINITY;3<=a&&
(d=arguments[2]);return function(a){return a.lift(new Dd(b,e,d,c))}}function Xa(b){var a=b.subscriber,c=b.context;c&&a.closeContext(c);a.closed||(b.context=a.openContext(),b.context.closeAction=this.schedule(b,b.bufferTimeSpan))}function Ed(b){var a=b.bufferCreationInterval,c=b.bufferTimeSpan,e=b.subscriber,d=b.scheduler,f=e.openContext();e.closed||(e.add(f.closeAction=d.schedule(Ya,c,{subscriber:e,context:f})),this.schedule(b,a))}function Ya(b){b.subscriber.closeContext(b.context)}function Za(b,
a){return function(c){return c.lift(new Fd(b,a))}}function $a(b){return function(a){return a.lift(new Gd(b))}}function ab(b){return function(a){var c=new Hd(b);a=a.lift(c);return c.caught=a}}function bb(b){return ab(b)(this)}function cb(b){return function(a){return a.lift(new na(b))}}function db(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){return c.lift.call(T.apply(void 0,[c].concat(b)))}}function pa(b,a){return S(b,a,1)}function eb(b,a){return pa(function(){return b},
a)}function fb(b){return function(a){return a.lift(new Id(b,a))}}function gb(){return function(b){return b.lift(new Jd)}}function hb(b){return function(a){return a.lift(new Kd(b))}}function ib(b,a){void 0===a&&(a=u);return function(c){return c.lift(new Ld(b,a))}}function Md(b){b.debouncedNext()}function qa(b){void 0===b&&(b=null);return function(a){return a.lift(new Nd(b))}}function jb(b,a){void 0===a&&(a=u);var c=ca(b)?+b-a.now():Math.abs(b);return function(b){return b.lift(new Od(c,a))}}function kb(b,
a){return a?function(c){return(new Pd(c,a)).lift(new lb(b))}:function(c){return c.lift(new lb(b))}}function Qd(){return function(){function b(){this._values=[]}b.prototype.add=function(a){this.has(a)||this._values.push(a)};b.prototype.has=function(a){return-1!==this._values.indexOf(a)};Object.defineProperty(b.prototype,"size",{get:function(){return this._values.length},enumerable:!0,configurable:!0});b.prototype.clear=function(){this._values.length=0};return b}()}function mb(b,a){return function(c){return c.lift(new Rd(b,
a))}}function ra(b,a){return function(c){return c.lift(new Sd(b,a))}}function nb(b,a){return ra(function(c,e){return a?a(c[b],e[b]):c[b]===e[b]})}function ob(b,a,c){return function(e){return e.lift(new Td(b,a,c))}}function pb(b,a,c){return ob(b,a,c)(this)}function qb(){return function(b){return b.lift(new Ud)}}function rb(b,a){return function(c){return c.lift(new Vd(b,a))}}function sb(b,a,c){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===c&&(c=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(e){return e.lift(new Wd(b,
a,c))}}function tb(b,a){return function(c){return c.lift(new Xd(b,a))}}function da(b,a){return function(c){return c.lift(new Yd(b,a))}}function ub(b){return function(a){return a.lift(new Zd(b))}}function vb(b){return ub(b)(this)}function wb(b,a){if("function"!==typeof b)throw new TypeError("predicate is not a function");return function(c){return c.lift(new xb(b,c,!1,a))}}function yb(b,a){return function(c){return c.lift(new xb(b,c,!0,a))}}function zb(b,a,c){return function(e){return e.lift(new $d(b,
a,c,e))}}function Ab(b,a,c,e){return function(d){return d.lift(new ae(b,a,c,e))}}function Bb(){return function(b){return b.lift(new be)}}function Cb(){return function(b){return b.lift(new ce)}}function sa(b){return function(a){return a.lift(new de(b))}}function Db(b,a){void 0===a&&(a=u);return sa(function(){return Eb(b,a)})}function Fb(b,a,c){return function(e){return e.lift(new ee(b,a,c,e))}}function Gb(b){return b(this)}function Hb(b,a){return function(c){return c.lift(new fe(b,a,c))}}function Ib(b){return function(a){return a.lift(new ge(b))}}
function Jb(){return function(b){return b.lift(new he)}}function V(b,a){var c=!1;2<=arguments.length&&(c=!0);return function(e){return e.lift(new ie(b,a,c))}}function ea(b){return function(a){return 0===b?new F:a.lift(new je(b))}}function P(b,a){return 2<=arguments.length?function(c){return la(V(b,a),ea(1),qa(a))(c)}:function(c){return la(V(function(c,a,f){return b(c,a,f+1)}),ea(1))(c)}}function Kb(b){return P("function"===typeof b?function(a,c){return 0<b(a,c)?a:c}:function(a,c){return a>c?a:c})}
function Lb(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){return c.lift.call(Ma.apply(void 0,[c].concat(b)))}}function Mb(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return S(b,a,c)(this)}function Nb(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return function(e){return e.lift(new ke(b,a,c))}}function Ob(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return Nb(b,a,c)(this)}function Pb(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);
return function(e){return e.lift(new le(b,a,c))}}function Qb(b){return P("function"===typeof b?function(a,c){return 0>b(a,c)?a:c}:function(a,c){return a<c?a:c})}function ta(){return function(b){return b.lift(new me(b))}}function H(b,a){return function(c){var e;e="function"===typeof b?b:function(){return b};if("function"===typeof a)return c.lift(new ne(e,a));var d=Object.create(c,oe);d.source=c;d.subjectFactory=e;return d}}function Rb(){return function(b){return b.lift(new pe)}}function qe(b,a){function c(){return!c.pred.apply(c.thisArg,
arguments)}c.pred=b;c.thisArg=a;return c}function Sb(b,a){return function(c){return[da(b,a)(c),da(qe(b,a))(c)]}}function Tb(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=b.length;if(0===c)throw Error("list of properties cannot be empty.");return function(a){return U(re(b,c))(a)}}function re(b,a){return function(c){var e=c;for(c=0;c<a;c++)if(e=e[b[c]],"undefined"===typeof e)return;return e}}function Ub(b){return b?H(function(){return new w},b):H(new w)}function Vb(b){return function(a){return H(new Wb(b))(a)}}
function Xb(b,a,c,e){c&&"function"!==typeof c&&(e=c);var d="function"===typeof c?c:void 0,f=new M(b,a,e);return function(c){return H(function(){return f},d)(c)}}function Yb(){return function(b){return H(new O)(b)}}function Zb(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){1===b.length&&E(b[0])&&(b=b[0]);return c.lift.call(Na.apply(void 0,[c].concat(b)))}}function $b(b){void 0===b&&(b=-1);return function(a){return 0===b?new F:0>b?a.lift(new ac(-1,a)):a.lift(new ac(b-
1,a))}}function bc(b){return function(a){return a.lift(new se(b))}}function cc(b){void 0===b&&(b=-1);return function(a){return a.lift(new te(b,a))}}function dc(b){return function(a){return a.lift(new ue(b,a))}}function ec(b){return function(a){return a.lift(new ve(b))}}function fc(b,a){void 0===a&&(a=u);return function(c){return c.lift(new we(b,a))}}function xe(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function gc(b,a){return function(c){return c.lift(new ye(b,a))}}function ze(){return new w}
function hc(){return function(b){return ta()(H(ze)(b))}}function ic(b,a,c){return function(e){return e.lift(Ae(b,a,c))}}function Ae(b,a,c){var e,d=0,f,h=!1,g=!1;return function(k){d++;if(!e||h)h=!1,e=new M(b,a,c),f=k.subscribe({next:function(c){e.next(c)},error:function(c){h=!0;e.error(c)},complete:function(){g=!0;e.complete()}});var z=e.subscribe(this);return function(){d--;z.unsubscribe();f&&0===d&&g&&f.unsubscribe()}}}function jc(b){return function(a){return a.lift(new Be(b,a))}}function kc(b){return function(a){return a.lift(new Ce(b))}}
function lc(b){return function(a){return a.lift(new De(b))}}function mc(b){return function(a){return a.lift(new Ee(b))}}function nc(b){return function(a){return a.lift(new Fe(b))}}function oc(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){var a=b[b.length-1];A(a)?b.pop():a=null;var d=b.length;return 1===d?T(new ua(b[0],a),c):1<d?T(new G(b,a),c):T(new F(a),c)}}function Ge(b,a){void 0===a&&(a=0);return function(c){return c.lift(new He(b,a))}}function va(b,a){return function(c){return c.lift(new Ie(b,
a))}}function pc(){return va(Ja)}function qc(){return pc()(this)}function rc(b,a){return function(c){return c.lift(new Je(b,a))}}function sc(b){return function(a){return 0===b?new F:a.lift(new Ke(b))}}function tc(b){return function(a){return a.lift(new Le(b))}}function uc(b){return function(a){return a.lift(new Me(b))}}function vc(b,a){void 0===a&&(a=fa);return function(c){return c.lift(new Ne(b,a.leading,a.trailing))}}function wc(b,a,c){void 0===a&&(a=u);void 0===c&&(c=fa);return function(e){return e.lift(new Oe(b,
a,c.leading,c.trailing))}}function Pe(b){b.subscriber.clearThrottle()}function xc(b){void 0===b&&(b=u);return function(a){return a.lift(new Qe(b))}}function yc(b,a){void 0===a&&(a=u);var c=ca(b),e=c?+b-a.now():Math.abs(b);return function(b){return b.lift(new Re(e,c,a,new zc))}}function Ac(b,a,c){void 0===c&&(c=u);return function(e){var d=ca(b),f=d?+b-c.now():Math.abs(b);return e.lift(new Se(f,d,a,c))}}function Bc(b){void 0===b&&(b=u);return U(function(a){return new Cc(a,b.now())})}function Te(b,a,
c){b.push(a);return b}function Dc(){return P(Te,[])}function Ec(b){return function(a){return a.lift(new Ue(b))}}function Fc(b,a){void 0===a&&(a=0);return function(c){return c.lift(new Ve(b,a))}}function Gc(b,a,c,e){var d=u,f=null,h=Number.POSITIVE_INFINITY;A(e)&&(d=e);A(c)?d=c:K(c)&&(h=c);A(a)?d=a:K(a)&&(f=a);return function(c){return c.lift(new We(b,f,h,d))}}function Xe(b){var a=b.subscriber,c=b.windowTimeSpan,e=b.window;e&&a.closeWindow(e);b.window=a.openWindow();this.schedule(b,c)}function Ye(b){var a=
b.windowTimeSpan,c=b.subscriber,e=b.scheduler,d=b.windowCreationInterval,f=c.openWindow(),h={action:this,subscription:null};h.subscription=e.schedule(Hc,a,{subscriber:c,window:f,context:h});this.add(h.subscription);this.schedule(b,d)}function Hc(b){var a=b.subscriber,c=b.window;(b=b.context)&&b.action&&b.subscription&&b.action.remove(b.subscription);a.closeWindow(c)}function Ic(b,a){return function(c){return c.lift(new Ze(b,a))}}function Jc(b){return function(a){return a.lift(new $e(b))}}function Kc(){for(var b=
[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){var a;"function"===typeof b[b.length-1]&&(a=b.pop());return c.lift(new af(b,a))}}function Lc(b){return function(a){return a.lift(new Sa(b))}}function Mc(b,a){for(var c=0,e=a.length;c<e;c++)for(var d=a[c],f=Object.getOwnPropertyNames(d.prototype),h=0,g=f.length;h<g;h++){var k=f[h];b.prototype[k]=d.prototype[k]}}var hd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var c in a)a.hasOwnProperty(c)&&
(b[c]=a[c])},bf="undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,cf="undefined"!==typeof global&&global,p="undefined"!==typeof window&&window||cf||bf;if(!p)throw Error("RxJS could not find any global context (window, self, global)");var E=Array.isArray||function(b){return b&&"number"===typeof b.length},n={e:{}},za,R=function(b){function a(c){b.call(this);this.errors=c;c=Error.call(this,c?c.length+" errors occurred during unsubscription:\n "+
c.map(function(c,a){return a+1+") "+c.toString()}).join("\n "):"");this.name=c.name="UnsubscriptionError";this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),v=function(){function b(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){var b=this._parent,d=this._parents,f=this._unsubscribe,h=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var g=
-1,k=d?d.length:0;b;)b.remove(this),b=++g<k&&d[g]||null;x(f)&&(b=q(f).call(this),b===n&&(a=!0,c=c||(n.e instanceof R?Aa(n.e.errors):[n.e])));if(E(h))for(g=-1,k=h.length;++g<k;)b=h[g],null!=b&&"object"===typeof b&&(b=q(b.unsubscribe).call(b),b===n&&(a=!0,c=c||[],b=n.e,b instanceof R?c=c.concat(Aa(b.errors)):c.push(b)));if(a)throw new R(c);}};b.prototype.add=function(a){if(!a||a===b.EMPTY)return b.EMPTY;if(a===this)return this;var c=a;switch(typeof a){case "function":c=new b(a);case "object":if(c.closed||
"function"!==typeof c.unsubscribe)return c;if(this.closed)return c.unsubscribe(),c;"function"!==typeof c._addParent&&(a=c,c=new b,c._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}(this._subscriptions||(this._subscriptions=[])).push(c);c._addParent(this);return c};b.prototype.remove=function(a){var c=this._subscriptions;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))};b.prototype._addParent=function(a){var c=this._parent,b=this._parents;c&&c!==a?b?-1===
b.indexOf(a)&&b.push(a):this._parents=[a]:this._parent=a};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),ga={closed:!0,next:function(b){},error:function(b){throw b;},complete:function(){}},wa=p.Symbol,W="function"===typeof wa&&"function"===typeof wa.for?wa.for("rxSubscriber"):"@@rxSubscriber",m=function(b){function a(c,e,d){b.call(this);this.syncErrorValue=null;this.isStopped=this.syncErrorThrowable=this.syncErrorThrown=!1;switch(arguments.length){case 0:this.destination=ga;break;case 1:if(!c){this.destination=
ga;break}if("object"===typeof c){c instanceof a?(this.syncErrorThrowable=c.syncErrorThrowable,this.destination=c,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new Nc(this,c));break}default:this.syncErrorThrowable=!0,this.destination=new Nc(this,c,e,d)}}k(a,b);a.prototype[W]=function(){return this};a.create=function(c,b,d){c=new a(c,b,d);c.syncErrorThrowable=!1;return c};a.prototype.next=function(c){this.isStopped||this._next(c)};a.prototype.error=function(c){this.isStopped||
(this.isStopped=!0,this._error(c))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,b.prototype.unsubscribe.call(this))};a.prototype._next=function(c){this.destination.next(c)};a.prototype._error=function(c){this.destination.error(c);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var c=this._parent,
a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=c;this._parents=a;return this};return a}(v),Nc=function(b){function a(c,a,d,f){b.call(this);this._parentSubscriber=c;var e;c=this;x(a)?e=a:a&&(e=a.next,d=a.error,f=a.complete,a!==ga&&(c=Object.create(a),x(c.unsubscribe)&&this.add(c.unsubscribe.bind(c)),c.unsubscribe=this.unsubscribe.bind(this)));this._context=c;this._next=e;this._error=d;this._complete=f}k(a,b);a.prototype.next=function(c){if(!this.isStopped&&
this._next){var a=this._parentSubscriber;a.syncErrorThrowable?this.__tryOrSetError(a,this._next,c)&&this.unsubscribe():this.__tryOrUnsub(this._next,c)}};a.prototype.error=function(c){if(!this.isStopped){var a=this._parentSubscriber;if(this._error)a.syncErrorThrowable?this.__tryOrSetError(a,this._error,c):this.__tryOrUnsub(this._error,c),this.unsubscribe();else if(a.syncErrorThrowable)a.syncErrorValue=c,a.syncErrorThrown=!0,this.unsubscribe();else throw this.unsubscribe(),c;}};a.prototype.complete=
function(){var c=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var b=function(){return c._complete.call(c._context)};a.syncErrorThrowable?this.__tryOrSetError(a,b):this.__tryOrUnsub(b)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(c,a){try{c.call(this._context,a)}catch(d){throw this.unsubscribe(),d;}};a.prototype.__tryOrSetError=function(c,a,b){try{a.call(this._context,b)}catch(f){return c.syncErrorValue=f,c.syncErrorThrown=!0}return!1};a.prototype._unsubscribe=
function(){var c=this._parentSubscriber;this._parentSubscriber=this._context=null;c.unsubscribe()};return a}(m),J=function(b){var a=b.Symbol;"function"===typeof a?a.observable?b=a.observable:(b=a("observable"),a.observable=b):b="@@observable";return b}(p),g=function(){function b(a){this._isScalar=!1;a&&(this._subscribe=a)}b.prototype.lift=function(a){var c=new b;c.source=this;c.operator=a;return c};b.prototype.subscribe=function(a,c,b){var e=this.operator;a:{if(a){if(a instanceof m)break a;if(a[W]){a=
a[W]();break a}}a=a||c||b?new m(a,c,b):new m(ga)}e?e.call(a,this.source):a.add(this.source||!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};b.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(c){a.syncErrorThrown=!0,a.syncErrorValue=c,a.error(c)}};b.prototype.forEach=function(a,c){var b=this;c||(p.Rx&&p.Rx.config&&p.Rx.config.Promise?c=p.Rx.config.Promise:p.Promise&&
(c=p.Promise));if(!c)throw Error("no Promise impl found");return new c(function(c,e){var d;d=b.subscribe(function(c){if(d)try{a(c)}catch(D){e(D),d.unsubscribe()}else a(c)},e,c)})};b.prototype._subscribe=function(a){return this.source.subscribe(a)};b.prototype[J]=function(){return this};b.prototype.pipe=function(){for(var a=[],c=0;c<arguments.length;c++)a[c-0]=arguments[c];return 0===a.length?this:Ba(a)(this)};b.prototype.toPromise=function(a){var c=this;a||(p.Rx&&p.Rx.config&&p.Rx.config.Promise?
a=p.Rx.config.Promise:p.Promise&&(a=p.Promise));if(!a)throw Error("no Promise impl found");return new a(function(a,b){var e;c.subscribe(function(c){return e=c},function(c){return b(c)},function(){return a(e)})})};b.create=function(a){return new b(a)};return b}(),I=function(b){function a(){var c=b.call(this,"object unsubscribed");this.name=c.name="ObjectUnsubscribedError";this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),Oc=function(b){function a(c,a){b.call(this);this.subject=c;this.subscriber=
a;this.closed=!1}k(a,b);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var c=this.subject,a=c.observers;this.subject=null;!a||0===a.length||c.isStopped||c.closed||(c=a.indexOf(this.subscriber),-1!==c&&a.splice(c,1))}};return a}(v),Pc=function(b){function a(c){b.call(this,c);this.destination=c}k(a,b);return a}(m),w=function(b){function a(){b.call(this);this.observers=[];this.hasError=this.isStopped=this.closed=!1;this.thrownError=null}k(a,b);a.prototype[W]=function(){return new Pc(this)};
a.prototype.lift=function(c){var a=new ha(this,this);a.operator=c;return a};a.prototype.next=function(c){if(this.closed)throw new I;if(!this.isStopped)for(var a=this.observers,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].next(c)};a.prototype.error=function(c){if(this.closed)throw new I;this.hasError=!0;this.thrownError=c;this.isStopped=!0;for(var a=this.observers,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].error(c);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new I;this.isStopped=
!0;for(var c=this.observers,a=c.length,c=c.slice(),b=0;b<a;b++)c[b].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(c){if(this.closed)throw new I;return b.prototype._trySubscribe.call(this,c)};a.prototype._subscribe=function(c){if(this.closed)throw new I;if(this.hasError)return c.error(this.thrownError),v.EMPTY;if(this.isStopped)return c.complete(),v.EMPTY;this.observers.push(c);return new Oc(this,
c)};a.prototype.asObservable=function(){var c=new g;c.source=this;return c};a.create=function(c,a){return new ha(c,a)};return a}(g),ha=function(b){function a(c,a){b.call(this);this.destination=c;this.source=a}k(a,b);a.prototype.next=function(c){var a=this.destination;a&&a.next&&a.next(c)};a.prototype.error=function(c){var a=this.destination;a&&a.error&&this.destination.error(c)};a.prototype.complete=function(){var c=this.destination;c&&c.complete&&this.destination.complete()};a.prototype._subscribe=
function(c){return this.source?this.source.subscribe(c):v.EMPTY};return a}(w),O=function(b){function a(){b.apply(this,arguments);this.value=null;this.hasCompleted=this.hasNext=!1}k(a,b);a.prototype._subscribe=function(c){return this.hasError?(c.error(this.thrownError),v.EMPTY):this.hasCompleted&&this.hasNext?(c.next(this.value),c.complete(),v.EMPTY):b.prototype._subscribe.call(this,c)};a.prototype.next=function(c){this.hasCompleted||(this.value=c,this.hasNext=!0)};a.prototype.error=function(c){this.hasCompleted||
b.prototype.error.call(this,c)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&b.prototype.next.call(this,this.value);b.prototype.complete.call(this)};return a}(w),df=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=function(c){var b=
this.callbackFunc,d=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(a.dispatch,0,{source:this,subscriber:c,context:this.context});h||(h=this.subject=new O,f=function D(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=D.source,a=b.selector,b=b.subject;a?(c=q(a).apply(this,c),c===n?b.error(n.e):(b.next(c),b.complete())):(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,q(b).apply(this.context,d.concat(f))===n&&h.error(n.e));return h.subscribe(c)};a.dispatch=
function(c){var a=this,b=c.source,f=c.subscriber;c=c.context;var h=b.callbackFunc,g=b.args,k=b.scheduler,l=b.subject;if(!l){var l=b.subject=new O,m=function md(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=md.source,b=e.selector,e=e.subject;b?(c=q(b).apply(this,c),c===n?a.add(k.schedule(jd,0,{err:n.e,subject:e})):a.add(k.schedule(Ca,0,{value:c,subject:e}))):a.add(k.schedule(Ca,0,{value:1>=c.length?c[0]:c,subject:e}))};m.source=b;q(h).apply(c,g.concat(m))===n&&l.error(n.e)}a.add(l.subscribe(f))};
return a}(g).create;g.bindCallback=df;var ef=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=function(c){var a=this.callbackFunc,b=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(kd,0,{source:this,subscriber:c,context:this.context});
h||(h=this.subject=new O,f=function D(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=D.source,a=b.selector,b=b.subject,e=c.shift();e?b.error(e):a?(c=q(a).apply(this,c),c===n?b.error(n.e):(b.next(c),b.complete())):(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,q(a).apply(this.context,b.concat(f))===n&&h.error(n.e));return h.subscribe(c)};return a}(g).create;g.bindNodeCallback=ef;var ua=function(b){function a(c,a){b.call(this);this.value=c;this.scheduler=a;this._isScalar=
!0;a&&(this._isScalar=!1)}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.value,b=c.subscriber;c.done?b.complete():(b.next(a),b.closed||(c.done=!0,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.value,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{done:!1,value:b,subscriber:c});c.next(b);c.closed||c.complete()};return a}(g),F=function(b){function a(c){b.call(this);this.scheduler=c}k(a,b);a.create=function(c){return new a(c)};a.dispatch=function(c){c.subscriber.complete()};
a.prototype._subscribe=function(c){var b=this.scheduler;if(b)return b.schedule(a.dispatch,0,{subscriber:c});c.complete()};return a}(g),G=function(b){function a(c,a){b.call(this);this.array=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){return new a(c,b)};a.of=function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];b=c[c.length-1];A(b)?c.pop():b=null;var d=c.length;return 1<d?new a(c,b):1===d?new ua(c[0],b):new F(b)};a.dispatch=
function(c){var a=c.array,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a[b]),f.closed||(c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.array,d=b.length,f=this.scheduler;if(f)return f.schedule(a.dispatch,0,{array:b,index:0,count:d,subscriber:c});for(f=0;f<d&&!c.closed;f++)c.next(b[f]);c.complete()};return a}(g),t=function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.destination.next(a)};a.prototype.notifyError=
function(c,a){this.destination.error(c)};a.prototype.notifyComplete=function(c){this.destination.complete()};return a}(m),C=function(b){var a=b.Symbol;if("function"===typeof a)return a.iterator||(a.iterator=a("iterator polyfill")),a.iterator;if((a=b.Set)&&"function"===typeof(new a)["@@iterator"])return"@@iterator";if(b=b.Map)for(var a=Object.getOwnPropertyNames(b.prototype),c=0;c<a.length;++c){var e=a[c];if("entries"!==e&&"size"!==e&&b.prototype[e]===b.prototype.entries)return e}return"@@iterator"}(p),
Fa=function(b){function a(c,a,d){b.call(this);this.parent=c;this.outerValue=a;this.outerIndex=d;this.index=0}k(a,b);a.prototype._next=function(c){this.parent.notifyNext(this.outerValue,c,this.outerIndex,this.index++,this)};a.prototype._error=function(c){this.parent.notifyError(c,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(m),Qc={},na=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new ff(a,
this.project))};return b}(),ff=function(b){function a(c,a){b.call(this,c);this.project=a;this.active=0;this.values=[];this.observables=[]}k(a,b);a.prototype._next=function(c){this.values.push(Qc);this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var b=0;b<a;b++){var f=c[b];this.add(r(this,f,f,b))}}};a.prototype.notifyComplete=function(c){0===--this.active&&this.destination.complete()};
a.prototype.notifyNext=function(c,a,b,f,h){c=this.values;f=c[b];f=this.toRespond?f===Qc?--this.toRespond:this.toRespond:0;c[b]=a;0===f&&(this.project?this._tryProject(c):this.destination.next(c.slice()))};a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(t);g.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=a=null;A(b[b.length-1])&&(c=b.pop());"function"===
typeof b[b.length-1]&&(a=b.pop());1===b.length&&E(b[0])&&(b=b[0]);return(new G(b,c)).lift(new na(a))};var La=G.of,Rc=function(b){function a(c,a){b.call(this);this.promise=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this,b=this.promise,f=this.scheduler;if(null==f)this._isScalar?c.closed||(c.next(this.value),c.complete()):b.then(function(b){a.value=b;a._isScalar=!0;c.closed||(c.next(b),c.complete())},function(a){c.closed||c.error(a)}).then(null,
function(c){p.setTimeout(function(){throw c;})});else if(this._isScalar){if(!c.closed)return f.schedule(Ha,0,{value:this.value,subscriber:c})}else b.then(function(b){a.value=b;a._isScalar=!0;c.closed||c.add(f.schedule(Ha,0,{value:b,subscriber:c}))},function(a){c.closed||c.add(f.schedule(nd,0,{err:a,subscriber:c}))}).then(null,function(c){p.setTimeout(function(){throw c;})})};return a}(g),jf=function(b){function a(c,a){b.call(this);this.scheduler=a;if(null==c)throw Error("iterator cannot be null.");
if((a=c[C])||"string"!==typeof c)if(a||void 0===c.length){if(!a)throw new TypeError("object is not iterable");c=c[C]()}else c=new gf(c);else c=new hf(c);this.iterator=c}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.index,b=c.iterator,f=c.subscriber;if(c.hasError)f.error(c.error);else{var h=b.next();h.done?f.complete():(f.next(h.value),c.index=a+1,f.closed?"function"===typeof b.return&&b.return():this.schedule(c))}};a.prototype._subscribe=function(c){var b=this.iterator,
d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{index:0,iterator:b,subscriber:c});do{d=b.next();if(d.done){c.complete();break}else c.next(d.value);if(c.closed){"function"===typeof b.return&&b.return();break}}while(1)};return a}(g),hf=function(){function b(a,c,b){void 0===c&&(c=0);void 0===b&&(b=a.length);this.str=a;this.idx=c;this.len=b}b.prototype[C]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}};
return b}(),gf=function(){function b(a,c,b){void 0===c&&(c=0);if(void 0===b)if(b=+a.length,isNaN(b))b=0;else if(0!==b&&"number"===typeof b&&p.isFinite(b)){var e;e=+b;e=0===e?e:isNaN(e)?e:0>e?-1:1;b=e*Math.floor(Math.abs(b));b=0>=b?0:b>Sc?Sc:b}this.arr=a;this.idx=c;this.len=b}b.prototype[C]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}};return b}(),Sc=Math.pow(2,53)-1,kf=function(b){function a(c,a){b.call(this);
this.arrayLike=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){var e=c.length;return 0===e?new F:1===e?new ua(c[0],b):new a(c,b)};a.dispatch=function(c){var a=c.arrayLike,b=c.index,f=c.subscriber;f.closed||(b>=c.length?f.complete():(f.next(a[b]),c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.arrayLike,d=this.scheduler,f=b.length;if(d)return d.schedule(a.dispatch,0,{arrayLike:b,index:0,length:f,subscriber:c});for(d=
0;d<f&&!c.closed;d++)c.next(b[d]);c.complete()};return a}(g),y=function(){function b(a,c,b){this.kind=a;this.value=c;this.error=b;this.hasValue="N"===a}b.prototype.observe=function(a){switch(this.kind){case "N":return a.next&&a.next(this.value);case "E":return a.error&&a.error(this.error);case "C":return a.complete&&a.complete()}};b.prototype.do=function(a,c,b){switch(this.kind){case "N":return a&&a(this.value);case "E":return c&&c(this.error);case "C":return b&&b()}};b.prototype.accept=function(a,
c,b){return a&&"function"===typeof a.next?this.observe(a):this.do(a,c,b)};b.prototype.toObservable=function(){switch(this.kind){case "N":return g.of(this.value);case "E":return g.throw(this.error);case "C":return g.empty()}throw Error("unexpected notification kind value");};b.createNext=function(a){return"undefined"!==typeof a?new b("N",a):b.undefinedValueNotification};b.createError=function(a){return new b("E",void 0,a)};b.createComplete=function(){return b.completeNotification};b.completeNotification=
new b("C");b.undefinedValueNotification=new b("N",void 0);return b}(),od=function(){function b(a,c){void 0===c&&(c=0);this.scheduler=a;this.delay=c}b.prototype.call=function(a,c){return c.subscribe(new xa(a,this.scheduler,this.delay))};return b}(),xa=function(b){function a(c,a,d){void 0===d&&(d=0);b.call(this,c);this.scheduler=a;this.delay=d}k(a,b);a.dispatch=function(c){c.notification.observe(c.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(c){this.add(this.scheduler.schedule(a.dispatch,
this.delay,new lf(c,this.destination)))};a.prototype._next=function(c){this.scheduleMessage(y.createNext(c))};a.prototype._error=function(c){this.scheduleMessage(y.createError(c))};a.prototype._complete=function(){this.scheduleMessage(y.createComplete())};return a}(m),lf=function(){return function(b,a){this.notification=b;this.destination=a}}(),Tc=function(b){function a(c,a){b.call(this,null);this.ish=c;this.scheduler=a}k(a,b);a.create=function(c,b){if(null!=c){if("function"===typeof c[J])return c instanceof
g&&!b?c:new a(c,b);if(E(c))return new G(c,b);if(Ea(c))return new Rc(c,b);if("function"===typeof c[C]||"string"===typeof c)return new jf(c,b);if(c&&"number"===typeof c.length)return new kf(c,b)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");};a.prototype._subscribe=function(c){var a=this.ish,b=this.scheduler;return null==b?a[J]().subscribe(c):a[J]().subscribe(new xa(c,b,0))};return a}(g),Ka=Tc.create,pd=function(){function b(a,c,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=
a;this.resultSelector=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new mf(a,this.project,this.resultSelector,this.concurrent))};return b}(),mf=function(b){function a(c,a,d,f){void 0===f&&(f=Number.POSITIVE_INFINITY);b.call(this,c);this.project=a;this.resultSelector=d;this.concurrent=f;this.hasCompleted=!1;this.buffer=[];this.index=this.active=0}k(a,b);a.prototype._next=function(c){this.active<this.concurrent?this._tryNext(c):this.buffer.push(c)};a.prototype._tryNext=function(c){var a,
b=this.index++;try{a=this.project(c,b)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(a,c,b)};a.prototype._innerSub=function(c,a,b){this.add(r(this,c,a,b))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,h){this.resultSelector?this._notifyResultSelector(c,a,b,f):this.destination.next(a)};a.prototype._notifyResultSelector=function(c,a,b,f){var e;try{e=this.resultSelector(c,
a,b,f)}catch(z){this.destination.error(z);return}this.destination.next(e)};a.prototype.notifyComplete=function(c){var a=this.buffer;this.remove(c);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(t);g.concat=T;var of=function(b){function a(c){b.call(this);this.observableFactory=c}k(a,b);a.create=function(c){return new a(c)};a.prototype._subscribe=function(c){return new nf(c,this.observableFactory)};return a}(g),nf=function(b){function a(c,
a){b.call(this,c);this.factory=a;this.tryDefer()}k(a,b);a.prototype.tryDefer=function(){try{this._callFactory()}catch(c){this._error(c)}};a.prototype._callFactory=function(){var c=this.factory();c&&this.add(r(this,c))};return a}(t);g.defer=of.create;g.empty=F.create;var qf=function(b){function a(c,a){b.call(this);this.sources=c;this.resultSelector=a}k(a,b);a.create=function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];if(null===c||0===arguments.length)return new F;b=null;"function"===
typeof c[c.length-1]&&(b=c.pop());1===c.length&&E(c[0])&&(c=c[0]);return 0===c.length?new F:new a(c,b)};a.prototype._subscribe=function(c){return new pf(c,this.sources,this.resultSelector)};return a}(g),pf=function(b){function a(c,a,d){b.call(this,c);this.sources=a;this.resultSelector=d;this.haveValues=this.completed=0;this.total=c=a.length;this.values=Array(c);for(d=0;d<c;d++){var e=r(this,a[d],null,d);e&&(e.outerIndex=d,this.add(e))}}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.values[b]=
a;h._hasValue||(h._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(c){var a=this.destination,b=this.haveValues,f=this.resultSelector,h=this.values,g=h.length;c._hasValue?(this.completed++,this.completed===g&&(b===g&&(c=f?f.apply(this,h):h,a.next(c)),a.complete())):a.complete()};return a}(t);g.forkJoin=qf.create;g.from=Ka;var Uc=Object.prototype.toString,rf=function(b){function a(c,a,d,f){b.call(this);this.sourceObj=c;this.eventName=a;this.selector=d;this.options=f}k(a,b);a.create=
function(c,b,d,f){x(d)&&(f=d,d=void 0);return new a(c,b,f,d)};a.setupSubscription=function(c,b,d,f,h){var e;if(c&&"[object NodeList]"===Uc.call(c)||c&&"[object HTMLCollection]"===Uc.call(c))for(var g=0,k=c.length;g<k;g++)a.setupSubscription(c[g],b,d,f,h);else if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(b,d,h),e=function(){return c.removeEventListener(b,d)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(b,d),e=function(){return c.off(b,
d)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(b,d),e=function(){return c.removeListener(b,d)};else throw new TypeError("Invalid event target");f.add(new v(e))};a.prototype._subscribe=function(c){var b=this.selector;a.setupSubscription(this.sourceObj,this.eventName,b?function(){for(var a=[],e=0;e<arguments.length;e++)a[e-0]=arguments[e];a=q(b).apply(void 0,a);a===n?c.error(n.e):c.next(a)}:function(a){return c.next(a)},c,this.options)};return a}(g).create;
g.fromEvent=rf;var sf=function(b){function a(c,a,d){b.call(this);this.addHandler=c;this.removeHandler=a;this.selector=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){var a=this,b=this.removeHandler,f=this.selector?function(){for(var b=[],e=0;e<arguments.length;e++)b[e-0]=arguments[e];a._callSelector(c,b)}:function(a){c.next(a)},h=this._callAddHandler(f,c);x(b)&&c.add(new v(function(){b(f,h)}))};a.prototype._callSelector=function(c,a){try{var b=this.selector.apply(this,
a);c.next(b)}catch(f){c.error(f)}};a.prototype._callAddHandler=function(c,a){try{return this.addHandler(c)||null}catch(d){a.error(d)}};return a}(g).create;g.fromEventPattern=sf;g.fromPromise=Rc.create;var Vc=function(b){return b},tf=function(b){function a(c,a,d,f,h){b.call(this);this.initialState=c;this.condition=a;this.iterate=d;this.resultSelector=f;this.scheduler=h}k(a,b);a.create=function(c,b,d,f,h){return 1==arguments.length?new a(c.initialState,c.condition,c.iterate,c.resultSelector||Vc,c.scheduler):
void 0===f||A(f)?new a(c,b,d,Vc,f):new a(c,b,d,f,h)};a.prototype._subscribe=function(c){var b=this.initialState;if(this.scheduler)return this.scheduler.schedule(a.dispatch,0,{subscriber:c,iterate:this.iterate,condition:this.condition,resultSelector:this.resultSelector,state:b});var d=this.condition,f=this.resultSelector,h=this.iterate;do{if(d){var g=void 0;try{g=d(b)}catch(D){c.error(D);break}if(!g){c.complete();break}}g=void 0;try{g=f(b)}catch(D){c.error(D);break}c.next(g);if(c.closed)break;try{b=
h(b)}catch(D){c.error(D);break}}while(1)};a.dispatch=function(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(z){a.error(z);return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(z){a.error(z);return}if(!f){a.complete();return}if(a.closed)return}var h;try{h=c.resultSelector(c.state)}catch(z){a.error(z);return}if(!a.closed&&(a.next(h),!a.closed))return this.schedule(c)}};return a}(g).create;g.generate=tf;var vf=function(b){function a(c,
a,d){b.call(this);this.condition=c;this.thenSource=a;this.elseSource=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){return new uf(c,this.condition,this.thenSource,this.elseSource)};return a}(g),uf=function(b){function a(c,a,d,f){b.call(this,c);this.condition=a;this.thenSource=d;this.elseSource=f;this.tryIf()}k(a,b);a.prototype.tryIf=function(){var c=this.condition,a=this.thenSource,b=this.elseSource,f;try{(c=(f=c())?a:b)?this.add(r(this,c)):this._complete()}catch(h){this._error(h)}};
return a}(t);g.if=vf.create;var X=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a;this.pending=!1}k(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(this.closed)return this;this.state=c;this.pending=!0;c=this.id;var b=this.scheduler;null!=c&&(this.id=this.recycleAsyncId(b,c,a));this.delay=a;this.id=this.id||this.requestAsyncId(b,this.id,a);return this};a.prototype.requestAsyncId=function(c,a,b){void 0===b&&(b=0);return p.setInterval(c.flush.bind(c,this),b)};a.prototype.recycleAsyncId=
function(c,a,b){void 0===b&&(b=0);return null!==b&&this.delay===b&&!1===this.pending?a:(p.clearInterval(a),void 0)};a.prototype.execute=function(c,a){if(this.closed)return Error("executing a cancelled action");this.pending=!1;if(c=this._execute(c,a))return c;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(c,a){a=!1;var b=void 0;try{this.work(c)}catch(f){a=!0,b=!!f&&f||Error(f)}if(a)return this.unsubscribe(),b};a.prototype._unsubscribe=
function(){var c=this.id,a=this.scheduler,b=a.actions,f=b.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;-1!==f&&b.splice(f,1);null!=c&&(this.id=this.recycleAsyncId(a,c,null));this.delay=null};return a}(function(b){function a(c,a){b.call(this)}k(a,b);a.prototype.schedule=function(c,a){return this};return a}(v)),Y=function(b){function a(){b.apply(this,arguments);this.actions=[];this.active=!1;this.scheduled=void 0}k(a,b);a.prototype.flush=function(c){var a=this.actions;
if(this.active)a.push(c);else{var b;this.active=!0;do if(b=c.execute(c.state,c.delay))break;while(c=a.shift());this.active=!1;if(b){for(;c=a.shift();)c.unsubscribe();throw b;}}};return a}(function(){function b(a,c){void 0===c&&(c=b.now);this.SchedulerAction=a;this.now=c}b.prototype.schedule=