/** @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. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *****************************************************************************/ (function(g,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],x):x(g.rxjs={})})(this,function(g){function x(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");Qa(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function Hb(b,a){var c={},d;for(d in b)Object.prototype.hasOwnProperty.call(b, d)&&0>a.indexOf(d)&&(c[d]=b[d]);if(null!=b&&"function"===typeof Object.getOwnPropertySymbols){var e=0;for(d=Object.getOwnPropertySymbols(b);ea.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(b,d[e])&&(c[d[e]]=b[d[e]])}return c}function ae(b,a,c,d){function e(a){return a instanceof c?a:new c(function(b){b(a)})}return new (c||(c=Promise))(function(c,h){function f(a){try{v(d.next(a))}catch(y){h(y)}}function k(a){try{v(d["throw"](a))}catch(y){h(y)}}function v(a){a.done?c(a.value): e(a.value).then(f,k)}v((d=d.apply(b,a||[])).next())})}function Ra(b,a){function c(a){return function(b){return d([a,b])}}function d(c){if(f)throw new TypeError("Generator is already executing.");for(;e;)try{if(f=1,h&&(l=c[0]&2?h["return"]:c[0]?h["throw"]||((l=h["return"])&&l.call(h),0):h.next)&&!(l=l.call(h,c[1])).done)return l;if(h=0,l)c=[c[0]&2,l.value];switch(c[0]){case 0:case 1:l=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++;h=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop(); continue;default:if(!(l=e.trys,l=0l[0]&&c[1]=b.length&&(b=void 0);return{value:b&&b[d++],done:!b}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.");}function z(b,a){var c="function"===typeof Symbol&&b[Symbol.iterator];if(!c)return b;b= c.call(b);var d,e=[],f;try{for(;(void 0===a||0=b._refCount||0<--b._refCount)c=null;else{var d=b._connection,f=c;c=null;!d||f&&d!==f||d.unsubscribe();a.unsubscribe()}});b.subscribe(d);d.closed||(c=b.connect())})}function Nb(b){var a=S.schedule;return new u(function(c){var d=new B,e=b||Ba,f=e.now(),h=function(l){var k=e.now();c.next({timestamp:b?k:l,elapsed:k-f});c.closed||d.add(a(h))};d.add(a(h));return d})}function Ob(b){return b in Wa?(delete Wa[b],!0):!1}function ee(b){return new u(function(a){return b.schedule(function(){return a.complete()})})}function Xa(b,a){return new u(function(c){var d=0;return a.schedule(function(){d===b.length?c.complete():(c.next(b[d++]),c.closed||this.schedule())})})}function fe(b,a){return new u(function(c){var d=new B;d.add(a.schedule(function(){var e=b[ca]();d.add(e.subscribe({next:function(b){d.add(a.schedule(function(){return c.next(b)}))},error:function(b){d.add(a.schedule(function(){return c.error(b)}))}, complete:function(){d.add(a.schedule(function(){return c.complete()}))}}))}));return d})}function ge(b,a){return new u(function(c){return a.schedule(function(){return b.then(function(b){c.add(a.schedule(function(){c.next(b);c.add(a.schedule(function(){return c.complete()}))}))},function(b){c.add(a.schedule(function(){return c.error(b)}))})})})}function Pb(b,a,c,d){void 0===d&&(d=0);a=a.schedule(function(){try{c.call(this)}catch(e){b.error(e)}},d);b.add(a);return a}function Qb(b,a){return new u(function(c){var d; c.add(a.schedule(function(){d=b[Ya]();Pb(c,a,function(){var a=d.next(),b=a.value;a.done?c.complete():(c.next(b),this.schedule())})}));return function(){return p(null===d||void 0===d?void 0:d.return)&&d.return()}})}function Rb(b,a){if(!b)throw Error("Iterable cannot be null");return new u(function(c){var d=new B;d.add(a.schedule(function(){var e=b[Symbol.asyncIterator]();d.add(a.schedule(function(){var a=this;e.next().then(function(b){b.done?c.complete():(c.next(b.value),a.schedule())})}))}));return d})} function Sb(b){return p(null===b||void 0===b?void 0:b[Ya])}function Tb(b){return Symbol.asyncIterator&&p(null===b||void 0===b?void 0:b[Symbol.asyncIterator])}function Ub(b){return new TypeError("You provided "+(null!==b&&"object"===typeof b?"an invalid object":"'"+b+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Vb(b){return be(this,arguments,function(){var a,c,d,e;return Ra(this,function(f){switch(f.label){case 0:a= b.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,aa(a.read())];case 3:return c=f.sent(),d=c.value,(e=c.done)?[4,aa(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,aa(d)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return a.releaseLock(),[7];case 10:return[2]}})})}function Wb(b,a){if(null!=b){if(p(b[ca]))return fe(b,a);if(Za(b))return Xa(b,a);if(p(null===b||void 0===b?void 0:b.then))return ge(b,a);if(Tb(b))return Rb(b,a); if(Sb(b))return Qb(b,a);if(p(null===b||void 0===b?void 0:b.getReader))return Rb(Vb(b),a)}throw Ub(b);}function da(b,a){return a?Wb(b,a):w(b)}function w(b){if(b instanceof u)return b;if(null!=b){if(p(b[ca]))return he(b);if(Za(b))return Xb(b);if(p(null===b||void 0===b?void 0:b.then))return ie(b);if(Tb(b))return Yb(b);if(Sb(b))return je(b);if(p(null===b||void 0===b?void 0:b.getReader))return Yb(Vb(b))}throw Ub(b);}function he(b){return new u(function(a){var c=b[ca]();if(p(c.subscribe))return c.subscribe(a); throw new TypeError("Provided object does not correctly implement Symbol.observable");})}function Xb(b){return new u(function(a){for(var c=0;ce&&(e=0);var h=0;return c.schedule(function(){a.closed||(a.next(h++),0<=d?this.schedule(void 0,d):a.complete())},e)})}function hc(b,a){void 0===b&&(b=0);void 0=== a&&(a=K);0>b&&(b=0);return fa(b,b,a)}function V(b){return 1===b.length&&xe(b[0])?b[0]:b}function ic(){for(var b=[],a=0;a=b?function(){return I}:n(function(a,c){var d=0;a.subscribe(new m(c,function(a){++d<=b&&(c.next(a), b<=d&&c.complete())}))})}function mb(){return n(function(b,a){b.subscribe(new m(a,C))})}function nb(b){return L(function(){return b})}function Ja(b,a){return a?function(c){return qa(a.pipe(W(1),mb()),c.pipe(Ja(b)))}:G(function(a,d){return b(a,d).pipe(W(1),nb(a))})}function Ac(b,a){void 0===a&&(a=K);var c=fa(b,a);return Ja(function(){return c})}function Bc(){return n(function(b,a){b.subscribe(new m(a,function(b){return Da(b,a)}))})}function Cc(b,a){return n(function(c,d){var e=new Set;c.subscribe(new m(d, function(a){var c=b?b(a):a;e.has(c)||(e.add(c),d.next(a))}));null===a||void 0===a?void 0:a.subscribe(new m(d,function(){return e.clear()},C))})}function ob(b,a){void 0===a&&(a=E);b=null!==b&&void 0!==b?b:De;return n(function(c,d){var e,f=!0;c.subscribe(new m(d,function(c){var h=a(c);if(f||!b(e,h))f=!1,e=h,d.next(c)}))})}function De(b,a){return b===a}function Dc(b,a){return ob(function(c,d){return a?a(c[b],d[b]):c[b]===d[b]})}function ua(b){void 0===b&&(b=Ee);return n(function(a,c){var d=!1;a.subscribe(new m(c, function(a){d=!0;c.next(a)},function(){return d?c.complete():c.error(b())}))})}function Ee(){return new X}function Ec(b,a){if(0>b)throw new pb;var c=2<=arguments.length;return function(d){return d.pipe(M(function(a,c){return c===b}),W(1),c?ta(a):ua(function(){return new pb}))}}function Fc(){for(var b=[],a=0;a(a||0)?Infinity:a;return n(function(d,e){return fb(d,e,b,a,void 0,!0,c)})}function Ic(b){return n(function(a,c){try{a.subscribe(c)}finally{c.add(b)}})}function Jc(b,a){return n(Kc(b,a,"value"))}function Kc(b,a,c){var d="index"===c;return function(c,f){var e=0;c.subscribe(new m(f,function(h){var l=e++;b.call(a,h,l,c)&&(f.next(d?l:h),f.complete())},function(){f.next(d? -1:void 0);f.complete()}))}}function Lc(b,a){return n(Kc(b,a,"index"))}function Mc(b,a){var c=2<=arguments.length;return function(d){return d.pipe(b?M(function(a,c){return b(a,c,d)}):E,W(1),c?ta(a):ua(function(){return new X}))}}function Nc(b,a,c,d){return n(function(e,f){function h(a,b){var c=new u(function(a){y.activeGroups++;var c=b.subscribe(a);return function(){c.unsubscribe();0===--y.activeGroups&&y.teardownAttempted&&y.unsubscribe()}});c.key=a;return c}var l;a&&"function"!==typeof a?(c=a.duration, l=a.element,d=a.connector):l=a;var k=new Map,g=function(a){k.forEach(a);a(f)},q=function(a){return g(function(b){return b.error(a)})},y=new Fe(f,function(a){try{var e=b(a),g=k.get(e);if(!g){k.set(e,g=d?d():new D);var v=h(e,g);f.next(v);if(c){var r=new m(g,function(){g.complete();null===r||void 0===r?void 0:r.unsubscribe()},void 0,void 0,function(){return k.delete(e)});y.add(w(c(v)).subscribe(r))}}g.next(l?l(a):a)}catch(P){q(P)}},function(){return g(function(a){return a.complete()})},q,function(){return k.clear()}); e.subscribe(y)})}function Oc(){return n(function(b,a){b.subscribe(new m(a,function(){a.next(!1);a.complete()},function(){a.next(!0);a.complete()}))})}function rb(b){return 0>=b?function(){return I}:n(function(a,c){var d=[];a.subscribe(new m(c,function(a){d.push(a);bb?a:b})}function Sc(b,a,c){void 0===c&&(c= Infinity);if(p(a))return G(function(){return b},a,c);"number"===typeof a&&(c=a);return G(function(){return b},c)}function Tc(b,a,c){void 0===c&&(c=Infinity);return n(function(d,e){var f=a;return fb(d,e,function(a,c){return b(f,a,c)},c,function(a){f=a},!1,void 0,function(){return f=null})})}function Uc(){for(var b=[],a=0;ab(a,c)?a:c}:function(a,b){return a=b?function(){return I}:n(function(a,c){var d=0,e,f=function(){var h=!1;e=a.subscribe(new m(c,void 0,function(){++d=c?E:n(function(a,b){var f=0,h,g=function(){var l=!1;h=a.subscribe(new m(b,function(a){e&&(f=0);b.next(a)},void 0, function(a){if(f++=b?E:n(function(a,c){var d=Array(b),e=0;a.subscribe(new m(c,function(a){var f=e++;if(fe){null===(c=null===p||void 0===p?void 0:p.complete)||void 0===c?void 0:c.call(p);c=void 0;try{c=new yb(b,t,r,Qd+"_"+b.type)}catch(ye){a.error(ye);return}a.next(c); a.complete()}else null===(d=null===p||void 0===p?void 0:p.error)||void 0===d?void 0:d.call(p,b),w(e)});g=r.user;d=r.method;f=r.async;g?t.open(d,k,f,g,r.password):t.open(d,k,f);f&&(t.timeout=r.timeout,t.responseType=r.responseType);"withCredentials"in t&&(t.withCredentials=r.withCredentials);for(q in e)e.hasOwnProperty(q)&&t.setRequestHeader(q,e[q]);c?t.send(c):t.send();return function(){t&&4!==t.readyState&&t.abort()}})}function Pe(b,a){var c;if(!b||"string"===typeof b||"undefined"!==typeof FormData&& b instanceof FormData||"undefined"!==typeof URLSearchParams&&b instanceof URLSearchParams||Bb(b,"ArrayBuffer")||Bb(b,"File")||Bb(b,"Blob")||"undefined"!==typeof ReadableStream&&b instanceof ReadableStream)return b;if("undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView(b))return b.buffer;if("object"===typeof b)return a["content-type"]=null!==(c=a["content-type"])&&void 0!==c?c:"application/json;charset\x3dutf-8",JSON.stringify(b);throw new TypeError("Unknown body type");}function Bb(b,a){return Re.call(b)=== "[object "+a+"]"}var Qa=function(b,a){Qa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return Qa(b,a)},Z=function(){Z=Object.assign||function(b){for(var a,c=1,d=arguments.length;ca&&hb.index?1:-1:a.delay>b.delay? 1:-1};return a}(xa),I=new u(function(b){return b.complete()}),Za=function(b){return b&&"number"===typeof b.length&&"function"!==typeof b},Ya;Ya="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";(function(b){b.NEXT="N";b.ERROR="E";b.COMPLETE="C"})(g.NotificationKind||(g.NotificationKind={}));var La=function(){function b(a,b,d){this.kind=a;this.value=b;this.error=d;this.hasValue="N"===a}b.prototype.observe=function(a){return Da(this,a)};b.prototype.do=function(a,b,d){var c=this.kind, f=this.value,h=this.error;return"N"===c?null===a||void 0===a?void 0:a(f):"E"===c?null===b||void 0===b?void 0:b(h):null===d||void 0===d?void 0:d()};b.prototype.accept=function(a,b,d){return p(null===a||void 0===a?void 0:a.next)?this.observe(a):this.do(a,b,d)};b.prototype.toObservable=function(){var a=this.kind,b=this.value,d=this.error,b="N"===a?$a(b):"E"===a?Zb(function(){return d}):"C"===a?I:0;if(!b)throw new TypeError("Unexpected notification kind "+a);return b};b.createNext=function(a){return new b("N", a)};b.createError=function(a){return new b("E",void 0,a)};b.createComplete=function(){return b.completeNotification};b.completeNotification=new b("C");return b}(),X=Q(function(b){return function(){b(this);this.name="EmptyError";this.message="no elements in sequence"}}),pb=Q(function(b){return function(){b(this);this.name="ArgumentOutOfRangeError";this.message="argument out of range"}}),md=Q(function(b){return function(a){b(this);this.name="NotFoundError";this.message=a}}),ld=Q(function(b){return function(a){b(this); this.name="SequenceError";this.message=a}}),$b=Q(function(b){return function(a){void 0===a&&(a=null);b(this);this.message="Timeout has occurred";this.name="TimeoutError";this.info=a}}),me=Array.isArray,ne=Array.isArray,oe=Object.getPrototypeOf,pe=Object.prototype,qe=Object.keys,$e={connector:function(){return new D},resetOnDisconnect:!0},ue=["addListener","removeListener"],se=["addEventListener","removeEventListener"],we=["on","off"],Xd=new u(C),xe=Array.isArray,Ae=function(b,a){return b.push(a), b},Ce={connector:function(){return new D}},Fe=function(b){function a(){var a=null!==b&&b.apply(this,arguments)||this;a.activeGroups=0;a.teardownAttempted=!1;return a}x(a,b);a.prototype.unsubscribe=function(){this.teardownAttempted=!0;0===this.activeGroups&&b.prototype.unsubscribe.call(this)};return a}(m),yd={leading:!0,trailing:!1},Ge=function(){return function(b,a){this.value=b;this.interval=a}}(),af=Object.freeze({audit:ib,auditTime:lc,buffer:mc,bufferCount:nc,bufferTime:oc,bufferToggle:pc,bufferWhen:qc, catchError:jb,combineAll:Ga,combineLatestAll:Ga,combineLatest:lb,combineLatestWith:tc,concat:vc,concatAll:Fa,concatMap:Ha,concatMapTo:uc,concatWith:wc,connect:Ia,count:xc,debounce:yc,debounceTime:zc,defaultIfEmpty:ta,delay:Ac,delayWhen:Ja,dematerialize:Bc,distinct:Cc,distinctUntilChanged:ob,distinctUntilKeyChanged:Dc,elementAt:Ec,endWith:Fc,every:Gc,exhaust:Ka,exhaustAll:Ka,exhaustMap:qb,expand:Hc,filter:M,finalize:Ic,find:Jc,findIndex:Lc,first:Mc,groupBy:Nc,ignoreElements:mb,isEmpty:Oc,last:Pc,map:L, mapTo:nb,materialize:Qc,max:Rc,merge:Uc,mergeAll:pa,flatMap:G,mergeMap:G,mergeMapTo:Sc,mergeScan:Tc,mergeWith:Vc,min:Wc,multicast:Ma,observeOn:db,onErrorResumeNext:ic,pairwise:Xc,partition:function(b,a){return function(c){return[M(b,a)(c),M(jc(b,a))(c)]}},pluck:Yc,publish:Zc,publishBehavior:$c,publishLast:bd,publishReplay:cd,race:function(){for(var b=[],a=0;ak?new za(l):new za(l,k)};a.parseMarbles=function(a,b,e,f,g){var c=this;void 0===f&&(f=!1);void 0===g&&(g=!1);if(-1!==a.indexOf("!"))throw Error('conventional marble diagrams cannot have the unsubscription marker "!"');var d=A([],z(a)),h=d.length,m=[];a=g?a.replace(/^[ ]+/, "").indexOf("^"):a.indexOf("^");var n=-1===a?0:a*-this.frameTimeFactor,p="object"!==typeof b?function(a){return a}:function(a){return f&&b[a]instanceof Gb?b[a].messages:b[a]},t=-1;a=function(a){var b=n,f=function(a){b+=a*c.frameTimeFactor},h=void 0,k=d[a];switch(k){case " ":g||f(1);break;case "-":f(1);break;case "(":t=n;f(1);break;case ")":t=-1;f(1);break;case "|":h=wa;f(1);break;case "^":f(1);break;case "#":h=H("E",void 0,e||"error");f(1);break;default:if(g&&k.match(/^[0-9]$/)&&(0===a||" "===d[a- 1])){var l=d.slice(a).join("").match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(l){a+=l[0].length-1;var k=parseFloat(l[1]),q=void 0;switch(l[2]){case "ms":q=k;break;case "s":q=1E3*k;break;case "m":q=6E4*k}f(q/u.frameTimeFactor);break}}h=H("N",p(k),void 0);f(1)}h&&m.push({frame:-1=a)return I;var d=a+b;return new u(c?function(a){var e=b;return c.schedule(function(){e