/** @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,y){"object"===typeof exports&&"undefined"!==typeof module?y(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],y):y(g.rxjs={})})(this,function(g){function y(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");Ta(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function Zd(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 $d(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{w(d.next(a))}catch(v){h(v)}}function k(a){try{w(d["throw"](a))}catch(v){h(v)}}function w(a){a.done?c(a.value): e(a.value).then(f,k)}w((d=d.apply(b,a||[])).next())})}function Ua(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 x(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 Mb(b){var a=T.schedule;return new p(function(c){var d=new C,e=b||Ea,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 Nb(b){return b in Ya?(delete Ya[b],!0):!1}function de(b){return new p(function(a){return b.schedule(function(){return a.complete()})})} function Fa(b){return b&&q(b.schedule)}function oa(b){return q(b[b.length-1])?b.pop():void 0}function O(b){return Fa(b[b.length-1])?b.pop():void 0}function Ob(b){return Symbol.asyncIterator&&q(null===b||void 0===b?void 0:b[Symbol.asyncIterator])}function Pb(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 Qb(b){return q(null=== b||void 0===b?void 0:b[Za])}function Rb(b){return ae(this,arguments,function(){var a,c,d,e;return Ua(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,ea(a.read())];case 3:return c=f.sent(),d=c.value,(e=c.done)?[4,ea(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,ea(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 t(b){if(b instanceof p)return b;if(null!=b){if(q(b[pa]))return ee(b);if($a(b))return fe(b);if(q(null===b||void 0===b?void 0:b.then))return ge(b);if(Ob(b))return Sb(b);if(Qb(b))return he(b);if(q(null===b||void 0===b?void 0:b.getReader))return Sb(Rb(b))}throw Pb(b);}function ee(b){return new p(function(a){var c=b[pa]();if(q(c.subscribe))return c.subscribe(a);throw new TypeError("Provided object does not correctly implement Symbol.observable");})}function fe(b){return new p(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 ec(b,a){void 0===b&&(b=0);void 0===a&&(a=I);0>b&&(b=0);return Z(b,b,a)}function aa(b){return 1===b.length&&we(b[0])?b[0]:b}function fc(){for(var b=[],a=0;a=b?function(){return L}:n(function(a,c){var d=0;a.subscribe(m(c,function(a){++d<=b&&(c.next(a),b<=d&&c.complete())}))})} function mb(){return n(function(b,a){b.subscribe(m(a,D))})}function nb(b){return P(function(){return b})}function Na(b,a){return a?function(c){return ta(a.pipe(ba(1),mb()),c.pipe(Na(b)))}:H(function(a,d){return b(a,d).pipe(ba(1),nb(a))})}function xc(b,a){void 0===a&&(a=I);var c=Z(b,a);return Na(function(){return c})}function yc(){return n(function(b,a){b.subscribe(m(a,function(c){return Ga(c,a)}))})}function zc(b,a){return n(function(c,d){var e=new Set;c.subscribe(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(m(d,function(){return e.clear()},D))})}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(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 Ac(b,a){return ob(function(c,d){return a?a(c[b],d[b]):c[b]===d[b]})}function va(b){void 0===b&&(b=Ee);return n(function(a,c){var d=!1;a.subscribe(m(c,function(a){d=!0;c.next(a)},function(){return d? c.complete():c.error(b())}))})}function Ee(){return new ca}function Bc(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}),ba(1),c?ua(a):va(function(){return new pb}))}}function Cc(){for(var b=[],a=0;a(a||0)?Infinity:a;return n(function(d,e){return eb(d,e,b,a,void 0,!0,c)})}function Fc(b){return n(function(a,c){try{a.subscribe(c)}finally{c.add(b)}})}function Gc(b,a){return n(Hc(b,a,"value"))}function Hc(b,a,c){var d="index"===c;return function(c,f){var e=0;c.subscribe(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 Ic(b,a){return n(Hc(b,a,"index"))} function Jc(b,a){var c=2<=arguments.length;return function(d){return d.pipe(b?M(function(a,c){return b(a,c,d)}):E,ba(1),c?ua(a):va(function(){return new ca}))}}function Kc(b,a,c,d){return n(function(e,f){function h(a,c){var b=new p(function(a){v++;var b=c.subscribe(a);return function(){b.unsubscribe();0===--v&&n&&Q.unsubscribe()}});b.key=a;return b}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)},r=function(a){return g(function(c){return c.error(a)})}, v=0,n=!1,Q=new Lb(f,function(a){try{var e=b(a),g=k.get(e);if(!g){k.set(e,g=d?d():new B);var w=h(e,g);f.next(w);if(c){var v=m(g,function(){g.complete();null===v||void 0===v?void 0:v.unsubscribe()},void 0,void 0,function(){return k.delete(e)});Q.add(t(c(w)).subscribe(v))}}g.next(l?l(a):a)}catch(xe){r(xe)}},function(){return g(function(a){return a.complete()})},r,function(){return k.clear()},function(){n=!0;return 0===v});e.subscribe(Q)})}function Lc(){return n(function(b,a){b.subscribe(m(a,function(){a.next(!1); a.complete()},function(){a.next(!0);a.complete()}))})}function rb(b){return 0>=b?function(){return L}:n(function(a,c){var d=[];a.subscribe(m(c,function(a){d.push(a);bc?a:c})}function Pc(b,a,c){void 0===c&&(c=Infinity);if(q(a))return H(function(){return b},a,c);"number"===typeof a&&(c=a);return H(function(){return b}, c)}function Qc(b,a,c){void 0===c&&(c=Infinity);return n(function(d,e){var f=a;return eb(d,e,function(a,c){return b(f,a,c)},c,function(a){f=a},!1,void 0,function(){return f=null})})}function Rc(){for(var b=[],a=0;ab(a,c)?a:c}:function(a,c){return a=c?function(){return L}:n(function(a,b){var e=0,f,k=function(){null===f||void 0===f?void 0:f.unsubscribe();f=null;if(null!=d){var a="number"===typeof d?Z(d):t(d(e)),c=m(b,function(){c.unsubscribe();g()});a.subscribe(c)}else g()},g=function(){var d=!1;f=a.subscribe(m(b,void 0,function(){++e= c?E:n(function(a,b){var f=0,h,g=function(){var l=!1;h=a.subscribe(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(m(c,function(a){var f=e++;if(fe){null===(b=null===p||void 0===p?void 0:p.complete)||void 0===b?void 0:b.call(p);b=void 0;try{b=new xb(c,u,q,Od+"_"+c.type)}catch(ye){a.error(ye);return}a.next(b);a.complete()}else null===(d=null===p||void 0===p?void 0:p.error)||void 0===d?void 0:d.call(p,c),x(e)});e=q.user;d=q.method;h=q.async;e?u.open(d,k,h,e,q.password):u.open(d,k,h);h&&(u.timeout=q.timeout,u.responseType= q.responseType);"withCredentials"in u&&(u.withCredentials=q.withCredentials);for(r in f)f.hasOwnProperty(r)&&u.setRequestHeader(r,f[r]);c?u.send(c):u.send();return function(){u&&4!==u.readyState&&u.abort()}})}function Oe(b,a){var c;if(!b||"string"===typeof b||"undefined"!==typeof FormData&&b instanceof FormData||"undefined"!==typeof URLSearchParams&&b instanceof URLSearchParams||Ab(b,"ArrayBuffer")||Ab(b,"File")||Ab(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 Ab(b,a){return Qe.call(b)==="[object "+a+"]"}var Ta=function(b,a){Ta=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 Ta(b,a)},U=function(){U=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}(za),L=new p(function(b){return b.complete()}),$a=function(b){return b&&"number"===typeof b.length&&"function"!==typeof b},Za;Za="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";(function(b){b.NEXT="N";b.ERROR="E";b.COMPLETE="C"})(g.NotificationKind||(g.NotificationKind={}));var Pa=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 Ga(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 q(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?ab(b):"E"===a?Wb(function(){return d}):"C"===a?L: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}(),ca=R(function(b){return function(){b(this);this.name="EmptyError";this.message="no elements in sequence"}}),pb=R(function(b){return function(){b(this);this.name="ArgumentOutOfRangeError"; this.message="argument out of range"}}),kd=R(function(b){return function(a){b(this);this.name="NotFoundError";this.message=a}}),jd=R(function(b){return function(a){b(this);this.name="SequenceError";this.message=a}}),Xb=R(function(b){return function(a){void 0===a&&(a=null);b(this);this.message="Timeout has occurred";this.name="TimeoutError";this.info=a}}),le=Array.isArray,me=Array.isArray,ne=Object.getPrototypeOf,oe=Object.prototype,pe=Object.keys,$e={connector:function(){return new B},resetOnDisconnect:!0}, te=["addListener","removeListener"],re=["addEventListener","removeEventListener"],ve=["on","off"],Vd=new p(D),we=Array.isArray,Ae=function(b,a){return b.push(a),b},Ce={connector:function(){return new B}},wd={leading:!0,trailing:!1},Fe=function(){return function(b,a){this.value=b;this.interval=a}}(),af=Object.freeze({audit:ib,auditTime:ic,buffer:jc,bufferCount:kc,bufferTime:lc,bufferToggle:mc,bufferWhen:nc,catchError:jb,combineAll:Ka,combineLatestAll:Ka,combineLatest:lb,combineLatestWith:qc,concat:sc, concatAll:Ia,concatMap:La,concatMapTo:rc,concatWith:tc,connect:Ma,count:uc,debounce:vc,debounceTime:wc,defaultIfEmpty:ua,delay:xc,delayWhen:Na,dematerialize:yc,distinct:zc,distinctUntilChanged:ob,distinctUntilKeyChanged:Ac,elementAt:Bc,endWith:Cc,every:Dc,exhaust:Oa,exhaustAll:Oa,exhaustMap:qb,expand:Ec,filter:M,finalize:Fc,find:Gc,findIndex:Ic,first:Jc,groupBy:Kc,ignoreElements:mb,isEmpty:Lc,last:Mc,map:P,mapTo:nb,materialize:Nc,max:Oc,merge:Rc,mergeAll:sa,flatMap:H,mergeMap:H,mergeMapTo:Pc,mergeScan:Qc, mergeWith:Sc,min:Tc,multicast:Qa,observeOn:qa,onErrorResumeNext:fc,pairwise:Uc,partition:function(b,a){return function(c){return[M(b,a)(c),M(gc(b,a))(c)]}},pluck:Vc,publish:Wc,publishBehavior:Xc,publishLast:Zc,publishReplay:$c,race:function(){for(var b=[],a=0;ak?new Ba(l):new Ba(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=z([],x(a)),h=d.length,m=[];a=g?a.replace(/^[ ]+/,"").indexOf("^"):a.indexOf("^");var n=-1===a?0:a*-this.frameTimeFactor,q="object"!==typeof b?function(a){return a}:function(a){return f&&b[a]instanceof Gb?b[a].messages:b[a]},p=-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 "(":p=n;f(1);break;case ")":p=-1;f(1);break;case "|":h=ya;f(1);break;case "^":f(1);break;case "#":h=J("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]),r=void 0;switch(l[2]){case "ms":r=k;break;case "s":r=1E3*k;break;case "m":r=6E4*k}f(r/u.frameTimeFactor);break}}h=J("N",q(k),void 0);f(1)}h&&m.push({frame:-1=a)return L;var d=a+b;return new p(c?function(a){var e=b;return c.schedule(function(){e