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IAGJ,IAAMI,EAAM,CACRC,OAAQ,SAASpC,EAAUC,EAAM19B,EAAGxM,EAAGwN,EAAG28B,EAAOmC,GAC7C,OAAO,IAAI/mB,SAAQ,SAASvE,EAASD,GACjC,IAAIwrB,EAAe,EACfD,GAAoBA,EAAiB,GACzClB,EAAQnB,EAAUC,EAAM19B,EAAGxM,EAAGwN,EAAG28B,GAAO,SAASvxB,EAAO4zB,EAAUpuB,GAC9D,GAAIxF,EACAmI,EAAOnI,QACJ,GAAIwF,EACHkuB,GAAqC,IAAjBC,GACpBD,EAAiB,GAErBtrB,EAAQ,IAAIljB,WAAWsgB,SACpB,GAAIkuB,GAAoBE,IAAaD,EAExC,OADAA,EAAeC,EACRF,EAAiBE,UAKxCC,WAAY,SAASxC,EAAUC,EAAM19B,EAAGxM,EAAGwN,EAAG28B,GAC1C,OAAO,IAAIrsC,WAAWstC,EAAQnB,EAAUC,EAAM19B,EAAGxM,EAAGwN,EAAG28B,MAM5DvuC,EAAOC,QAAUuwC,EAldxB,qCCmBA,IAfA,WACI,IAMIM,EAFJ,OAJgBC,UAAUC,eACtB,WAAWC,KAAKF,UAAUG,aACzB,iBAAiBD,KAAKF,UAAUG,YAEnBC,UAAUC,UAGrB,IAAIznB,SAAQ,SAAUvE,GACzB,IAAIisB,EAAS,WAAc,OAAOF,UAAUC,YAAYE,QAAQlsB,IAChE0rB,EAAalhB,YAAYyhB,EAAQ,KACjCA,OACDC,SAAQ,WAAc,OAAOzhB,cAAcihB,MANnCnnB,QAAQvE","sources":["../node_modules/ripemd160/index.js","../node_modules/rlp/src/index.ts","../node_modules/rlp/node_modules/bn.js/lib/bn.js","../node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts","../node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts","../node_modules/rxjs/src/internal/scheduler/animationFrame.ts","../node_modules/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts","../node_modules/rxjs/src/internal/util/isObservable.ts","../node_modules/rxjs/src/internal/observable/bindCallback.ts","../node_modules/rxjs/src/internal/observable/bindNodeCallback.ts","../node_modules/rxjs/src/internal/observable/forkJoin.ts","../node_modules/rxjs/src/internal/observable/fromEvent.ts","../node_modules/rxjs/src/internal/observable/fromEventPattern.ts","../node_modules/rxjs/src/internal/observable/generate.ts","../node_modules/rxjs/src/internal/observable/iif.ts","../node_modules/rxjs/src/internal/observable/interval.ts","../node_modules/rxjs/src/internal/observable/never.ts","../node_modules/rxjs/src/internal/observable/onErrorResumeNext.ts","../node_modules/rxjs/src/internal/observable/pairs.ts","../node_modules/rxjs/src/internal/observable/partition.ts","../node_modules/rxjs/src/internal/observable/range.ts","../node_modules/rxjs/src/internal/observable/using.ts","../node_modules/rxjs/src/internal/AsyncSubject.ts","../node_modules/rxjs/src/internal/BehaviorSubject.ts","../node_modules/rxjs/src/internal/Notification.ts","../node_modules/rxjs/src/internal/Observable.ts","../node_modules/rxjs/src/internal/util/toSubscriber.ts","../node_modules/rxjs/src/internal/Observer.ts","../node_modules/rxjs/src/internal/OuterSubscriber.ts","../node_modules/rxjs/src/internal/ReplaySubject.ts","../node_modules/rxjs/src/internal/Scheduler.ts","../node_modules/rxjs/src/internal/Subject.ts","../node_modules/rxjs/src/internal/SubjectSubscription.ts","../node_modules/rxjs/src/internal/Subscriber.ts","../node_modules/rxjs/src/internal/Subscription.ts","../node_modules/rxjs/src/internal/config.ts","../node_modules/rxjs/src/internal/innerSubscribe.ts","../node_modules/rxjs/src/internal/observable/ConnectableObservable.ts","../node_modules/rxjs/src/internal/observable/combineLatest.ts","../node_modules/rxjs/src/internal/observable/concat.ts","../node_modules/rxjs/src/internal/observable/defer.ts","../node_modules/rxjs/src/internal/observable/empty.ts","../node_modules/rxjs/src/internal/observable/from.ts","../node_modules/rxjs/src/internal/observable/fromArray.ts","../node_modules/rxjs/src/internal/observable/merge.ts","../node_modules/rxjs/src/internal/observable/of.ts","../node_modules/rxjs/src/internal/observable/race.ts","../node_modules/rxjs/src/internal/observable/throwError.ts","../node_modules/rxjs/src/internal/observable/timer.ts","../node_modules/rxjs/src/internal/observable/zip.ts","../node_modules/rxjs/src/internal/operators/concatAll.ts","../node_modules/rxjs/src/internal/operators/filter.ts","../node_modules/rxjs/src/internal/operators/groupBy.ts","../node_modules/rxjs/src/internal/operators/map.ts","../node_modules/rxjs/src/internal/operators/mergeAll.ts","../node_modules/rxjs/src/internal/operators/mergeMap.ts","../node_modules/rxjs/src/internal/operators/observeOn.ts","../node_modules/rxjs/src/internal/operators/refCount.ts","../node_modules/rxjs/src/internal/scheduled/scheduleArray.ts","../node_modules/rxjs/src/internal/scheduled/scheduled.ts","../node_modules/rxjs/src/internal/util/isInteropObservable.ts","../node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts","../node_modules/rxjs/src/internal/scheduled/schedulePromise.ts","../node_modules/rxjs/src/internal/util/isIterable.ts","../node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts","../node_modules/rxjs/src/internal/scheduler/AsyncAction.ts","../node_modules/rxjs/src/internal/scheduler/Action.ts","../node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts","../node_modules/rxjs/src/internal/util/Immediate.ts","../node_modules/rxjs/src/internal/scheduler/AsapAction.ts","../node_modules/rxjs/src/internal/scheduler/AsapScheduler.ts","../node_modules/rxjs/src/internal/scheduler/asap.ts","../node_modules/rxjs/src/internal/scheduler/async.ts","../node_modules/rxjs/src/internal/scheduler/QueueAction.ts","../node_modules/rxjs/src/internal/scheduler/QueueScheduler.ts","../node_modules/rxjs/src/internal/scheduler/queue.ts","../node_modules/rxjs/src/internal/symbol/iterator.ts","../node_modules/rxjs/src/internal/symbol/rxSubscriber.ts","../node_modules/rxjs/src/internal/util/ArgumentOutOfRangeError.ts","../node_modules/rxjs/src/internal/util/EmptyError.ts","../node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts","../node_modules/rxjs/src/internal/util/TimeoutError.ts","../node_modules/rxjs/src/internal/util/UnsubscriptionError.ts","../node_modules/rxjs/src/internal/util/canReportError.ts","../node_modules/rxjs/src/internal/util/hostReportError.ts","../node_modules/rxjs/src/internal/util/identity.ts","../node_modules/rxjs/src/internal/util/isFunction.ts","../node_modules/rxjs/src/internal/util/isNumeric.ts","../node_modules/rxjs/src/internal/util/isObject.ts","../node_modules/rxjs/src/internal/util/isPromise.ts","../node_modules/rxjs/src/internal/util/isScheduler.ts","../node_modules/rxjs/src/internal/util/not.ts","../node_modules/rxjs/src/internal/util/pipe.ts","../node_modules/rxjs/src/internal/util/subscribeTo.ts","../node_modules/rxjs/src/internal/util/subscribeToObservable.ts","../node_modules/rxjs/src/internal/util/subscribeToPromise.ts","../node_modules/rxjs/src/internal/util/subscribeToIterable.ts","../node_modules/rxjs/src/internal/util/subscribeToArray.ts","../node_modules/rxjs/src/internal/InnerSubscriber.ts","../node_modules/rxjs/src/internal/util/subscribeToResult.ts","../node_modules/rxjs/src/internal/operators/audit.ts","../node_modules/rxjs/src/internal/operators/auditTime.ts","../node_modules/rxjs/src/internal/operators/buffer.ts","../node_modules/rxjs/src/internal/operators/bufferCount.ts","../node_modules/rxjs/src/internal/operators/bufferTime.ts","../node_modules/rxjs/src/internal/operators/bufferToggle.ts","../node_modules/rxjs/src/internal/operators/bufferWhen.ts","../node_modules/rxjs/src/internal/operators/catchError.ts","../node_modules/rxjs/src/internal/operators/combineAll.ts","../node_modules/rxjs/src/internal/operators/combineLatest.ts","../node_modules/rxjs/src/internal/operators/concat.ts","../node_modules/rxjs/src/internal/operators/concatMap.ts","../node_modules/rxjs/src/internal/operators/concatMapTo.ts","../node_modules/rxjs/src/internal/operators/count.ts","../node_modules/rxjs/src/internal/operators/debounce.ts","../node_modules/rxjs/src/internal/operators/debounceTime.ts","../node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts","../node_modules/rxjs/src/internal/util/isDate.ts","../node_modules/rxjs/src/internal/operators/delay.ts","../node_modules/rxjs/src/internal/operators/delayWhen.ts","../node_modules/rxjs/src/internal/operators/dematerialize.ts","../node_modules/rxjs/src/internal/operators/distinct.ts","../node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts","../node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts","../node_modules/rxjs/src/internal/operators/throwIfEmpty.ts","../node_modules/rxjs/src/internal/operators/take.ts","../node_modules/rxjs/src/internal/operators/elementAt.ts","../node_modules/rxjs/src/internal/operators/endWith.ts","../node_modules/rxjs/src/internal/operators/every.ts","../node_modules/rxjs/src/internal/operators/exhaust.ts","../node_modules/rxjs/src/internal/operators/exhaustMap.ts","../node_modules/rxjs/src/internal/operators/expand.ts","../node_modules/rxjs/src/internal/operators/finalize.ts","../node_modules/rxjs/src/internal/operators/find.ts","../node_modules/rxjs/src/internal/operators/findIndex.ts","../node_modules/rxjs/src/internal/operators/first.ts","../node_modules/rxjs/src/internal/operators/ignoreElements.ts","../node_modules/rxjs/src/internal/operators/isEmpty.ts","../node_modules/rxjs/src/internal/operators/takeLast.ts","../node_modules/rxjs/src/internal/operators/last.ts","../node_modules/rxjs/src/internal/operators/mapTo.ts","../node_modules/rxjs/src/internal/operators/materialize.ts","../node_modules/rxjs/src/internal/operators/scan.ts","../node_modules/rxjs/src/internal/operators/reduce.ts","../node_modules/rxjs/src/internal/operators/max.ts","../node_modules/rxjs/src/internal/operators/merge.ts","../node_modules/rxjs/src/internal/operators/mergeMapTo.ts","../node_modules/rxjs/src/internal/operators/mergeScan.ts","../node_modules/rxjs/src/internal/operators/min.ts","../node_modules/rxjs/src/internal/operators/multicast.ts","../node_modules/rxjs/src/internal/operators/onErrorResumeNext.ts","../node_modules/rxjs/src/internal/operators/pairwise.ts","../node_modules/rxjs/src/internal/operators/partition.ts","../node_modules/rxjs/src/internal/operators/pluck.ts","../node_modules/rxjs/src/internal/operators/publish.ts","../node_modules/rxjs/src/internal/operators/publishBehavior.ts","../node_modules/rxjs/src/internal/operators/publishLast.ts","../node_modules/rxjs/src/internal/operators/publishReplay.ts","../node_modules/rxjs/src/internal/operators/race.ts","../node_modules/rxjs/src/internal/operators/repeat.ts","../node_modules/rxjs/src/internal/operators/repeatWhen.ts","../node_modules/rxjs/src/internal/operators/retry.ts","../node_modules/rxjs/src/internal/operators/retryWhen.ts","../node_modules/rxjs/src/internal/operators/sample.ts","../node_modules/rxjs/src/internal/operators/sampleTime.ts","../node_modules/rxjs/src/internal/operators/sequenceEqual.ts","../node_modules/rxjs/src/internal/operators/share.ts","../node_modules/rxjs/src/internal/operators/shareReplay.ts","../node_modules/rxjs/src/internal/operators/single.ts","../node_modules/rxjs/src/internal/operators/skip.ts","../node_modules/rxjs/src/internal/operators/skipLast.ts","../node_modules/rxjs/src/internal/operators/skipUntil.ts","../node_modules/rxjs/src/internal/operators/skipWhile.ts","../node_modules/rxjs/src/internal/operators/startWith.ts","../node_modules/rxjs/src/internal/observable/SubscribeOnObservable.ts","../node_modules/rxjs/src/internal/operators/subscribeOn.ts","../node_modules/rxjs/src/internal/operators/switchMap.ts","../node_modules/rxjs/src/internal/operators/switchAll.ts","../node_modules/rxjs/src/internal/operators/switchMapTo.ts","../node_modules/rxjs/src/internal/operators/takeUntil.ts","../node_modules/rxjs/src/internal/operators/takeWhile.ts","../node_modules/rxjs/src/internal/operators/tap.ts","../node_modules/rxjs/src/internal/operators/throttle.ts","../node_modules/rxjs/src/internal/operators/throttleTime.ts","../node_modules/rxjs/src/internal/operators/timeInterval.ts","../node_modules/rxjs/src/internal/operators/timeoutWith.ts","../node_modules/rxjs/src/internal/operators/timeout.ts","../node_modules/rxjs/src/internal/operators/timestamp.ts","../node_modules/rxjs/src/internal/operators/toArray.ts","../node_modules/rxjs/src/internal/operators/window.ts","../node_modules/rxjs/src/internal/operators/windowCount.ts","../node_modules/rxjs/src/internal/operators/windowTime.ts","../node_modules/rxjs/src/internal/operators/windowToggle.ts","../node_modules/rxjs/src/internal/operators/windowWhen.ts","../node_modules/rxjs/src/internal/operators/withLatestFrom.ts","../node_modules/rxjs/src/internal/operators/zip.ts","../node_modules/rxjs/src/internal/operators/zipAll.ts","../node_modules/rxjs/node_modules/tslib/tslib.es6.js","../node_modules/safe-buffer/index.js","../node_modules/safer-buffer/safer.js","../node_modules/scheduler/cjs/scheduler.production.min.js","../node_modules/scheduler/index.js","../node_modules/scrypt-js/scrypt.js","../node_modules/safari-14-idb-fix/dist/index.js"],"sourcesContent":["'use strict'\nvar Buffer = require('buffer').Buffer\nvar inherits = require('inherits')\nvar HashBase = require('hash-base')\n\nvar ARRAY16 = new Array(16)\n\nvar zl = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n]\n\nvar zr = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n]\n\nvar sl = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n]\n\nvar sr = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n]\n\nvar hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]\nvar hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]\n\nfunction RIPEMD160 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n}\n\ninherits(RIPEMD160, HashBase)\n\nRIPEMD160.prototype._update = function () {\n var words = ARRAY16\n for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)\n\n var al = this._a | 0\n var bl = this._b | 0\n var cl = this._c | 0\n var dl = this._d | 0\n var el = this._e | 0\n\n var ar = this._a | 0\n var br = this._b | 0\n var cr = this._c | 0\n var dr = this._d | 0\n var er = this._e | 0\n\n // computation\n for (var i = 0; i < 80; i += 1) {\n var tl\n var tr\n if (i < 16) {\n tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])\n tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])\n } else if (i < 32) {\n tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])\n tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])\n } else if (i < 48) {\n tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])\n tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])\n } else if (i < 64) {\n tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])\n tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])\n } else { // if (i<80) {\n tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])\n tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])\n }\n\n al = el\n el = dl\n dl = rotl(cl, 10)\n cl = bl\n bl = tl\n\n ar = er\n er = dr\n dr = rotl(cr, 10)\n cr = br\n br = tr\n }\n\n // update state\n var t = (this._b + cl + dr) | 0\n this._b = (this._c + dl + er) | 0\n this._c = (this._d + el + ar) | 0\n this._d = (this._e + al + br) | 0\n this._e = (this._a + bl + cr) | 0\n this._a = t\n}\n\nRIPEMD160.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n buffer.writeInt32LE(this._e, 16)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fn1 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn2 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn3 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn4 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn5 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0\n}\n\nmodule.exports = RIPEMD160\n","import BN from 'bn.js'\n\nimport { Decoded, Input, List } from './types'\n\n// Types exported outside of this package\nexport { Decoded, Input, List }\n\n/**\n * RLP Encoding based on: https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP\n * This function takes in a data, convert it to buffer if not, and a length for recursion\n * @param input - will be converted to buffer\n * @returns returns buffer of encoded data\n **/\nexport function encode(input: Input): Buffer {\n if (Array.isArray(input)) {\n const output: Buffer[] = []\n for (let i = 0; i < input.length; i++) {\n output.push(encode(input[i]))\n }\n const buf = Buffer.concat(output)\n return Buffer.concat([encodeLength(buf.length, 192), buf])\n } else {\n const inputBuf = toBuffer(input)\n return inputBuf.length === 1 && inputBuf[0] < 128\n ? inputBuf\n : Buffer.concat([encodeLength(inputBuf.length, 128), inputBuf])\n }\n}\n\n/**\n * Parse integers. Check if there is no leading zeros\n * @param v The value to parse\n * @param base The base to parse the integer into\n */\nfunction safeParseInt(v: string, base: number): number {\n if (v[0] === '0' && v[1] === '0') {\n throw new Error('invalid RLP: extra zeros')\n }\n\n return parseInt(v, base)\n}\n\nfunction encodeLength(len: number, offset: number): Buffer {\n if (len < 56) {\n return Buffer.from([len + offset])\n } else {\n const hexLength = intToHex(len)\n const lLength = hexLength.length / 2\n const firstByte = intToHex(offset + 55 + lLength)\n return Buffer.from(firstByte + hexLength, 'hex')\n }\n}\n\n/**\n * RLP Decoding based on: {@link https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP|RLP}\n * @param input - will be converted to buffer\n * @param stream - Is the input a stream (false by default)\n * @returns - returns decode Array of Buffers containg the original message\n **/\nexport function decode(input: Buffer, stream?: boolean): Buffer\nexport function decode(input: Buffer[], stream?: boolean): Buffer[]\nexport function decode(input: Input, stream?: boolean): Buffer[] | Buffer | Decoded\nexport function decode(input: Input, stream: boolean = false): Buffer[] | Buffer | Decoded {\n if (!input || (input as any).length === 0) {\n return Buffer.from([])\n }\n\n const inputBuffer = toBuffer(input)\n const decoded = _decode(inputBuffer)\n\n if (stream) {\n return decoded\n }\n if (decoded.remainder.length !== 0) {\n throw new Error('invalid remainder')\n }\n\n return decoded.data\n}\n\n/**\n * Get the length of the RLP input\n * @param input\n * @returns The length of the input or an empty Buffer if no input\n */\nexport function getLength(input: Input): Buffer | number {\n if (!input || (input as any).length === 0) {\n return Buffer.from([])\n }\n\n const inputBuffer = toBuffer(input)\n const firstByte = inputBuffer[0]\n\n if (firstByte <= 0x7f) {\n return inputBuffer.length\n } else if (firstByte <= 0xb7) {\n return firstByte - 0x7f\n } else if (firstByte <= 0xbf) {\n return firstByte - 0xb6\n } else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n return firstByte - 0xbf\n } else {\n // a list over 55 bytes long\n const llength = firstByte - 0xf6\n const length = safeParseInt(inputBuffer.slice(1, llength).toString('hex'), 16)\n return llength + length\n }\n}\n\n/** Decode an input with RLP */\nfunction _decode(input: Buffer): Decoded {\n let length, llength, data, innerRemainder, d\n const decoded = []\n const firstByte = input[0]\n\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n }\n } else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f\n\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([])\n } else {\n data = input.slice(1, length)\n }\n\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80')\n }\n\n return {\n data: data,\n remainder: input.slice(length),\n }\n } else if (firstByte <= 0xbf) {\n // string is greater than 55 bytes long. A single byte with the value (0xb7 plus the length of the length),\n // followed by the length, followed by the string\n llength = firstByte - 0xb6\n if (input.length - 1 < llength) {\n throw new Error('invalid RLP: not enough bytes for string length')\n }\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16)\n if (length <= 55) {\n throw new Error('invalid RLP: expected string length to be greater than 55')\n }\n data = input.slice(llength, length + llength)\n if (data.length < length) {\n throw new Error('invalid RLP: not enough bytes for string')\n }\n\n return {\n data: data,\n remainder: input.slice(length + llength),\n }\n } else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf\n innerRemainder = input.slice(1, length)\n while (innerRemainder.length) {\n d = _decode(innerRemainder)\n decoded.push(d.data as Buffer)\n innerRemainder = d.remainder\n }\n\n return {\n data: decoded,\n remainder: input.slice(length),\n }\n } else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16)\n const totalLength = llength + length\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data')\n }\n\n innerRemainder = input.slice(llength, totalLength)\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length')\n }\n\n while (innerRemainder.length) {\n d = _decode(innerRemainder)\n decoded.push(d.data as Buffer)\n innerRemainder = d.remainder\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n }\n }\n}\n\n/** Check if a string is prefixed by 0x */\nfunction isHexPrefixed(str: string): boolean {\n return str.slice(0, 2) === '0x'\n}\n\n/** Removes 0x from a given String */\nfunction stripHexPrefix(str: string): string {\n if (typeof str !== 'string') {\n return str\n }\n return isHexPrefixed(str) ? str.slice(2) : str\n}\n\n/** Transform an integer into its hexadecimal value */\nfunction intToHex(integer: number | bigint): string {\n if (integer < 0) {\n throw new Error('Invalid integer as argument, must be unsigned!')\n }\n const hex = integer.toString(16)\n return hex.length % 2 ? `0${hex}` : hex\n}\n\n/** Pad a string to be even */\nfunction padToEven(a: string): string {\n return a.length % 2 ? `0${a}` : a\n}\n\n/** Transform an integer into a Buffer */\nfunction intToBuffer(integer: number | bigint): Buffer {\n const hex = intToHex(integer)\n return Buffer.from(hex, 'hex')\n}\n\n/** Transform anything into a Buffer */\nfunction toBuffer(v: Input): Buffer {\n if (!Buffer.isBuffer(v)) {\n if (typeof v === 'string') {\n if (isHexPrefixed(v)) {\n return Buffer.from(padToEven(stripHexPrefix(v)), 'hex')\n } else {\n return Buffer.from(v)\n }\n } else if (typeof v === 'number' || typeof v === 'bigint') {\n if (!v) {\n return Buffer.from([])\n } else {\n return intToBuffer(v)\n }\n } else if (v === null || v === undefined) {\n return Buffer.from([])\n } else if (v instanceof Uint8Array) {\n return Buffer.from(v as any)\n } else if (BN.isBN(v)) {\n // converts a BN to a Buffer\n return Buffer.from(v.toArray())\n } else {\n throw new Error('invalid type')\n }\n }\n return v\n}\n","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","import { AsyncAction } from './AsyncAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nimport { SchedulerAction } from '../types';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AnimationFrameAction extends AsyncAction {\n\n constructor(protected scheduler: AnimationFrameScheduler,\n protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: any, delay: number = 0): any {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If an animation frame has already been requested, don't request another\n // one. If an animation frame hasn't been requested yet, request one. Return\n // the current animation frame request id.\n return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(\n () => scheduler.flush(null)));\n }\n protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue is empty, cancel the requested animation frame and\n // set the scheduled flag to undefined so the next AnimationFrameAction will\n // request its own.\n if (scheduler.actions.length === 0) {\n cancelAnimationFrame(id);\n scheduler.scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AnimationFrameScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction): void {\n\n this.active = true;\n this.scheduled = undefined;\n\n const {actions} = this;\n let error: any;\n let index: number = -1;\n let count: number = actions.length;\n action = action || actions.shift();\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n\n this.active = false;\n\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\n\n/**\n *\n * Animation Frame Scheduler\n *\n * Perform task when `window.requestAnimationFrame` would fire\n *\n * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler\n * behaviour.\n *\n * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.\n * It makes sure scheduled task will happen just before next browser content repaint,\n * thus performing animations as efficiently as possible.\n *\n * ## Example\n * Schedule div height animation\n * ```ts\n * // html:
\n * import { animationFrameScheduler } from 'rxjs';\n *\n * const div = document.querySelector('div');\n *\n * animationFrameScheduler.schedule(function(height) {\n * div.style.height = height + \"px\";\n *\n * this.schedule(height + 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * }, 0, 0);\n *\n * // You will see a div element growing in height\n * ```\n */\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\n\n/**\n * @deprecated renamed. Use {@link animationFrameScheduler}\n */\nexport const animationFrame = animationFrameScheduler;\n","import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\nimport { SchedulerAction } from '../types';\n\nexport class VirtualTimeScheduler extends AsyncScheduler {\n\n protected static frameTimeFactor: number = 10;\n\n public frame: number = 0;\n public index: number = -1;\n\n constructor(SchedulerAction: typeof AsyncAction = VirtualAction as any,\n public maxFrames: number = Number.POSITIVE_INFINITY) {\n super(SchedulerAction, () => this.frame);\n }\n\n /**\n * Prompt the Scheduler to execute all of its queued actions, therefore\n * clearing its queue.\n * @return {void}\n */\n public flush(): void {\n\n const {actions, maxFrames} = this;\n let error: any, action: AsyncAction;\n\n while ((action = actions[0]) && action.delay <= maxFrames) {\n actions.shift();\n this.frame = action.delay;\n\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n }\n\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @nodoc\n */\nexport class VirtualAction extends AsyncAction {\n\n protected active: boolean = true;\n\n constructor(protected scheduler: VirtualTimeScheduler,\n protected work: (this: SchedulerAction, state?: T) => void,\n protected index: number = scheduler.index += 1) {\n super(scheduler, work);\n this.index = scheduler.index = index;\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (!this.id) {\n return super.schedule(state, delay);\n }\n this.active = false;\n // If an action is rescheduled, we save allocations by mutating its state,\n // pushing it to the end of the scheduler queue, and recycling the action.\n // But since the VirtualTimeScheduler is used for testing, VirtualActions\n // must be immutable so they can be inspected later.\n const action = new VirtualAction(this.scheduler, this.work);\n this.add(action);\n return action.schedule(state, delay);\n }\n\n protected requestAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any {\n this.delay = scheduler.frame + delay;\n const {actions} = scheduler;\n actions.push(this);\n (actions as Array>).sort(VirtualAction.sortActions);\n return true;\n }\n\n protected recycleAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any {\n return undefined;\n }\n\n protected _execute(state: T, delay: number): any {\n if (this.active === true) {\n return super._execute(state, delay);\n }\n }\n\n public static sortActions(a: VirtualAction, b: VirtualAction) {\n if (a.delay === b.delay) {\n if (a.index === b.index) {\n return 0;\n } else if (a.index > b.index) {\n return 1;\n } else {\n return -1;\n }\n } else if (a.delay > b.delay) {\n return 1;\n } else {\n return -1;\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput } from '../types';\n\n/**\n * Tests to see if the object is an RxJS {@link Observable}\n * @param obj the object to test\n */\nexport function isObservable(obj: any): obj is Observable {\n return !!obj && (obj instanceof Observable || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}\n","import { SchedulerLike, SchedulerAction } from '../types';\nimport { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { Subscriber } from '../Subscriber';\nimport { map } from '../operators/map';\nimport { canReportError } from '../util/canReportError';\nimport { isArray } from '../util/isArray';\nimport { isScheduler } from '../util/isScheduler';\n\n// tslint:disable:max-line-length\n/** @deprecated resultSelector is no longer supported, use a mapping function. */\nexport function bindCallback(callbackFunc: Function, resultSelector: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable;\n\nexport function bindCallback(callbackFunc: (callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): () => Observable;\nexport function bindCallback(callbackFunc: (callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2, R3]>;\nexport function bindCallback(callbackFunc: (callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2]>;\nexport function bindCallback(callbackFunc: (callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): () => Observable;\nexport function bindCallback(callbackFunc: (callback: () => any) => any, scheduler?: SchedulerLike): () => Observable;\n\nexport function bindCallback(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2, R3]>;\nexport function bindCallback(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2]>;\nexport function bindCallback(callbackFunc: (arg1: A1, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable;\n\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2, R3]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable;\n\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2, R3]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable;\n\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2, R3]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable;\n\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2, R3]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2]>;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable;\nexport function bindCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable;\n\nexport function bindCallback(callbackFunc: (...args: Array any)>) => any, scheduler?: SchedulerLike): (...args: A[]) => Observable;\nexport function bindCallback(callbackFunc: (...args: Array any)>) => any, scheduler?: SchedulerLike): (...args: A[]) => Observable;\n\nexport function bindCallback(callbackFunc: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable;\n\n// tslint:enable:max-line-length\n\n/**\n * Converts a callback API to a function that returns an Observable.\n *\n * Give it a function `f` of type `f(x, callback)` and\n * it will return a function `g` that when called as `g(x)` will output an\n * Observable.\n *\n * `bindCallback` is not an operator because its input and output are not\n * Observables. The input is a function `func` with some parameters. The\n * last parameter must be a callback function that `func` calls when it is\n * done.\n *\n * The output of `bindCallback` is a function that takes the same parameters\n * as `func`, except the last one (the callback). When the output function\n * is called with arguments it will return an Observable. If function `func`\n * calls its callback with one argument, the Observable will emit that value.\n * If on the other hand the callback is called with multiple values the resulting\n * Observable will emit an array with said values as arguments.\n *\n * It is **very important** to remember that input function `func` is not called\n * when the output function is, but rather when the Observable returned by the output\n * function is subscribed. This means if `func` makes an AJAX request, that request\n * will be made every time someone subscribes to the resulting Observable, but not before.\n *\n * The last optional parameter - `scheduler` - can be used to control when the call\n * to `func` happens after someone subscribes to Observable, as well as when results\n * passed to callback will be emitted. By default, the subscription to an Observable calls `func`\n * synchronously, but using {@link asyncScheduler} as the last parameter will defer the call to `func`,\n * just like wrapping the call in `setTimeout` with a timeout of `0` would. If you were to use the async Scheduler\n * and call `subscribe` on the output Observable, all function calls that are currently executing\n * will end before `func` is invoked.\n *\n * By default, results passed to the callback are emitted immediately after `func` invokes the callback.\n * In particular, if the callback is called synchronously, then the subscription of the resulting Observable\n * will call the `next` function synchronously as well. If you want to defer that call,\n * you may use {@link asyncScheduler} just as before. This means that by using `Scheduler.async` you can\n * ensure that `func` always calls its callback asynchronously, thus avoiding terrifying Zalgo.\n *\n * Note that the Observable created by the output function will always emit a single value\n * and then complete immediately. If `func` calls the callback multiple times, values from subsequent\n * calls will not appear in the stream. If you need to listen for multiple calls,\n * you probably want to use {@link fromEvent} or {@link fromEventPattern} instead.\n *\n * If `func` depends on some context (`this` property) and is not already bound, the context of `func`\n * will be the context that the output function has at call time. In particular, if `func`\n * is called as a method of some objec and if `func` is not already bound, in order to preserve the context\n * it is recommended that the context of the output function is set to that object as well.\n *\n * If the input function calls its callback in the \"node style\" (i.e. first argument to callback is\n * optional error parameter signaling whether the call failed or not), {@link bindNodeCallback}\n * provides convenient error handling and probably is a better choice.\n * `bindCallback` will treat such functions the same as any other and error parameters\n * (whether passed or not) will always be interpreted as regular callback argument.\n *\n * ## Examples\n *\n * ### Convert jQuery's getJSON to an Observable API\n * ```ts\n * import { bindCallback } from 'rxjs';\n * import * as jQuery from 'jquery';\n *\n * // Suppose we have jQuery.getJSON('/my/url', callback)\n * const getJSONAsObservable = bindCallback(jQuery.getJSON);\n * const result = getJSONAsObservable('/my/url');\n * result.subscribe(x => console.log(x), e => console.error(e));\n * ```\n *\n * ### Receive an array of arguments passed to a callback\n * ```ts\n * import { bindCallback } from 'rxjs';\n *\n * const someFunction = (a, b, c) => {\n * console.log(a); // 5\n * console.log(b); // 'some string'\n * console.log(c); // {someProperty: 'someValue'}\n * };\n *\n * const boundSomeFunction = bindCallback(someFunction);\n * boundSomeFunction().subscribe(values => {\n * console.log(values) // [5, 'some string', {someProperty: 'someValue'}]\n * });\n * ```\n *\n * ### Compare behaviour with and without async Scheduler\n * ```ts\n * import { bindCallback } from 'rxjs';\n *\n * function iCallMyCallbackSynchronously(cb) {\n * cb();\n * }\n *\n * const boundSyncFn = bindCallback(iCallMyCallbackSynchronously);\n * const boundAsyncFn = bindCallback(iCallMyCallbackSynchronously, null, Rx.Scheduler.async);\n *\n * boundSyncFn().subscribe(() => console.log('I was sync!'));\n * boundAsyncFn().subscribe(() => console.log('I was async!'));\n * console.log('This happened...');\n *\n * // Logs:\n * // I was sync!\n * // This happened...\n * // I was async!\n * ```\n *\n * ### Use bindCallback on an object method\n * ```ts\n * import { bindCallback } from 'rxjs';\n *\n * const boundMethod = bindCallback(someObject.methodWithCallback);\n * boundMethod.call(someObject) // make sure methodWithCallback has access to someObject\n * .subscribe(subscriber);\n * ```\n *\n * @see {@link bindNodeCallback}\n * @see {@link from}\n *\n * @param {function} func A function with a callback as the last parameter.\n * @param {SchedulerLike} [scheduler] The scheduler on which to schedule the\n * callbacks.\n * @return {function(...params: *): Observable} A function which returns the\n * Observable that delivers the same values the callback would deliver.\n * @name bindCallback\n */\nexport function bindCallback(\n callbackFunc: Function,\n resultSelector?: Function|SchedulerLike,\n scheduler?: SchedulerLike\n): (...args: any[]) => Observable {\n if (resultSelector) {\n if (isScheduler(resultSelector)) {\n scheduler = resultSelector;\n } else {\n // DEPRECATED PATH\n return (...args: any[]) => bindCallback(callbackFunc, scheduler)(...args).pipe(\n map((args) => isArray(args) ? resultSelector(...args) : resultSelector(args)),\n );\n }\n }\n\n return function (this: any, ...args: any[]): Observable {\n const context = this;\n let subject: AsyncSubject;\n const params = {\n context,\n subject,\n callbackFunc,\n scheduler,\n };\n return new Observable(subscriber => {\n if (!scheduler) {\n if (!subject) {\n subject = new AsyncSubject();\n const handler = (...innerArgs: any[]) => {\n subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);\n subject.complete();\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n if (canReportError(subject)) {\n subject.error(err);\n } else {\n console.warn(err);\n }\n }\n }\n return subject.subscribe(subscriber);\n } else {\n const state: DispatchState = {\n args, subscriber, params,\n };\n return scheduler.schedule>(dispatch, 0, state);\n }\n });\n };\n}\n\ninterface DispatchState {\n args: any[];\n subscriber: Subscriber;\n params: ParamsContext;\n}\n\ninterface ParamsContext {\n callbackFunc: Function;\n scheduler: SchedulerLike;\n context: any;\n subject: AsyncSubject;\n}\n\nfunction dispatch(this: SchedulerAction>, state: DispatchState) {\n const self = this;\n const { args, subscriber, params } = state;\n const { callbackFunc, context, scheduler } = params;\n let { subject } = params;\n if (!subject) {\n subject = params.subject = new AsyncSubject();\n\n const handler = (...innerArgs: any[]) => {\n const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;\n this.add(scheduler.schedule>(dispatchNext, 0, { value, subject }));\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n subject.error(err);\n }\n }\n\n this.add(subject.subscribe(subscriber));\n}\n\ninterface NextState {\n subject: AsyncSubject;\n value: T;\n}\n\nfunction dispatchNext(this: SchedulerAction>, state: NextState) {\n const { value, subject } = state;\n subject.next(value);\n subject.complete();\n}\n\ninterface ErrorState {\n subject: AsyncSubject;\n err: any;\n}\n\nfunction dispatchError(this: SchedulerAction>, state: ErrorState) {\n const { err, subject } = state;\n subject.error(err);\n}\n","import { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { Subscriber } from '../Subscriber';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { map } from '../operators/map';\nimport { canReportError } from '../util/canReportError';\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\n\n/* tslint:disable:max-line-length */\n/** @deprecated resultSelector is deprecated, pipe to map instead */\nexport function bindNodeCallback(callbackFunc: Function, resultSelector: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable;\n\nexport function bindNodeCallback(callbackFunc: (callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable;\nexport function bindNodeCallback(callbackFunc: (callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback(callbackFunc: (callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2]>;\nexport function bindNodeCallback(callbackFunc: (callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): () => Observable;\nexport function bindNodeCallback(callbackFunc: (callback: (err: any) => any) => any, scheduler?: SchedulerLike): () => Observable;\n\nexport function bindNodeCallback(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable;\n\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable;\n\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable;\n\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable;\n\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2, R3]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2]>;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable;\nexport function bindNodeCallback(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable; /* tslint:enable:max-line-length */\n\nexport function bindNodeCallback(callbackFunc: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable;\n/**\n * Converts a Node.js-style callback API to a function that returns an\n * Observable.\n *\n * It's just like {@link bindCallback}, but the\n * callback is expected to be of type `callback(error, result)`.\n *\n * `bindNodeCallback` is not an operator because its input and output are not\n * Observables. The input is a function `func` with some parameters, but the\n * last parameter must be a callback function that `func` calls when it is\n * done. The callback function is expected to follow Node.js conventions,\n * where the first argument to the callback is an error object, signaling\n * whether call was successful. If that object is passed to callback, it means\n * something went wrong.\n *\n * The output of `bindNodeCallback` is a function that takes the same\n * parameters as `func`, except the last one (the callback). When the output\n * function is called with arguments, it will return an Observable.\n * If `func` calls its callback with error parameter present, Observable will\n * error with that value as well. If error parameter is not passed, Observable will emit\n * second parameter. If there are more parameters (third and so on),\n * Observable will emit an array with all arguments, except first error argument.\n *\n * Note that `func` will not be called at the same time output function is,\n * but rather whenever resulting Observable is subscribed. By default call to\n * `func` will happen synchronously after subscription, but that can be changed\n * with proper `scheduler` provided as optional third parameter. {@link SchedulerLike}\n * can also control when values from callback will be emitted by Observable.\n * To find out more, check out documentation for {@link bindCallback}, where\n * {@link SchedulerLike} works exactly the same.\n *\n * As in {@link bindCallback}, context (`this` property) of input function will be set to context\n * of returned function, when it is called.\n *\n * After Observable emits value, it will complete immediately. This means\n * even if `func` calls callback again, values from second and consecutive\n * calls will never appear on the stream. If you need to handle functions\n * that call callbacks multiple times, check out {@link fromEvent} or\n * {@link fromEventPattern} instead.\n *\n * Note that `bindNodeCallback` can be used in non-Node.js environments as well.\n * \"Node.js-style\" callbacks are just a convention, so if you write for\n * browsers or any other environment and API you use implements that callback style,\n * `bindNodeCallback` can be safely used on that API functions as well.\n *\n * Remember that Error object passed to callback does not have to be an instance\n * of JavaScript built-in `Error` object. In fact, it does not even have to an object.\n * Error parameter of callback function is interpreted as \"present\", when value\n * of that parameter is truthy. It could be, for example, non-zero number, non-empty\n * string or boolean `true`. In all of these cases resulting Observable would error\n * with that value. This means usually regular style callbacks will fail very often when\n * `bindNodeCallback` is used. If your Observable errors much more often then you\n * would expect, check if callback really is called in Node.js-style and, if not,\n * switch to {@link bindCallback} instead.\n *\n * Note that even if error parameter is technically present in callback, but its value\n * is falsy, it still won't appear in array emitted by Observable.\n *\n * ## Examples\n * ### Read a file from the filesystem and get the data as an Observable\n * ```ts\n * import * as fs from 'fs';\n * const readFileAsObservable = bindNodeCallback(fs.readFile);\n * const result = readFileAsObservable('./roadNames.txt', 'utf8');\n * result.subscribe(x => console.log(x), e => console.error(e));\n * ```\n *\n * ### Use on function calling callback with multiple arguments\n * ```ts\n * someFunction((err, a, b) => {\n * console.log(err); // null\n * console.log(a); // 5\n * console.log(b); // \"some string\"\n * });\n * const boundSomeFunction = bindNodeCallback(someFunction);\n * boundSomeFunction()\n * .subscribe(value => {\n * console.log(value); // [5, \"some string\"]\n * });\n * ```\n *\n * ### Use on function calling callback in regular style\n * ```ts\n * someFunction(a => {\n * console.log(a); // 5\n * });\n * const boundSomeFunction = bindNodeCallback(someFunction);\n * boundSomeFunction()\n * .subscribe(\n * value => {} // never gets called\n * err => console.log(err) // 5\n * );\n * ```\n *\n * @see {@link bindCallback}\n * @see {@link from}\n *\n * @param {function} func Function with a Node.js-style callback as the last parameter.\n * @param {SchedulerLike} [scheduler] The scheduler on which to schedule the\n * callbacks.\n * @return {function(...params: *): Observable} A function which returns the\n * Observable that delivers the same values the Node.js callback would\n * deliver.\n * @name bindNodeCallback\n */\nexport function bindNodeCallback(\n callbackFunc: Function,\n resultSelector: Function|SchedulerLike,\n scheduler?: SchedulerLike\n): (...args: any[]) => Observable {\n\n if (resultSelector) {\n if (isScheduler(resultSelector)) {\n scheduler = resultSelector;\n } else {\n // DEPRECATED PATH\n return (...args: any[]) => bindNodeCallback(callbackFunc, scheduler)(...args).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n }\n\n return function(this: any, ...args: any[]): Observable {\n const params: ParamsState = {\n subject: undefined,\n args,\n callbackFunc,\n scheduler,\n context: this,\n };\n return new Observable(subscriber => {\n const { context } = params;\n let { subject } = params;\n if (!scheduler) {\n if (!subject) {\n subject = params.subject = new AsyncSubject();\n const handler = (...innerArgs: any[]) => {\n const err = innerArgs.shift();\n\n if (err) {\n subject.error(err);\n return;\n }\n\n subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);\n subject.complete();\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n if (canReportError(subject)) {\n subject.error(err);\n } else {\n console.warn(err);\n }\n }\n }\n return subject.subscribe(subscriber);\n } else {\n return scheduler.schedule>(dispatch, 0, { params, subscriber, context });\n }\n });\n };\n}\n\ninterface DispatchState {\n subscriber: Subscriber;\n context: any;\n params: ParamsState;\n}\n\ninterface ParamsState {\n callbackFunc: Function;\n args: any[];\n scheduler: SchedulerLike;\n subject: AsyncSubject;\n context: any;\n}\n\nfunction dispatch(this: SchedulerAction>, state: DispatchState) {\n const { params, subscriber, context } = state;\n const { callbackFunc, args, scheduler } = params;\n let subject = params.subject;\n\n if (!subject) {\n subject = params.subject = new AsyncSubject();\n\n const handler = (...innerArgs: any[]) => {\n const err = innerArgs.shift();\n if (err) {\n this.add(scheduler.schedule>(dispatchError, 0, { err, subject }));\n } else {\n const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;\n this.add(scheduler.schedule>(dispatchNext, 0, { value, subject }));\n }\n };\n\n try {\n callbackFunc.apply(context, [...args, handler]);\n } catch (err) {\n this.add(scheduler.schedule>(dispatchError, 0, { err, subject }));\n }\n }\n\n this.add(subject.subscribe(subscriber));\n}\n\ninterface DispatchNextArg {\n subject: AsyncSubject;\n value: T;\n}\n\nfunction dispatchNext(arg: DispatchNextArg) {\n const { value, subject } = arg;\n subject.next(value);\n subject.complete();\n}\n\ninterface DispatchErrorArg {\n subject: AsyncSubject;\n err: any;\n}\n\nfunction dispatchError(arg: DispatchErrorArg) {\n const { err, subject } = arg;\n subject.error(err);\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, ObservedValuesFromArray, ObservedValueOf, SubscribableOrPromise } from '../types';\nimport { isArray } from '../util/isArray';\nimport { map } from '../operators/map';\nimport { isObject } from '../util/isObject';\nimport { isObservable } from '../util/isObservable';\nimport { from } from './from';\n\n/* tslint:disable:max-line-length */\n\n// forkJoin(a$, b$, c$)\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin(v1: SubscribableOrPromise): Observable<[T]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin(v1: ObservableInput, v2: ObservableInput): Observable<[T, T2]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput): Observable<[T, T2, T3]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput): Observable<[T, T2, T3, T4]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput): Observable<[T, T2, T3, T4, T5]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput): Observable<[T, T2, T3, T4, T5, T6]>;\n\n// forkJoin([a$, b$, c$]);\n// TODO(benlesh): Uncomment for TS 3.0\n// export function forkJoin(sources: []): Observable;\nexport function forkJoin(sources: [ObservableInput]): Observable<[A]>;\nexport function forkJoin(sources: [ObservableInput, ObservableInput]): Observable<[A, B]>;\nexport function forkJoin(sources: [ObservableInput, ObservableInput, ObservableInput]): Observable<[A, B, C]>;\nexport function forkJoin(sources: [ObservableInput, ObservableInput, ObservableInput, ObservableInput]): Observable<[A, B, C, D]>;\nexport function forkJoin(sources: [ObservableInput, ObservableInput, ObservableInput, ObservableInput, ObservableInput]): Observable<[A, B, C, D, E]>;\nexport function forkJoin(sources: [ObservableInput, ObservableInput, ObservableInput, ObservableInput, ObservableInput, ObservableInput]): Observable<[A, B, C, D, E, F]>;\nexport function forkJoin[]>(sources: A): Observable[]>;\n\n// forkJoin({})\nexport function forkJoin(sourcesObject: {}): Observable;\nexport function forkJoin(sourcesObject: T): Observable<{ [K in keyof T]: ObservedValueOf }>;\n\n/** @deprecated resultSelector is deprecated, pipe to map instead */\nexport function forkJoin(...args: Array|Function>): Observable;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin(...sources: ObservableInput[]): Observable;\n/* tslint:enable:max-line-length */\n\n/**\n * Accepts an `Array` of {@link ObservableInput} or a dictionary `Object` of {@link ObservableInput} and returns\n * an {@link Observable} that emits either an array of values in the exact same order as the passed array,\n * or a dictionary of values in the same shape as the passed dictionary.\n *\n * Wait for Observables to complete and then combine last values they emitted.\n *\n * ![](forkJoin.png)\n *\n * `forkJoin` is an operator that takes any number of input observables which can be passed either as an array\n * or a dictionary of input observables. If no input observables are provided, resulting stream will complete\n * immediately.\n *\n * `forkJoin` will wait for all passed observables to complete and then it will emit an array or an object with last\n * values from corresponding observables.\n *\n * If you pass an array of `n` observables to the operator, resulting\n * array will have `n` values, where first value is the last thing emitted by the first observable,\n * second value is the last thing emitted by the second observable and so on.\n *\n * If you pass a dictionary of observables to the operator, resulting\n * objects will have the same keys as the dictionary passed, with their last values they've emitted\n * located at the corresponding key.\n *\n * That means `forkJoin` will not emit more than once and it will complete after that. If you need to emit combined\n * values not only at the end of lifecycle of passed observables, but also throughout it, try out {@link combineLatest}\n * or {@link zip} instead.\n *\n * In order for resulting array to have the same length as the number of input observables, whenever any of\n * that observables completes without emitting any value, `forkJoin` will complete at that moment as well\n * and it will not emit anything either, even if it already has some last values from other observables.\n * Conversely, if there is an observable that never completes, `forkJoin` will never complete as well,\n * unless at any point some other observable completes without emitting value, which brings us back to\n * the previous case. Overall, in order for `forkJoin` to emit a value, all observables passed as arguments\n * have to emit something at least once and complete.\n *\n * If any input observable errors at some point, `forkJoin` will error as well and all other observables\n * will be immediately unsubscribed.\n *\n * Optionally `forkJoin` accepts project function, that will be called with values which normally\n * would land in emitted array. Whatever is returned by project function, will appear in output\n * observable instead. This means that default project can be thought of as a function that takes\n * all its arguments and puts them into an array. Note that project function will be called only\n * when output observable is supposed to emit a result.\n *\n * ## Examples\n *\n * ### Use forkJoin with a dictionary of observable inputs\n * ```ts\n * import { forkJoin, of, timer } from 'rxjs';\n *\n * const observable = forkJoin({\n * foo: of(1, 2, 3, 4),\n * bar: Promise.resolve(8),\n * baz: timer(4000),\n * });\n * observable.subscribe({\n * next: value => console.log(value),\n * complete: () => console.log('This is how it ends!'),\n * });\n *\n * // Logs:\n * // { foo: 4, bar: 8, baz: 0 } after 4 seconds\n * // \"This is how it ends!\" immediately after\n * ```\n *\n * ### Use forkJoin with an array of observable inputs\n * ```ts\n * import { forkJoin, of } from 'rxjs';\n *\n * const observable = forkJoin([\n * of(1, 2, 3, 4),\n * Promise.resolve(8),\n * timer(4000),\n * ]);\n * observable.subscribe({\n * next: value => console.log(value),\n * complete: () => console.log('This is how it ends!'),\n * });\n *\n * // Logs:\n * // [4, 8, 0] after 4 seconds\n * // \"This is how it ends!\" immediately after\n * ```\n *\n * @see {@link combineLatest}\n * @see {@link zip}\n *\n * @param {...ObservableInput} sources Any number of Observables provided either as an array or as an arguments\n * passed directly to the operator.\n * @param {function} [project] Function that takes values emitted by input Observables and returns value\n * that will appear in resulting Observable instead of default array.\n * @return {Observable} Observable emitting either an array of last values emitted by passed Observables\n * or value from project function.\n */\nexport function forkJoin(\n ...sources: any[]\n): Observable {\n if (sources.length === 1) {\n const first = sources[0];\n if (isArray(first)) {\n return forkJoinInternal(first, null);\n }\n // TODO(benlesh): isObservable check will not be necessary when deprecated path is removed.\n if (isObject(first) && Object.getPrototypeOf(first) === Object.prototype) {\n const keys = Object.keys(first);\n return forkJoinInternal(keys.map(key => first[key]), keys);\n }\n }\n\n // DEPRECATED PATHS BELOW HERE\n if (typeof sources[sources.length - 1] === 'function') {\n const resultSelector = sources.pop() as Function;\n sources = (sources.length === 1 && isArray(sources[0])) ? sources[0] : sources;\n return forkJoinInternal(sources, null).pipe(\n map((args: any[]) => resultSelector(...args))\n );\n }\n\n return forkJoinInternal(sources, null);\n}\n\nfunction forkJoinInternal(sources: ObservableInput[], keys: string[] | null): Observable {\n return new Observable(subscriber => {\n const len = sources.length;\n if (len === 0) {\n subscriber.complete();\n return;\n }\n const values = new Array(len);\n let completed = 0;\n let emitted = 0;\n for (let i = 0; i < len; i++) {\n const source = from(sources[i]);\n let hasValue = false;\n subscriber.add(source.subscribe({\n next: value => {\n if (!hasValue) {\n hasValue = true;\n emitted++;\n }\n values[i] = value;\n },\n error: err => subscriber.error(err),\n complete: () => {\n completed++;\n if (completed === len || !hasValue) {\n if (emitted === len) {\n subscriber.next(keys ?\n keys.reduce((result, key, i) => (result[key] = values[i], result), {}) :\n values);\n }\n subscriber.complete();\n }\n }\n }));\n }\n });\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { Subscriber } from '../Subscriber';\nimport { map } from '../operators/map';\n\nconst toString: Function = (() => Object.prototype.toString)();\n\nexport interface NodeStyleEventEmitter {\n addListener: (eventName: string | symbol, handler: NodeEventHandler) => this;\n removeListener: (eventName: string | symbol, handler: NodeEventHandler) => this;\n}\n\nexport type NodeEventHandler = (...args: any[]) => void;\n\n// For APIs that implement `addListener` and `removeListener` methods that may\n// not use the same arguments or return EventEmitter values\n// such as React Native\nexport interface NodeCompatibleEventEmitter {\n addListener: (eventName: string, handler: NodeEventHandler) => void | {};\n removeListener: (eventName: string, handler: NodeEventHandler) => void | {};\n}\n\nexport interface JQueryStyleEventEmitter {\n on: (eventName: string, handler: Function) => void;\n off: (eventName: string, handler: Function) => void;\n}\n\nexport interface HasEventTargetAddRemove {\n addEventListener(type: string, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: string, listener?: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void;\n}\n\nexport type EventTargetLike = HasEventTargetAddRemove | NodeStyleEventEmitter | NodeCompatibleEventEmitter | JQueryStyleEventEmitter;\n\nexport type FromEventTarget = EventTargetLike | ArrayLike>;\n\nexport interface EventListenerOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n}\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n once?: boolean;\n passive?: boolean;\n}\n\n/* tslint:disable:max-line-length */\nexport function fromEvent(target: FromEventTarget, eventName: string): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEvent(target: FromEventTarget, eventName: string, resultSelector: (...args: any[]) => T): Observable;\nexport function fromEvent(target: FromEventTarget, eventName: string, options: EventListenerOptions): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEvent(target: FromEventTarget, eventName: string, options: EventListenerOptions, resultSelector: (...args: any[]) => T): Observable;\n/* tslint:enable:max-line-length */\n\n/**\n * Creates an Observable that emits events of a specific type coming from the\n * given event target.\n *\n * Creates an Observable from DOM events, or Node.js\n * EventEmitter events or others.\n *\n * ![](fromEvent.png)\n *\n * `fromEvent` accepts as a first argument event target, which is an object with methods\n * for registering event handler functions. As a second argument it takes string that indicates\n * type of event we want to listen for. `fromEvent` supports selected types of event targets,\n * which are described in detail below. If your event target does not match any of the ones listed,\n * you should use {@link fromEventPattern}, which can be used on arbitrary APIs.\n * When it comes to APIs supported by `fromEvent`, their methods for adding and removing event\n * handler functions have different names, but they all accept a string describing event type\n * and function itself, which will be called whenever said event happens.\n *\n * Every time resulting Observable is subscribed, event handler function will be registered\n * to event target on given event type. When that event fires, value\n * passed as a first argument to registered function will be emitted by output Observable.\n * When Observable is unsubscribed, function will be unregistered from event target.\n *\n * Note that if event target calls registered function with more than one argument, second\n * and following arguments will not appear in resulting stream. In order to get access to them,\n * you can pass to `fromEvent` optional project function, which will be called with all arguments\n * passed to event handler. Output Observable will then emit value returned by project function,\n * instead of the usual value.\n *\n * Remember that event targets listed below are checked via duck typing. It means that\n * no matter what kind of object you have and no matter what environment you work in,\n * you can safely use `fromEvent` on that object if it exposes described methods (provided\n * of course they behave as was described above). So for example if Node.js library exposes\n * event target which has the same method names as DOM EventTarget, `fromEvent` is still\n * a good choice.\n *\n * If the API you use is more callback then event handler oriented (subscribed\n * callback function fires only once and thus there is no need to manually\n * unregister it), you should use {@link bindCallback} or {@link bindNodeCallback}\n * instead.\n *\n * `fromEvent` supports following types of event targets:\n *\n * **DOM EventTarget**\n *\n * This is an object with `addEventListener` and `removeEventListener` methods.\n *\n * In the browser, `addEventListener` accepts - apart from event type string and event\n * handler function arguments - optional third parameter, which is either an object or boolean,\n * both used for additional configuration how and when passed function will be called. When\n * `fromEvent` is used with event target of that type, you can provide this values\n * as third parameter as well.\n *\n * **Node.js EventEmitter**\n *\n * An object with `addListener` and `removeListener` methods.\n *\n * **JQuery-style event target**\n *\n * An object with `on` and `off` methods\n *\n * **DOM NodeList**\n *\n * List of DOM Nodes, returned for example by `document.querySelectorAll` or `Node.childNodes`.\n *\n * Although this collection is not event target in itself, `fromEvent` will iterate over all Nodes\n * it contains and install event handler function in every of them. When returned Observable\n * is unsubscribed, function will be removed from all Nodes.\n *\n * **DOM HtmlCollection**\n *\n * Just as in case of NodeList it is a collection of DOM nodes. Here as well event handler function is\n * installed and removed in each of elements.\n *\n *\n * ## Examples\n * ### Emits clicks happening on the DOM document\n * ```ts\n * import { fromEvent } from 'rxjs';\n *\n * const clicks = fromEvent(document, 'click');\n * clicks.subscribe(x => console.log(x));\n *\n * // Results in:\n * // MouseEvent object logged to console every time a click\n * // occurs on the document.\n * ```\n *\n * ### Use addEventListener with capture option\n * ```ts\n * import { fromEvent } from 'rxjs';\n *\n * const clicksInDocument = fromEvent(document, 'click', true); // note optional configuration parameter\n * // which will be passed to addEventListener\n * const clicksInDiv = fromEvent(someDivInDocument, 'click');\n *\n * clicksInDocument.subscribe(() => console.log('document'));\n * clicksInDiv.subscribe(() => console.log('div'));\n *\n * // By default events bubble UP in DOM tree, so normally\n * // when we would click on div in document\n * // \"div\" would be logged first and then \"document\".\n * // Since we specified optional `capture` option, document\n * // will catch event when it goes DOWN DOM tree, so console\n * // will log \"document\" and then \"div\".\n * ```\n *\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n * @see {@link fromEventPattern}\n *\n * @param {FromEventTarget} target The DOM EventTarget, Node.js\n * EventEmitter, JQuery-like event target, NodeList or HTMLCollection to attach the event handler to.\n * @param {string} eventName The event name of interest, being emitted by the\n * `target`.\n * @param {EventListenerOptions} [options] Options to pass through to addEventListener\n * @return {Observable}\n * @name fromEvent\n */\nexport function fromEvent(\n target: FromEventTarget,\n eventName: string,\n options?: EventListenerOptions | ((...args: any[]) => T),\n resultSelector?: ((...args: any[]) => T)\n): Observable {\n\n if (isFunction(options)) {\n // DEPRECATED PATH\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n // DEPRECATED PATH\n return fromEvent(target, eventName, options).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n\n return new Observable(subscriber => {\n function handler(e: T) {\n if (arguments.length > 1) {\n subscriber.next(Array.prototype.slice.call(arguments));\n } else {\n subscriber.next(e);\n }\n }\n setupSubscription(target, eventName, handler, subscriber, options as EventListenerOptions);\n });\n}\n\nfunction setupSubscription(sourceObj: FromEventTarget, eventName: string,\n handler: (...args: any[]) => void, subscriber: Subscriber,\n options?: EventListenerOptions) {\n let unsubscribe: () => void;\n if (isEventTarget(sourceObj)) {\n const source = sourceObj;\n sourceObj.addEventListener(eventName, handler, options);\n unsubscribe = () => source.removeEventListener(eventName, handler, options);\n } else if (isJQueryStyleEventEmitter(sourceObj)) {\n const source = sourceObj;\n sourceObj.on(eventName, handler);\n unsubscribe = () => source.off(eventName, handler);\n } else if (isNodeStyleEventEmitter(sourceObj)) {\n const source = sourceObj;\n sourceObj.addListener(eventName, handler as NodeEventHandler);\n unsubscribe = () => source.removeListener(eventName, handler as NodeEventHandler);\n } else if (sourceObj && (sourceObj as any).length) {\n for (let i = 0, len = (sourceObj as any).length; i < len; i++) {\n setupSubscription(sourceObj[i], eventName, handler, subscriber, options);\n }\n } else {\n throw new TypeError('Invalid event target');\n }\n\n subscriber.add(unsubscribe);\n}\n\nfunction isNodeStyleEventEmitter(sourceObj: any): sourceObj is NodeStyleEventEmitter {\n return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';\n}\n\nfunction isJQueryStyleEventEmitter(sourceObj: any): sourceObj is JQueryStyleEventEmitter {\n return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';\n}\n\nfunction isEventTarget(sourceObj: any): sourceObj is HasEventTargetAddRemove {\n return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { NodeEventHandler } from './fromEvent';\nimport { map } from '../operators/map';\n\n/* tslint:disable:max-line-length */\nexport function fromEventPattern(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEventPattern(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void, resultSelector?: (...args: any[]) => T): Observable;\n/* tslint:enable:max-line-length */\n\n/**\n * Creates an Observable from an arbitrary API for registering event handlers.\n *\n * When that method for adding event handler was something {@link fromEvent}\n * was not prepared for.\n *\n * ![](fromEventPattern.png)\n *\n * `fromEventPattern` allows you to convert into an Observable any API that supports registering handler functions\n * for events. It is similar to {@link fromEvent}, but far\n * more flexible. In fact, all use cases of {@link fromEvent} could be easily handled by\n * `fromEventPattern` (although in slightly more verbose way).\n *\n * This operator accepts as a first argument an `addHandler` function, which will be injected with\n * handler parameter. That handler is actually an event handler function that you now can pass\n * to API expecting it. `addHandler` will be called whenever Observable\n * returned by the operator is subscribed, so registering handler in API will not\n * necessarily happen when `fromEventPattern` is called.\n *\n * After registration, every time an event that we listen to happens,\n * Observable returned by `fromEventPattern` will emit value that event handler\n * function was called with. Note that if event handler was called with more\n * then one argument, second and following arguments will not appear in the Observable.\n *\n * If API you are using allows to unregister event handlers as well, you can pass to `fromEventPattern`\n * another function - `removeHandler` - as a second parameter. It will be injected\n * with the same handler function as before, which now you can use to unregister\n * it from the API. `removeHandler` will be called when consumer of resulting Observable\n * unsubscribes from it.\n *\n * In some APIs unregistering is actually handled differently. Method registering an event handler\n * returns some kind of token, which is later used to identify which function should\n * be unregistered or it itself has method that unregisters event handler.\n * If that is the case with your API, make sure token returned\n * by registering method is returned by `addHandler`. Then it will be passed\n * as a second argument to `removeHandler`, where you will be able to use it.\n *\n * If you need access to all event handler parameters (not only the first one),\n * or you need to transform them in any way, you can call `fromEventPattern` with optional\n * third parameter - project function which will accept all arguments passed to\n * event handler when it is called. Whatever is returned from project function will appear on\n * resulting stream instead of usual event handlers first argument. This means\n * that default project can be thought of as function that takes its first parameter\n * and ignores the rest.\n *\n * ## Example\n * ### Emits clicks happening on the DOM document\n *\n * ```ts\n * import { fromEventPattern } from 'rxjs';\n *\n * function addClickHandler(handler) {\n * document.addEventListener('click', handler);\n * }\n *\n * function removeClickHandler(handler) {\n * document.removeEventListener('click', handler);\n * }\n *\n * const clicks = fromEventPattern(\n * addClickHandler,\n * removeClickHandler\n * );\n * clicks.subscribe(x => console.log(x));\n *\n * // Whenever you click anywhere in the browser, DOM MouseEvent\n * // object will be logged.\n * ```\n *\n * ## Example\n * ### Use with API that returns cancellation token\n *\n * ```ts\n * import { fromEventPattern } from 'rxjs';\n *\n * const token = someAPI.registerEventHandler(function() {});\n * someAPI.unregisterEventHandler(token); // this APIs cancellation method accepts\n * // not handler itself, but special token.\n *\n * const someAPIObservable = fromEventPattern(\n * function(handler) { return someAPI.registerEventHandler(handler); }, // Note that we return the token here...\n * function(handler, token) { someAPI.unregisterEventHandler(token); } // ...to then use it here.\n * );\n * ```\n *\n * ## Example\n * ### Use with project function\n *\n * ```ts\n * import { fromEventPattern } from 'rxjs';\n *\n * someAPI.registerEventHandler((eventType, eventMessage) => {\n * console.log(eventType, eventMessage); // Logs \"EVENT_TYPE\" \"EVENT_MESSAGE\" to console.\n * });\n *\n * const someAPIObservable = fromEventPattern(\n * handler => someAPI.registerEventHandler(handler),\n * handler => someAPI.unregisterEventHandler(handler)\n * (eventType, eventMessage) => eventType + \" --- \" + eventMessage // without that function only \"EVENT_TYPE\"\n * ); // would be emitted by the Observable\n *\n * someAPIObservable.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"EVENT_TYPE --- EVENT_MESSAGE\"\n * ```\n *\n * @see {@link fromEvent}\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n *\n * @param {function(handler: Function): any} addHandler A function that takes\n * a `handler` function as argument and attaches it somehow to the actual\n * source of events.\n * @param {function(handler: Function, token?: any): void} [removeHandler] A function that\n * takes a `handler` function as an argument and removes it from the event source. If `addHandler`\n * returns some kind of token, `removeHandler` function will have it as a second parameter.\n * @param {function(...args: any): T} [project] A function to\n * transform results. It takes the arguments from the event handler and\n * should return a single value.\n * @return {Observable} Observable which, when an event happens, emits first parameter\n * passed to registered event handler. Alternatively it emits whatever project function returns\n * at that moment.\n * @static true\n * @name fromEventPattern\n * @owner Observable\n */\n\nexport function fromEventPattern(addHandler: (handler: NodeEventHandler) => any,\n removeHandler?: (handler: NodeEventHandler, signal?: any) => void,\n resultSelector?: (...args: any[]) => T): Observable {\n\n if (resultSelector) {\n // DEPRECATED PATH\n return fromEventPattern(addHandler, removeHandler).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n\n return new Observable(subscriber => {\n const handler = (...e: T[]) => subscriber.next(e.length === 1 ? e[0] : e);\n\n let retValue: any;\n try {\n retValue = addHandler(handler);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n if (!isFunction(removeHandler)) {\n return undefined;\n }\n\n return () => removeHandler(handler, retValue) ;\n });\n}\n","import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { identity } from '../util/identity';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { isScheduler } from '../util/isScheduler';\n\nexport type ConditionFunc = (state: S) => boolean;\nexport type IterateFunc = (state: S) => S;\nexport type ResultFunc = (state: S) => T;\n\ninterface SchedulerState {\n needIterate?: boolean;\n state: S;\n subscriber: Subscriber;\n condition?: ConditionFunc;\n iterate: IterateFunc;\n resultSelector: ResultFunc;\n}\n\nexport interface GenerateBaseOptions {\n /**\n * Initial state.\n */\n initialState: S;\n /**\n * Condition function that accepts state and returns boolean.\n * When it returns false, the generator stops.\n * If not specified, a generator never stops.\n */\n condition?: ConditionFunc;\n /**\n * Iterate function that accepts state and returns new state.\n */\n iterate: IterateFunc;\n /**\n * SchedulerLike to use for generation process.\n * By default, a generator starts immediately.\n */\n scheduler?: SchedulerLike;\n}\n\nexport interface GenerateOptions extends GenerateBaseOptions {\n /**\n * Result selection function that accepts state and returns a value to emit.\n */\n resultSelector: ResultFunc;\n}\n\n/**\n * Generates an observable sequence by running a state-driven loop\n * producing the sequence's elements, using the specified scheduler\n * to send out observer messages.\n *\n * ![](generate.png)\n *\n * @example Produces sequence of 0, 1, 2, ... 9, then completes.\n * const res = generate(0, x => x < 10, x => x + 1, x => x);\n *\n * @example Using asap scheduler, produces sequence of 2, 3, 5, then completes.\n * const res = generate(1, x => x < 5, x => x * 2, x => x + 1, asap);\n *\n * @see {@link from}\n * @see {@link Observable}\n *\n * @param {S} initialState Initial state.\n * @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).\n * @param {function (state: S): S} iterate Iteration step function.\n * @param {function (state: S): T} resultSelector Selector function for results produced in the sequence. (deprecated)\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} on which to run the generator loop. If not provided, defaults to emit immediately.\n * @returns {Observable} The generated sequence.\n */\n export function generate(initialState: S,\n condition: ConditionFunc,\n iterate: IterateFunc,\n resultSelector: ResultFunc,\n scheduler?: SchedulerLike): Observable;\n\n/**\n * Generates an Observable by running a state-driven loop\n * that emits an element on each iteration.\n *\n * Use it instead of nexting values in a for loop.\n *\n * \n *\n * `generate` allows you to create stream of values generated with a loop very similar to\n * traditional for loop. First argument of `generate` is a beginning value. Second argument\n * is a function that accepts this value and tests if some condition still holds. If it does,\n * loop continues, if not, it stops. Third value is a function which takes previously defined\n * value and modifies it in some way on each iteration. Note how these three parameters\n * are direct equivalents of three expressions in regular for loop: first expression\n * initializes some state (for example numeric index), second tests if loop can make next\n * iteration (for example if index is lower than 10) and third states how defined value\n * will be modified on every step (index will be incremented by one).\n *\n * Return value of a `generate` operator is an Observable that on each loop iteration\n * emits a value. First, condition function is ran. If it returned true, Observable\n * emits currently stored value (initial value at the first iteration) and then updates\n * that value with iterate function. If at some point condition returned false, Observable\n * completes at that moment.\n *\n * Optionally you can pass fourth parameter to `generate` - a result selector function which allows you\n * to immediately map value that would normally be emitted by an Observable.\n *\n * If you find three anonymous functions in `generate` call hard to read, you can provide\n * single object to the operator instead. That object has properties: `initialState`,\n * `condition`, `iterate` and `resultSelector`, which should have respective values that you\n * would normally pass to `generate`. `resultSelector` is still optional, but that form\n * of calling `generate` allows you to omit `condition` as well. If you omit it, that means\n * condition always holds, so output Observable will never complete.\n *\n * Both forms of `generate` can optionally accept a scheduler. In case of multi-parameter call,\n * scheduler simply comes as a last argument (no matter if there is resultSelector\n * function or not). In case of single-parameter call, you can provide it as a\n * `scheduler` property on object passed to the operator. In both cases scheduler decides when\n * next iteration of the loop will happen and therefore when next value will be emitted\n * by the Observable. For example to ensure that each value is pushed to the observer\n * on separate task in event loop, you could use `async` scheduler. Note that\n * by default (when no scheduler is passed) values are simply emitted synchronously.\n *\n *\n * @example Use with condition and iterate functions.\n * const generated = generate(0, x => x < 3, x => x + 1);\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!')\n * );\n *\n * // Logs:\n * // 0\n * // 1\n * // 2\n * // \"Yo!\"\n *\n *\n * @example Use with condition, iterate and resultSelector functions.\n * const generated = generate(0, x => x < 3, x => x + 1, x => x * 1000);\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!')\n * );\n *\n * // Logs:\n * // 0\n * // 1000\n * // 2000\n * // \"Yo!\"\n *\n *\n * @example Use with options object.\n * const generated = generate({\n * initialState: 0,\n * condition(value) { return value < 3; },\n * iterate(value) { return value + 1; },\n * resultSelector(value) { return value * 1000; }\n * });\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!')\n * );\n *\n * // Logs:\n * // 0\n * // 1000\n * // 2000\n * // \"Yo!\"\n *\n * @example Use options object without condition function.\n * const generated = generate({\n * initialState: 0,\n * iterate(value) { return value + 1; },\n * resultSelector(value) { return value * 1000; }\n * });\n *\n * generated.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('Yo!') // This will never run.\n * );\n *\n * // Logs:\n * // 0\n * // 1000\n * // 2000\n * // 3000\n * // ...and never stops.\n *\n *\n * @see {@link from}\n * @see {@link index/Observable.create}\n *\n * @param {S} initialState Initial state.\n * @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).\n * @param {function (state: S): S} iterate Iteration step function.\n * @param {function (state: S): T} [resultSelector] Selector function for results produced in the sequence.\n * @param {Scheduler} [scheduler] A {@link Scheduler} on which to run the generator loop. If not provided, defaults to emitting immediately.\n * @return {Observable} The generated sequence.\n */\nexport function generate(initialState: S,\n condition: ConditionFunc,\n iterate: IterateFunc,\n scheduler?: SchedulerLike): Observable;\n\n/**\n * Generates an observable sequence by running a state-driven loop\n * producing the sequence's elements, using the specified scheduler\n * to send out observer messages.\n * The overload accepts options object that might contain initial state, iterate,\n * condition and scheduler.\n *\n * ![](generate.png)\n *\n * @example Produces sequence of 0, 1, 2, ... 9, then completes.\n * const res = generate({\n * initialState: 0,\n * condition: x => x < 10,\n * iterate: x => x + 1,\n * });\n *\n * @see {@link from}\n * @see {@link Observable}\n *\n * @param {GenerateBaseOptions} options Object that must contain initialState, iterate and might contain condition and scheduler.\n * @returns {Observable} The generated sequence.\n */\nexport function generate(options: GenerateBaseOptions): Observable;\n\n/**\n * Generates an observable sequence by running a state-driven loop\n * producing the sequence's elements, using the specified scheduler\n * to send out observer messages.\n * The overload accepts options object that might contain initial state, iterate,\n * condition, result selector and scheduler.\n *\n * ![](generate.png)\n *\n * @example Produces sequence of 0, 1, 2, ... 9, then completes.\n * const res = generate({\n * initialState: 0,\n * condition: x => x < 10,\n * iterate: x => x + 1,\n * resultSelector: x => x,\n * });\n *\n * @see {@link from}\n * @see {@link Observable}\n *\n * @param {GenerateOptions} options Object that must contain initialState, iterate, resultSelector and might contain condition and scheduler.\n * @returns {Observable} The generated sequence.\n */\nexport function generate(options: GenerateOptions): Observable;\n\nexport function generate(initialStateOrOptions: S | GenerateOptions,\n condition?: ConditionFunc,\n iterate?: IterateFunc,\n resultSelectorOrObservable?: (ResultFunc) | SchedulerLike,\n scheduler?: SchedulerLike): Observable {\n\n let resultSelector: ResultFunc;\n let initialState: S;\n\n if (arguments.length == 1) {\n const options = initialStateOrOptions as GenerateOptions;\n initialState = options.initialState;\n condition = options.condition;\n iterate = options.iterate;\n resultSelector = options.resultSelector || identity as ResultFunc;\n scheduler = options.scheduler;\n } else if (resultSelectorOrObservable === undefined || isScheduler(resultSelectorOrObservable)) {\n initialState = initialStateOrOptions as S;\n resultSelector = identity as ResultFunc;\n scheduler = resultSelectorOrObservable as SchedulerLike;\n } else {\n initialState = initialStateOrOptions as S;\n resultSelector = resultSelectorOrObservable as ResultFunc;\n }\n\n return new Observable(subscriber => {\n let state = initialState;\n if (scheduler) {\n return scheduler.schedule>(dispatch, 0, {\n subscriber,\n iterate,\n condition,\n resultSelector,\n state\n });\n }\n\n do {\n if (condition) {\n let conditionResult: boolean;\n try {\n conditionResult = condition(state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!conditionResult) {\n subscriber.complete();\n break;\n }\n }\n let value: T;\n try {\n value = resultSelector(state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n break;\n }\n try {\n state = iterate(state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n } while (true);\n\n return undefined;\n });\n}\n\nfunction dispatch(this: SchedulerAction>, state: SchedulerState) {\n const { subscriber, condition } = state;\n if (subscriber.closed) {\n return undefined;\n }\n if (state.needIterate) {\n try {\n state.state = state.iterate(state.state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n } else {\n state.needIterate = true;\n }\n if (condition) {\n let conditionResult: boolean;\n try {\n conditionResult = condition(state.state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!conditionResult) {\n subscriber.complete();\n return undefined;\n }\n if (subscriber.closed) {\n return undefined;\n }\n }\n let value: T;\n try {\n value = state.resultSelector(state.state);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (subscriber.closed) {\n return undefined;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n return undefined;\n }\n return this.schedule(state);\n}\n","import { Observable } from '../Observable';\nimport { defer } from './defer';\nimport { EMPTY } from './empty';\nimport { SubscribableOrPromise } from '../types';\n\n/**\n * Decides at subscription time which Observable will actually be subscribed.\n *\n * `If` statement for Observables.\n *\n * `iif` accepts a condition function and two Observables. When\n * an Observable returned by the operator is subscribed, condition function will be called.\n * Based on what boolean it returns at that moment, consumer will subscribe either to\n * the first Observable (if condition was true) or to the second (if condition was false). Condition\n * function may also not return anything - in that case condition will be evaluated as false and\n * second Observable will be subscribed.\n *\n * Note that Observables for both cases (true and false) are optional. If condition points to an Observable that\n * was left undefined, resulting stream will simply complete immediately. That allows you to, rather\n * than controlling which Observable will be subscribed, decide at runtime if consumer should have access\n * to given Observable or not.\n *\n * If you have more complex logic that requires decision between more than two Observables, {@link defer}\n * will probably be a better choice. Actually `iif` can be easily implemented with {@link defer}\n * and exists only for convenience and readability reasons.\n *\n *\n * ## Examples\n * ### Change at runtime which Observable will be subscribed\n * ```ts\n * import { iif, of } from 'rxjs';\n *\n * let subscribeToFirst;\n * const firstOrSecond = iif(\n * () => subscribeToFirst,\n * of('first'),\n * of('second'),\n * );\n *\n * subscribeToFirst = true;\n * firstOrSecond.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"first\"\n *\n * subscribeToFirst = false;\n * firstOrSecond.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"second\"\n *\n * ```\n *\n * ### Control an access to an Observable\n * ```ts\n * let accessGranted;\n * const observableIfYouHaveAccess = iif(\n * () => accessGranted,\n * of('It seems you have an access...'), // Note that only one Observable is passed to the operator.\n * );\n *\n * accessGranted = true;\n * observableIfYouHaveAccess.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('The end'),\n * );\n *\n * // Logs:\n * // \"It seems you have an access...\"\n * // \"The end\"\n *\n * accessGranted = false;\n * observableIfYouHaveAccess.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('The end'),\n * );\n *\n * // Logs:\n * // \"The end\"\n * ```\n *\n * @see {@link defer}\n *\n * @param {function(): boolean} condition Condition which Observable should be chosen.\n * @param {Observable} [trueObservable] An Observable that will be subscribed if condition is true.\n * @param {Observable} [falseObservable] An Observable that will be subscribed if condition is false.\n * @return {Observable} Either first or second Observable, depending on condition.\n * @static true\n * @name iif\n * @owner Observable\n*/\nexport function iif(\n condition: () => boolean,\n trueResult: SubscribableOrPromise = EMPTY,\n falseResult: SubscribableOrPromise = EMPTY\n): Observable {\n return defer(() => condition() ? trueResult : falseResult);\n}\n","import { Observable } from '../Observable';\nimport { async } from '../scheduler/async';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { isNumeric } from '../util/isNumeric';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that emits sequential numbers every specified\n * interval of time, on a specified {@link SchedulerLike}.\n *\n * Emits incremental numbers periodically in time.\n * \n *\n * ![](interval.png)\n *\n * `interval` returns an Observable that emits an infinite sequence of\n * ascending integers, with a constant interval of time of your choosing\n * between those emissions. The first emission is not sent immediately, but\n * only after the first period has passed. By default, this operator uses the\n * `async` {@link SchedulerLike} to provide a notion of time, but you may pass any\n * {@link SchedulerLike} to it.\n *\n * ## Example\n * Emits ascending numbers, one every second (1000ms) up to the number 3\n * ```ts\n * import { interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const numbers = interval(1000);\n *\n * const takeFourNumbers = numbers.pipe(take(4));\n *\n * takeFourNumbers.subscribe(x => console.log('Next: ', x));\n *\n * // Logs:\n * // Next: 0\n * // Next: 1\n * // Next: 2\n * // Next: 3\n * ```\n *\n * @see {@link timer}\n * @see {@link delay}\n *\n * @param {number} [period=0] The interval size in milliseconds (by default)\n * or the time unit determined by the scheduler's clock.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling\n * the emission of values, and providing a notion of \"time\".\n * @return {Observable} An Observable that emits a sequential number each time\n * interval.\n * @static true\n * @name interval\n * @owner Observable\n */\nexport function interval(period = 0,\n scheduler: SchedulerLike = async): Observable {\n if (!isNumeric(period) || period < 0) {\n period = 0;\n }\n\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n scheduler = async;\n }\n\n return new Observable(subscriber => {\n subscriber.add(\n scheduler.schedule(dispatch, period, { subscriber, counter: 0, period })\n );\n return subscriber;\n });\n}\n\nfunction dispatch(this: SchedulerAction, state: IntervalState) {\n const { subscriber, counter, period } = state;\n subscriber.next(counter);\n this.schedule({ subscriber, counter: counter + 1, period }, period);\n}\n\ninterface IntervalState {\n subscriber: Subscriber;\n counter: number;\n period: number;\n}\n","import { Observable } from '../Observable';\nimport { noop } from '../util/noop';\n\n/**\n * An Observable that emits no items to the Observer and never completes.\n *\n * ![](never.png)\n *\n * A simple Observable that emits neither values nor errors nor the completion\n * notification. It can be used for testing purposes or for composing with other\n * Observables. Please note that by never emitting a complete notification, this\n * Observable keeps the subscription from being disposed automatically.\n * Subscriptions need to be manually disposed.\n *\n * ## Example\n * ### Emit the number 7, then never emit anything else (not even complete)\n * ```ts\n * import { NEVER } from 'rxjs';\n * import { startWith } from 'rxjs/operators';\n *\n * function info() {\n * console.log('Will not be called');\n * }\n * const result = NEVER.pipe(startWith(7));\n * result.subscribe(x => console.log(x), info, info);\n *\n * ```\n *\n * @see {@link Observable}\n * @see {@link index/EMPTY}\n * @see {@link of}\n * @see {@link throwError}\n */\nexport const NEVER = new Observable(noop);\n\n/**\n * @deprecated Deprecated in favor of using {@link NEVER} constant.\n */\nexport function never () {\n return NEVER;\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput } from '../types';\nimport { from } from './from';\nimport { isArray } from '../util/isArray';\nimport { EMPTY } from './empty';\n\n/* tslint:disable:max-line-length */\nexport function onErrorResumeNext(v: ObservableInput): Observable;\nexport function onErrorResumeNext(v2: ObservableInput, v3: ObservableInput): Observable;\nexport function onErrorResumeNext(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput): Observable;\nexport function onErrorResumeNext(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput): Observable;\nexport function onErrorResumeNext(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput): Observable;\n\nexport function onErrorResumeNext(...observables: Array | ((...values: Array) => R)>): Observable;\nexport function onErrorResumeNext(array: ObservableInput[]): Observable;\n/* tslint:enable:max-line-length */\n\n/**\n * When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one\n * that was passed.\n *\n * Execute series of Observables no matter what, even if it means swallowing errors.\n *\n * ![](onErrorResumeNext.png)\n *\n * `onErrorResumeNext` Will subscribe to each observable source it is provided, in order.\n * If the source it's subscribed to emits an error or completes, it will move to the next source\n * without error.\n *\n * If `onErrorResumeNext` is provided no arguments, or a single, empty array, it will return {@link index/EMPTY}.\n *\n * `onErrorResumeNext` is basically {@link concat}, only it will continue, even if one of its\n * sources emits an error.\n *\n * Note that there is no way to handle any errors thrown by sources via the result of\n * `onErrorResumeNext`. If you want to handle errors thrown in any given source, you can\n * always use the {@link catchError} operator on them before passing them into `onErrorResumeNext`.\n *\n * ## Example\n * Subscribe to the next Observable after map fails\n * ```ts\n * import { onErrorResumeNext, of } from 'rxjs';\n * import { map } from 'rxjs/operators';\n *\n * onErrorResumeNext(\n * of(1, 2, 3, 0).pipe(\n * map(x => {\n * if (x === 0) throw Error();\n * return 10 / x;\n * })\n * ),\n * of(1, 2, 3),\n * )\n * .subscribe(\n * val => console.log(val),\n * err => console.log(err), // Will never be called.\n * () => console.log('done'),\n * );\n *\n * // Logs:\n * // 10\n * // 5\n * // 3.3333333333333335\n * // 1\n * // 2\n * // 3\n * // \"done\"\n * ```\n *\n * @see {@link concat}\n * @see {@link catchError}\n *\n * @param {...ObservableInput} sources Observables (or anything that *is* observable) passed either directly or as an array.\n * @return {Observable} An Observable that concatenates all sources, one after the other,\n * ignoring all errors, such that any error causes it to move on to the next source.\n */\nexport function onErrorResumeNext(...sources: Array |\n Array> |\n ((...values: Array) => R)>): Observable {\n\n if (sources.length === 0) {\n return EMPTY;\n }\n\n const [ first, ...remainder ] = sources;\n\n if (sources.length === 1 && isArray(first)) {\n return onErrorResumeNext(...first);\n }\n\n return new Observable(subscriber => {\n const subNext = () => subscriber.add(\n onErrorResumeNext(...remainder).subscribe(subscriber)\n );\n\n return from(first).subscribe({\n next(value) { subscriber.next(value); },\n error: subNext,\n complete: subNext,\n });\n });\n}\n","import { Observable } from '../Observable';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\n\n/**\n * Convert an object into an Observable of `[key, value]` pairs.\n *\n * Turn entries of an object into a stream.\n *\n * \n *\n * `pairs` takes an arbitrary object and returns an Observable that emits arrays. Each\n * emitted array has exactly two elements - the first is a key from the object\n * and the second is a value corresponding to that key. Keys are extracted from\n * an object via `Object.keys` function, which means that they will be only\n * enumerable keys that are present on an object directly - not ones inherited\n * via prototype chain.\n *\n * By default these arrays are emitted synchronously. To change that you can\n * pass a {@link SchedulerLike} as a second argument to `pairs`.\n *\n * @example Converts a javascript object to an Observable\n * ```ts\n * import { pairs } from 'rxjs';\n *\n * const obj = {\n * foo: 42,\n * bar: 56,\n * baz: 78\n * };\n *\n * pairs(obj)\n * .subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('the end!')\n * );\n *\n * // Logs:\n * // [\"foo\", 42],\n * // [\"bar\", 56],\n * // [\"baz\", 78],\n * // \"the end!\"\n * ```\n *\n * @param {Object} obj The object to inspect and turn into an\n * Observable sequence.\n * @param {Scheduler} [scheduler] An optional IScheduler to schedule\n * when resulting Observable will emit values.\n * @returns {(Observable>)} An observable sequence of\n * [key, value] pairs from the object.\n */\nexport function pairs(obj: Object, scheduler?: SchedulerLike): Observable<[string, T]> {\n if (!scheduler) {\n return new Observable<[string, T]>(subscriber => {\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length && !subscriber.closed; i++) {\n const key = keys[i];\n if (obj.hasOwnProperty(key)) {\n subscriber.next([key, obj[key]]);\n }\n }\n subscriber.complete();\n });\n } else {\n return new Observable<[string, T]>(subscriber => {\n const keys = Object.keys(obj);\n const subscription = new Subscription();\n subscription.add(\n scheduler.schedule<{ keys: string[], index: number, subscriber: Subscriber<[string, T]>, subscription: Subscription, obj: Object }>\n (dispatch, 0, { keys, index: 0, subscriber, subscription, obj }));\n return subscription;\n });\n }\n}\n\n/** @internal */\nexport function dispatch(this: SchedulerAction,\n state: { keys: string[], index: number, subscriber: Subscriber<[string, T]>, subscription: Subscription, obj: Object }) {\n const { keys, index, subscriber, subscription, obj } = state;\n if (!subscriber.closed) {\n if (index < keys.length) {\n const key = keys[index];\n subscriber.next([key, obj[key]]);\n subscription.add(this.schedule({ keys, index: index + 1, subscriber, subscription, obj }));\n } else {\n subscriber.complete();\n }\n }\n}\n","import { not } from '../util/not';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { filter } from '../operators/filter';\nimport { ObservableInput } from '../types';\nimport { Observable } from '../Observable';\n\n/**\n * Splits the source Observable into two, one with values that satisfy a\n * predicate, and another with values that don't satisfy the predicate.\n *\n * It's like {@link filter}, but returns two Observables:\n * one like the output of {@link filter}, and the other with values that did not\n * pass the condition.\n *\n * ![](partition.png)\n *\n * `partition` outputs an array with two Observables that partition the values\n * from the source Observable through the given `predicate` function. The first\n * Observable in that array emits source values for which the predicate argument\n * returns true. The second Observable emits source values for which the\n * predicate returns false. The first behaves like {@link filter} and the second\n * behaves like {@link filter} with the predicate negated.\n *\n * ## Example\n * Partition a set of numbers into odds and evens observables\n * ```ts\n * import { of, partition } from 'rxjs';\n *\n * const observableValues = of(1, 2, 3, 4, 5, 6);\n * const [evens$, odds$] = partition(observableValues, (value, index) => value % 2 === 0);\n *\n * odds$.subscribe(x => console.log('odds', x));\n * evens$.subscribe(x => console.log('evens', x));\n *\n * // Logs:\n * // odds 1\n * // odds 3\n * // odds 5\n * // evens 2\n * // evens 4\n * // evens 6\n * ```\n *\n * @see {@link filter}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted on the first Observable in the returned array, if\n * `false` the value is emitted on the second Observable in the array. The\n * `index` parameter is the number `i` for the i-th source emission that has\n * happened since the subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {[Observable, Observable]} An array with two Observables: one\n * with values that passed the predicate, and another with values that did not\n * pass the predicate.\n */\nexport function partition(\n source: ObservableInput,\n predicate: (value: T, index: number) => boolean,\n thisArg?: any\n): [Observable, Observable] {\n return [\n filter(predicate, thisArg)(new Observable(subscribeTo(source))),\n filter(not(predicate, thisArg) as any)(new Observable(subscribeTo(source)))\n ] as [Observable, Observable];\n}\n","import { SchedulerAction, SchedulerLike } from '../types';\nimport { Observable } from '../Observable';\n\n/**\n * Creates an Observable that emits a sequence of numbers within a specified\n * range.\n *\n * Emits a sequence of numbers in a range.\n *\n * ![](range.png)\n *\n * `range` operator emits a range of sequential integers, in order, where you\n * select the `start` of the range and its `length`. By default, uses no\n * {@link SchedulerLike} and just delivers the notifications synchronously, but may use\n * an optional {@link SchedulerLike} to regulate those deliveries.\n *\n * ## Example\n * Emits the numbers 1 to 10\n * ```ts\n * import { range } from 'rxjs';\n *\n * const numbers = range(1, 10);\n * numbers.subscribe(x => console.log(x));\n * ```\n * @see {@link timer}\n * @see {@link index/interval}\n *\n * @param {number} [start=0] The value of the first integer in the sequence.\n * @param {number} count The number of sequential integers to generate.\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling\n * the emissions of the notifications.\n * @return {Observable} An Observable of numbers that emits a finite range of\n * sequential integers.\n * @static true\n * @name range\n * @owner Observable\n */\nexport function range(start: number = 0,\n count?: number,\n scheduler?: SchedulerLike): Observable {\n return new Observable(subscriber => {\n if (count === undefined) {\n count = start;\n start = 0;\n }\n\n let index = 0;\n let current = start;\n\n if (scheduler) {\n return scheduler.schedule(dispatch, 0, {\n index, count, start, subscriber\n });\n } else {\n do {\n if (index++ >= count) {\n subscriber.complete();\n break;\n }\n subscriber.next(current++);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n }\n\n return undefined;\n });\n}\n\n/** @internal */\nexport function dispatch(this: SchedulerAction, state: any) {\n const { start, index, count, subscriber } = state;\n\n if (index >= count) {\n subscriber.complete();\n return;\n }\n\n subscriber.next(start);\n\n if (subscriber.closed) {\n return;\n }\n\n state.index = index + 1;\n state.start = start + 1;\n\n this.schedule(state);\n}\n","import { Observable } from '../Observable';\nimport { Unsubscribable, ObservableInput } from '../types';\nimport { from } from './from'; // from from from! LAWL\nimport { EMPTY } from './empty';\n\n/**\n * Creates an Observable that uses a resource which will be disposed at the same time as the Observable.\n *\n * Use it when you catch yourself cleaning up after an Observable.\n *\n * `using` is a factory operator, which accepts two functions. First function returns a disposable resource.\n * It can be an arbitrary object that implements `unsubscribe` method. Second function will be injected with\n * that object and should return an Observable. That Observable can use resource object during its execution.\n * Both functions passed to `using` will be called every time someone subscribes - neither an Observable nor\n * resource object will be shared in any way between subscriptions.\n *\n * When Observable returned by `using` is subscribed, Observable returned from the second function will be subscribed\n * as well. All its notifications (nexted values, completion and error events) will be emitted unchanged by the output\n * Observable. If however someone unsubscribes from the Observable or source Observable completes or errors by itself,\n * the `unsubscribe` method on resource object will be called. This can be used to do any necessary clean up, which\n * otherwise would have to be handled by hand. Note that complete or error notifications are not emitted when someone\n * cancels subscription to an Observable via `unsubscribe`, so `using` can be used as a hook, allowing you to make\n * sure that all resources which need to exist during an Observable execution will be disposed at appropriate time.\n *\n * @see {@link defer}\n *\n * @param {function(): ISubscription} resourceFactory A function which creates any resource object\n * that implements `unsubscribe` method.\n * @param {function(resource: ISubscription): Observable} observableFactory A function which\n * creates an Observable, that can use injected resource object.\n * @return {Observable} An Observable that behaves the same as Observable returned by `observableFactory`, but\n * which - when completed, errored or unsubscribed - will also call `unsubscribe` on created resource object.\n */\nexport function using(resourceFactory: () => Unsubscribable | void,\n observableFactory: (resource: Unsubscribable | void) => ObservableInput | void): Observable {\n return new Observable(subscriber => {\n let resource: Unsubscribable | void;\n\n try {\n resource = resourceFactory();\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n let result: ObservableInput | void;\n try {\n result = observableFactory(resource);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n const source = result ? from(result) : EMPTY;\n const subscription = source.subscribe(subscriber);\n return () => {\n subscription.unsubscribe();\n if (resource) {\n resource.unsubscribe();\n }\n };\n });\n}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that only emits a value when it completes. It will emit\n * its latest value to all its observers on completion.\n *\n * @class AsyncSubject\n */\nexport class AsyncSubject extends Subject {\n private value: T = null;\n private hasNext: boolean = false;\n private hasCompleted: boolean = false;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber): Subscription {\n if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n } else if (this.hasCompleted && this.hasNext) {\n subscriber.next(this.value);\n subscriber.complete();\n return Subscription.EMPTY;\n }\n return super._subscribe(subscriber);\n }\n\n next(value: T): void {\n if (!this.hasCompleted) {\n this.value = value;\n this.hasNext = true;\n }\n }\n\n error(error: any): void {\n if (!this.hasCompleted) {\n super.error(error);\n }\n }\n\n complete(): void {\n this.hasCompleted = true;\n if (this.hasNext) {\n super.next(this.value);\n }\n super.complete();\n }\n}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { SubscriptionLike } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n *\n * @class BehaviorSubject\n */\nexport class BehaviorSubject extends Subject {\n\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber): Subscription {\n const subscription = super._subscribe(subscriber);\n if (subscription && !(subscription).closed) {\n subscriber.next(this._value);\n }\n return subscription;\n }\n\n getValue(): T {\n if (this.hasError) {\n throw this.thrownError;\n } else if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return this._value;\n }\n }\n\n next(value: T): void {\n super.next(this._value = value);\n }\n}\n","import { PartialObserver } from './types';\nimport { Observable } from './Observable';\nimport { empty } from './observable/empty';\nimport { of } from './observable/of';\nimport { throwError } from './observable/throwError';\nimport { deprecate } from 'util';\n\n// TODO: When this enum is removed, replace it with a type alias. See #4556.\n/**\n * @deprecated NotificationKind is deprecated as const enums are not compatible with isolated modules. Use a string literal instead.\n */\nexport enum NotificationKind {\n NEXT = 'N',\n ERROR = 'E',\n COMPLETE = 'C',\n}\n\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification\n */\nexport class Notification {\n hasValue: boolean;\n\n constructor(public kind: 'N' | 'E' | 'C', public value?: T, public error?: any) {\n this.hasValue = kind === 'N';\n }\n\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n observe(observer: PartialObserver): any {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n }\n\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n do(next: (value: T) => void, error?: (err: any) => void, complete?: () => void): any {\n const kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n }\n\n /**\n * Takes an Observer or its individual callback functions, and calls `observe`\n * or `do` methods accordingly.\n * @param {Observer|function(value: T): void} nextOrObserver An Observer or\n * the `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n accept(nextOrObserver: PartialObserver | ((value: T) => void), error?: (err: any) => void, complete?: () => void) {\n if (nextOrObserver && typeof (>nextOrObserver).next === 'function') {\n return this.observe(>nextOrObserver);\n } else {\n return this.do(<(value: T) => void>nextOrObserver, error, complete);\n }\n }\n\n /**\n * Returns a simple Observable that just delivers the notification represented\n * by this Notification instance.\n * @return {any}\n */\n toObservable(): Observable {\n const kind = this.kind;\n switch (kind) {\n case 'N':\n return of(this.value);\n case 'E':\n return throwError(this.error);\n case 'C':\n return empty();\n }\n throw new Error('unexpected notification kind value');\n }\n\n private static completeNotification: Notification = new Notification('C');\n private static undefinedValueNotification: Notification = new Notification('N', undefined);\n\n /**\n * A shortcut to create a Notification instance of the type `next` from a\n * given value.\n * @param {T} value The `next` value.\n * @return {Notification} The \"next\" Notification representing the\n * argument.\n * @nocollapse\n */\n static createNext(value: T): Notification {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n }\n\n /**\n * A shortcut to create a Notification instance of the type `error` from a\n * given error.\n * @param {any} [err] The `error` error.\n * @return {Notification} The \"error\" Notification representing the\n * argument.\n * @nocollapse\n */\n static createError(err?: any): Notification {\n return new Notification('E', undefined, err);\n }\n\n /**\n * A shortcut to create a Notification instance of the type `complete`.\n * @return {Notification} The valueless \"complete\" Notification.\n * @nocollapse\n */\n static createComplete(): Notification {\n return Notification.completeNotification;\n }\n}\n","import { Operator } from './Operator';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, PartialObserver, Subscribable } from './types';\nimport { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { iif } from './observable/iif';\nimport { throwError } from './observable/throwError';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable\n */\nexport class Observable implements Subscribable {\n\n /** Internal implementation detail, do not use directly. */\n public _isScalar: boolean = false;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n source: Observable;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n operator: Operator;\n\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new cold Observable by calling the Observable constructor\n * @static true\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new cold observable\n * @nocollapse\n * @deprecated use new Observable() instead\n */\n static create: Function = (subscribe?: (subscriber: Subscriber) => TeardownLogic) => {\n return new Observable(subscribe);\n }\n\n /**\n * Creates a new Observable, with this Observable as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param {Operator} operator the operator defining the operation to take on the observable\n * @return {Observable} a new observable with the Operator applied\n */\n lift(operator: Operator): Observable {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observer?: PartialObserver): Subscription;\n /** @deprecated Use an observer instead of a complete callback */\n subscribe(next: null | undefined, error: null | undefined, complete: () => void): Subscription;\n /** @deprecated Use an observer instead of an error callback */\n subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscription;\n /** @deprecated Use an observer instead of a complete callback */\n subscribe(next: (value: T) => void, error: null | undefined, complete: () => void): Subscription;\n subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * Use it when you have all these Observables, but still nothing is happening.\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided, all errors will\n * be left uncaught.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of Observer,\n * if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * ## Example\n * ### Subscribe with an Observer\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n * ```\n *\n * ### Subscribe with functions\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n * ```\n *\n * ### Cancel a subscription\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe(\n * num => console.log(num),\n * undefined,\n * () => {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * );\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // \"unsubscribed!\" after 2.5s\n * ```\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {ISubscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n subscribe(observerOrNext?: PartialObserver | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void): Subscription {\n\n const { operator } = this;\n const sink = toSubscriber(observerOrNext, error, complete);\n\n if (operator) {\n sink.add(operator.call(sink, this.source));\n } else {\n sink.add(\n this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?\n this._subscribe(sink) :\n this._trySubscribe(sink)\n );\n }\n\n if (config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n\n return sink;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _trySubscribe(sink: Subscriber): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError(sink)) {\n sink.error(err);\n } else {\n console.warn(err);\n }\n }\n }\n\n /**\n * @method forEach\n * @param {Function} next a handler for each value emitted by the observable\n * @param {PromiseConstructor} [promiseCtor] a constructor function used to instantiate the Promise\n * @return {Promise} a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n // Must be declared in a separate statement to avoid a ReferenceError when\n // accessing subscription below in the closure due to Temporal Dead Zone.\n let subscription: Subscription;\n subscription = this.subscribe((value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n }) as Promise;\n }\n\n /** @internal This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber): TeardownLogic {\n const { source } = this;\n return source && source.subscribe(subscriber);\n }\n\n // `if` and `throw` are special snow flakes, the compiler sees them as reserved words. Deprecated in\n // favor of iif and throwError functions.\n /**\n * @nocollapse\n * @deprecated In favor of iif creation function: import { iif } from 'rxjs';\n */\n static if: typeof iif;\n /**\n * @nocollapse\n * @deprecated In favor of throwError creation function: import { throwError } from 'rxjs';\n */\n static throw: typeof throwError;\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable;\n pipe(op1: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction, op4: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction, op4: OperatorFunction, op5: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction, op4: OperatorFunction, op5: OperatorFunction, op6: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction, op4: OperatorFunction, op5: OperatorFunction, op6: OperatorFunction, op7: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction, op4: OperatorFunction, op5: OperatorFunction, op6: OperatorFunction, op7: OperatorFunction, op8: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction, op4: OperatorFunction, op5: OperatorFunction, op6: OperatorFunction, op7: OperatorFunction, op8: OperatorFunction, op9: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction, op4: OperatorFunction, op5: OperatorFunction, op6: OperatorFunction, op7: OperatorFunction, op8: OperatorFunction, op9: OperatorFunction, ...operations: OperatorFunction[]): Observable<{}>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * ### Example\n * ```ts\n * import { interval } from 'rxjs';\n * import { map, filter, scan } from 'rxjs/operators';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x))\n * ```\n */\n pipe(...operations: OperatorFunction[]): Observable {\n if (operations.length === 0) {\n return this as any;\n }\n\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n toPromise(this: Observable): Promise;\n toPromise(this: Observable, PromiseCtor: typeof Promise): Promise;\n toPromise(this: Observable, PromiseCtor: PromiseConstructorLike): Promise;\n /* tslint:enable:max-line-length */\n\n toPromise(promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: any;\n this.subscribe((x: T) => value = x, (err: any) => reject(err), () => resolve(value));\n }) as Promise;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n if (!promiseCtor) {\n promiseCtor = config.Promise || Promise;\n }\n\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n\n return promiseCtor;\n}\n","import { Subscriber } from '../Subscriber';\nimport { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';\nimport { empty as emptyObserver } from '../Observer';\nimport { PartialObserver } from '../types';\n\nexport function toSubscriber(\n nextOrObserver?: PartialObserver | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void): Subscriber {\n\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber) {\n return (> nextOrObserver);\n }\n\n if (nextOrObserver[rxSubscriberSymbol]) {\n return nextOrObserver[rxSubscriberSymbol]();\n }\n }\n\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber(emptyObserver);\n }\n\n return new Subscriber(nextOrObserver, error, complete);\n}\n","import { Observer } from './types';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\n\nexport const empty: Observer = {\n closed: true,\n next(value: any): void { /* noop */},\n error(err: any): void {\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n } else {\n hostReportError(err);\n }\n },\n complete(): void { /*noop*/ }\n};\n","import { Subscriber } from './Subscriber';\nimport { InnerSubscriber } from './InnerSubscriber';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class OuterSubscriber extends Subscriber {\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber): void {\n this.destination.next(innerValue);\n }\n\n notifyError(error: any, innerSub: InnerSubscriber): void {\n this.destination.error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber): void {\n this.destination.complete();\n }\n}\n","import { Subject } from './Subject';\nimport { SchedulerLike } from './types';\nimport { queue } from './scheduler/queue';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObserveOnSubscriber } from './operators/observeOn';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\n/**\n * A variant of Subject that \"replays\" or emits old values to new subscribers.\n * It buffers a set number of values and will emit those values immediately to\n * any new subscribers in addition to emitting new values to existing subscribers.\n *\n * @class ReplaySubject\n */\nexport class ReplaySubject extends Subject {\n private _events: (ReplayEvent | T)[] = [];\n private _bufferSize: number;\n private _windowTime: number;\n private _infiniteTimeWindow: boolean = false;\n\n constructor(bufferSize: number = Number.POSITIVE_INFINITY,\n windowTime: number = Number.POSITIVE_INFINITY,\n private scheduler?: SchedulerLike) {\n super();\n this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n this._windowTime = windowTime < 1 ? 1 : windowTime;\n\n if (windowTime === Number.POSITIVE_INFINITY) {\n this._infiniteTimeWindow = true;\n this.next = this.nextInfiniteTimeWindow;\n } else {\n this.next = this.nextTimeWindow;\n }\n }\n\n private nextInfiniteTimeWindow(value: T): void {\n if (!this.isStopped) {\n const _events = this._events;\n _events.push(value);\n // Since this method is invoked in every next() call than the buffer\n // can overgrow the max size only by one item\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n }\n super.next(value);\n }\n\n private nextTimeWindow(value: T): void {\n if (!this.isStopped) {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n }\n super.next(value);\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber): Subscription {\n // When `_infiniteTimeWindow === true` then the buffer is already trimmed\n const _infiniteTimeWindow = this._infiniteTimeWindow;\n const _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n const scheduler = this.scheduler;\n const len = _events.length;\n let subscription: Subscription;\n\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else if (this.isStopped || this.hasError) {\n subscription = Subscription.EMPTY;\n } else {\n this.observers.push(subscriber);\n subscription = new SubjectSubscription(this, subscriber);\n }\n\n if (scheduler) {\n subscriber.add(subscriber = new ObserveOnSubscriber(subscriber, scheduler));\n }\n\n if (_infiniteTimeWindow) {\n for (let i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i]);\n }\n } else {\n for (let i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next((>_events[i]).value);\n }\n }\n\n if (this.hasError) {\n subscriber.error(this.thrownError);\n } else if (this.isStopped) {\n subscriber.complete();\n }\n\n return subscription;\n }\n\n _getNow(): number {\n return (this.scheduler || queue).now();\n }\n\n private _trimBufferThenGetEvents(): ReplayEvent[] {\n const now = this._getNow();\n const _bufferSize = this._bufferSize;\n const _windowTime = this._windowTime;\n const _events = []>this._events;\n\n const eventsCount = _events.length;\n let spliceCount = 0;\n\n // Trim events that fall out of the time window.\n // Start at the front of the list. Break early once\n // we encounter an event that falls within the window.\n while (spliceCount < eventsCount) {\n if ((now - _events[spliceCount].time) < _windowTime) {\n break;\n }\n spliceCount++;\n }\n\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n\n return _events;\n }\n\n}\n\nclass ReplayEvent {\n constructor(public time: number, public value: T) {\n }\n}\n","import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}\n */\nexport class Scheduler implements SchedulerLike {\n\n /**\n * Note: the extra arrow function wrapper is to make testing by overriding\n * Date.now easier.\n * @nocollapse\n */\n public static now: () => number = () => Date.now();\n\n constructor(private SchedulerAction: typeof Action,\n now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return {number} A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n public schedule(work: (this: SchedulerAction, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.SchedulerAction(this, work).schedule(state, delay);\n }\n}\n","import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\n\n/**\n * @class SubjectSubscriber\n */\nexport class SubjectSubscriber extends Subscriber {\n constructor(protected destination: Subject) {\n super(destination);\n }\n}\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n *\n * @class Subject\n */\nexport class Subject extends Observable implements SubscriptionLike {\n\n [rxSubscriberSymbol]() {\n return new SubjectSubscriber(this);\n }\n\n observers: Observer[] = [];\n\n closed = false;\n\n isStopped = false;\n\n hasError = false;\n\n thrownError: any = null;\n\n constructor() {\n super();\n }\n\n /**@nocollapse\n * @deprecated use new Subject() instead\n */\n static create: Function = (destination: Observer, source: Observable): AnonymousSubject => {\n return new AnonymousSubject(destination, source);\n }\n\n lift(operator: Operator): Observable {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n }\n\n next(value?: T) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n }\n\n error(err: any) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n }\n\n complete() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n }\n\n unsubscribe() {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _trySubscribe(subscriber: Subscriber): TeardownLogic {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return super._trySubscribe(subscriber);\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber): Subscription {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n } else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n } else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create customize Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return {Observable} Observable that the Subject casts to\n */\n asObservable(): Observable {\n const observable = new Observable();\n (observable).source = this;\n return observable;\n }\n}\n\n/**\n * @class AnonymousSubject\n */\nexport class AnonymousSubject extends Subject {\n constructor(protected destination?: Observer, source?: Observable) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n const { destination } = this;\n if (destination && destination.next) {\n destination.next(value);\n }\n }\n\n error(err: any) {\n const { destination } = this;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n }\n\n complete() {\n const { destination } = this;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber): Subscription {\n const { source } = this;\n if (source) {\n return this.source.subscribe(subscriber);\n } else {\n return Subscription.EMPTY;\n }\n }\n}\n","import { Subject } from './Subject';\nimport { Observer } from './types';\nimport { Subscription } from './Subscription';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SubjectSubscription extends Subscription {\n closed: boolean = false;\n\n constructor(public subject: Subject, public subscriber: Observer) {\n super();\n }\n\n unsubscribe() {\n if (this.closed) {\n return;\n }\n\n this.closed = true;\n\n const subject = this.subject;\n const observers = subject.observers;\n\n this.subject = null;\n\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n\n const subscriberIndex = observers.indexOf(this.subscriber);\n\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Observer, PartialObserver, TeardownLogic } from './types';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber\n */\nexport class Subscriber extends Subscription implements Observer {\n\n [rxSubscriberSymbol]() { return this; }\n\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param {function(x: ?T): void} [next] The `next` callback of an Observer.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n * @return {Subscriber} A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @nocollapse\n */\n static create(next?: (x?: T) => void,\n error?: (e?: any) => void,\n complete?: () => void): Subscriber {\n const subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n }\n\n /** @internal */ syncErrorValue: any = null;\n /** @internal */ syncErrorThrown: boolean = false;\n /** @internal */ syncErrorThrowable: boolean = false;\n\n protected isStopped: boolean = false;\n protected destination: PartialObserver | Subscriber; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @param {Observer|function(value: T): void} [destinationOrNext] A partially\n * defined Observer or a `next` callback function.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n */\n constructor(destinationOrNext?: PartialObserver | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super();\n\n switch (arguments.length) {\n case 0:\n this.destination = emptyObserver;\n break;\n case 1:\n if (!destinationOrNext) {\n this.destination = emptyObserver;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n this.destination = destinationOrNext;\n destinationOrNext.add(this);\n } else {\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber(this, > destinationOrNext);\n }\n break;\n }\n default:\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber(this, <((value: T) => void)> destinationOrNext, error, complete);\n break;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n next(value?: T): void {\n if (!this.isStopped) {\n this._next(value);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n error(err?: any): void {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n complete(): void {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n super.unsubscribe();\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n this.destination.error(err);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.destination.complete();\n this.unsubscribe();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribeAndRecycle(): Subscriber {\n const { _parentOrParents } = this;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SafeSubscriber extends Subscriber {\n\n private _context: any;\n\n constructor(private _parentSubscriber: Subscriber,\n observerOrNext?: PartialObserver | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super();\n\n let next: ((value: T) => void);\n let context: any = this;\n\n if (isFunction(observerOrNext)) {\n next = (<((value: T) => void)> observerOrNext);\n } else if (observerOrNext) {\n next = (> observerOrNext).next;\n error = (> observerOrNext).error;\n complete = (> observerOrNext).complete;\n if (observerOrNext !== emptyObserver) {\n context = Object.create(observerOrNext);\n if (isFunction(context.unsubscribe)) {\n this.add(<() => void> context.unsubscribe.bind(context));\n }\n context.unsubscribe = this.unsubscribe.bind(this);\n }\n }\n\n this._context = context;\n this._next = next;\n this._error = error;\n this._complete = complete;\n }\n\n next(value?: T): void {\n if (!this.isStopped && this._next) {\n const { _parentSubscriber } = this;\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n }\n\n error(err?: any): void {\n if (!this.isStopped) {\n const { _parentSubscriber } = this;\n const { useDeprecatedSynchronousErrorHandling } = config;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n } else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n } else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError(err);\n } else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n } else {\n hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n }\n\n complete(): void {\n if (!this.isStopped) {\n const { _parentSubscriber } = this;\n if (this._complete) {\n const wrappedComplete = () => this._complete.call(this._context);\n\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n } else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n } else {\n this.unsubscribe();\n }\n }\n }\n\n private __tryOrUnsub(fn: Function, value?: any): void {\n try {\n fn.call(this._context, value);\n } catch (err) {\n this.unsubscribe();\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n } else {\n hostReportError(err);\n }\n }\n }\n\n private __tryOrSetError(parent: Subscriber, fn: Function, value?: any): boolean {\n if (!config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n } catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n } else {\n hostReportError(err);\n return true;\n }\n }\n return false;\n }\n\n /** @internal This is an internal implementation detail, do not use. */\n _unsubscribe(): void {\n const { _parentSubscriber } = this;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n }\n}\n","import { isArray } from './util/isArray';\nimport { isObject } from './util/isObject';\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic } from './types';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nexport class Subscription implements SubscriptionLike {\n /** @nocollapse */\n public static EMPTY: Subscription = (function(empty: any) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n * @type {boolean}\n */\n public closed: boolean = false;\n\n /** @internal */\n protected _parentOrParents: Subscription | Subscription[] = null;\n /** @internal */\n private _subscriptions: SubscriptionLike[] = null;\n\n /**\n * @param {function(): void} [unsubscribe] A function describing how to\n * perform the disposal of resources when the `unsubscribe` method is called.\n */\n constructor(unsubscribe?: () => void) {\n if (unsubscribe) {\n (this as any)._ctorUnsubscribe = true;\n (this as any)._unsubscribe = unsubscribe;\n }\n }\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n unsubscribe(): void {\n let errors: any[];\n\n if (this.closed) {\n return;\n }\n\n let { _parentOrParents, _ctorUnsubscribe, _unsubscribe, _subscriptions } = (this as any);\n\n this.closed = true;\n this._parentOrParents = null;\n // null out _subscriptions first so any child subscriptions that attempt\n // to remove themselves from this subscription will noop\n this._subscriptions = null;\n\n if (_parentOrParents instanceof Subscription) {\n _parentOrParents.remove(this);\n } else if (_parentOrParents !== null) {\n for (let index = 0; index < _parentOrParents.length; ++index) {\n const parent = _parentOrParents[index];\n parent.remove(this);\n }\n }\n\n if (isFunction(_unsubscribe)) {\n // It's only possible to null _unsubscribe - to release the reference to\n // any teardown function passed in the constructor - if the property was\n // actually assigned in the constructor, as there are some classes that\n // are derived from Subscriber (which derives from Subscription) that\n // implement an _unsubscribe method as a mechanism for obtaining\n // unsubscription notifications and some of those subscribers are\n // recycled. Also, in some of those subscribers, _unsubscribe switches\n // from a prototype method to an instance property - see notifyNext in\n // RetryWhenSubscriber.\n if (_ctorUnsubscribe) {\n (this as any)._unsubscribe = undefined;\n }\n try {\n _unsubscribe.call(this);\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n }\n }\n\n if (isArray(_subscriptions)) {\n let index = -1;\n let len = _subscriptions.length;\n\n while (++index < len) {\n const sub = _subscriptions[index];\n if (isObject(sub)) {\n try {\n sub.unsubscribe();\n } catch (e) {\n errors = errors || [];\n if (e instanceof UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(e.errors));\n } else {\n errors.push(e);\n }\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n\n /**\n * Adds a tear down to be called during the unsubscribe() of this\n * Subscription. Can also be used to add a child subscription.\n *\n * If the tear down being added is a subscription that is already\n * unsubscribed, is the same reference `add` is being called on, or is\n * `Subscription.EMPTY`, it will not be added.\n *\n * If this subscription is already in an `closed` state, the passed\n * tear down logic will be executed immediately.\n *\n * When a parent subscription is unsubscribed, any child subscriptions that were added to it are also unsubscribed.\n *\n * @param {TeardownLogic} teardown The additional logic to execute on\n * teardown.\n * @return {Subscription} Returns the Subscription used or created to be\n * added to the inner subscriptions list. This Subscription can be used with\n * `remove()` to remove the passed teardown logic from the inner subscriptions\n * list.\n */\n add(teardown: TeardownLogic): Subscription {\n let subscription = (teardown);\n\n if (!teardown) {\n return Subscription.EMPTY;\n }\n\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(<(() => void)>teardown);\n case 'object':\n if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n // This also covers the case where `subscription` is `Subscription.EMPTY`, which is always in `closed` state.\n return subscription;\n } else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n } else if (!(subscription instanceof Subscription)) {\n const tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default: {\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n }\n\n // Add `this` as parent of `subscription` if that's not already the case.\n let { _parentOrParents } = subscription;\n if (_parentOrParents === null) {\n // If we don't have a parent, then set `subscription._parents` to\n // the `this`, which is the common case that we optimize for.\n subscription._parentOrParents = this;\n } else if (_parentOrParents instanceof Subscription) {\n if (_parentOrParents === this) {\n // The `subscription` already has `this` as a parent.\n return subscription;\n }\n // If there's already one parent, but not multiple, allocate an\n // Array to store the rest of the parent Subscriptions.\n subscription._parentOrParents = [_parentOrParents, this];\n } else if (_parentOrParents.indexOf(this) === -1) {\n // Only add `this` to the _parentOrParents list if it's not already there.\n _parentOrParents.push(this);\n } else {\n // The `subscription` already has `this` as a parent.\n return subscription;\n }\n\n // Optimize for the common case when adding the first subscription.\n const subscriptions = this._subscriptions;\n if (subscriptions === null) {\n this._subscriptions = [subscription];\n } else {\n subscriptions.push(subscription);\n }\n\n return subscription;\n }\n\n /**\n * Removes a Subscription from the internal list of subscriptions that will\n * unsubscribe during the unsubscribe process of this Subscription.\n * @param {Subscription} subscription The subscription to remove.\n * @return {void}\n */\n remove(subscription: Subscription): void {\n const subscriptions = this._subscriptions;\n if (subscriptions) {\n const subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n }\n}\n\nfunction flattenUnsubscriptionErrors(errors: any[]) {\n return errors.reduce((errs, err) => errs.concat((err instanceof UnsubscriptionError) ? err.errors : err), []);\n}\n","let _enable_super_gross_mode_that_will_cause_bad_things = false;\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like what Promise contructor should used to create Promises\n */\nexport const config = {\n /**\n * The promise constructor used by default for methods such as\n * {@link toPromise} and {@link forEach}\n */\n Promise: undefined as PromiseConstructorLike,\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BY TIME\n * FOR MIGRATION REASONS.\n */\n set useDeprecatedSynchronousErrorHandling(value: boolean) {\n if (value) {\n const error = new Error();\n console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n' + error.stack);\n } else if (_enable_super_gross_mode_that_will_cause_bad_things) {\n console.log('RxJS: Back to a better error behavior. Thank you. <3');\n }\n _enable_super_gross_mode_that_will_cause_bad_things = value;\n },\n\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n },\n};\n","/** @prettier */\nimport { Subscription } from './Subscription';\nimport { Subscriber } from './Subscriber';\nimport { Observable } from './Observable';\nimport { subscribeTo } from './util/subscribeTo';\n\ninterface SimpleOuterSubscriberLike {\n /**\n * A handler for inner next notifications from the inner subscription\n * @param innerValue the value nexted by the inner producer\n */\n notifyNext(innerValue: T): void;\n /**\n * A handler for inner error notifications from the inner subscription\n * @param err the error from the inner producer\n */\n notifyError(err: any): void;\n /**\n * A handler for inner complete notifications from the inner subscription.\n */\n notifyComplete(): void;\n}\n\nexport class SimpleInnerSubscriber extends Subscriber {\n constructor(private parent: SimpleOuterSubscriberLike) {\n super();\n }\n\n protected _next(value: T): void {\n this.parent.notifyNext(value);\n }\n\n protected _error(error: any): void {\n this.parent.notifyError(error);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.notifyComplete();\n this.unsubscribe();\n }\n}\n\nexport class ComplexInnerSubscriber extends Subscriber {\n constructor(private parent: ComplexOuterSubscriber, public outerValue: T, public outerIndex: number) {\n super();\n }\n\n protected _next(value: R): void {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);\n }\n\n protected _error(error: any): void {\n this.parent.notifyError(error);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n }\n}\n\nexport class SimpleOuterSubscriber extends Subscriber implements SimpleOuterSubscriberLike {\n notifyNext(innerValue: R): void {\n this.destination.next(innerValue);\n }\n\n notifyError(err: any): void {\n this.destination.error(err);\n }\n\n notifyComplete(): void {\n this.destination.complete();\n }\n}\n\n/**\n * DO NOT USE (formerly \"OuterSubscriber\")\n * TODO: We want to refactor this and remove it. It is retaining values it shouldn't for long\n * periods of time.\n */\nexport class ComplexOuterSubscriber extends Subscriber {\n /**\n * @param _outerValue Used by: bufferToggle, delayWhen, windowToggle\n * @param innerValue Used by: subclass default, combineLatest, race, bufferToggle, windowToggle, withLatestFrom\n * @param _outerIndex Used by: combineLatest, race, withLatestFrom\n * @param _innerSub Used by: delayWhen\n */\n notifyNext(_outerValue: T, innerValue: R, _outerIndex: number, _innerSub: ComplexInnerSubscriber): void {\n this.destination.next(innerValue);\n }\n\n notifyError(error: any): void {\n this.destination.error(error);\n }\n\n /**\n * @param _innerSub Used by: race, bufferToggle, delayWhen, windowToggle, windowWhen\n */\n notifyComplete(_innerSub: ComplexInnerSubscriber): void {\n this.destination.complete();\n }\n}\n\nexport function innerSubscribe(result: any, innerSubscriber: Subscriber): Subscription | undefined {\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(innerSubscriber);\n }\n let subscription: Subscription;\n try {\n subscription = subscribeTo(result)(innerSubscriber) as Subscription;\n } catch (error) {\n innerSubscriber.error(error);\n }\n return subscription;\n}\n","import { Subject, SubjectSubscriber } from '../Subject';\nimport { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { TeardownLogic } from '../types';\nimport { refCount as higherOrderRefCount } from '../operators/refCount';\n\n/**\n * @class ConnectableObservable\n */\nexport class ConnectableObservable extends Observable {\n\n protected _subject: Subject;\n protected _refCount: number = 0;\n protected _connection: Subscription;\n /** @internal */\n _isComplete = false;\n\n constructor(public source: Observable,\n protected subjectFactory: () => Subject) {\n super();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber) {\n return this.getSubject().subscribe(subscriber);\n }\n\n protected getSubject(): Subject {\n const subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n }\n\n connect(): Subscription {\n let connection = this._connection;\n if (!connection) {\n this._isComplete = false;\n connection = this._connection = new Subscription();\n connection.add(this.source\n .subscribe(new ConnectableSubscriber(this.getSubject(), this)));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription.EMPTY;\n }\n }\n return connection;\n }\n\n refCount(): Observable {\n return higherOrderRefCount()(this) as Observable;\n }\n}\n\nexport const connectableObservableDescriptor: PropertyDescriptorMap = (() => {\n const connectableProto = ConnectableObservable.prototype;\n return {\n operator: { value: null as null },\n _refCount: { value: 0, writable: true },\n _subject: { value: null as null, writable: true },\n _connection: { value: null as null, writable: true },\n _subscribe: { value: connectableProto._subscribe },\n _isComplete: { value: connectableProto._isComplete, writable: true },\n getSubject: { value: connectableProto.getSubject },\n connect: { value: connectableProto.connect },\n refCount: { value: connectableProto.refCount }\n };\n})();\n\nclass ConnectableSubscriber extends SubjectSubscriber {\n constructor(destination: Subject,\n private connectable: ConnectableObservable) {\n super(destination);\n }\n protected _error(err: any): void {\n this._unsubscribe();\n super._error(err);\n }\n protected _complete(): void {\n this.connectable._isComplete = true;\n this._unsubscribe();\n super._complete();\n }\n protected _unsubscribe() {\n const connectable = this.connectable;\n if (connectable) {\n this.connectable = null;\n const connection = connectable._connection;\n connectable._refCount = 0;\n connectable._subject = null;\n connectable._connection = null;\n if (connection) {\n connection.unsubscribe();\n }\n }\n }\n}\n\nclass RefCountOperator implements Operator {\n constructor(private connectable: ConnectableObservable) {\n }\n call(subscriber: Subscriber, source: any): TeardownLogic {\n\n const { connectable } = this;\n ( connectable)._refCount++;\n\n const refCounter = new RefCountSubscriber(subscriber, connectable);\n const subscription = source.subscribe(refCounter);\n\n if (!refCounter.closed) {\n ( refCounter).connection = connectable.connect();\n }\n\n return subscription;\n }\n}\n\nclass RefCountSubscriber extends Subscriber {\n\n private connection: Subscription;\n\n constructor(destination: Subscriber,\n private connectable: ConnectableObservable) {\n super(destination);\n }\n\n protected _unsubscribe() {\n\n const { connectable } = this;\n if (!connectable) {\n this.connection = null;\n return;\n }\n\n this.connectable = null;\n const refCount = ( connectable)._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n\n ( connectable)._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n\n ///\n // Compare the local RefCountSubscriber's connection Subscription to the\n // connection Subscription on the shared ConnectableObservable. In cases\n // where the ConnectableObservable source synchronously emits values, and\n // the RefCountSubscriber's downstream Observers synchronously unsubscribe,\n // execution continues to here before the RefCountOperator has a chance to\n // supply the RefCountSubscriber with the shared connection Subscription.\n // For example:\n // ```\n // range(0, 10).pipe(\n // publish(),\n // refCount(),\n // take(5),\n // ).subscribe();\n // ```\n // In order to account for this case, RefCountSubscriber should only dispose\n // the ConnectableObservable's shared connection Subscription if the\n // connection Subscription exists, *and* either:\n // a. RefCountSubscriber doesn't have a reference to the shared connection\n // Subscription yet, or,\n // b. RefCountSubscriber's connection Subscription reference is identical\n // to the shared connection Subscription\n ///\n const { connection } = this;\n const sharedConnection = ( connectable)._connection;\n this.connection = null;\n\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { Subscriber } from '../Subscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { Operator } from '../Operator';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\n\nconst NONE = {};\n\n/* tslint:disable:max-line-length */\n\n// If called with a single array, it \"auto-spreads\" the array, with result selector\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, R>(sources: [O1], resultSelector: (v1: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, R>(sources: [O1, O2], resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, R>(sources: [O1, O2, O3], resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, R>(sources: [O1, O2, O3, O4], resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, R>(sources: [O1, O2, O3, O4, O5], resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput, R>(sources: [O1, O2, O3, O4, O5, O6], resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf, v6: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, R>(sources: O[], resultSelector: (...args: ObservedValueOf[]) => R, scheduler?: SchedulerLike): Observable;\n\n// standard call, but with a result selector\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, R>(v1: O1, resultSelector: (v1: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, R>(v1: O1, v2: O2, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, v4: O4, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf, v6: ObservedValueOf) => R, scheduler?: SchedulerLike): Observable;\n\n// With a scheduler (deprecated)\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest>(sources: [O1], scheduler: SchedulerLike): Observable<[ObservedValueOf]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest, O2 extends ObservableInput>(sources: [O1, O2], scheduler: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput>(sources: [O1, O2, O3], scheduler: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput>(sources: [O1, O2, O3, O4], scheduler: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput>(sources: [O1, O2, O3, O4, O5], scheduler: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput>(sources: [O1, O2, O3, O4, O5, O6], scheduler: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest>(sources: O[], scheduler: SchedulerLike): Observable[]>;\n\n// Best case\nexport function combineLatest>(sources: [O1]): Observable<[ObservedValueOf]>;\nexport function combineLatest, O2 extends ObservableInput>(sources: [O1, O2]): Observable<[ObservedValueOf, ObservedValueOf]>;\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput>(sources: [O1, O2, O3]): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput>(sources: [O1, O2, O3, O4]): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput>(sources: [O1, O2, O3, O4, O5]): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput>(sources: [O1, O2, O3, O4, O5, O6]): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function combineLatest>(sources: O[]): Observable[]>;\n\n// Standard calls\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest>(v1: O1, scheduler?: SchedulerLike): Observable<[ObservedValueOf]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest, O2 extends ObservableInput>(v1: O1, v2: O2, scheduler?: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput>(v1: O1, v2: O2, v3: O3, scheduler?: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, scheduler?: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, scheduler?: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, scheduler?: SchedulerLike): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest>(...observables: O[]): Observable;\n\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest, R>(...observables: Array | ((...values: Array) => R)>): Observable;\n\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest, R>(array: O[], resultSelector: (...values: ObservedValueOf[]) => R, scheduler?: SchedulerLike): Observable;\n\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest>(...observables: Array): Observable;\n\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest, R>(...observables: Array[]) => R) | SchedulerLike>): Observable;\n\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest(...observables: Array | ((...values: Array) => R) | SchedulerLike>): Observable;\n/* tslint:enable:max-line-length */\n\n/**\n * Combines multiple Observables to create an Observable whose values are\n * calculated from the latest values of each of its input Observables.\n *\n * Whenever any input Observable emits a value, it\n * computes a formula using the latest values from all the inputs, then emits\n * the output of that formula.\n *\n * ![](combineLatest.png)\n *\n * `combineLatest` combines the values from all the Observables passed as\n * arguments. This is done by subscribing to each Observable in order and,\n * whenever any Observable emits, collecting an array of the most recent\n * values from each Observable. So if you pass `n` Observables to operator,\n * returned Observable will always emit an array of `n` values, in order\n * corresponding to order of passed Observables (value from the first Observable\n * on the first place and so on).\n *\n * Static version of `combineLatest` accepts either an array of Observables\n * or each Observable can be put directly as an argument. Note that array of\n * Observables is good choice, if you don't know beforehand how many Observables\n * you will combine. Passing empty array will result in Observable that\n * completes immediately.\n *\n * To ensure output array has always the same length, `combineLatest` will\n * actually wait for all input Observables to emit at least once,\n * before it starts emitting results. This means if some Observable emits\n * values before other Observables started emitting, all these values but the last\n * will be lost. On the other hand, if some Observable does not emit a value but\n * completes, resulting Observable will complete at the same moment without\n * emitting anything, since it will be now impossible to include value from\n * completed Observable in resulting array. Also, if some input Observable does\n * not emit any value and never completes, `combineLatest` will also never emit\n * and never complete, since, again, it will wait for all streams to emit some\n * value.\n *\n * If at least one Observable was passed to `combineLatest` and all passed Observables\n * emitted something, resulting Observable will complete when all combined\n * streams complete. So even if some Observable completes, result of\n * `combineLatest` will still emit values when other Observables do. In case\n * of completed Observable, its value from now on will always be the last\n * emitted value. On the other hand, if any Observable errors, `combineLatest`\n * will error immediately as well, and all other Observables will be unsubscribed.\n *\n * `combineLatest` accepts as optional parameter `project` function, which takes\n * as arguments all values that would normally be emitted by resulting Observable.\n * `project` can return any kind of value, which will be then emitted by Observable\n * instead of default array. Note that `project` does not take as argument that array\n * of values, but values themselves. That means default `project` can be imagined\n * as function that takes all its arguments and puts them into an array.\n *\n * ## Examples\n * ### Combine two timer Observables\n * ```ts\n * import { combineLatest, timer } from 'rxjs';\n *\n * const firstTimer = timer(0, 1000); // emit 0, 1, 2... after every second, starting from now\n * const secondTimer = timer(500, 1000); // emit 0, 1, 2... after every second, starting 0,5s from now\n * const combinedTimers = combineLatest(firstTimer, secondTimer);\n * combinedTimers.subscribe(value => console.log(value));\n * // Logs\n * // [0, 0] after 0.5s\n * // [1, 0] after 1s\n * // [1, 1] after 1.5s\n * // [2, 1] after 2s\n * ```\n *\n * ### Combine an array of Observables\n * ```ts\n * import { combineLatest, of } from 'rxjs';\n * import { delay, starWith } from 'rxjs/operators';\n *\n * const observables = [1, 5, 10].map(\n * n => of(n).pipe(\n * delay(n * 1000), // emit 0 and then emit n after n seconds\n * startWith(0),\n * )\n * );\n * const combined = combineLatest(observables);\n * combined.subscribe(value => console.log(value));\n * // Logs\n * // [0, 0, 0] immediately\n * // [1, 0, 0] after 1s\n * // [1, 5, 0] after 5s\n * // [1, 5, 10] after 10s\n * ```\n *\n *\n * ### Use project function to dynamically calculate the Body-Mass Index\n * ```ts\n * import { combineLatest, of } from 'rxjs';\n * import { map } from 'rxjs/operators';\n *\n * const weight = of(70, 72, 76, 79, 75);\n * const height = of(1.76, 1.77, 1.78);\n * const bmi = combineLatest(weight, height).pipe(\n * map(([w, h]) => w / (h * h)),\n * );\n * bmi.subscribe(x => console.log('BMI is ' + x));\n *\n * // With output to console:\n * // BMI is 24.212293388429753\n * // BMI is 23.93948099205209\n * // BMI is 23.671253629592222\n * ```\n *\n * @see {@link combineAll}\n * @see {@link merge}\n * @see {@link withLatestFrom}\n *\n * @param {ObservableInput} observable1 An input Observable to combine with other Observables.\n * @param {ObservableInput} observable2 An input Observable to combine with other Observables.\n * More than one input Observables may be given as arguments\n * or an array of Observables may be given as the first argument.\n * @param {function} [project] An optional function to project the values from\n * the combined latest values into a new value on the output Observable.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for subscribing to\n * each input Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n */\nexport function combineLatest, R>(\n ...observables: (O | ((...values: ObservedValueOf[]) => R) | SchedulerLike)[]\n): Observable {\n let resultSelector: ((...values: Array) => R) | undefined = undefined;\n let scheduler: SchedulerLike|undefined = undefined;\n\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop() as SchedulerLike;\n }\n\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop() as (...values: Array) => R;\n }\n\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `combineLatest([obs1, obs2, obs3], resultSelector)`\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0] as any;\n }\n\n return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\n\nexport class CombineLatestOperator implements Operator {\n constructor(private resultSelector?: (...values: Array) => R) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class CombineLatestSubscriber extends OuterSubscriber {\n private active: number = 0;\n private values: any[] = [];\n private observables: any[] = [];\n private toRespond?: number;\n\n constructor(destination: Subscriber, private resultSelector?: (...values: Array) => R) {\n super(destination);\n }\n\n protected _next(observable: any) {\n this.values.push(NONE);\n this.observables.push(observable);\n }\n\n protected _complete() {\n const observables = this.observables;\n const len = observables.length;\n if (len === 0) {\n this.destination.complete!();\n } else {\n this.active = len;\n this.toRespond = len;\n for (let i = 0; i < len; i++) {\n const observable = observables[i];\n this.add(subscribeToResult(this, observable, undefined, i));\n }\n }\n }\n\n notifyComplete(unused: Subscriber): void {\n if ((this.active -= 1) === 0) {\n this.destination.complete!();\n }\n }\n\n notifyNext(_outerValue: T, innerValue: R,\n outerIndex: number): void {\n const values = this.values;\n const oldVal = values[outerIndex];\n const toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n } else {\n this.destination.next!(values.slice());\n }\n }\n }\n\n private _tryResultSelector(values: any[]) {\n let result: any;\n try {\n result = this.resultSelector!.apply(this, values);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.destination.next!(result);\n }\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { of } from './of';\nimport { from } from './from';\nimport { concatAll } from '../operators/concatAll';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat>(v1: O1, scheduler: SchedulerLike): Observable>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat, O2 extends ObservableInput>(v1: O1, v2: O2, scheduler: SchedulerLike): Observable | ObservedValueOf>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput>(v1: O1, v2: O2, v3: O3, scheduler: SchedulerLike): Observable | ObservedValueOf | ObservedValueOf>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, scheduler: SchedulerLike): Observable | ObservedValueOf | ObservedValueOf | ObservedValueOf>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, scheduler: SchedulerLike): Observable | ObservedValueOf | ObservedValueOf | ObservedValueOf | ObservedValueOf>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, scheduler: SchedulerLike): Observable | ObservedValueOf | ObservedValueOf | ObservedValueOf | ObservedValueOf | ObservedValueOf>;\n\nexport function concat>(v1: O1): Observable>;\nexport function concat, O2 extends ObservableInput>(v1: O1, v2: O2): Observable | ObservedValueOf>;\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput>(v1: O1, v2: O2, v3: O3): Observable | ObservedValueOf | ObservedValueOf>;\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4): Observable | ObservedValueOf | ObservedValueOf | ObservedValueOf>;\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5): Observable | ObservedValueOf | ObservedValueOf | ObservedValueOf | ObservedValueOf>;\nexport function concat, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6): Observable | ObservedValueOf | ObservedValueOf | ObservedValueOf | ObservedValueOf | ObservedValueOf>;\nexport function concat>(...observables: O[]): Observable>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat>(...observables: (O | SchedulerLike)[]): Observable>;\nexport function concat(...observables: ObservableInput[]): Observable;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat(...observables: (ObservableInput | SchedulerLike)[]): Observable;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which sequentially emits all values from given\n * Observable and then moves on to the next.\n *\n * Concatenates multiple Observables together by\n * sequentially emitting their values, one Observable after the other.\n *\n * ![](concat.png)\n *\n * `concat` joins multiple Observables together, by subscribing to them one at a time and\n * merging their results into the output Observable. You can pass either an array of\n * Observables, or put them directly as arguments. Passing an empty array will result\n * in Observable that completes immediately.\n *\n * `concat` will subscribe to first input Observable and emit all its values, without\n * changing or affecting them in any way. When that Observable completes, it will\n * subscribe to then next Observable passed and, again, emit its values. This will be\n * repeated, until the operator runs out of Observables. When last input Observable completes,\n * `concat` will complete as well. At any given moment only one Observable passed to operator\n * emits values. If you would like to emit values from passed Observables concurrently, check out\n * {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,\n * `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.\n *\n * Note that if some input Observable never completes, `concat` will also never complete\n * and Observables following the one that did not complete will never be subscribed. On the other\n * hand, if some Observable simply completes immediately after it is subscribed, it will be\n * invisible for `concat`, which will just move on to the next Observable.\n *\n * If any Observable in chain errors, instead of passing control to the next Observable,\n * `concat` will error immediately as well. Observables that would be subscribed after\n * the one that emitted error, never will.\n *\n * If you pass to `concat` the same Observable many times, its stream of values\n * will be \"replayed\" on every subscription, which means you can repeat given Observable\n * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,\n * you can always use {@link repeat}.\n *\n * ## Examples\n * ### Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10\n * ```ts\n * import { concat, interval, range } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer = interval(1000).pipe(take(4));\n * const sequence = range(1, 10);\n * const result = concat(timer, sequence);\n * result.subscribe(x => console.log(x));\n *\n * // results in:\n * // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10\n * ```\n *\n * ### Concatenate 3 Observables\n * ```ts\n * import { concat, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer1 = interval(1000).pipe(take(10));\n * const timer2 = interval(2000).pipe(take(6));\n * const timer3 = interval(500).pipe(take(10));\n *\n * const result = concat(timer1, timer2, timer3);\n * result.subscribe(x => console.log(x));\n *\n * // results in the following:\n * // (Prints to console sequentially)\n * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9\n * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5\n * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9\n * ```\n *\n * ### Concatenate the same Observable to repeat it\n * ```ts\n * import { concat, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer = interval(1000).pipe(take(2));\n *\n * concat(timer, timer) // concatenating the same Observable!\n * .subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('...and it is done!')\n * );\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 0 after 3s\n * // 1 after 4s\n * // \"...and it is done!\" also after 4s\n * ```\n *\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n * @see {@link startWith}\n * @see {@link endWith}\n *\n * @param {ObservableInput} input1 An input Observable to concatenate with others.\n * @param {ObservableInput} input2 An input Observable to concatenate with others.\n * More than one input Observables may be given as argument.\n * @param {SchedulerLike} [scheduler=null] An optional {@link SchedulerLike} to schedule each\n * Observable subscription on.\n * @return {Observable} All values of each passed Observable merged into a\n * single Observable, in order, in serial fashion.\n * @static true\n * @name concat\n * @owner Observable\n */\nexport function concat, R>(...observables: Array): Observable | R> {\n return concatAll()(of(...observables));\n}\n","import { Observable } from '../Observable';\nimport { SubscribableOrPromise, ObservedValueOf, ObservableInput } from '../types';\nimport { from } from './from'; // lol\nimport { empty } from './empty';\n\n/**\n * Creates an Observable that, on subscribe, calls an Observable factory to\n * make an Observable for each new Observer.\n *\n * Creates the Observable lazily, that is, only when it\n * is subscribed.\n * \n *\n * ![](defer.png)\n *\n * `defer` allows you to create the Observable only when the Observer\n * subscribes, and create a fresh Observable for each Observer. It waits until\n * an Observer subscribes to it, and then it generates an Observable,\n * typically with an Observable factory function. It does this afresh for each\n * subscriber, so although each subscriber may think it is subscribing to the\n * same Observable, in fact each subscriber gets its own individual\n * Observable.\n *\n * ## Example\n * ### Subscribe to either an Observable of clicks or an Observable of interval, at random\n * ```ts\n * import { defer, fromEvent, interval } from 'rxjs';\n *\n * const clicksOrInterval = defer(function () {\n * return Math.random() > 0.5\n * ? fromEvent(document, 'click')\n * : interval(1000);\n * });\n * clicksOrInterval.subscribe(x => console.log(x));\n *\n * // Results in the following behavior:\n * // If the result of Math.random() is greater than 0.5 it will listen\n * // for clicks anywhere on the \"document\"; when document is clicked it\n * // will log a MouseEvent object to the console. If the result is less\n * // than 0.5 it will emit ascending numbers, one every second(1000ms).\n * ```\n *\n * @see {@link Observable}\n *\n * @param {function(): SubscribableOrPromise} observableFactory The Observable\n * factory function to invoke for each Observer that subscribes to the output\n * Observable. May also return a Promise, which will be converted on the fly\n * to an Observable.\n * @return {Observable} An Observable whose Observers' subscriptions trigger\n * an invocation of the given Observable factory function.\n * @static true\n * @name defer\n * @owner Observable\n */\nexport function defer | void>(observableFactory: () => R): Observable> {\n return new Observable>(subscriber => {\n let input: R | void;\n try {\n input = observableFactory();\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n const source = input ? from(input as ObservableInput>) : empty();\n return source.subscribe(subscriber);\n });\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\n\n/**\n * The same Observable instance returned by any call to {@link empty} without a\n * `scheduler`. It is preferrable to use this over `empty()`.\n */\nexport const EMPTY = new Observable(subscriber => subscriber.complete());\n\n/**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * Just emits 'complete', and nothing else.\n * \n *\n * ![](empty.png)\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n * ### Emit the number 7, then complete\n * ```ts\n * import { empty } from 'rxjs';\n * import { startWith } from 'rxjs/operators';\n *\n * const result = empty().pipe(startWith(7));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * ### Map and flatten only odd numbers to the sequence 'a', 'b', 'c'\n * ```ts\n * import { empty, interval, of } from 'rxjs';\n * import { mergeMap } from 'rxjs/operators';\n *\n * const interval$ = interval(1000);\n * const result = interval$.pipe(\n * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : empty()),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval eg(0,1,2,3,...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1 print abc\n * // if x % 2 is not equal to 1 nothing will be output\n * ```\n *\n * @see {@link Observable}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throwError}\n *\n * @param scheduler A {@link SchedulerLike} to use for scheduling\n * the emission of the complete notification.\n * @return An \"empty\" Observable: emits only the complete\n * notification.\n * @deprecated Deprecated in favor of using {@link EMPTY} constant, or {@link scheduled} (e.g. `scheduled([], scheduler)`)\n */\nexport function empty(scheduler?: SchedulerLike) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\n\nfunction emptyScheduled(scheduler: SchedulerLike) {\n return new Observable(subscriber => scheduler.schedule(() => subscriber.complete()));\n}\n","import { Observable } from '../Observable';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';\nimport { scheduled } from '../scheduled/scheduled';\n\nexport function from>(input: O): Observable>;\n/** @deprecated use {@link scheduled} instead. */\nexport function from>(input: O, scheduler: SchedulerLike): Observable>;\n\n/**\n * Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object.\n *\n * Converts almost anything to an Observable.\n *\n * ![](from.png)\n *\n * `from` converts various other objects and data types into Observables. It also converts a Promise, an array-like, or an\n * iterable\n * object into an Observable that emits the items in that promise, array, or iterable. A String, in this context, is treated\n * as an array of characters. Observable-like objects (contains a function named with the ES2015 Symbol for Observable) can also be\n * converted through this operator.\n *\n * ## Examples\n *\n * ### Converts an array to an Observable\n *\n * ```ts\n * import { from } from 'rxjs';\n *\n * const array = [10, 20, 30];\n * const result = from(array);\n *\n * result.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 10\n * // 20\n * // 30\n * ```\n *\n * ---\n *\n * ### Convert an infinite iterable (from a generator) to an Observable\n *\n * ```ts\n * import { from } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * function* generateDoubles(seed) {\n * let i = seed;\n * while (true) {\n * yield i;\n * i = 2 * i; // double it\n * }\n * }\n *\n * const iterator = generateDoubles(3);\n * const result = from(iterator).pipe(take(10));\n *\n * result.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 3\n * // 6\n * // 12\n * // 24\n * // 48\n * // 96\n * // 192\n * // 384\n * // 768\n * // 1536\n * ```\n *\n * ---\n *\n * ### With async scheduler\n *\n * ```ts\n * import { from, asyncScheduler } from 'rxjs';\n *\n * console.log('start');\n *\n * const array = [10, 20, 30];\n * const result = from(array, asyncScheduler);\n *\n * result.subscribe(x => console.log(x));\n *\n * console.log('end');\n *\n * // Logs:\n * // start\n * // end\n * // 10\n * // 20\n * // 30\n * ```\n *\n * @see {@link fromEvent}\n * @see {@link fromEventPattern}\n *\n * @param {ObservableInput} A subscription object, a Promise, an Observable-like,\n * an Array, an iterable, or an array-like object to be converted.\n * @param {SchedulerLike} An optional {@link SchedulerLike} on which to schedule the emission of values.\n * @return {Observable}\n * @name from\n * @owner Observable\n */\nexport function from(input: ObservableInput, scheduler?: SchedulerLike): Observable {\n if (!scheduler) {\n if (input instanceof Observable) {\n return input;\n }\n return new Observable(subscribeTo(input));\n } else {\n return scheduled(input, scheduler);\n }\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { subscribeToArray } from '../util/subscribeToArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\n\nexport function fromArray(input: ArrayLike, scheduler?: SchedulerLike) {\n if (!scheduler) {\n return new Observable(subscribeToArray(input));\n } else {\n return scheduleArray(input, scheduler);\n }\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike} from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { mergeAll } from '../operators/mergeAll';\nimport { fromArray } from './fromArray';\n\n/* tslint:disable:max-line-length */\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, concurrent: number, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, concurrent: number, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, concurrent: number, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, concurrent: number, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, concurrent: number, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, concurrent: number, scheduler: SchedulerLike): Observable;\n\nexport function merge(v1: ObservableInput): Observable;\nexport function merge(v1: ObservableInput, concurrent?: number): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, concurrent?: number): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, concurrent?: number): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, concurrent?: number): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, concurrent?: number): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput): Observable;\nexport function merge(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, concurrent?: number): Observable;\nexport function merge(...observables: (ObservableInput | number)[]): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(...observables: (ObservableInput | SchedulerLike | number)[]): Observable;\nexport function merge(...observables: (ObservableInput | number)[]): Observable;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge(...observables: (ObservableInput | SchedulerLike | number)[]): Observable;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which concurrently emits all values from every\n * given input Observable.\n *\n * Flattens multiple Observables together by blending\n * their values into one Observable.\n *\n * ![](merge.png)\n *\n * `merge` subscribes to each given input Observable (as arguments), and simply\n * forwards (without doing any transformation) all the values from all the input\n * Observables to the output Observable. The output Observable only completes\n * once all input Observables have completed. Any error delivered by an input\n * Observable will be immediately emitted on the output Observable.\n *\n * ## Examples\n * ### Merge together two Observables: 1s interval and clicks\n * ```ts\n * import { merge, fromEvent, interval } from 'rxjs';\n *\n * const clicks = fromEvent(document, 'click');\n * const timer = interval(1000);\n * const clicksOrTimer = merge(clicks, timer);\n * clicksOrTimer.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // timer will emit ascending values, one every second(1000ms) to console\n * // clicks logs MouseEvents to console everytime the \"document\" is clicked\n * // Since the two streams are merged you see these happening\n * // as they occur.\n * ```\n *\n * ### Merge together 3 Observables, but only 2 run concurrently\n * ```ts\n * import { merge, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer1 = interval(1000).pipe(take(10));\n * const timer2 = interval(2000).pipe(take(6));\n * const timer3 = interval(500).pipe(take(10));\n * const concurrent = 2; // the argument\n * const merged = merge(timer1, timer2, timer3, concurrent);\n * merged.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // - First timer1 and timer2 will run concurrently\n * // - timer1 will emit a value every 1000ms for 10 iterations\n * // - timer2 will emit a value every 2000ms for 6 iterations\n * // - after timer1 hits its max iteration, timer2 will\n * // continue, and timer3 will start to run concurrently with timer2\n * // - when timer2 hits its max iteration it terminates, and\n * // timer3 will continue to emit a value every 500ms until it is complete\n * ```\n *\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n *\n * @param {...ObservableInput} observables Input Observables to merge together.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for managing\n * concurrency of input Observables.\n * @return {Observable} an Observable that emits items that are the result of\n * every input Observable.\n * @static true\n * @name merge\n * @owner Observable\n */\nexport function merge(...observables: Array | SchedulerLike | number>): Observable {\n let concurrent = Number.POSITIVE_INFINITY;\n let scheduler: SchedulerLike = null;\n let last: any = observables[observables.length - 1];\n if (isScheduler(last)) {\n scheduler = observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = observables.pop();\n }\n } else if (typeof last === 'number') {\n concurrent = observables.pop();\n }\n\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {\n return >observables[0];\n }\n\n return mergeAll(concurrent)(fromArray(observables, scheduler));\n}\n","import { SchedulerLike } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { fromArray } from './fromArray';\nimport { Observable } from '../Observable';\nimport { scheduleArray } from '../scheduled/scheduleArray';\n\n/* tslint:disable:max-line-length */\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, c: T3, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, c: T3, d: T4, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, scheduler: SchedulerLike): Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, scheduler: SchedulerLike):\n Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, scheduler: SchedulerLike):\n Observable;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9, scheduler: SchedulerLike):\n Observable;\nexport function of(...args: (T | SchedulerLike)[]): Observable;\n\n// TODO(benlesh): Update the typings for this when we can switch to TS 3.x\nexport function of(a: T): Observable;\nexport function of(a: T, b: T2): Observable;\nexport function of(a: T, b: T2, c: T3): Observable;\nexport function of(a: T, b: T2, c: T3, d: T4): Observable;\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5): Observable;\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6): Observable;\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7):\n Observable;\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8):\n Observable;\nexport function of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9):\n Observable;\nexport function of(...args: T[]): Observable;\n/* tslint:enable:max-line-length */\n\n/**\n * Converts the arguments to an observable sequence.\n *\n * Each argument becomes a `next` notification.\n *\n * ![](of.png)\n *\n * Unlike {@link from}, it does not do any flattening and emits each argument in whole\n * as a separate `next` notification.\n *\n * ## Examples\n *\n * Emit the values `10, 20, 30`\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * of(10, 20, 30)\n * .subscribe(\n * next => console.log('next:', next),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'next: 10'\n * // 'next: 20'\n * // 'next: 30'\n *\n * ```\n *\n * Emit the array `[1,2,3]`\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * of([1,2,3])\n * .subscribe(\n * next => console.log('next:', next),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'next: [1,2,3]'\n * ```\n *\n * @see {@link from}\n * @see {@link range}\n *\n * @param {...T} values A comma separated list of arguments you want to be emitted\n * @return {Observable} An Observable that emits the arguments\n * described above and then completes.\n * @method of\n * @owner Observable\n */\n\nexport function of(...args: Array): Observable {\n let scheduler = args[args.length - 1] as SchedulerLike;\n if (isScheduler(scheduler)) {\n args.pop();\n return scheduleArray(args as T[], scheduler);\n } else {\n return fromArray(args as T[]);\n }\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { fromArray } from './fromArray';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { TeardownLogic, ObservableInput } from '../types';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\n\n// tslint:disable:max-line-length\nexport function race(arg: [ObservableInput]): Observable;\nexport function race(arg: [ObservableInput, ObservableInput]): Observable;\nexport function race(arg: [ObservableInput, ObservableInput, ObservableInput]): Observable;\nexport function race(arg: [ObservableInput, ObservableInput, ObservableInput, ObservableInput]): Observable;\nexport function race(arg: [ObservableInput, ObservableInput, ObservableInput, ObservableInput, ObservableInput]): Observable;\nexport function race(arg: ObservableInput[]): Observable;\nexport function race(arg: ObservableInput[]): Observable<{}>;\n\nexport function race(a: ObservableInput): Observable;\nexport function race(a: ObservableInput, b: ObservableInput): Observable;\nexport function race(a: ObservableInput, b: ObservableInput, c: ObservableInput): Observable;\nexport function race(a: ObservableInput, b: ObservableInput, c: ObservableInput, d: ObservableInput): Observable;\nexport function race(a: ObservableInput, b: ObservableInput, c: ObservableInput, d: ObservableInput, e: ObservableInput): Observable;\n// tslint:enable:max-line-length\n\nexport function race(observables: ObservableInput[]): Observable;\nexport function race(observables: ObservableInput[]): Observable<{}>;\nexport function race(...observables: ObservableInput[]): Observable;\nexport function race(...observables: ObservableInput[]): Observable<{}>;\n\n/**\n * Returns an Observable that mirrors the first source Observable to emit an item.\n *\n * ## Example\n * ### Subscribes to the observable that was the first to start emitting.\n *\n * ```ts\n * import { race, interval } from 'rxjs';\n * import { mapTo } from 'rxjs/operators';\n *\n * const obs1 = interval(1000).pipe(mapTo('fast one'));\n * const obs2 = interval(3000).pipe(mapTo('medium one'));\n * const obs3 = interval(5000).pipe(mapTo('slow one'));\n *\n * race(obs3, obs1, obs2)\n * .subscribe(\n * winner => console.log(winner)\n * );\n *\n * // result:\n * // a series of 'fast one'\n * ```\n *\n * @param {...Observables} ...observables sources used to race for which Observable emits first.\n * @return {Observable} an Observable that mirrors the output of the first Observable to emit an item.\n * @static true\n * @name race\n * @owner Observable\n */\nexport function race(...observables: ObservableInput[]): Observable {\n // if the only argument is an array, it was most likely called with\n // `race([obs1, obs2, ...])`\n if (observables.length === 1) {\n if (isArray(observables[0])) {\n observables = observables[0] as Observable[];\n } else {\n return observables[0] as Observable;\n }\n }\n\n return fromArray(observables, undefined).lift(new RaceOperator());\n}\n\nexport class RaceOperator implements Operator {\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new RaceSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class RaceSubscriber extends OuterSubscriber {\n private hasFirst: boolean = false;\n private observables: Observable[] = [];\n private subscriptions: Subscription[] = [];\n\n constructor(destination: Subscriber) {\n super(destination);\n }\n\n protected _next(observable: any): void {\n this.observables.push(observable);\n }\n\n protected _complete() {\n const observables = this.observables;\n const len = observables.length;\n\n if (len === 0) {\n this.destination.complete!();\n } else {\n for (let i = 0; i < len && !this.hasFirst; i++) {\n const observable = observables[i];\n const subscription = subscribeToResult(this, observable, undefined, i)!;\n\n if (this.subscriptions) {\n this.subscriptions.push(subscription);\n }\n this.add(subscription);\n }\n this.observables = null!;\n }\n }\n\n notifyNext(_outerValue: T, innerValue: T,\n outerIndex: number): void {\n if (!this.hasFirst) {\n this.hasFirst = true;\n\n for (let i = 0; i < this.subscriptions.length; i++) {\n if (i !== outerIndex) {\n let subscription = this.subscriptions[i];\n\n subscription.unsubscribe();\n this.remove(subscription);\n }\n }\n\n this.subscriptions = null!;\n }\n\n this.destination.next!(innerValue);\n }\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits an error notification.\n *\n * Just emits 'error', and nothing else.\n * \n *\n * ![](throw.png)\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the error notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n * ### Emit the number 7, then emit an error\n * ```ts\n * import { throwError, concat, of } from 'rxjs';\n *\n * const result = concat(of(7), throwError(new Error('oops!')));\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * // Logs:\n * // 7\n * // Error: oops!\n * ```\n *\n * ---\n *\n * ### Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 2\n * ```ts\n * import { throwError, interval, of } from 'rxjs';\n * import { mergeMap } from 'rxjs/operators';\n *\n * interval(1000).pipe(\n * mergeMap(x => x === 2\n * ? throwError('Twos are bad')\n * : of('a', 'b', 'c')\n * ),\n * ).subscribe(x => console.log(x), e => console.error(e));\n *\n * // Logs:\n * // a\n * // b\n * // c\n * // a\n * // b\n * // c\n * // Twos are bad\n * ```\n *\n * @see {@link Observable}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link of}\n *\n * @param {any} error The particular Error to pass to the error notification.\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling\n * the emission of the error notification.\n * @return {Observable} An error Observable: emits only the error notification\n * using the given error argument.\n * @static true\n * @name throwError\n * @owner Observable\n */\nexport function throwError(error: any, scheduler?: SchedulerLike): Observable {\n if (!scheduler) {\n return new Observable(subscriber => subscriber.error(error));\n } else {\n return new Observable(subscriber => scheduler.schedule(dispatch, 0, { error, subscriber }));\n }\n}\n\ninterface DispatchArg {\n error: any;\n subscriber: Subscriber;\n}\n\nfunction dispatch({ error, subscriber }: DispatchArg) {\n subscriber.error(error);\n}\n","import { Observable } from '../Observable';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { async } from '../scheduler/async';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that starts emitting after an `dueTime` and\n * emits ever increasing numbers after each `period` of time thereafter.\n *\n * Its like {@link index/interval}, but you can specify when\n * should the emissions start.\n *\n * ![](timer.png)\n *\n * `timer` returns an Observable that emits an infinite sequence of ascending\n * integers, with a constant interval of time, `period` of your choosing\n * between those emissions. The first emission happens after the specified\n * `dueTime`. The initial delay may be a `Date`. By default, this\n * operator uses the {@link asyncScheduler} {@link SchedulerLike} to provide a notion of time, but you\n * may pass any {@link SchedulerLike} to it. If `period` is not specified, the output\n * Observable emits only one value, `0`. Otherwise, it emits an infinite\n * sequence.\n *\n * ## Examples\n * ### Emits ascending numbers, one every second (1000ms), starting after 3 seconds\n * ```ts\n * import { timer } from 'rxjs';\n *\n * const numbers = timer(3000, 1000);\n * numbers.subscribe(x => console.log(x));\n * ```\n *\n * ### Emits one number after five seconds\n * ```ts\n * import { timer } from 'rxjs';\n *\n * const numbers = timer(5000);\n * numbers.subscribe(x => console.log(x));\n * ```\n * @see {@link index/interval}\n * @see {@link delay}\n *\n * @param {number|Date} [dueTime] The initial delay time specified as a Date object or as an integer denoting\n * milliseconds to wait before emitting the first value of 0`.\n * @param {number|SchedulerLike} [periodOrScheduler] The period of time between emissions of the\n * subsequent numbers.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling\n * the emission of values, and providing a notion of \"time\".\n * @return {Observable} An Observable that emits a `0` after the\n * `dueTime` and ever increasing numbers after each `period` of time\n * thereafter.\n * @static true\n * @name timer\n * @owner Observable\n */\nexport function timer(dueTime: number | Date = 0,\n periodOrScheduler?: number | SchedulerLike,\n scheduler?: SchedulerLike): Observable {\n let period = -1;\n if (isNumeric(periodOrScheduler)) {\n period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);\n } else if (isScheduler(periodOrScheduler)) {\n scheduler = periodOrScheduler as any;\n }\n\n if (!isScheduler(scheduler)) {\n scheduler = async;\n }\n\n return new Observable(subscriber => {\n const due = isNumeric(dueTime)\n ? (dueTime as number)\n : (+dueTime - scheduler.now());\n\n return scheduler.schedule(dispatch, due, {\n index: 0, period, subscriber\n });\n });\n}\n\ninterface TimerState {\n index: number;\n period: number;\n subscriber: Subscriber;\n}\n\nfunction dispatch(this: SchedulerAction, state: TimerState) {\n const { index, period, subscriber } = state;\n subscriber.next(index);\n\n if (subscriber.closed) {\n return;\n } else if (period === -1) {\n return subscriber.complete();\n }\n\n state.index = index + 1;\n this.schedule(state, period);\n}\n","import { Observable } from '../Observable';\nimport { fromArray } from './fromArray';\nimport { isArray } from '../util/isArray';\nimport { Operator } from '../Operator';\nimport { ObservableInput, PartialObserver, ObservedValueOf } from '../types';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { iterator as Symbol_iterator } from '../../internal/symbol/iterator';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip, R>(v1: O1, resultSelector: (v1: ObservedValueOf) => R): Observable;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip, O2 extends ObservableInput, R>(v1: O1, v2: O2, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf) => R): Observable;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf) => R): Observable;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, v4: O4, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf) => R): Observable;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf) => R): Observable;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, resultSelector: (v1: ObservedValueOf, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf, v6: ObservedValueOf) => R): Observable;\n\nexport function zip, O2 extends ObservableInput>(v1: O1, v2: O2): Observable<[ObservedValueOf, ObservedValueOf]>;\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput>(v1: O1, v2: O2, v3: O3): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function zip, O2 extends ObservableInput, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6): Observable<[ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\n\nexport function zip>(array: O[]): Observable[]>;\nexport function zip(array: ObservableInput[]): Observable;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip, R>(array: O[], resultSelector: (...values: ObservedValueOf[]) => R): Observable;\n/** @deprecated resultSelector is no longer supported, pipe to map instead */\nexport function zip(array: ObservableInput[], resultSelector: (...values: any[]) => R): Observable;\n\nexport function zip>(...observables: O[]): Observable[]>;\nexport function zip, R>(...observables: Array[]) => R)>): Observable;\nexport function zip(...observables: Array | ((...values: Array) => R)>): Observable;\n/* tslint:enable:max-line-length */\n\n/**\n * Combines multiple Observables to create an Observable whose values are calculated from the values, in order, of each\n * of its input Observables.\n *\n * If the last parameter is a function, this function is used to compute the created value from the input values.\n * Otherwise, an array of the input values is returned.\n *\n * ## Example\n * Combine age and name from different sources\n * ```ts\n * import { zip, of } from 'rxjs';\n * import { map } from 'rxjs/operators';\n *\n * let age$ = of(27, 25, 29);\n * let name$ = of('Foo', 'Bar', 'Beer');\n * let isDev$ = of(true, true, false);\n *\n * zip(age$, name$, isDev$).pipe(\n * map(([age, name, isDev]) => ({ age, name, isDev })),\n * )\n * .subscribe(x => console.log(x));\n *\n * // outputs\n * // { age: 27, name: 'Foo', isDev: true }\n * // { age: 25, name: 'Bar', isDev: true }\n * // { age: 29, name: 'Beer', isDev: false }\n * ```\n * @param observables\n * @return {Observable}\n * @static true\n * @name zip\n * @owner Observable\n */\nexport function zip, R>(\n ...observables: Array[]) => R)>\n): Observable[]|R> {\n const resultSelector = <((...ys: Array) => R)> observables[observables.length - 1];\n if (typeof resultSelector === 'function') {\n observables.pop();\n }\n return fromArray(observables, undefined).lift(new ZipOperator(resultSelector));\n}\n\nexport class ZipOperator implements Operator {\n\n resultSelector?: (...values: Array) => R;\n\n constructor(resultSelector?: (...values: Array) => R) {\n this.resultSelector = resultSelector;\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ZipSubscriber extends Subscriber {\n private iterators: LookAheadIterator[] = [];\n private active = 0;\n\n constructor(destination: Subscriber,\n private resultSelector?: (...values: Array) => R,\n values: any = Object.create(null)) {\n super(destination);\n this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : undefined;\n }\n\n protected _next(value: any) {\n const iterators = this.iterators;\n if (isArray(value)) {\n iterators.push(new StaticArrayIterator(value));\n } else if (typeof value[Symbol_iterator] === 'function') {\n iterators.push(new StaticIterator(value[Symbol_iterator]()));\n } else {\n iterators.push(new ZipBufferIterator(this.destination, this, value));\n }\n }\n\n protected _complete() {\n const iterators = this.iterators;\n const len = iterators.length;\n\n this.unsubscribe();\n\n if (len === 0) {\n this.destination.complete!();\n return;\n }\n\n this.active = len;\n for (let i = 0; i < len; i++) {\n let iterator: ZipBufferIterator = iterators[i];\n if (iterator.stillUnsubscribed) {\n const destination = this.destination as Subscription;\n destination.add(iterator.subscribe());\n } else {\n this.active--; // not an observable\n }\n }\n }\n\n notifyInactive() {\n this.active--;\n if (this.active === 0) {\n this.destination.complete!();\n }\n }\n\n checkIterators() {\n const iterators = this.iterators;\n const len = iterators.length;\n const destination = this.destination;\n\n // abort if not all of them have values\n for (let i = 0; i < len; i++) {\n let iterator = iterators[i];\n if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {\n return;\n }\n }\n\n let shouldComplete = false;\n const args: any[] = [];\n for (let i = 0; i < len; i++) {\n let iterator = iterators[i];\n let result = iterator.next();\n\n // check to see if it's completed now that you've gotten\n // the next value.\n if (iterator.hasCompleted()) {\n shouldComplete = true;\n }\n\n if (result.done) {\n destination.complete!();\n return;\n }\n\n args.push(result.value);\n }\n\n if (this.resultSelector) {\n this._tryresultSelector(args);\n } else {\n destination.next!(args);\n }\n\n if (shouldComplete) {\n destination.complete!();\n }\n }\n\n protected _tryresultSelector(args: any[]) {\n let result: any;\n try {\n result = this.resultSelector!.apply(this, args);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.destination.next!(result);\n }\n}\n\ninterface LookAheadIterator extends Iterator {\n hasValue(): boolean;\n hasCompleted(): boolean;\n}\n\nclass StaticIterator implements LookAheadIterator {\n private nextResult: IteratorResult;\n\n constructor(private iterator: Iterator) {\n this.nextResult = iterator.next();\n }\n\n hasValue() {\n return true;\n }\n\n next(): IteratorResult {\n const result = this.nextResult;\n this.nextResult = this.iterator.next();\n return result;\n }\n\n hasCompleted(): boolean {\n const nextResult = this.nextResult;\n return Boolean(nextResult && nextResult.done);\n }\n}\n\nclass StaticArrayIterator implements LookAheadIterator {\n private index = 0;\n private length = 0;\n\n constructor(private array: T[]) {\n this.length = array.length;\n }\n\n [Symbol_iterator]() {\n return this;\n }\n\n next(value?: any): IteratorResult {\n const i = this.index++;\n const array = this.array;\n return i < this.length ? { value: array[i], done: false } : { value: null, done: true };\n }\n\n hasValue() {\n return this.array.length > this.index;\n }\n\n hasCompleted() {\n return this.array.length === this.index;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ZipBufferIterator extends SimpleOuterSubscriber implements LookAheadIterator {\n stillUnsubscribed = true;\n buffer: T[] = [];\n isComplete = false;\n\n constructor(destination: PartialObserver,\n private parent: ZipSubscriber,\n private observable: Observable) {\n super(destination);\n }\n\n [Symbol_iterator]() {\n return this;\n }\n\n // NOTE: there is actually a name collision here with Subscriber.next and Iterator.next\n // this is legit because `next()` will never be called by a subscription in this case.\n next(): IteratorResult {\n const buffer = this.buffer;\n if (buffer.length === 0 && this.isComplete) {\n return { value: null, done: true };\n } else {\n return { value: buffer.shift()!, done: false };\n }\n }\n\n hasValue() {\n return this.buffer.length > 0;\n }\n\n hasCompleted() {\n return this.buffer.length === 0 && this.isComplete;\n }\n\n notifyComplete() {\n if (this.buffer.length > 0) {\n this.isComplete = true;\n this.parent.notifyInactive();\n } else {\n this.destination.complete!();\n }\n }\n\n notifyNext(innerValue: any): void {\n this.buffer.push(innerValue);\n this.parent.checkIterators();\n }\n\n subscribe() {\n return innerSubscribe(this.observable, new SimpleInnerSubscriber(this));\n }\n}\n","\nimport { mergeAll } from './mergeAll';\nimport { OperatorFunction, ObservableInput } from '../types';\n\nexport function concatAll(): OperatorFunction, T>;\nexport function concatAll(): OperatorFunction;\n\n/**\n * Converts a higher-order Observable into a first-order Observable by\n * concatenating the inner Observables in order.\n *\n * Flattens an Observable-of-Observables by putting one\n * inner Observable after the other.\n *\n * ![](concatAll.png)\n *\n * Joins every Observable emitted by the source (a higher-order Observable), in\n * a serial fashion. It subscribes to each inner Observable only after the\n * previous inner Observable has completed, and merges all of their values into\n * the returned observable.\n *\n * __Warning:__ If the source Observable emits Observables quickly and\n * endlessly, and the inner Observables it emits generally complete slower than\n * the source emits, you can run into memory issues as the incoming Observables\n * collect in an unbounded buffer.\n *\n * Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set\n * to `1`.\n *\n * ## Example\n *\n * For each click event, tick every second from 0 to 3, with no concurrency\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { map, take, concatAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map(ev => interval(1000).pipe(take(4))),\n * );\n * const firstOrder = higherOrder.pipe(concatAll());\n * firstOrder.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concat}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n * @see {@link exhaust}\n * @see {@link mergeAll}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link zipAll}\n *\n * @return {Observable} An Observable emitting values from all the inner\n * Observables concatenated.\n * @method concatAll\n * @owner Observable\n */\nexport function concatAll(): OperatorFunction, T> {\n return mergeAll(1);\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function filter(predicate: (value: T, index: number) => value is S,\n thisArg?: any): OperatorFunction;\nexport function filter(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.\n *\n * ![](filter.png)\n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * ## Example\n * Emit only click events whose target was a DIV element\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { filter } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const clicksOnDivs = clicks.pipe(filter(ev => ev.target.tagName === 'DIV'));\n * clicksOnDivs.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nexport function filter(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction {\n return function filterOperatorFunction(source: Observable): Observable {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\n\nclass FilterOperator implements Operator {\n constructor(private predicate: (value: T, index: number) => boolean,\n private thisArg?: any) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass FilterSubscriber extends Subscriber {\n\n count: number = 0;\n\n constructor(destination: Subscriber,\n private predicate: (value: T, index: number) => boolean,\n private thisArg: any) {\n super(destination);\n }\n\n // the try catch block below is left specifically for\n // optimization and perf reasons. a tryCatcher is not necessary here.\n protected _next(value: T) {\n let result: any;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n }\n}\n","import { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subject } from '../Subject';\nimport { OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function groupBy(keySelector: (value: T) => K): OperatorFunction>;\nexport function groupBy(keySelector: (value: T) => K, elementSelector: void, durationSelector: (grouped: GroupedObservable) => Observable): OperatorFunction>;\nexport function groupBy(keySelector: (value: T) => K, elementSelector?: (value: T) => R, durationSelector?: (grouped: GroupedObservable) => Observable): OperatorFunction>;\nexport function groupBy(keySelector: (value: T) => K, elementSelector?: (value: T) => R, durationSelector?: (grouped: GroupedObservable) => Observable, subjectSelector?: () => Subject): OperatorFunction>;\n/* tslint:enable:max-line-length */\n\n/**\n * Groups the items emitted by an Observable according to a specified criterion,\n * and emits these grouped items as `GroupedObservables`, one\n * {@link GroupedObservable} per group.\n *\n * ![](groupBy.png)\n *\n * When the Observable emits an item, a key is computed for this item with the keySelector function.\n *\n * If a {@link GroupedObservable} for this key exists, this {@link GroupedObservable} emits. Elsewhere, a new\n * {@link GroupedObservable} for this key is created and emits.\n *\n * A {@link GroupedObservable} represents values belonging to the same group represented by a common key. The common\n * key is available as the key field of a {@link GroupedObservable} instance.\n *\n * The elements emitted by {@link GroupedObservable}s are by default the items emitted by the Observable, or elements\n * returned by the elementSelector function.\n *\n * ## Examples\n *\n * ### Group objects by id and return as array\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { mergeMap, groupBy, reduce } from 'rxjs/operators';\n *\n * of(\n * {id: 1, name: 'JavaScript'},\n * {id: 2, name: 'Parcel'},\n * {id: 2, name: 'webpack'},\n * {id: 1, name: 'TypeScript'},\n * {id: 3, name: 'TSLint'}\n * ).pipe(\n * groupBy(p => p.id),\n * mergeMap((group$) => group$.pipe(reduce((acc, cur) => [...acc, cur], []))),\n * )\n * .subscribe(p => console.log(p));\n *\n * // displays:\n * // [ { id: 1, name: 'JavaScript'},\n * // { id: 1, name: 'TypeScript'} ]\n * //\n * // [ { id: 2, name: 'Parcel'},\n * // { id: 2, name: 'webpack'} ]\n * //\n * // [ { id: 3, name: 'TSLint'} ]\n * ```\n *\n * ### Pivot data on the id field\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { groupBy, map, mergeMap, reduce } from 'rxjs/operators';\n *\n * of(\n * { id: 1, name: 'JavaScript' },\n * { id: 2, name: 'Parcel' },\n * { id: 2, name: 'webpack' },\n * { id: 1, name: 'TypeScript' },\n * { id: 3, name: 'TSLint' }\n * )\n * .pipe(\n * groupBy(p => p.id, p => p.name),\n * mergeMap(group$ =>\n * group$.pipe(reduce((acc, cur) => [...acc, cur], [`${group$.key}`]))\n * ),\n * map(arr => ({ id: parseInt(arr[0], 10), values: arr.slice(1) }))\n * )\n * .subscribe(p => console.log(p));\n *\n * // displays:\n * // { id: 1, values: [ 'JavaScript', 'TypeScript' ] }\n * // { id: 2, values: [ 'Parcel', 'webpack' ] }\n * // { id: 3, values: [ 'TSLint' ] }\n * ```\n *\n * @param {function(value: T): K} keySelector A function that extracts the key\n * for each item.\n * @param {function(value: T): R} [elementSelector] A function that extracts the\n * return element for each item.\n * @param {function(grouped: GroupedObservable): Observable} [durationSelector]\n * A function that returns an Observable to determine how long each group should\n * exist.\n * @return {Observable>} An Observable that emits\n * GroupedObservables, each of which corresponds to a unique key value and each\n * of which emits those items from the source Observable that share that key\n * value.\n * @method groupBy\n * @owner Observable\n */\nexport function groupBy(keySelector: (value: T) => K,\n elementSelector?: ((value: T) => R) | void,\n durationSelector?: (grouped: GroupedObservable) => Observable,\n subjectSelector?: () => Subject): OperatorFunction> {\n return (source: Observable) =>\n source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));\n}\n\nexport interface RefCountSubscription {\n count: number;\n unsubscribe: () => void;\n closed: boolean;\n attemptedToUnsubscribe: boolean;\n}\n\nclass GroupByOperator implements Operator> {\n constructor(private keySelector: (value: T) => K,\n private elementSelector?: ((value: T) => R) | void,\n private durationSelector?: (grouped: GroupedObservable) => Observable,\n private subjectSelector?: () => Subject) {\n }\n\n call(subscriber: Subscriber>, source: any): any {\n return source.subscribe(new GroupBySubscriber(\n subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass GroupBySubscriber extends Subscriber implements RefCountSubscription {\n private groups: Map> = null;\n public attemptedToUnsubscribe: boolean = false;\n public count: number = 0;\n\n constructor(destination: Subscriber>,\n private keySelector: (value: T) => K,\n private elementSelector?: ((value: T) => R) | void,\n private durationSelector?: (grouped: GroupedObservable) => Observable,\n private subjectSelector?: () => Subject) {\n super(destination);\n }\n\n protected _next(value: T): void {\n let key: K;\n try {\n key = this.keySelector(value);\n } catch (err) {\n this.error(err);\n return;\n }\n\n this._group(value, key);\n }\n\n private _group(value: T, key: K) {\n let groups = this.groups;\n\n if (!groups) {\n groups = this.groups = new Map>();\n }\n\n let group = groups.get(key);\n\n let element: R;\n if (this.elementSelector) {\n try {\n element = this.elementSelector(value);\n } catch (err) {\n this.error(err);\n }\n } else {\n element = value;\n }\n\n if (!group) {\n group = (this.subjectSelector ? this.subjectSelector() : new Subject()) as Subject;\n groups.set(key, group);\n const groupedObservable = new GroupedObservable(key, group, this);\n this.destination.next(groupedObservable);\n if (this.durationSelector) {\n let duration: any;\n try {\n duration = this.durationSelector(new GroupedObservable(key, >group));\n } catch (err) {\n this.error(err);\n return;\n }\n this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));\n }\n }\n\n if (!group.closed) {\n group.next(element);\n }\n }\n\n protected _error(err: any): void {\n const groups = this.groups;\n if (groups) {\n groups.forEach((group, key) => {\n group.error(err);\n });\n\n groups.clear();\n }\n this.destination.error(err);\n }\n\n protected _complete(): void {\n const groups = this.groups;\n if (groups) {\n groups.forEach((group, key) => {\n group.complete();\n });\n\n groups.clear();\n }\n this.destination.complete();\n }\n\n removeGroup(key: K): void {\n this.groups.delete(key);\n }\n\n unsubscribe() {\n if (!this.closed) {\n this.attemptedToUnsubscribe = true;\n if (this.count === 0) {\n super.unsubscribe();\n }\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass GroupDurationSubscriber extends Subscriber {\n constructor(private key: K,\n private group: Subject,\n private parent: GroupBySubscriber) {\n super(group);\n }\n\n protected _next(value: T): void {\n this.complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { parent, key } = this;\n this.key = this.parent = null;\n if (parent) {\n parent.removeGroup(key);\n }\n }\n}\n\n/**\n * An Observable representing values belonging to the same group represented by\n * a common key. The values emitted by a GroupedObservable come from the source\n * Observable. The common key is available as the field `key` on a\n * GroupedObservable instance.\n *\n * @class GroupedObservable\n */\nexport class GroupedObservable extends Observable {\n /** @deprecated Do not construct this type. Internal use only */\n constructor(public key: K,\n private groupSubject: Subject,\n private refCountSubscription?: RefCountSubscription) {\n super();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber) {\n const subscription = new Subscription();\n const { refCountSubscription, groupSubject } = this;\n if (refCountSubscription && !refCountSubscription.closed) {\n subscription.add(new InnerRefCountSubscription(refCountSubscription));\n }\n subscription.add(groupSubject.subscribe(subscriber));\n return subscription;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass InnerRefCountSubscription extends Subscription {\n constructor(private parent: RefCountSubscription) {\n super();\n parent.count++;\n }\n\n unsubscribe() {\n const parent = this.parent;\n if (!parent.closed && !this.closed) {\n super.unsubscribe();\n parent.count -= 1;\n if (parent.count === 0 && parent.attemptedToUnsubscribe) {\n parent.unsubscribe();\n }\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.\n *\n * ![](map.png)\n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * ## Example\n * Map every click to the clientX position of that click\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { map } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const positions = clicks.pipe(map(ev => ev.clientX));\n * positions.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nexport function map(project: (value: T, index: number) => R, thisArg?: any): OperatorFunction {\n return function mapOperation(source: Observable): Observable {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\n\nexport class MapOperator implements Operator {\n constructor(private project: (value: T, index: number) => R, private thisArg: any) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MapSubscriber extends Subscriber {\n count: number = 0;\n private thisArg: any;\n\n constructor(destination: Subscriber,\n private project: (value: T, index: number) => R,\n thisArg: any) {\n super(destination);\n this.thisArg = thisArg || this;\n }\n\n // NOTE: This looks unoptimized, but it's actually purposefully NOT\n // using try/catch optimizations.\n protected _next(value: T) {\n let result: R;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}\n","\nimport { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nimport { OperatorFunction, ObservableInput } from '../types';\n\n/**\n * Converts a higher-order Observable into a first-order Observable which\n * concurrently delivers all values that are emitted on the inner Observables.\n *\n * Flattens an Observable-of-Observables.\n *\n * ![](mergeAll.png)\n *\n * `mergeAll` subscribes to an Observable that emits Observables, also known as\n * a higher-order Observable. Each time it observes one of these emitted inner\n * Observables, it subscribes to that and delivers all the values from the\n * inner Observable on the output Observable. The output Observable only\n * completes once all inner Observables have completed. Any error delivered by\n * a inner Observable will be immediately emitted on the output Observable.\n *\n * ## Examples\n * Spawn a new interval Observable for each click event, and blend their outputs as one Observable\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { map, mergeAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(map((ev) => interval(1000)));\n * const firstOrder = higherOrder.pipe(mergeAll());\n * firstOrder.subscribe(x => console.log(x));\n * ```\n *\n * Count from 0 to 9 every second for each click, but only allow 2 concurrent timers\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { take, map, mergeAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map((ev) => interval(1000).pipe(take(10))),\n * );\n * const firstOrder = higherOrder.pipe(mergeAll(2));\n * firstOrder.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link exhaust}\n * @see {@link merge}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link zipAll}\n *\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits values coming from all the\n * inner Observables emitted by the source Observable.\n * @method mergeAll\n * @owner Observable\n */\nexport function mergeAll(concurrent: number = Number.POSITIVE_INFINITY): OperatorFunction, T> {\n return mergeMap(identity, concurrent);\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function mergeMap>(project: (value: T, index: number) => O, concurrent?: number): OperatorFunction>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function mergeMap>(project: (value: T, index: number) => O, resultSelector: undefined, concurrent?: number): OperatorFunction>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function mergeMap>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R, concurrent?: number): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable.\n *\n * Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link mergeAll}.\n *\n * ![](mergeMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger.\n *\n * ## Example\n * Map and flatten each letter to an Observable ticking every 1 second\n * ```ts\n * import { of, interval } from 'rxjs';\n * import { mergeMap, map } from 'rxjs/operators';\n *\n * const letters = of('a', 'b', 'c');\n * const result = letters.pipe(\n * mergeMap(x => interval(1000).pipe(map(i => x+i))),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // a0\n * // b0\n * // c0\n * // a1\n * // b1\n * // c1\n * // continues to list a,b,c with respective ascending integers\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item\n * emitted by the source Observable and merging the results of the Observables\n * obtained from this transformation.\n */\nexport function mergeMap>(\n project: (value: T, index: number) => O,\n resultSelector?: ((outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R) | number,\n concurrent: number = Number.POSITIVE_INFINITY\n): OperatorFunction|R> {\n if (typeof resultSelector === 'function') {\n // DEPRECATED PATH\n return (source: Observable) => source.pipe(\n mergeMap((a, i) => from(project(a, i)).pipe(\n map((b: any, ii: number) => resultSelector(a, b, i, ii)),\n ), concurrent)\n );\n } else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return (source: Observable) => source.lift(new MergeMapOperator(project, concurrent));\n}\n\nexport class MergeMapOperator implements Operator {\n constructor(private project: (value: T, index: number) => ObservableInput,\n private concurrent: number = Number.POSITIVE_INFINITY) {\n }\n\n call(observer: Subscriber, source: any): any {\n return source.subscribe(new MergeMapSubscriber(\n observer, this.project, this.concurrent\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class MergeMapSubscriber extends SimpleOuterSubscriber {\n private hasCompleted: boolean = false;\n private buffer: T[] = [];\n private active: number = 0;\n protected index: number = 0;\n\n constructor(destination: Subscriber,\n private project: (value: T, index: number) => ObservableInput,\n private concurrent: number = Number.POSITIVE_INFINITY) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n } else {\n this.buffer.push(value);\n }\n }\n\n protected _tryNext(value: T) {\n let result: ObservableInput;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.active++;\n this._innerSub(result);\n }\n\n private _innerSub(ish: ObservableInput): void {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(ish, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete!();\n }\n this.unsubscribe();\n }\n\n notifyNext(innerValue: R): void {\n this.destination.next!(innerValue);\n }\n\n notifyComplete(): void {\n const buffer = this.buffer;\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift()!);\n } else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete!();\n }\n }\n}\n\n/**\n * @deprecated renamed. Use {@link mergeMap}\n */\nexport const flatMap = mergeMap;","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Notification } from '../Notification';\nimport { MonoTypeOperatorFunction, PartialObserver, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n *\n * Re-emits all notifications from source Observable with specified scheduler.\n *\n * Ensure a specific scheduler is used, from outside of an Observable.\n *\n * `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule\n * notifications emitted by the source Observable. It might be useful, if you do not have control over\n * internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.\n *\n * Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,\n * but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal\n * scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits\n * notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.\n * An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split\n * that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source\n * Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a\n * little bit more, to ensure that they are emitted at expected moments.\n *\n * As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications\n * will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`\n * will delay all notifications - including error notifications - while `delay` will pass through error\n * from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator\n * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used\n * for notification emissions in general.\n *\n * ## Example\n * Ensure values in subscribe are called just before browser repaint.\n * ```ts\n * import { interval } from 'rxjs';\n * import { observeOn } from 'rxjs/operators';\n *\n * const intervals = interval(10); // Intervals are scheduled\n * // with async scheduler by default...\n * intervals.pipe(\n * observeOn(animationFrameScheduler), // ...but we will observe on animationFrame\n * ) // scheduler to ensure smooth animation.\n * .subscribe(val => {\n * someDiv.style.height = val + 'px';\n * });\n * ```\n *\n * @see {@link delay}\n *\n * @param {SchedulerLike} scheduler Scheduler that will be used to reschedule notifications from source Observable.\n * @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.\n * @return {Observable} Observable that emits the same notifications as the source Observable,\n * but with provided scheduler.\n *\n * @method observeOn\n * @owner Observable\n */\nexport function observeOn(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction {\n return function observeOnOperatorFunction(source: Observable): Observable {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\n\nexport class ObserveOnOperator implements Operator {\n constructor(private scheduler: SchedulerLike, private delay: number = 0) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ObserveOnSubscriber extends Subscriber {\n /** @nocollapse */\n static dispatch(this: SchedulerAction, arg: ObserveOnMessage) {\n const { notification, destination } = arg;\n notification.observe(destination);\n this.unsubscribe();\n }\n\n constructor(destination: Subscriber,\n private scheduler: SchedulerLike,\n private delay: number = 0) {\n super(destination);\n }\n\n private scheduleMessage(notification: Notification): void {\n const destination = this.destination as Subscription;\n destination.add(this.scheduler.schedule(\n ObserveOnSubscriber.dispatch,\n this.delay,\n new ObserveOnMessage(notification, this.destination)\n ));\n }\n\n protected _next(value: T): void {\n this.scheduleMessage(Notification.createNext(value));\n }\n\n protected _error(err: any): void {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n }\n}\n\nexport class ObserveOnMessage {\n constructor(public notification: Notification,\n public destination: PartialObserver) {\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { Observable } from '../Observable';\n\n/**\n * Make a {@link ConnectableObservable} behave like a ordinary observable and automates the way\n * you can connect to it.\n *\n * Internally it counts the subscriptions to the observable and subscribes (only once) to the source if\n * the number of subscriptions is larger than 0. If the number of subscriptions is smaller than 1, it\n * unsubscribes from the source. This way you can make sure that everything before the *published*\n * refCount has only a single subscription independently of the number of subscribers to the target\n * observable.\n *\n * Note that using the {@link share} operator is exactly the same as using the *publish* operator\n * (making the observable hot) and the *refCount* operator in a sequence.\n *\n * ![](refCount.png)\n *\n * ## Example\n *\n * In the following example there are two intervals turned into connectable observables\n * by using the *publish* operator. The first one uses the *refCount* operator, the\n * second one does not use it. You will notice that a connectable observable does nothing\n * until you call its connect function.\n *\n * ```ts\n * import { interval } from 'rxjs';\n * import { tap, publish, refCount } from 'rxjs/operators';\n *\n * // Turn the interval observable into a ConnectableObservable (hot)\n * const refCountInterval = interval(400).pipe(\n * tap((num) => console.log(`refCount ${num}`)),\n * publish(),\n * refCount()\n * );\n *\n * const publishedInterval = interval(400).pipe(\n * tap((num) => console.log(`publish ${num}`)),\n * publish()\n * );\n *\n * refCountInterval.subscribe();\n * refCountInterval.subscribe();\n * // 'refCount 0' -----> 'refCount 1' -----> etc\n * // All subscriptions will receive the same value and the tap (and\n * // every other operator) before the publish operator will be executed\n * // only once per event independently of the number of subscriptions.\n *\n * publishedInterval.subscribe();\n * // Nothing happens until you call .connect() on the observable.\n * ```\n *\n * @see {@link ConnectableObservable}\n * @see {@link share}\n * @see {@link publish}\n */\nexport function refCount(): MonoTypeOperatorFunction {\n return function refCountOperatorFunction(source: ConnectableObservable): Observable {\n return source.lift(new RefCountOperator(source));\n } as MonoTypeOperatorFunction;\n}\n\nclass RefCountOperator implements Operator {\n constructor(private connectable: ConnectableObservable) {\n }\n call(subscriber: Subscriber, source: any): TeardownLogic {\n\n const { connectable } = this;\n ( connectable)._refCount++;\n\n const refCounter = new RefCountSubscriber(subscriber, connectable);\n const subscription = source.subscribe(refCounter);\n\n if (!refCounter.closed) {\n ( refCounter).connection = connectable.connect();\n }\n\n return subscription;\n }\n}\n\nclass RefCountSubscriber extends Subscriber {\n\n private connection: Subscription;\n\n constructor(destination: Subscriber,\n private connectable: ConnectableObservable) {\n super(destination);\n }\n\n protected _unsubscribe() {\n\n const { connectable } = this;\n if (!connectable) {\n this.connection = null;\n return;\n }\n\n this.connectable = null;\n const refCount = ( connectable)._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n\n ( connectable)._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n\n ///\n // Compare the local RefCountSubscriber's connection Subscription to the\n // connection Subscription on the shared ConnectableObservable. In cases\n // where the ConnectableObservable source synchronously emits values, and\n // the RefCountSubscriber's downstream Observers synchronously unsubscribe,\n // execution continues to here before the RefCountOperator has a chance to\n // supply the RefCountSubscriber with the shared connection Subscription.\n // For example:\n // ```\n // range(0, 10).pipe(\n // publish(),\n // refCount(),\n // take(5),\n // )\n // .subscribe();\n // ```\n // In order to account for this case, RefCountSubscriber should only dispose\n // the ConnectableObservable's shared connection Subscription if the\n // connection Subscription exists, *and* either:\n // a. RefCountSubscriber doesn't have a reference to the shared connection\n // Subscription yet, or,\n // b. RefCountSubscriber's connection Subscription reference is identical\n // to the shared connection Subscription\n ///\n const { connection } = this;\n const sharedConnection = ( connectable)._connection;\n this.connection = null;\n\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\n\nexport function scheduleArray(input: ArrayLike, scheduler: SchedulerLike) {\n return new Observable(subscriber => {\n const sub = new Subscription();\n let i = 0;\n sub.add(scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n return;\n }\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n sub.add(this.schedule());\n }\n }));\n return sub;\n });\n}\n","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { ObservableInput, SchedulerLike, Observable } from 'rxjs';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\n\n/**\n * Converts from a common {@link ObservableInput} type to an observable where subscription and emissions\n * are scheduled on the provided scheduler.\n *\n * @see from\n * @see of\n *\n * @param input The observable, array, promise, iterable, etc you would like to schedule\n * @param scheduler The scheduler to use to schedule the subscription and emissions from\n * the returned observable.\n */\nexport function scheduled(input: ObservableInput, scheduler: SchedulerLike): Observable {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n } else if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n } else if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n } else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}\n","import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable {\n return input && typeof input[Symbol_observable] === 'function';\n}\n","import { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { InteropObservable, SchedulerLike, Subscribable } from '../types';\n\nexport function scheduleObservable(input: InteropObservable, scheduler: SchedulerLike) {\n return new Observable(subscriber => {\n const sub = new Subscription();\n sub.add(scheduler.schedule(() => {\n const observable: Subscribable = input[Symbol_observable]();\n sub.add(observable.subscribe({\n next(value) { sub.add(scheduler.schedule(() => subscriber.next(value))); },\n error(err) { sub.add(scheduler.schedule(() => subscriber.error(err))); },\n complete() { sub.add(scheduler.schedule(() => subscriber.complete())); },\n }));\n }));\n return sub;\n });\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\n\nexport function schedulePromise(input: PromiseLike, scheduler: SchedulerLike) {\n return new Observable(subscriber => {\n const sub = new Subscription();\n sub.add(scheduler.schedule(() => input.then(\n value => {\n sub.add(scheduler.schedule(() => {\n subscriber.next(value);\n sub.add(scheduler.schedule(() => subscriber.complete()));\n }));\n },\n err => {\n sub.add(scheduler.schedule(() => subscriber.error(err)));\n }\n )));\n return sub;\n });\n}\n","import { iterator as Symbol_iterator } from '../symbol/iterator';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable {\n return input && typeof input[Symbol_iterator] === 'function';\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\n\nexport function scheduleIterable(input: Iterable, scheduler: SchedulerLike) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(subscriber => {\n const sub = new Subscription();\n let iterator: Iterator;\n sub.add(() => {\n // Finalize generators\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(() => {\n iterator = input[Symbol_iterator]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n let value: T;\n let done: boolean;\n try {\n const result = iterator.next();\n value = result.value;\n done = result.done;\n } catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n } else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}\n","import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AsyncAction extends Action {\n\n public id: any;\n public state: T;\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler,\n protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, id?: any, delay: number = 0): any {\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(scheduler: AsyncScheduler, id: any, delay: number = 0): any {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n clearInterval(id);\n return undefined;\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n public execute(state: T, delay: number): any {\n\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, delay: number): any {\n let errored: boolean = false;\n let errorValue: any = undefined;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n\n const id = this.id;\n const scheduler = this.scheduler;\n const actions = scheduler.actions;\n const index = actions.indexOf(this);\n\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n\n if (index !== -1) {\n actions.splice(index, 1);\n }\n\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null;\n }\n}\n","import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action\n */\nexport class Action extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n","import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\n\nexport class AsyncScheduler extends Scheduler {\n public static delegate?: Scheduler;\n public actions: Array> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n * @deprecated internal use only\n */\n public active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n * @deprecated internal use only\n */\n public scheduled: any = undefined;\n\n constructor(SchedulerAction: typeof Action,\n now: () => number = Scheduler.now) {\n super(SchedulerAction, () => {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.now();\n } else {\n return now();\n }\n });\n }\n\n public schedule(work: (this: SchedulerAction, state?: T) => void, delay: number = 0, state?: T): Subscription {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n } else {\n return super.schedule(work, delay, state);\n }\n }\n\n public flush(action: AsyncAction): void {\n\n const {actions} = this;\n\n if (this.active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this.active = true;\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift()); // exhaust the scheduler queue\n\n this.active = false;\n\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","let nextHandle = 1;\nconst RESOLVED = (() => Promise.resolve())();\nconst activeHandles: { [key: number]: any } = {};\n\n/**\n * Finds the handle in the list of active handles, and removes it.\n * Returns `true` if found, `false` otherwise. Used both to clear\n * Immediate scheduled tasks, and to identify if a task should be scheduled.\n */\nfunction findAndClearHandle(handle: number): boolean {\n if (handle in activeHandles) {\n delete activeHandles[handle];\n return true;\n }\n return false;\n}\n\n/**\n * Helper functions to schedule and unschedule microtasks.\n */\nexport const Immediate = {\n setImmediate(cb: () => void): number {\n const handle = nextHandle++;\n activeHandles[handle] = true;\n RESOLVED.then(() => findAndClearHandle(handle) && cb());\n return handle;\n },\n\n clearImmediate(handle: number): void {\n findAndClearHandle(handle);\n },\n};\n\n/**\n * Used for internal testing purposes only. Do not export from library.\n */\nexport const TestTools = {\n pending() {\n return Object.keys(activeHandles).length;\n }\n};\n","import { Immediate } from '../util/Immediate';\nimport { AsyncAction } from './AsyncAction';\nimport { AsapScheduler } from './AsapScheduler';\nimport { SchedulerAction } from '../types';\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AsapAction extends AsyncAction {\n\n constructor(protected scheduler: AsapScheduler,\n protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AsapScheduler, id?: any, delay: number = 0): any {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If a microtask has already been scheduled, don't schedule another\n // one. If a microtask hasn't been scheduled yet, schedule one now. Return\n // the current scheduled microtask id.\n return scheduler.scheduled || (scheduler.scheduled = Immediate.setImmediate(\n scheduler.flush.bind(scheduler, null)\n ));\n }\n protected recycleAsyncId(scheduler: AsapScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue is empty, cancel the requested microtask and\n // set the scheduled flag to undefined so the next AsapAction will schedule\n // its own.\n if (scheduler.actions.length === 0) {\n Immediate.clearImmediate(id);\n scheduler.scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AsapScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction): void {\n\n this.active = true;\n this.scheduled = undefined;\n\n const {actions} = this;\n let error: any;\n let index: number = -1;\n let count: number = actions.length;\n action = action || actions.shift();\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n\n this.active = false;\n\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsapAction } from './AsapAction';\nimport { AsapScheduler } from './AsapScheduler';\n\n/**\n *\n * Asap Scheduler\n *\n * Perform task as fast as it can be performed asynchronously\n *\n * `asap` scheduler behaves the same as {@link asyncScheduler} scheduler when you use it to delay task\n * in time. If however you set delay to `0`, `asap` will wait for current synchronously executing\n * code to end and then it will try to execute given task as fast as possible.\n *\n * `asap` scheduler will do its best to minimize time between end of currently executing code\n * and start of scheduled task. This makes it best candidate for performing so called \"deferring\".\n * Traditionally this was achieved by calling `setTimeout(deferredTask, 0)`, but that technique involves\n * some (although minimal) unwanted delay.\n *\n * Note that using `asap` scheduler does not necessarily mean that your task will be first to process\n * after currently executing code. In particular, if some task was also scheduled with `asap` before,\n * that task will execute first. That being said, if you need to schedule task asynchronously, but\n * as soon as possible, `asap` scheduler is your best bet.\n *\n * ## Example\n * Compare async and asap scheduler<\n * ```ts\n * import { asapScheduler, asyncScheduler } from 'rxjs';\n *\n * asyncScheduler.schedule(() => console.log('async')); // scheduling 'async' first...\n * asapScheduler.schedule(() => console.log('asap'));\n *\n * // Logs:\n * // \"asap\"\n * // \"async\"\n * // ... but 'asap' goes first!\n * ```\n */\nexport const asapScheduler = new AsapScheduler(AsapAction);\n\n/**\n * @deprecated renamed. Use {@link asapScheduler}\n */\nexport const asap = asapScheduler;\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * Schedule task as if you used setTimeout(task, duration)\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * const task = () => console.log('it works!');\n *\n * asyncScheduler.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * asyncScheduler.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n */\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\n\n/**\n * @deprecated renamed. Use {@link asyncScheduler}\n */\nexport const async = asyncScheduler;","import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { QueueScheduler } from './QueueScheduler';\nimport { SchedulerAction } from '../types';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class QueueAction extends AsyncAction {\n\n constructor(protected scheduler: QueueScheduler,\n protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (delay > 0) {\n return super.schedule(state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n }\n\n public execute(state: T, delay: number): any {\n return (delay > 0 || this.closed) ?\n super.execute(state, delay) :\n this._execute(state, delay) ;\n }\n\n protected requestAsyncId(scheduler: QueueScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Otherwise flush the scheduler starting with this action.\n return scheduler.flush(this);\n }\n}\n","import { AsyncScheduler } from './AsyncScheduler';\n\nexport class QueueScheduler extends AsyncScheduler {\n}\n","import { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\n\n/**\n *\n * Queue Scheduler\n *\n * Put every next task on a queue, instead of executing it immediately\n *\n * `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.\n *\n * When used without delay, it schedules given task synchronously - executes it right when\n * it is scheduled. However when called recursively, that is when inside the scheduled task,\n * another task is scheduled with queue scheduler, instead of executing immediately as well,\n * that task will be put on a queue and wait for current one to finish.\n *\n * This means that when you execute task with `queue` scheduler, you are sure it will end\n * before any other task scheduled with that scheduler will start.\n *\n * ## Examples\n * Schedule recursively first, then do something\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(() => {\n * queueScheduler.schedule(() => console.log('second')); // will not happen now, but will be put on a queue\n *\n * console.log('first');\n * });\n *\n * // Logs:\n * // \"first\"\n * // \"second\"\n * ```\n *\n * Reschedule itself recursively\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(function(state) {\n * if (state !== 0) {\n * console.log('before', state);\n * this.schedule(state - 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * console.log('after', state);\n * }\n * }, 0, 3);\n *\n * // In scheduler that runs recursively, you would expect:\n * // \"before\", 3\n * // \"before\", 2\n * // \"before\", 1\n * // \"after\", 1\n * // \"after\", 2\n * // \"after\", 3\n *\n * // But with queue it logs:\n * // \"before\", 3\n * // \"after\", 3\n * // \"before\", 2\n * // \"after\", 2\n * // \"before\", 1\n * // \"after\", 1\n * ```\n */\nexport const queueScheduler = new QueueScheduler(QueueAction);\n\n/**\n * @deprecated renamed. Use {@link queueScheduler}\n */\nexport const queue = queueScheduler;\n","export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n\n/**\n * @deprecated use {@link iterator} instead\n */\nexport const $$iterator = iterator;\n","/** @deprecated do not use, this is no longer checked by RxJS internals */\nexport const rxSubscriber = (() =>\n typeof Symbol === 'function'\n ? Symbol('rxSubscriber')\n : '@@rxSubscriber_' + Math.random())();\n\n/**\n * @deprecated use rxSubscriber instead\n */\nexport const $$rxSubscriber = rxSubscriber;\n","export interface ArgumentOutOfRangeError extends Error {\n}\n\nexport interface ArgumentOutOfRangeErrorCtor {\n new(): ArgumentOutOfRangeError;\n}\n\nconst ArgumentOutOfRangeErrorImpl = (() => {\n function ArgumentOutOfRangeErrorImpl(this: any) {\n Error.call(this);\n this.message = 'argument out of range';\n this.name = 'ArgumentOutOfRangeError';\n return this;\n }\n\n ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);\n\n return ArgumentOutOfRangeErrorImpl;\n})();\n\n/**\n * An error thrown when an element was queried at a certain index of an\n * Observable, but no such index or position exists in that sequence.\n *\n * @see {@link elementAt}\n * @see {@link take}\n * @see {@link takeLast}\n *\n * @class ArgumentOutOfRangeError\n */\nexport const ArgumentOutOfRangeError: ArgumentOutOfRangeErrorCtor = ArgumentOutOfRangeErrorImpl as any;","export interface EmptyError extends Error {\n}\n\nexport interface EmptyErrorCtor {\n new(): EmptyError;\n}\n\nconst EmptyErrorImpl = (() => {\n function EmptyErrorImpl(this: any) {\n Error.call(this);\n this.message = 'no elements in sequence';\n this.name = 'EmptyError';\n return this;\n }\n\n EmptyErrorImpl.prototype = Object.create(Error.prototype);\n\n return EmptyErrorImpl;\n})();\n\n/**\n * An error thrown when an Observable or a sequence was queried but has no\n * elements.\n *\n * @see {@link first}\n * @see {@link last}\n * @see {@link single}\n *\n * @class EmptyError\n */\nexport const EmptyError: EmptyErrorCtor = EmptyErrorImpl as any;","export interface ObjectUnsubscribedError extends Error {\n}\n\nexport interface ObjectUnsubscribedErrorCtor {\n new(): ObjectUnsubscribedError;\n}\n\nconst ObjectUnsubscribedErrorImpl = (() => {\n function ObjectUnsubscribedErrorImpl(this: any) {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n }\n\n ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);\n\n return ObjectUnsubscribedErrorImpl;\n})();\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = ObjectUnsubscribedErrorImpl as any;","export interface TimeoutError extends Error {\n}\n\nexport interface TimeoutErrorCtor {\n new(): TimeoutError;\n}\n\nconst TimeoutErrorImpl = (() => {\n function TimeoutErrorImpl(this: any) {\n Error.call(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n return this;\n }\n\n TimeoutErrorImpl.prototype = Object.create(Error.prototype);\n\n return TimeoutErrorImpl;\n})();\n\n/**\n * An error thrown when duetime elapses.\n *\n * @see {@link operators/timeout}\n *\n * @class TimeoutError\n */\nexport const TimeoutError: TimeoutErrorCtor = TimeoutErrorImpl as any;\n","export interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n new(errors: any[]): UnsubscriptionError;\n}\n\nconst UnsubscriptionErrorImpl = (() => {\n function UnsubscriptionErrorImpl(this: any, errors: any[]) {\n Error.call(this);\n this.message = errors ?\n `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}` : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n\n UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);\n\n return UnsubscriptionErrorImpl;\n})();\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any;","import { Subscriber } from '../Subscriber';\nimport { Subject } from '../Subject';\n\n/**\n * Determines whether the ErrorObserver is closed or stopped or has a\n * destination that is closed or stopped - in which case errors will\n * need to be reported via a different mechanism.\n * @param observer the observer\n */\nexport function canReportError(observer: Subscriber | Subject): boolean {\n while (observer) {\n const { closed, destination, isStopped } = observer as any;\n if (closed || isStopped) {\n return false;\n } else if (destination && destination instanceof Subscriber) {\n observer = destination;\n } else {\n observer = null;\n }\n }\n return true;\n}\n","/**\n * Throws an error on another job so that it's picked up by the runtime's\n * uncaught error handling mechanism.\n * @param err the error to throw\n */\nexport function hostReportError(err: any) {\n setTimeout(() => { throw err; }, 0);\n}","export function identity(x: T): T {\n return x;\n}\n","export function isFunction(x: any): x is Function {\n return typeof x === 'function';\n}\n","import { isArray } from './isArray';\n\nexport function isNumeric(val: any): val is number | string {\n // parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n // subtraction forces infinities to NaN\n // adding 1 corrects loss of precision from parseFloat (#15100)\n return !isArray(val) && (val - parseFloat(val) + 1) >= 0;\n}\n","export function isObject(x: any): x is Object {\n return x !== null && typeof x === 'object';\n}\n","/**\n * Tests to see if the object is an ES2015 (ES6) Promise\n * @see {@link https://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects}\n * @param value the object to test\n */\nexport function isPromise(value: any): value is PromiseLike {\n return !!value && typeof (value).subscribe !== 'function' && typeof (value as any).then === 'function';\n}\n","import { SchedulerLike } from '../types';\n\nexport function isScheduler(value: any): value is SchedulerLike {\n return value && typeof (value).schedule === 'function';\n}\n","export function not(pred: Function, thisArg: any): Function {\n function notPred(): any {\n return !(( notPred).pred.apply(( notPred).thisArg, arguments));\n }\n ( notPred).pred = pred;\n ( notPred).thisArg = thisArg;\n return notPred;\n}","import { noop } from './noop';\nimport { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function pipe(): UnaryFunction;\nexport function pipe(fn1: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction, fn4: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction, fn4: UnaryFunction, fn5: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction, fn4: UnaryFunction, fn5: UnaryFunction, fn6: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction, fn4: UnaryFunction, fn5: UnaryFunction, fn6: UnaryFunction, fn7: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction, fn4: UnaryFunction, fn5: UnaryFunction, fn6: UnaryFunction, fn7: UnaryFunction, fn8: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction, fn4: UnaryFunction, fn5: UnaryFunction, fn6: UnaryFunction, fn7: UnaryFunction, fn8: UnaryFunction, fn9: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction, fn4: UnaryFunction, fn5: UnaryFunction, fn6: UnaryFunction, fn7: UnaryFunction, fn8: UnaryFunction, fn9: UnaryFunction, ...fns: UnaryFunction[]): UnaryFunction;\n/* tslint:enable:max-line-length */\n\nexport function pipe(...fns: Array>): UnaryFunction {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray(fns: Array>): UnaryFunction {\n if (fns.length === 0) {\n return identity as UnaryFunction;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction) => fn(prev), input as any);\n };\n}\n","import { ObservableInput } from '../types';\nimport { subscribeToArray } from './subscribeToArray';\nimport { subscribeToPromise } from './subscribeToPromise';\nimport { subscribeToIterable } from './subscribeToIterable';\nimport { subscribeToObservable } from './subscribeToObservable';\nimport { isArrayLike } from './isArrayLike';\nimport { isPromise } from './isPromise';\nimport { isObject } from './isObject';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { Subscription } from '../Subscription';\nimport { Subscriber } from '../Subscriber';\n\nexport const subscribeTo = (result: ObservableInput): (subscriber: Subscriber) => Subscription | void => {\n if (!!result && typeof result[Symbol_observable] === 'function') {\n return subscribeToObservable(result as any);\n } else if (isArrayLike(result)) {\n return subscribeToArray(result);\n } else if (isPromise(result)) {\n return subscribeToPromise(result as Promise);\n } else if (!!result && typeof result[Symbol_iterator] === 'function') {\n return subscribeToIterable(result as any);\n } else {\n const value = isObject(result) ? 'an invalid object' : `'${result}'`;\n const msg = `You provided ${value} where a stream was expected.`\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n throw new TypeError(msg);\n }\n};\n","import { Subscriber } from '../Subscriber';\nimport { observable as Symbol_observable } from '../symbol/observable';\n\n/**\n * Subscribes to an object that implements Symbol.observable with the given\n * Subscriber.\n * @param obj An object that implements Symbol.observable\n */\nexport const subscribeToObservable = (obj: any) => (subscriber: Subscriber) => {\n const obs = obj[Symbol_observable]();\n if (typeof obs.subscribe !== 'function') {\n // Should be caught by observable subscribe function error handling.\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n } else {\n return obs.subscribe(subscriber);\n }\n};\n","import { Subscriber } from '../Subscriber';\nimport { hostReportError } from './hostReportError';\n\nexport const subscribeToPromise = (promise: PromiseLike) => (subscriber: Subscriber) => {\n promise.then(\n (value) => {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n },\n (err: any) => subscriber.error(err)\n )\n .then(null, hostReportError);\n return subscriber;\n};\n","import { Subscriber } from '../Subscriber';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\n\nexport const subscribeToIterable = (iterable: Iterable) => (subscriber: Subscriber) => {\n const iterator = (iterable as any)[Symbol_iterator]();\n\n do {\n let item: IteratorResult;\n try {\n item = iterator.next();\n } catch (err) {\n subscriber.error(err);\n return subscriber;\n }\n if (item.done) {\n subscriber.complete();\n break;\n }\n subscriber.next(item.value);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n\n // Finalize the iterator if it happens to be a Generator\n if (typeof iterator.return === 'function') {\n subscriber.add(() => {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n\n return subscriber;\n};\n","import { Subscriber } from '../Subscriber';\n\n/**\n * Subscribes to an ArrayLike with a subscriber\n * @param array The array or array-like to subscribe to\n */\nexport const subscribeToArray = (array: ArrayLike) => (subscriber: Subscriber) => {\n for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n};\n","import { Subscriber } from './Subscriber';\nimport { OuterSubscriber } from './OuterSubscriber';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class InnerSubscriber extends Subscriber {\n private index = 0;\n\n constructor(private parent: OuterSubscriber, public outerValue: T, public outerIndex: number) {\n super();\n }\n\n protected _next(value: R): void {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n }\n\n protected _error(error: any): void {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n }\n}\n","import { Subscription } from '../Subscription';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { Subscriber } from '../Subscriber';\nimport { subscribeTo } from './subscribeTo';\nimport { Observable } from '../Observable';\n\nexport function subscribeToResult(\n outerSubscriber: OuterSubscriber,\n result: any,\n outerValue: undefined,\n outerIndex: undefined,\n innerSubscriber: InnerSubscriber\n): Subscription | undefined;\n\nexport function subscribeToResult(\n outerSubscriber: OuterSubscriber,\n result: any,\n outerValue?: T,\n outerIndex?: number\n): Subscription | undefined;\n\nexport function subscribeToResult(\n outerSubscriber: OuterSubscriber,\n result: any,\n outerValue?: T,\n outerIndex?: number,\n innerSubscriber: Subscriber = new InnerSubscriber(outerSubscriber, outerValue, outerIndex)\n): Subscription | undefined {\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(innerSubscriber);\n }\n return subscribeTo(result)(innerSubscriber) as Subscription;\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Ignores source values for a duration determined by another Observable, then\n * emits the most recent value from the source Observable, then repeats this\n * process.\n *\n * It's like {@link auditTime}, but the silencing\n * duration is determined by a second Observable.\n *\n * ![](audit.png)\n *\n * `audit` is similar to `throttle`, but emits the last value from the silenced\n * time window, instead of the first value. `audit` emits the most recent value\n * from the source Observable on the output Observable as soon as its internal\n * timer becomes disabled, and ignores source values while the timer is enabled.\n * Initially, the timer is disabled. As soon as the first source value arrives,\n * the timer is enabled by calling the `durationSelector` function with the\n * source value, which returns the \"duration\" Observable. When the duration\n * Observable emits a value or completes, the timer is disabled, then the most\n * recent source value is emitted on the output Observable, and this process\n * repeats for the next source value.\n *\n * ## Example\n *\n * Emit clicks at a rate of at most one click per second\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { audit } from 'rxjs/operators'\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(audit(ev => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttle}\n *\n * @param {function(value: T): SubscribableOrPromise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration, returned as an Observable or a Promise.\n * @return {Observable} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method audit\n * @owner Observable\n */\nexport function audit(durationSelector: (value: T) => SubscribableOrPromise): MonoTypeOperatorFunction {\n return function auditOperatorFunction(source: Observable) {\n return source.lift(new AuditOperator(durationSelector));\n };\n}\n\nclass AuditOperator implements Operator {\n constructor(private durationSelector: (value: T) => SubscribableOrPromise) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass AuditSubscriber extends SimpleOuterSubscriber {\n\n private value?: T;\n private hasValue: boolean = false;\n private throttled?: Subscription;\n\n constructor(destination: Subscriber,\n private durationSelector: (value: T) => SubscribableOrPromise) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.value = value;\n this.hasValue = true;\n if (!this.throttled) {\n let duration;\n try {\n const { durationSelector } = this;\n duration = durationSelector(value);\n } catch (err) {\n return this.destination.error!(err);\n }\n const innerSubscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n if (!innerSubscription || innerSubscription.closed) {\n this.clearThrottle();\n } else {\n this.add(this.throttled = innerSubscription);\n }\n }\n }\n\n clearThrottle() {\n const { value, hasValue, throttled } = this;\n if (throttled) {\n this.remove(throttled);\n this.throttled = undefined;\n throttled.unsubscribe();\n }\n if (hasValue) {\n this.value = undefined;\n this.hasValue = false;\n this.destination.next!(value);\n }\n }\n\n notifyNext(): void {\n this.clearThrottle();\n }\n\n notifyComplete(): void {\n this.clearThrottle();\n }\n}\n","import { async } from '../scheduler/async';\nimport { audit } from './audit';\nimport { timer } from '../observable/timer';\nimport { MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/**\n * Ignores source values for `duration` milliseconds, then emits the most recent\n * value from the source Observable, then repeats this process.\n *\n * When it sees a source value, it ignores that plus\n * the next ones for `duration` milliseconds, and then it emits the most recent\n * value from the source.\n *\n * ![](auditTime.png)\n *\n * `auditTime` is similar to `throttleTime`, but emits the last value from the\n * silenced time window, instead of the first value. `auditTime` emits the most\n * recent value from the source Observable on the output Observable as soon as\n * its internal timer becomes disabled, and ignores source values while the\n * timer is enabled. Initially, the timer is disabled. As soon as the first\n * source value arrives, the timer is enabled. After `duration` milliseconds (or\n * the time unit determined internally by the optional `scheduler`) has passed,\n * the timer is disabled, then the most recent source value is emitted on the\n * output Observable, and this process repeats for the next source value.\n * Optionally takes a {@link SchedulerLike} for managing timers.\n *\n * ## Example\n *\n * Emit clicks at a rate of at most one click per second\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { auditTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(auditTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounceTime}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} duration Time to wait before emitting the most recent source\n * value, measured in milliseconds or the time unit determined internally\n * by the optional `scheduler`.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the rate-limiting behavior.\n * @return {Observable} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method auditTime\n * @owner Observable\n */\nexport function auditTime(duration: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction {\n return audit(() => timer(duration, scheduler));\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Buffers the source Observable values until `closingNotifier` emits.\n *\n * Collects values from the past as an array, and emits\n * that array only when another Observable emits.\n *\n * ![](buffer.png)\n *\n * Buffers the incoming Observable values until the given `closingNotifier`\n * Observable emits a value, at which point it emits the buffer on the output\n * Observable and starts a new buffer internally, awaiting the next time\n * `closingNotifier` emits.\n *\n * ## Example\n *\n * On every click, emit array of most recent interval events\n *\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { buffer } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const intervalEvents = interval(1000);\n * const buffered = intervalEvents.pipe(buffer(clicks));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link bufferCount}\n * @see {@link bufferTime}\n * @see {@link bufferToggle}\n * @see {@link bufferWhen}\n * @see {@link window}\n *\n * @param {Observable} closingNotifier An Observable that signals the\n * buffer to be emitted on the output Observable.\n * @return {Observable} An Observable of buffers, which are arrays of\n * values.\n * @method buffer\n * @owner Observable\n */\nexport function buffer(closingNotifier: Observable): OperatorFunction {\n return function bufferOperatorFunction(source: Observable) {\n return source.lift(new BufferOperator(closingNotifier));\n };\n}\n\nclass BufferOperator implements Operator {\n\n constructor(private closingNotifier: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferSubscriber extends SimpleOuterSubscriber {\n private buffer: T[] = [];\n\n constructor(destination: Subscriber, closingNotifier: Observable) {\n super(destination);\n this.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(this)));\n }\n\n protected _next(value: T) {\n this.buffer.push(value);\n }\n\n notifyNext(): void {\n const buffer = this.buffer;\n this.buffer = [];\n this.destination.next!(buffer);\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Buffers the source Observable values until the size hits the maximum\n * `bufferSize` given.\n *\n * Collects values from the past as an array, and emits\n * that array only when its size reaches `bufferSize`.\n *\n * ![](bufferCount.png)\n *\n * Buffers a number of values from the source Observable by `bufferSize` then\n * emits the buffer and clears it, and starts a new buffer each\n * `startBufferEvery` values. If `startBufferEvery` is not provided or is\n * `null`, then new buffers are started immediately at the start of the source\n * and when each buffer closes and is emitted.\n *\n * ## Examples\n *\n * Emit the last two click events as an array\n *\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { bufferCount } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferCount(2));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * On every click, emit the last two click events as an array\n *\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { bufferCount } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferCount(2, 1));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferTime}\n * @see {@link bufferToggle}\n * @see {@link bufferWhen}\n * @see {@link pairwise}\n * @see {@link windowCount}\n *\n * @param {number} bufferSize The maximum size of the buffer emitted.\n * @param {number} [startBufferEvery] Interval at which to start a new buffer.\n * For example if `startBufferEvery` is `2`, then a new buffer will be started\n * on every other value from the source. A new buffer is started at the\n * beginning of the source by default.\n * @return {Observable} An Observable of arrays of buffered values.\n * @method bufferCount\n * @owner Observable\n */\nexport function bufferCount(bufferSize: number, startBufferEvery: number = null): OperatorFunction {\n return function bufferCountOperatorFunction(source: Observable) {\n return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));\n };\n}\n\nclass BufferCountOperator implements Operator {\n private subscriberClass: any;\n\n constructor(private bufferSize: number, private startBufferEvery: number) {\n if (!startBufferEvery || bufferSize === startBufferEvery) {\n this.subscriberClass = BufferCountSubscriber;\n } else {\n this.subscriberClass = BufferSkipCountSubscriber;\n }\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferCountSubscriber extends Subscriber {\n private buffer: T[] = [];\n\n constructor(destination: Subscriber, private bufferSize: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const buffer = this.buffer;\n\n buffer.push(value);\n\n if (buffer.length == this.bufferSize) {\n this.destination.next(buffer);\n this.buffer = [];\n }\n }\n\n protected _complete(): void {\n const buffer = this.buffer;\n if (buffer.length > 0) {\n this.destination.next(buffer);\n }\n super._complete();\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferSkipCountSubscriber extends Subscriber {\n private buffers: Array = [];\n private count: number = 0;\n\n constructor(destination: Subscriber, private bufferSize: number, private startBufferEvery: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const { bufferSize, startBufferEvery, buffers, count } = this;\n\n this.count++;\n if (count % startBufferEvery === 0) {\n buffers.push([]);\n }\n\n for (let i = buffers.length; i--; ) {\n const buffer = buffers[i];\n buffer.push(value);\n if (buffer.length === bufferSize) {\n buffers.splice(i, 1);\n this.destination.next(buffer);\n }\n }\n }\n\n protected _complete(): void {\n const { buffers, destination } = this;\n\n while (buffers.length > 0) {\n let buffer = buffers.shift();\n if (buffer.length > 0) {\n destination.next(buffer);\n }\n }\n super._complete();\n }\n\n}\n","import { Operator } from '../Operator';\nimport { async } from '../scheduler/async';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { isScheduler } from '../util/isScheduler';\nimport { OperatorFunction, SchedulerAction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function bufferTime(bufferTimeSpan: number, scheduler?: SchedulerLike): OperatorFunction;\nexport function bufferTime(bufferTimeSpan: number, bufferCreationInterval: number | null | undefined, scheduler?: SchedulerLike): OperatorFunction;\nexport function bufferTime(bufferTimeSpan: number, bufferCreationInterval: number | null | undefined, maxBufferSize: number, scheduler?: SchedulerLike): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Buffers the source Observable values for a specific time period.\n *\n * Collects values from the past as an array, and emits\n * those arrays periodically in time.\n *\n * ![](bufferTime.png)\n *\n * Buffers values from the source for a specific time duration `bufferTimeSpan`.\n * Unless the optional argument `bufferCreationInterval` is given, it emits and\n * resets the buffer every `bufferTimeSpan` milliseconds. If\n * `bufferCreationInterval` is given, this operator opens the buffer every\n * `bufferCreationInterval` milliseconds and closes (emits and resets) the\n * buffer every `bufferTimeSpan` milliseconds. When the optional argument\n * `maxBufferSize` is specified, the buffer will be closed either after\n * `bufferTimeSpan` milliseconds or when it contains `maxBufferSize` elements.\n *\n * ## Examples\n *\n * Every second, emit an array of the recent click events\n *\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { bufferTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferTime(1000));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * Every 5 seconds, emit the click events from the next 2 seconds\n *\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { bufferTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferTime(2000, 5000));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n * @see {@link bufferToggle}\n * @see {@link bufferWhen}\n * @see {@link windowTime}\n *\n * @param {number} bufferTimeSpan The amount of time to fill each buffer array.\n * @param {number} [bufferCreationInterval] The interval at which to start new\n * buffers.\n * @param {number} [maxBufferSize] The maximum buffer size.\n * @param {SchedulerLike} [scheduler=async] The scheduler on which to schedule the\n * intervals that determine buffer boundaries.\n * @return {Observable} An observable of arrays of buffered values.\n * @method bufferTime\n * @owner Observable\n */\nexport function bufferTime(bufferTimeSpan: number): OperatorFunction {\n let length: number = arguments.length;\n\n let scheduler: SchedulerLike = async;\n if (isScheduler(arguments[arguments.length - 1])) {\n scheduler = arguments[arguments.length - 1];\n length--;\n }\n\n let bufferCreationInterval: number = null;\n if (length >= 2) {\n bufferCreationInterval = arguments[1];\n }\n\n let maxBufferSize: number = Number.POSITIVE_INFINITY;\n if (length >= 3) {\n maxBufferSize = arguments[2];\n }\n\n return function bufferTimeOperatorFunction(source: Observable) {\n return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));\n };\n}\n\nclass BufferTimeOperator implements Operator {\n constructor(private bufferTimeSpan: number,\n private bufferCreationInterval: number,\n private maxBufferSize: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new BufferTimeSubscriber(\n subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler\n ));\n }\n}\n\nclass Context {\n buffer: T[] = [];\n closeAction: Subscription;\n}\n\ninterface DispatchCreateArg {\n bufferTimeSpan: number;\n bufferCreationInterval: number;\n subscriber: BufferTimeSubscriber;\n scheduler: SchedulerLike;\n}\n\ninterface DispatchCloseArg {\n subscriber: BufferTimeSubscriber;\n context: Context;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferTimeSubscriber extends Subscriber {\n private contexts: Array> = [];\n private timespanOnly: boolean;\n\n constructor(destination: Subscriber,\n private bufferTimeSpan: number,\n private bufferCreationInterval: number,\n private maxBufferSize: number,\n private scheduler: SchedulerLike) {\n super(destination);\n const context = this.openContext();\n this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;\n if (this.timespanOnly) {\n const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };\n this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));\n } else {\n const closeState = { subscriber: this, context };\n const creationState: DispatchCreateArg = { bufferTimeSpan, bufferCreationInterval, subscriber: this, scheduler };\n this.add(context.closeAction = scheduler.schedule>(dispatchBufferClose, bufferTimeSpan, closeState));\n this.add(scheduler.schedule>(dispatchBufferCreation, bufferCreationInterval, creationState));\n }\n }\n\n protected _next(value: T) {\n const contexts = this.contexts;\n const len = contexts.length;\n let filledBufferContext: Context;\n for (let i = 0; i < len; i++) {\n const context = contexts[i];\n const buffer = context.buffer;\n buffer.push(value);\n if (buffer.length == this.maxBufferSize) {\n filledBufferContext = context;\n }\n }\n\n if (filledBufferContext) {\n this.onBufferFull(filledBufferContext);\n }\n }\n\n protected _error(err: any) {\n this.contexts.length = 0;\n super._error(err);\n }\n\n protected _complete() {\n const { contexts, destination } = this;\n while (contexts.length > 0) {\n const context = contexts.shift();\n destination.next(context.buffer);\n }\n super._complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.contexts = null;\n }\n\n protected onBufferFull(context: Context) {\n this.closeContext(context);\n const closeAction = context.closeAction;\n closeAction.unsubscribe();\n this.remove(closeAction);\n\n if (!this.closed && this.timespanOnly) {\n context = this.openContext();\n const bufferTimeSpan = this.bufferTimeSpan;\n const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };\n this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));\n }\n }\n\n openContext(): Context {\n const context: Context = new Context();\n this.contexts.push(context);\n return context;\n }\n\n closeContext(context: Context) {\n this.destination.next(context.buffer);\n const contexts = this.contexts;\n\n const spliceIndex = contexts ? contexts.indexOf(context) : -1;\n if (spliceIndex >= 0) {\n contexts.splice(contexts.indexOf(context), 1);\n }\n }\n}\n\nfunction dispatchBufferTimeSpanOnly(this: SchedulerAction, state: any) {\n const subscriber: BufferTimeSubscriber = state.subscriber;\n\n const prevContext = state.context;\n if (prevContext) {\n subscriber.closeContext(prevContext);\n }\n\n if (!subscriber.closed) {\n state.context = subscriber.openContext();\n state.context.closeAction = this.schedule(state, state.bufferTimeSpan);\n }\n}\n\nfunction dispatchBufferCreation(this: SchedulerAction>, state: DispatchCreateArg) {\n const { bufferCreationInterval, bufferTimeSpan, subscriber, scheduler } = state;\n const context = subscriber.openContext();\n const action = >>this;\n if (!subscriber.closed) {\n subscriber.add(context.closeAction = scheduler.schedule>(dispatchBufferClose, bufferTimeSpan, { subscriber, context }));\n action.schedule(state, bufferCreationInterval);\n }\n}\n\nfunction dispatchBufferClose(arg: DispatchCloseArg) {\n const { subscriber, context } = arg;\n subscriber.closeContext(context);\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { OperatorFunction, SubscribableOrPromise } from '../types';\n\n/**\n * Buffers the source Observable values starting from an emission from\n * `openings` and ending when the output of `closingSelector` emits.\n *\n * Collects values from the past as an array. Starts\n * collecting only when `opening` emits, and calls the `closingSelector`\n * function to get an Observable that tells when to close the buffer.\n *\n * ![](bufferToggle.png)\n *\n * Buffers values from the source by opening the buffer via signals from an\n * Observable provided to `openings`, and closing and sending the buffers when\n * a Subscribable or Promise returned by the `closingSelector` function emits.\n *\n * ## Example\n *\n * Every other second, emit the click events from the next 500ms\n *\n * ```ts\n * import { fromEvent, interval, EMPTY } from 'rxjs';\n * import { bufferToggle } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const openings = interval(1000);\n * const buffered = clicks.pipe(bufferToggle(openings, i =>\n * i % 2 ? interval(500) : EMPTY\n * ));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n * @see {@link bufferTime}\n * @see {@link bufferWhen}\n * @see {@link windowToggle}\n *\n * @param {SubscribableOrPromise} openings A Subscribable or Promise of notifications to start new\n * buffers.\n * @param {function(value: O): SubscribableOrPromise} closingSelector A function that takes\n * the value emitted by the `openings` observable and returns a Subscribable or Promise,\n * which, when it emits, signals that the associated buffer should be emitted\n * and cleared.\n * @return {Observable} An observable of arrays of buffered values.\n * @method bufferToggle\n * @owner Observable\n */\nexport function bufferToggle(\n openings: SubscribableOrPromise,\n closingSelector: (value: O) => SubscribableOrPromise\n): OperatorFunction {\n return function bufferToggleOperatorFunction(source: Observable) {\n return source.lift(new BufferToggleOperator(openings, closingSelector));\n };\n}\n\nclass BufferToggleOperator implements Operator {\n\n constructor(private openings: SubscribableOrPromise,\n private closingSelector: (value: O) => SubscribableOrPromise) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));\n }\n}\n\ninterface BufferContext {\n buffer: T[];\n subscription: Subscription;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferToggleSubscriber extends OuterSubscriber {\n private contexts: Array> = [];\n\n constructor(destination: Subscriber,\n openings: SubscribableOrPromise,\n private closingSelector: (value: O) => SubscribableOrPromise | void) {\n super(destination);\n this.add(subscribeToResult(this, openings));\n }\n\n protected _next(value: T): void {\n const contexts = this.contexts;\n const len = contexts.length;\n for (let i = 0; i < len; i++) {\n contexts[i].buffer.push(value);\n }\n }\n\n protected _error(err: any): void {\n const contexts = this.contexts;\n while (contexts.length > 0) {\n const context = contexts.shift()!;\n context.subscription.unsubscribe();\n context.buffer = null!;\n context.subscription = null!;\n }\n this.contexts = null!;\n super._error(err);\n }\n\n protected _complete(): void {\n const contexts = this.contexts;\n while (contexts.length > 0) {\n const context = contexts.shift()!;\n this.destination.next!(context.buffer);\n context.subscription.unsubscribe();\n context.buffer = null!;\n context.subscription = null!;\n }\n this.contexts = null!;\n super._complete();\n }\n\n notifyNext(outerValue: any, innerValue: O): void {\n outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);\n }\n\n notifyComplete(innerSub: InnerSubscriber): void {\n this.closeBuffer(( innerSub).context);\n }\n\n private openBuffer(value: O): void {\n try {\n const closingSelector = this.closingSelector;\n const closingNotifier = closingSelector.call(this, value);\n if (closingNotifier) {\n this.trySubscribe(closingNotifier);\n }\n } catch (err) {\n this._error(err);\n }\n }\n\n private closeBuffer(context: BufferContext): void {\n const contexts = this.contexts;\n\n if (contexts && context) {\n const { buffer, subscription } = context;\n this.destination.next!(buffer);\n contexts.splice(contexts.indexOf(context), 1);\n this.remove(subscription);\n subscription.unsubscribe();\n }\n }\n\n private trySubscribe(closingNotifier: any): void {\n const contexts = this.contexts;\n\n const buffer: Array = [];\n const subscription = new Subscription();\n const context = { buffer, subscription };\n contexts.push(context);\n\n const innerSubscription = subscribeToResult(this, closingNotifier, context as any);\n\n if (!innerSubscription || innerSubscription.closed) {\n this.closeBuffer(context);\n } else {\n (innerSubscription as any).context = context;\n\n this.add(innerSubscription);\n subscription.add(innerSubscription);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { OperatorFunction } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Buffers the source Observable values, using a factory function of closing\n * Observables to determine when to close, emit, and reset the buffer.\n *\n * Collects values from the past as an array. When it\n * starts collecting values, it calls a function that returns an Observable that\n * tells when to close the buffer and restart collecting.\n *\n * ![](bufferWhen.png)\n *\n * Opens a buffer immediately, then closes the buffer when the observable\n * returned by calling `closingSelector` function emits a value. When it closes\n * the buffer, it immediately opens a new buffer and repeats the process.\n *\n * ## Example\n *\n * Emit an array of the last clicks every [1-5] random seconds\n *\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { bufferWhen } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const buffered = clicks.pipe(bufferWhen(() =>\n * interval(1000 + Math.random() * 4000)\n * ));\n * buffered.subscribe(x => console.log(x));\n * ```\n *\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n * @see {@link bufferTime}\n * @see {@link bufferToggle}\n * @see {@link windowWhen}\n *\n * @param {function(): Observable} closingSelector A function that takes no\n * arguments and returns an Observable that signals buffer closure.\n * @return {Observable} An observable of arrays of buffered values.\n * @method bufferWhen\n * @owner Observable\n */\nexport function bufferWhen(closingSelector: () => Observable): OperatorFunction {\n return function (source: Observable) {\n return source.lift(new BufferWhenOperator(closingSelector));\n };\n}\n\nclass BufferWhenOperator implements Operator {\n\n constructor(private closingSelector: () => Observable) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass BufferWhenSubscriber extends SimpleOuterSubscriber {\n private buffer?: T[];\n private subscribing: boolean = false;\n private closingSubscription?: Subscription;\n\n constructor(destination: Subscriber, private closingSelector: () => Observable) {\n super(destination);\n this.openBuffer();\n }\n\n protected _next(value: T) {\n this.buffer!.push(value);\n }\n\n protected _complete() {\n const buffer = this.buffer;\n if (buffer) {\n this.destination.next!(buffer);\n }\n super._complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.buffer = undefined;\n this.subscribing = false;\n }\n\n notifyNext(): void {\n this.openBuffer();\n }\n\n notifyComplete(): void {\n if (this.subscribing) {\n this.complete();\n } else {\n this.openBuffer();\n }\n }\n\n openBuffer() {\n let { closingSubscription } = this;\n\n if (closingSubscription) {\n this.remove(closingSubscription);\n closingSubscription.unsubscribe();\n }\n\n const buffer = this.buffer;\n if (this.buffer) {\n this.destination.next!(buffer);\n }\n\n this.buffer = [];\n\n let closingNotifier;\n try {\n const { closingSelector } = this;\n closingNotifier = closingSelector();\n } catch (err) {\n return this.error(err);\n }\n closingSubscription = new Subscription();\n this.closingSubscription = closingSubscription;\n this.add(closingSubscription);\n this.subscribing = true;\n closingSubscription.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(this)));\n this.subscribing = false;\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\n\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function catchError>(selector: (err: any, caught: Observable) => O): OperatorFunction>;\n/* tslint:enable:max-line-length */\n\n/**\n * Catches errors on the observable to be handled by returning a new observable or throwing an error.\n *\n * ![](catch.png)\n *\n * ## Examples\n * Continues with a different Observable when there's an error\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { map, catchError } from 'rxjs/operators';\n *\n * of(1, 2, 3, 4, 5).pipe(\n * map(n => {\n * \t if (n === 4) {\n * \t throw 'four!';\n * }\n *\t return n;\n * }),\n * catchError(err => of('I', 'II', 'III', 'IV', 'V')),\n * )\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, I, II, III, IV, V\n * ```\n *\n * Retries the caught source Observable again in case of error, similar to retry() operator\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { map, catchError, take } from 'rxjs/operators';\n *\n * of(1, 2, 3, 4, 5).pipe(\n * map(n => {\n * \t if (n === 4) {\n * \t throw 'four!';\n * }\n * \t return n;\n * }),\n * catchError((err, caught) => caught),\n * take(30),\n * )\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, 1, 2, 3, ...\n * ```\n *\n * Throws a new error when the source Observable throws an error\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { map, catchError } from 'rxjs/operators';\n *\n * of(1, 2, 3, 4, 5).pipe(\n * map(n => {\n * if (n === 4) {\n * throw 'four!';\n * }\n * return n;\n * }),\n * catchError(err => {\n * throw 'error in source. Details: ' + err;\n * }),\n * )\n * .subscribe(\n * x => console.log(x),\n * err => console.log(err)\n * );\n * // 1, 2, 3, error in source. Details: four!\n * ```\n *\n * @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which\n * is the source observable, in case you'd like to \"retry\" that observable by returning it again. Whatever observable\n * is returned by the `selector` will be used to continue the observable chain.\n * @return {Observable} An observable that originates from either the source or the observable returned by the\n * catch `selector` function.\n * @name catchError\n */\nexport function catchError>(\n selector: (err: any, caught: Observable) => O\n): OperatorFunction> {\n return function catchErrorOperatorFunction(source: Observable): Observable> {\n const operator = new CatchOperator(selector);\n const caught = source.lift(operator);\n return (operator.caught = caught as Observable);\n };\n}\n\nclass CatchOperator implements Operator {\n caught: Observable;\n\n constructor(private selector: (err: any, caught: Observable) => ObservableInput) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass CatchSubscriber extends SimpleOuterSubscriber {\n constructor(destination: Subscriber,\n private selector: (err: any, caught: Observable) => ObservableInput,\n private caught: Observable) {\n super(destination);\n }\n\n // NOTE: overriding `error` instead of `_error` because we don't want\n // to have this flag this subscriber as `isStopped`. We can mimic the\n // behavior of the RetrySubscriber (from the `retry` operator), where\n // we unsubscribe from our source chain, reset our Subscriber flags,\n // then subscribe to the selector result.\n error(err: any) {\n if (!this.isStopped) {\n let result: any;\n try {\n result = this.selector(err, this.caught);\n } catch (err2) {\n super.error(err2);\n return;\n }\n this._unsubscribeAndRecycle();\n const innerSubscriber = new SimpleInnerSubscriber(this);\n this.add(innerSubscriber);\n const innerSubscription = innerSubscribe(result, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (innerSubscription !== innerSubscriber) {\n this.add(innerSubscription);\n }\n }\n }\n}\n","import { CombineLatestOperator } from '../observable/combineLatest';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, ObservableInput } from '../types';\n\nexport function combineAll(): OperatorFunction, T[]>;\nexport function combineAll(): OperatorFunction;\nexport function combineAll(project: (...values: T[]) => R): OperatorFunction, R>;\nexport function combineAll(project: (...values: Array) => R): OperatorFunction;\n/**\n * Flattens an Observable-of-Observables by applying {@link combineLatest} when the Observable-of-Observables completes.\n *\n * ![](combineAll.png)\n *\n * `combineAll` takes an Observable of Observables, and collects all Observables from it. Once the outer Observable completes,\n * it subscribes to all collected Observables and combines their values using the {@link combineLatest} strategy, such that:\n *\n * * Every time an inner Observable emits, the output Observable emits\n * * When the returned observable emits, it emits all of the latest values by:\n * * If a `project` function is provided, it is called with each recent value from each inner Observable in whatever order they\n * arrived, and the result of the `project` function is what is emitted by the output Observable.\n * * If there is no `project` function, an array of all the most recent values is emitted by the output Observable.\n *\n * ---\n *\n * ## Examples\n *\n * ### Map two click events to a finite interval Observable, then apply `combineAll`\n *\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { map, combineAll, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map(ev =>\n * interval(Math.random() * 2000).pipe(take(3))\n * ),\n * take(2)\n * );\n * const result = higherOrder.pipe(\n * combineAll()\n * );\n *\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineLatest}\n * @see {@link mergeAll}\n *\n * @param {function(...values: Array)} An optional function to map the most recent values from each inner Observable into a new result.\n * Takes each of the most recent values from each collected inner Observable as arguments, in order.\n * @return {Observable}\n * @name combineAll\n */\nexport function combineAll(project?: (...values: Array) => R): OperatorFunction {\n return (source: Observable) => source.lift(new CombineLatestOperator(project));\n}\n","\nimport { isArray } from '../util/isArray';\nimport { CombineLatestOperator } from '../observable/combineLatest';\nimport { from } from '../observable/from';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction } from '../types';\n\nconst none = {};\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(project: (v1: T) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, project: (v1: T, v2: T2) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput, project: (v1: T, v2: T2, v3: T3) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R): OperatorFunction ;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput): OperatorFunction ;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(...observables: Array | ((...values: Array) => R)>): OperatorFunction;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(array: ObservableInput[]): OperatorFunction>;\n/** @deprecated Deprecated in favor of static combineLatest. */\nexport function combineLatest(array: ObservableInput[], project: (v1: T, ...values: Array) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link combineLatest}.\n */\nexport function combineLatest(...observables: Array |\n Array> |\n ((...values: Array) => R)>): OperatorFunction {\n let project: (...values: Array) => R = null;\n if (typeof observables[observables.length - 1] === 'function') {\n project = <(...values: Array) => R>observables.pop();\n }\n\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `combineLatest([obs1, obs2, obs3], project)`\n if (observables.length === 1 && isArray(observables[0])) {\n observables = (observables[0]).slice();\n }\n\n return (source: Observable) => source.lift.call(from([source, ...observables]), new CombineLatestOperator(project));\n}\n","import { concat as concatStatic } from '../observable/concat';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction, MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(scheduler?: SchedulerLike): MonoTypeOperatorFunction;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(v2: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(v2: ObservableInput, v3: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(...observables: Array | SchedulerLike>): MonoTypeOperatorFunction;\n/** @deprecated Deprecated in favor of static concat. */\nexport function concat(...observables: Array | SchedulerLike>): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link concat}.\n */\nexport function concat(...observables: Array | SchedulerLike>): OperatorFunction {\n return (source: Observable) => source.lift.call(concatStatic(source, ...observables));\n}\n","import { mergeMap } from './mergeMap';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function concatMap>(project: (value: T, index: number) => O): OperatorFunction>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function concatMap>(project: (value: T, index: number) => O, resultSelector: undefined): OperatorFunction>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function concatMap>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, in a serialized fashion waiting for each one to complete before\n * merging the next.\n *\n * Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link concatAll}.\n *\n * ![](concatMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each new inner Observable is\n * concatenated with the previous inner Observable.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set\n * to `1`.\n *\n * ## Example\n * For each click event, tick every second from 0 to 3, with no concurrency\n *\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { concatMap, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * concatMap(ev => interval(1000).pipe(take(4)))\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMapTo}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item emitted\n * by the source Observable and taking values from each projected inner\n * Observable sequentially.\n * @method concatMap\n * @owner Observable\n */\nexport function concatMap>(\n project: (value: T, index: number) => O,\n resultSelector?: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R\n): OperatorFunction|R> {\n return mergeMap(project, resultSelector, 1);\n}\n","import { concatMap } from './concatMap';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function concatMapTo>(observable: O): OperatorFunction>;\n/** @deprecated */\nexport function concatMapTo>(observable: O, resultSelector: undefined): OperatorFunction>;\n/** @deprecated */\nexport function concatMapTo>(observable: O, resultSelector: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to the same Observable which is merged multiple\n * times in a serialized fashion on the output Observable.\n *\n * It's like {@link concatMap}, but maps each value\n * always to the same inner Observable.\n *\n * ![](concatMapTo.png)\n *\n * Maps each source value to the given Observable `innerObservable` regardless\n * of the source value, and then flattens those resulting Observables into one\n * single Observable, which is the output Observable. Each new `innerObservable`\n * instance emitted on the output Observable is concatenated with the previous\n * `innerObservable` instance.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMapTo` is equivalent to `mergeMapTo` with concurrency parameter\n * set to `1`.\n *\n * ## Example\n * For each click event, tick every second from 0 to 3, with no concurrency\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { concatMapTo, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * concatMapTo(interval(1000).pipe(take(4))),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link mergeMapTo}\n * @see {@link switchMapTo}\n *\n * @param {ObservableInput} innerObservable An Observable to replace each value from\n * the source Observable.\n * @return {Observable} An observable of values merged together by joining the\n * passed observable with itself, one after the other, for each value emitted\n * from the source.\n * @method concatMapTo\n * @owner Observable\n */\nexport function concatMapTo>(\n innerObservable: O,\n resultSelector?: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R\n): OperatorFunction|R> {\n return concatMap(() => innerObservable, resultSelector);\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Observer, OperatorFunction } from '../types';\nimport { Subscriber } from '../Subscriber';\n/**\n * Counts the number of emissions on the source and emits that number when the\n * source completes.\n *\n * Tells how many values were emitted, when the source\n * completes.\n *\n * ![](count.png)\n *\n * `count` transforms an Observable that emits values into an Observable that\n * emits a single value that represents the number of values emitted by the\n * source Observable. If the source Observable terminates with an error, `count`\n * will pass this error notification along without emitting a value first. If\n * the source Observable does not terminate at all, `count` will neither emit\n * a value nor terminate. This operator takes an optional `predicate` function\n * as argument, in which case the output emission will represent the number of\n * source values that matched `true` with the `predicate`.\n *\n * ## Examples\n *\n * Counts how many seconds have passed before the first click happened\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { count, takeUntil } from 'rxjs/operators';\n *\n * const seconds = interval(1000);\n * const clicks = fromEvent(document, 'click');\n * const secondsBeforeClick = seconds.pipe(takeUntil(clicks));\n * const result = secondsBeforeClick.pipe(count());\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Counts how many odd numbers are there between 1 and 7\n * ```ts\n * import { range } from 'rxjs';\n * import { count } from 'rxjs/operators';\n *\n * const numbers = range(1, 7);\n * const result = numbers.pipe(count(i => i % 2 === 1));\n * result.subscribe(x => console.log(x));\n * // Results in:\n * // 4\n * ```\n *\n * @see {@link max}\n * @see {@link min}\n * @see {@link reduce}\n *\n * @param {function(value: T, i: number, source: Observable): boolean} [predicate] A\n * boolean function to select what values are to be counted. It is provided with\n * arguments of:\n * - `value`: the value from the source Observable.\n * - `index`: the (zero-based) \"index\" of the value from the source Observable.\n * - `source`: the source Observable instance itself.\n * @return {Observable} An Observable of one number that represents the count as\n * described above.\n * @method count\n * @owner Observable\n */\n\nexport function count(predicate?: (value: T, index: number, source: Observable) => boolean): OperatorFunction {\n return (source: Observable) => source.lift(new CountOperator(predicate, source));\n}\n\nclass CountOperator implements Operator {\n constructor(private predicate?: (value: T, index: number, source: Observable) => boolean,\n private source?: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass CountSubscriber extends Subscriber {\n private count: number = 0;\n private index: number = 0;\n\n constructor(destination: Observer,\n private predicate?: (value: T, index: number, source: Observable) => boolean,\n private source?: Observable) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (this.predicate) {\n this._tryPredicate(value);\n } else {\n this.count++;\n }\n }\n\n private _tryPredicate(value: T) {\n let result: any;\n\n try {\n result = this.predicate(value, this.index++, this.source);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n\n if (result) {\n this.count++;\n }\n }\n\n protected _complete(): void {\n this.destination.next(this.count);\n this.destination.complete();\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Emits a value from the source Observable only after a particular time span\n * determined by another Observable has passed without another source emission.\n *\n * It's like {@link debounceTime}, but the time span of\n * emission silence is determined by a second Observable.\n *\n * ![](debounce.png)\n *\n * `debounce` delays values emitted by the source Observable, but drops previous\n * pending delayed emissions if a new value arrives on the source Observable.\n * This operator keeps track of the most recent value from the source\n * Observable, and spawns a duration Observable by calling the\n * `durationSelector` function. The value is emitted only when the duration\n * Observable emits a value or completes, and if no other value was emitted on\n * the source Observable since the duration Observable was spawned. If a new\n * value appears before the duration Observable emits, the previous value will\n * be dropped and will not be emitted on the output Observable.\n *\n * Like {@link debounceTime}, this is a rate-limiting operator, and also a\n * delay-like operator since output emissions do not necessarily occur at the\n * same time as they did on the source Observable.\n *\n * ## Example\n * Emit the most recent click after a burst of clicks\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { debounce } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(debounce(() => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounceTime}\n * @see {@link delayWhen}\n * @see {@link throttle}\n *\n * @param {function(value: T): SubscribableOrPromise} durationSelector A function\n * that receives a value from the source Observable, for computing the timeout\n * duration for each source value, returned as an Observable or a Promise.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified duration Observable returned by\n * `durationSelector`, and may drop some values if they occur too frequently.\n * @method debounce\n * @owner Observable\n */\nexport function debounce(durationSelector: (value: T) => SubscribableOrPromise): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new DebounceOperator(durationSelector));\n}\n\nclass DebounceOperator implements Operator {\n constructor(private durationSelector: (value: T) => SubscribableOrPromise) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DebounceSubscriber extends SimpleOuterSubscriber {\n private value?: T;\n private hasValue = false;\n private durationSubscription?: Subscription;\n\n constructor(destination: Subscriber,\n private durationSelector: (value: T) => SubscribableOrPromise) {\n super(destination);\n }\n\n protected _next(value: T): void {\n try {\n const result = this.durationSelector.call(this, value);\n\n if (result) {\n this._tryNext(value, result);\n }\n } catch (err) {\n this.destination.error!(err);\n }\n }\n\n protected _complete(): void {\n this.emitValue();\n this.destination.complete!();\n }\n\n private _tryNext(value: T, duration: SubscribableOrPromise): void {\n let subscription = this.durationSubscription;\n this.value = value;\n this.hasValue = true;\n if (subscription) {\n subscription.unsubscribe();\n this.remove(subscription);\n }\n\n subscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n if (subscription && !subscription.closed) {\n this.add(this.durationSubscription = subscription);\n }\n }\n\n notifyNext(): void {\n this.emitValue();\n }\n\n notifyComplete(): void {\n this.emitValue();\n }\n\n emitValue(): void {\n if (this.hasValue) {\n const value = this.value;\n const subscription = this.durationSubscription;\n if (subscription) {\n this.durationSubscription = undefined;\n subscription.unsubscribe();\n this.remove(subscription);\n }\n // This must be done *before* passing the value\n // along to the destination because it's possible for\n // the value to synchronously re-enter this operator\n // recursively if the duration selector Observable\n // emits synchronously\n this.value = undefined;\n this.hasValue = false;\n super._next(value!);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { async } from '../scheduler/async';\nimport { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Emits a value from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * It's like {@link delay}, but passes only the most\n * recent value from each burst of emissions.\n *\n * ![](debounceTime.png)\n *\n * `debounceTime` delays values emitted by the source Observable, but drops\n * previous pending delayed emissions if a new value arrives on the source\n * Observable. This operator keeps track of the most recent value from the\n * source Observable, and emits that only when `dueTime` enough time has passed\n * without any other value appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous value will be dropped\n * and will not be emitted on the output Observable.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * value to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link SchedulerLike} for\n * managing timers.\n *\n * ## Example\n * Emit the most recent click after a burst of clicks\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { debounceTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(debounceTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the timeout for each value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified `dueTime`, and may drop some values if they occur\n * too frequently.\n * @method debounceTime\n * @owner Observable\n */\nexport function debounceTime(dueTime: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new DebounceTimeOperator(dueTime, scheduler));\n}\n\nclass DebounceTimeOperator implements Operator {\n constructor(private dueTime: number, private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DebounceTimeSubscriber extends Subscriber {\n private debouncedSubscription: Subscription = null;\n private lastValue: T = null;\n private hasValue: boolean = false;\n\n constructor(destination: Subscriber,\n private dueTime: number,\n private scheduler: SchedulerLike) {\n super(destination);\n }\n\n protected _next(value: T) {\n this.clearDebounce();\n this.lastValue = value;\n this.hasValue = true;\n this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));\n }\n\n protected _complete() {\n this.debouncedNext();\n this.destination.complete();\n }\n\n debouncedNext(): void {\n this.clearDebounce();\n\n if (this.hasValue) {\n const { lastValue } = this;\n // This must be done *before* passing the value\n // along to the destination because it's possible for\n // the value to synchronously re-enter this operator\n // recursively when scheduled with things like\n // VirtualScheduler/TestScheduler.\n this.lastValue = null;\n this.hasValue = false;\n this.destination.next(lastValue);\n }\n }\n\n private clearDebounce(): void {\n const debouncedSubscription = this.debouncedSubscription;\n\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n }\n}\n\nfunction dispatchNext(subscriber: DebounceTimeSubscriber) {\n subscriber.debouncedNext();\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function defaultIfEmpty(defaultValue?: T): MonoTypeOperatorFunction;\nexport function defaultIfEmpty(defaultValue?: R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Emits a given value if the source Observable completes without emitting any\n * `next` value, otherwise mirrors the source Observable.\n *\n * If the source Observable turns out to be empty, then\n * this operator will emit a default value.\n *\n * ![](defaultIfEmpty.png)\n *\n * `defaultIfEmpty` emits the values emitted by the source Observable or a\n * specified default value if the source Observable is empty (completes without\n * having emitted any `next` value).\n *\n * ## Example\n * If no clicks happen in 5 seconds, then emit \"no clicks\"\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { defaultIfEmpty, takeUntil } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const clicksBeforeFive = clicks.pipe(takeUntil(interval(5000)));\n * const result = clicksBeforeFive.pipe(defaultIfEmpty('no clicks'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link empty}\n * @see {@link last}\n *\n * @param {any} [defaultValue=null] The default value used if the source\n * Observable is empty.\n * @return {Observable} An Observable that emits either the specified\n * `defaultValue` if the source Observable emits no items, or the values emitted\n * by the source Observable.\n * @method defaultIfEmpty\n * @owner Observable\n */\nexport function defaultIfEmpty(defaultValue: R = null): OperatorFunction {\n return (source: Observable) => source.lift(new DefaultIfEmptyOperator(defaultValue)) as Observable;\n}\n\nclass DefaultIfEmptyOperator implements Operator {\n\n constructor(private defaultValue: R) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DefaultIfEmptySubscriber extends Subscriber {\n private isEmpty: boolean = true;\n\n constructor(destination: Subscriber, private defaultValue: R) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.isEmpty = false;\n this.destination.next(value);\n }\n\n protected _complete(): void {\n if (this.isEmpty) {\n this.destination.next(this.defaultValue);\n }\n this.destination.complete();\n }\n}\n","export function isDate(value: any): value is Date {\n return value instanceof Date && !isNaN(+value);\n}\n","import { async } from '../scheduler/async';\nimport { isDate } from '../util/isDate';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Notification } from '../Notification';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, PartialObserver, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Delays the emission of items from the source Observable by a given timeout or\n * until a given Date.\n *\n * Time shifts each item by some specified amount of\n * milliseconds.\n *\n * ![](delay.png)\n *\n * If the delay argument is a Number, this operator time shifts the source\n * Observable by that amount of time expressed in milliseconds. The relative\n * time intervals between the values are preserved.\n *\n * If the delay argument is a Date, this operator time shifts the start of the\n * Observable execution until the given date occurs.\n *\n * ## Examples\n * Delay each click by one second\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { delay } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const delayedClicks = clicks.pipe(delay(1000)); // each click emitted after 1 second\n * delayedClicks.subscribe(x => console.log(x));\n * ```\n *\n * Delay all clicks until a future date happens\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { delay } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const date = new Date('March 15, 2050 12:00:00'); // in the future\n * const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date\n * delayedClicks.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link debounceTime}\n * @see {@link delayWhen}\n *\n * @param {number|Date} delay The delay duration in milliseconds (a `number`) or\n * a `Date` until which the emission of the source items is delayed.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the time-shift for each item.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified timeout or Date.\n * @method delay\n * @owner Observable\n */\nexport function delay(delay: number|Date,\n scheduler: SchedulerLike = async): MonoTypeOperatorFunction {\n const absoluteDelay = isDate(delay);\n const delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);\n return (source: Observable) => source.lift(new DelayOperator(delayFor, scheduler));\n}\n\nclass DelayOperator implements Operator {\n constructor(private delay: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));\n }\n}\n\ninterface DelayState {\n source: DelaySubscriber;\n destination: PartialObserver;\n scheduler: SchedulerLike;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DelaySubscriber extends Subscriber {\n private queue: Array> = [];\n private active: boolean = false;\n private errored: boolean = false;\n\n private static dispatch(this: SchedulerAction>, state: DelayState): void {\n const source = state.source;\n const queue = source.queue;\n const scheduler = state.scheduler;\n const destination = state.destination;\n\n while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {\n queue.shift().notification.observe(destination);\n }\n\n if (queue.length > 0) {\n const delay = Math.max(0, queue[0].time - scheduler.now());\n this.schedule(state, delay);\n } else {\n this.unsubscribe();\n source.active = false;\n }\n }\n\n constructor(destination: Subscriber,\n private delay: number,\n private scheduler: SchedulerLike) {\n super(destination);\n }\n\n private _schedule(scheduler: SchedulerLike): void {\n this.active = true;\n const destination = this.destination as Subscription;\n destination.add(scheduler.schedule>(DelaySubscriber.dispatch, this.delay, {\n source: this, destination: this.destination, scheduler: scheduler\n }));\n }\n\n private scheduleNotification(notification: Notification): void {\n if (this.errored === true) {\n return;\n }\n\n const scheduler = this.scheduler;\n const message = new DelayMessage(scheduler.now() + this.delay, notification);\n this.queue.push(message);\n\n if (this.active === false) {\n this._schedule(scheduler);\n }\n }\n\n protected _next(value: T) {\n this.scheduleNotification(Notification.createNext(value));\n }\n\n protected _error(err: any) {\n this.errored = true;\n this.queue = [];\n this.destination.error(err);\n this.unsubscribe();\n }\n\n protected _complete() {\n this.scheduleNotification(Notification.createComplete());\n this.unsubscribe();\n }\n}\n\nclass DelayMessage {\n constructor(public readonly time: number,\n public readonly notification: Notification) {\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated In future versions, empty notifiers will no longer re-emit the source value on the output observable. */\nexport function delayWhen(delayDurationSelector: (value: T, index: number) => Observable, subscriptionDelay?: Observable): MonoTypeOperatorFunction;\nexport function delayWhen(delayDurationSelector: (value: T, index: number) => Observable, subscriptionDelay?: Observable): MonoTypeOperatorFunction;\n/* tslint:disable:max-line-length */\n\n/**\n * Delays the emission of items from the source Observable by a given time span\n * determined by the emissions of another Observable.\n *\n * It's like {@link delay}, but the time span of the\n * delay duration is determined by a second Observable.\n *\n * ![](delayWhen.png)\n *\n * `delayWhen` time shifts each emitted value from the source Observable by a\n * time span determined by another Observable. When the source emits a value,\n * the `delayDurationSelector` function is called with the source value as\n * argument, and should return an Observable, called the \"duration\" Observable.\n * The source value is emitted on the output Observable only when the duration\n * Observable emits a value or completes.\n * The completion of the notifier triggering the emission of the source value\n * is deprecated behavior and will be removed in future versions.\n *\n * Optionally, `delayWhen` takes a second argument, `subscriptionDelay`, which\n * is an Observable. When `subscriptionDelay` emits its first value or\n * completes, the source Observable is subscribed to and starts behaving like\n * described in the previous paragraph. If `subscriptionDelay` is not provided,\n * `delayWhen` will subscribe to the source Observable as soon as the output\n * Observable is subscribed.\n *\n * ## Example\n * Delay each click by a random amount of time, between 0 and 5 seconds\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { delayWhen } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const delayedClicks = clicks.pipe(\n * delayWhen(event => interval(Math.random() * 5000)),\n * );\n * delayedClicks.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link delay}\n * @see {@link throttle}\n * @see {@link throttleTime}\n * @see {@link debounce}\n * @see {@link debounceTime}\n * @see {@link sample}\n * @see {@link sampleTime}\n * @see {@link audit}\n * @see {@link auditTime}\n *\n * @param {function(value: T, index: number): Observable} delayDurationSelector A function that\n * returns an Observable for each value emitted by the source Observable, which\n * is then used to delay the emission of that item on the output Observable\n * until the Observable returned from this function emits a value.\n * @param {Observable} subscriptionDelay An Observable that triggers the\n * subscription to the source Observable once it emits any value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by an amount of time specified by the Observable returned by\n * `delayDurationSelector`.\n * @method delayWhen\n * @owner Observable\n */\nexport function delayWhen(delayDurationSelector: (value: T, index: number) => Observable,\n subscriptionDelay?: Observable): MonoTypeOperatorFunction {\n if (subscriptionDelay) {\n return (source: Observable) =>\n new SubscriptionDelayObservable(source, subscriptionDelay)\n .lift(new DelayWhenOperator(delayDurationSelector));\n }\n return (source: Observable) => source.lift(new DelayWhenOperator(delayDurationSelector));\n}\n\nclass DelayWhenOperator implements Operator {\n constructor(private delayDurationSelector: (value: T, index: number) => Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DelayWhenSubscriber extends OuterSubscriber {\n private completed: boolean = false;\n private delayNotifierSubscriptions: Array = [];\n private index: number = 0;\n\n constructor(destination: Subscriber,\n private delayDurationSelector: (value: T, index: number) => Observable) {\n super(destination);\n }\n\n notifyNext(outerValue: T, _innerValue: any,\n _outerIndex: number, _innerIndex: number,\n innerSub: InnerSubscriber): void {\n this.destination.next!(outerValue);\n this.removeSubscription(innerSub);\n this.tryComplete();\n }\n\n notifyError(error: any, innerSub: InnerSubscriber): void {\n this._error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber): void {\n const value = this.removeSubscription(innerSub);\n if (value) {\n this.destination.next!(value);\n }\n this.tryComplete();\n }\n\n protected _next(value: T): void {\n const index = this.index++;\n try {\n const delayNotifier = this.delayDurationSelector(value, index);\n if (delayNotifier) {\n this.tryDelay(delayNotifier, value);\n }\n } catch (err) {\n this.destination.error!(err);\n }\n }\n\n protected _complete(): void {\n this.completed = true;\n this.tryComplete();\n this.unsubscribe();\n }\n\n private removeSubscription(subscription: InnerSubscriber): T {\n subscription.unsubscribe();\n\n const subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);\n if (subscriptionIdx !== -1) {\n this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);\n }\n\n return subscription.outerValue;\n }\n\n private tryDelay(delayNotifier: Observable, value: T): void {\n const notifierSubscription = subscribeToResult(this, delayNotifier, value);\n\n if (notifierSubscription && !notifierSubscription.closed) {\n const destination = this.destination as Subscription;\n destination.add(notifierSubscription);\n this.delayNotifierSubscriptions.push(notifierSubscription);\n }\n }\n\n private tryComplete(): void {\n if (this.completed && this.delayNotifierSubscriptions.length === 0) {\n this.destination.complete!();\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SubscriptionDelayObservable extends Observable {\n constructor(public source: Observable, private subscriptionDelay: Observable) {\n super();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber) {\n this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SubscriptionDelaySubscriber extends Subscriber {\n private sourceSubscribed: boolean = false;\n\n constructor(private parent: Subscriber, private source: Observable) {\n super();\n }\n\n protected _next(unused: any) {\n this.subscribeToSource();\n }\n\n protected _error(err: any) {\n this.unsubscribe();\n this.parent.error(err);\n }\n\n protected _complete() {\n this.unsubscribe();\n this.subscribeToSource();\n }\n\n private subscribeToSource(): void {\n if (!this.sourceSubscribed) {\n this.sourceSubscribed = true;\n this.unsubscribe();\n this.source.subscribe(this.parent);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nimport { OperatorFunction } from '../types';\n\n/**\n * Converts an Observable of {@link Notification} objects into the emissions\n * that they represent.\n *\n * Unwraps {@link Notification} objects as actual `next`,\n * `error` and `complete` emissions. The opposite of {@link materialize}.\n *\n * ![](dematerialize.png)\n *\n * `dematerialize` is assumed to operate an Observable that only emits\n * {@link Notification} objects as `next` emissions, and does not emit any\n * `error`. Such Observable is the output of a `materialize` operation. Those\n * notifications are then unwrapped using the metadata they contain, and emitted\n * as `next`, `error`, and `complete` on the output Observable.\n *\n * Use this operator in conjunction with {@link materialize}.\n *\n * ## Example\n * Convert an Observable of Notifications to an actual Observable\n * ```ts\n * import { of, Notification } from 'rxjs';\n * import { dematerialize } from 'rxjs/operators';\n *\n * const notifA = new Notification('N', 'A');\n * const notifB = new Notification('N', 'B');\n * const notifE = new Notification('E', undefined,\n * new TypeError('x.toUpperCase is not a function')\n * );\n * const materialized = of(notifA, notifB, notifE);\n * const upperCase = materialized.pipe(dematerialize());\n * upperCase.subscribe(x => console.log(x), e => console.error(e));\n *\n * // Results in:\n * // A\n * // B\n * // TypeError: x.toUpperCase is not a function\n * ```\n *\n * @see {@link Notification}\n * @see {@link materialize}\n *\n * @return {Observable} An Observable that emits items and notifications\n * embedded in Notification objects emitted by the source Observable.\n * @method dematerialize\n * @owner Observable\n */\nexport function dematerialize(): OperatorFunction, T> {\n return function dematerializeOperatorFunction(source: Observable>) {\n return source.lift(new DeMaterializeOperator());\n };\n}\n\nclass DeMaterializeOperator, R> implements Operator {\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new DeMaterializeSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DeMaterializeSubscriber> extends Subscriber {\n constructor(destination: Subscriber) {\n super(destination);\n }\n\n protected _next(value: T) {\n value.observe(this.destination);\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items.\n *\n * If a keySelector function is provided, then it will project each value from the source observable into a new value that it will\n * check for equality with previously projected values. If a keySelector function is not provided, it will use each value from the\n * source observable directly with an equality check against previous values.\n *\n * In JavaScript runtimes that support `Set`, this operator will use a `Set` to improve performance of the distinct value checking.\n *\n * In other runtimes, this operator will use a minimal implementation of `Set` that relies on an `Array` and `indexOf` under the\n * hood, so performance will degrade as more values are checked for distinction. Even in newer browsers, a long-running `distinct`\n * use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so\n * that the internal `Set` can be \"flushed\", basically clearing it of values.\n *\n * ## Examples\n * A simple example with numbers\n * ```ts\n * import { of } from 'rxjs';\n * import { distinct } from 'rxjs/operators';\n *\n * of(1, 1, 2, 2, 2, 1, 2, 3, 4, 3, 2, 1).pipe(\n * distinct(),\n * )\n * .subscribe(x => console.log(x)); // 1, 2, 3, 4\n * ```\n *\n * An example using a keySelector function\n * ```typescript\n * import { of } from 'rxjs';\n * import { distinct } from 'rxjs/operators';\n *\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of(\n * { age: 4, name: 'Foo'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo'},\n * ).pipe(\n * distinct((p: Person) => p.name),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo' }\n * // { age: 7, name: 'Bar' }\n * ```\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n *\n * @param {function} [keySelector] Optional function to select which value you want to check as distinct.\n * @param {Observable} [flushes] Optional Observable for flushing the internal HashSet of the operator.\n * @return {Observable} An Observable that emits items from the source Observable with distinct values.\n * @method distinct\n * @owner Observable\n */\nexport function distinct(keySelector?: (value: T) => K,\n flushes?: Observable): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new DistinctOperator(keySelector, flushes));\n}\n\nclass DistinctOperator implements Operator {\n constructor(private keySelector?: (value: T) => K, private flushes?: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class DistinctSubscriber extends SimpleOuterSubscriber {\n private values = new Set();\n\n constructor(destination: Subscriber, private keySelector?: (value: T) => K, flushes?: Observable) {\n super(destination);\n\n if (flushes) {\n this.add(innerSubscribe(flushes, new SimpleInnerSubscriber(this)));\n }\n }\n\n notifyNext(): void {\n this.values.clear();\n }\n\n notifyError(error: any): void {\n this._error(error);\n }\n\n protected _next(value: T): void {\n if (this.keySelector) {\n this._useKeySelector(value);\n } else {\n this._finalizeNext(value, value);\n }\n }\n\n private _useKeySelector(value: T): void {\n let key: K;\n const { destination } = this;\n try {\n key = this.keySelector!(value);\n } catch (err) {\n destination.error!(err);\n return;\n }\n this._finalizeNext(key, value);\n }\n\n private _finalizeNext(key: K|T, value: T) {\n const { values } = this;\n if (!values.has(key)) {\n values.add(key);\n this.destination.next!(value);\n }\n }\n\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function distinctUntilChanged(compare?: (x: T, y: T) => boolean): MonoTypeOperatorFunction;\nexport function distinctUntilChanged(compare: (x: K, y: K) => boolean, keySelector: (x: T) => K): MonoTypeOperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item.\n *\n * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.\n *\n * If a comparator function is not provided, an equality check is used by default.\n *\n * ## Example\n * A simple example with numbers\n * ```ts\n * import { of } from 'rxjs';\n * import { distinctUntilChanged } from 'rxjs/operators';\n *\n * of(1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 4).pipe(\n * distinctUntilChanged(),\n * )\n * .subscribe(x => console.log(x)); // 1, 2, 1, 2, 3, 4\n * ```\n *\n * An example using a compare function\n * ```typescript\n * import { of } from 'rxjs';\n * import { distinctUntilChanged } from 'rxjs/operators';\n *\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of(\n * { age: 4, name: 'Foo'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo'},\n * { age: 6, name: 'Foo'},\n * ).pipe(\n * distinctUntilChanged((p: Person, q: Person) => p.name === q.name),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo' }\n * // { age: 7, name: 'Bar' }\n * // { age: 5, name: 'Foo' }\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilKeyChanged}\n *\n * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.\n * @return {Observable} An Observable that emits items from the source Observable with distinct values.\n * @method distinctUntilChanged\n * @owner Observable\n */\nexport function distinctUntilChanged(compare?: (x: K, y: K) => boolean, keySelector?: (x: T) => K): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new DistinctUntilChangedOperator(compare, keySelector));\n}\n\nclass DistinctUntilChangedOperator implements Operator {\n constructor(private compare: (x: K, y: K) => boolean,\n private keySelector: (x: T) => K) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DistinctUntilChangedSubscriber extends Subscriber {\n private key: K;\n private hasKey: boolean = false;\n\n constructor(destination: Subscriber,\n compare: (x: K, y: K) => boolean,\n private keySelector: (x: T) => K) {\n super(destination);\n if (typeof compare === 'function') {\n this.compare = compare;\n }\n }\n\n private compare(x: any, y: any): boolean {\n return x === y;\n }\n\n protected _next(value: T): void {\n let key: any;\n try {\n const { keySelector } = this;\n key = keySelector ? keySelector(value) : value;\n } catch (err) {\n return this.destination.error(err);\n }\n let result = false;\n if (this.hasKey) {\n try {\n const { compare } = this;\n result = compare(this.key, key);\n } catch (err) {\n return this.destination.error(err);\n }\n } else {\n this.hasKey = true;\n }\n if (!result) {\n this.key = key;\n this.destination.next(value);\n }\n }\n}\n","import { distinctUntilChanged } from './distinctUntilChanged';\nimport { MonoTypeOperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function distinctUntilKeyChanged(key: keyof T): MonoTypeOperatorFunction;\nexport function distinctUntilKeyChanged(key: K, compare: (x: T[K], y: T[K]) => boolean): MonoTypeOperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item,\n * using a property accessed by using the key provided to check if the two items are distinct.\n *\n * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.\n *\n * If a comparator function is not provided, an equality check is used by default.\n *\n * ## Examples\n * An example comparing the name of persons\n * ```typescript\n * import { of } from 'rxjs';\n * import { distinctUntilKeyChanged } from 'rxjs/operators';\n *\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of(\n * { age: 4, name: 'Foo'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo'},\n * { age: 6, name: 'Foo'},\n * ).pipe(\n * distinctUntilKeyChanged('name'),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo' }\n * // { age: 7, name: 'Bar' }\n * // { age: 5, name: 'Foo' }\n * ```\n *\n * An example comparing the first letters of the name\n * ```typescript\n * import { of } from 'rxjs';\n * import { distinctUntilKeyChanged } from 'rxjs/operators';\n *\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of(\n * { age: 4, name: 'Foo1'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo2'},\n * { age: 6, name: 'Foo3'},\n * ).pipe(\n * distinctUntilKeyChanged('name', (x: string, y: string) => x.substring(0, 3) === y.substring(0, 3)),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo1' }\n * // { age: 7, name: 'Bar' }\n * // { age: 5, name: 'Foo2' }\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n *\n * @param {string} key String key for object property lookup on each item.\n * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.\n * @return {Observable} An Observable that emits items from the source Observable with distinct values based on the key specified.\n * @method distinctUntilKeyChanged\n * @owner Observable\n */\nexport function distinctUntilKeyChanged(key: K, compare?: (x: T[K], y: T[K]) => boolean): MonoTypeOperatorFunction {\n return distinctUntilChanged((x: T, y: T) => compare ? compare(x[key], y[key]) : x[key] === y[key]);\n}\n","import { EmptyError } from '../util/EmptyError';\nimport { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { TeardownLogic, MonoTypeOperatorFunction } from '../types';\n\n/**\n * If the source observable completes without emitting a value, it will emit\n * an error. The error will be created at that time by the optional\n * `errorFactory` argument, otherwise, the error will be {@link EmptyError}.\n *\n * ![](throwIfEmpty.png)\n *\n * ## Example\n * ```ts\n * import { fromEvent, timer } from 'rxjs';\n * import { throwIfEmpty, takeUntil } from 'rxjs/operators';\n *\n * const click$ = fromEvent(document, 'click');\n *\n * click$.pipe(\n * takeUntil(timer(1000)),\n * throwIfEmpty(\n * () => new Error('the document was not clicked within 1 second')\n * ),\n * )\n * .subscribe({\n * next() { console.log('The button was clicked'); },\n * error(err) { console.error(err); }\n * });\n * ```\n *\n * @param errorFactory A factory function called to produce the\n * error to be thrown when the source observable completes without emitting a\n * value.\n */\nexport function throwIfEmpty (errorFactory: (() => any) = defaultErrorFactory): MonoTypeOperatorFunction {\n return (source: Observable) => {\n return source.lift(new ThrowIfEmptyOperator(errorFactory));\n };\n}\n\nclass ThrowIfEmptyOperator implements Operator {\n constructor(private errorFactory: () => any) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory));\n }\n}\n\nclass ThrowIfEmptySubscriber extends Subscriber {\n private hasValue: boolean = false;\n\n constructor(destination: Subscriber, private errorFactory: () => any) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.hasValue = true;\n this.destination.next(value);\n }\n\n protected _complete() {\n if (!this.hasValue) {\n let err: any;\n try {\n err = this.errorFactory();\n } catch (e) {\n err = e;\n }\n this.destination.error(err);\n } else {\n return this.destination.complete();\n }\n }\n}\n\nfunction defaultErrorFactory() {\n return new EmptyError();\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Emits only the first `count` values emitted by the source Observable.\n *\n * Takes the first `count` values from the source, then\n * completes.\n *\n * ![](take.png)\n *\n * `take` returns an Observable that emits only the first `count` values emitted\n * by the source Observable. If the source emits fewer than `count` values then\n * all of its values are emitted. After that, it completes, regardless if the\n * source completes.\n *\n * ## Example\n * Take the first 5 seconds of an infinite 1-second interval Observable\n * ```ts\n * import { interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const intervalCount = interval(1000);\n * const takeFive = intervalCount.pipe(take(5));\n * takeFive.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 0\n * // 1\n * // 2\n * // 3\n * // 4\n * ```\n *\n * @see {@link takeLast}\n * @see {@link takeUntil}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.\n *\n * @param {number} count The maximum number of `next` values to emit.\n * @return {Observable} An Observable that emits only the first `count`\n * values emitted by the source Observable, or all of the values from the source\n * if the source emits fewer than `count` values.\n * @method take\n * @owner Observable\n */\nexport function take(count: number): MonoTypeOperatorFunction {\n return (source: Observable) => {\n if (count === 0) {\n return empty();\n } else {\n return source.lift(new TakeOperator(count));\n }\n };\n}\n\nclass TakeOperator implements Operator {\n constructor(private total: number) {\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new TakeSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeSubscriber extends Subscriber {\n private count: number = 0;\n\n constructor(destination: Subscriber, private total: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const total = this.total;\n const count = ++this.count;\n if (count <= total) {\n this.destination.next(value);\n if (count === total) {\n this.destination.complete();\n this.unsubscribe();\n }\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { filter } from './filter';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { take } from './take';\n\n/**\n * Emits the single value at the specified `index` in a sequence of emissions\n * from the source Observable.\n *\n * Emits only the i-th value, then completes.\n *\n * ![](elementAt.png)\n *\n * `elementAt` returns an Observable that emits the item at the specified\n * `index` in the source Observable, or a default value if that `index` is out\n * of range and the `default` argument is provided. If the `default` argument is\n * not given and the `index` is out of range, the output Observable will emit an\n * `ArgumentOutOfRangeError` error.\n *\n * ## Example\n * Emit only the third click event\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { elementAt } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(elementAt(2));\n * result.subscribe(x => console.log(x));\n *\n * // Results in:\n * // click 1 = nothing\n * // click 2 = nothing\n * // click 3 = MouseEvent object logged to console\n * ```\n *\n * @see {@link first}\n * @see {@link last}\n * @see {@link skip}\n * @see {@link single}\n * @see {@link take}\n *\n * @throws {ArgumentOutOfRangeError} When using `elementAt(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0` or the\n * Observable has completed before emitting the i-th `next` notification.\n *\n * @param {number} index Is the number `i` for the i-th source emission that has\n * happened since the subscription, starting from the number `0`.\n * @param {T} [defaultValue] The default value returned for missing indices.\n * @return {Observable} An Observable that emits a single item, if it is found.\n * Otherwise, will emit the default value if given. If not, then emits an error.\n * @method elementAt\n * @owner Observable\n */\nexport function elementAt(index: number, defaultValue?: T): MonoTypeOperatorFunction {\n if (index < 0) { throw new ArgumentOutOfRangeError(); }\n const hasDefaultValue = arguments.length >= 2;\n return (source: Observable) => source.pipe(\n filter((v, i) => i === index),\n take(1),\n hasDefaultValue\n ? defaultIfEmpty(defaultValue)\n : throwIfEmpty(() => new ArgumentOutOfRangeError()),\n );\n}\n","import { Observable } from '../Observable';\nimport { concat } from '../observable/concat';\nimport { of } from '../observable/of';\nimport { MonoTypeOperatorFunction, SchedulerLike, OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(scheduler: SchedulerLike): MonoTypeOperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(v1: A, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(v1: A, v2: B, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(v1: A, v2: B, v3: C, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(v1: A, v2: B, v3: C, v4: D, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(v1: A, v2: B, v3: C, v4: D, v5: E, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(v1: A, v2: B, v3: C, v4: D, v5: E, v6: F, scheduler: SchedulerLike): OperatorFunction;\n\nexport function endWith(v1: A): OperatorFunction;\nexport function endWith(v1: A, v2: B): OperatorFunction;\nexport function endWith(v1: A, v2: B, v3: C): OperatorFunction;\nexport function endWith(v1: A, v2: B, v3: C, v4: D): OperatorFunction;\nexport function endWith(v1: A, v2: B, v3: C, v4: D, v5: E): OperatorFunction;\nexport function endWith(v1: A, v2: B, v3: C, v4: D, v5: E, v6: F): OperatorFunction;\nexport function endWith(...array: Z[]): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */\nexport function endWith(...array: Array): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the items you specify as arguments after it finishes emitting\n * items emitted by the source Observable.\n *\n * ![](endWith.png)\n *\n * ## Example\n * ### After the source observable completes, appends an emission and then completes too.\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { endWith } from 'rxjs/operators';\n *\n * of('hi', 'how are you?', 'sorry, I have to go now').pipe(\n * endWith('goodbye!'),\n * )\n * .subscribe(word => console.log(word));\n * // result:\n * // 'hi'\n * // 'how are you?'\n * // 'sorry, I have to go now'\n * // 'goodbye!'\n * ```\n *\n * @param {...T} values - Items you want the modified Observable to emit last.\n * @param {SchedulerLike} [scheduler] - A {@link SchedulerLike} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable} An Observable that emits the items emitted by the source Observable\n * and then emits the items in the specified Iterable.\n * @method endWith\n * @owner Observable\n */\nexport function endWith(...array: Array): MonoTypeOperatorFunction {\n return (source: Observable) => concat(source, of(...array)) as Observable;\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Observer, OperatorFunction } from '../types';\n\n/**\n * Returns an Observable that emits whether or not every item of the source satisfies the condition specified.\n *\n * ## Example\n * A simple example emitting true if all elements are less than 5, false otherwise\n * ```ts\n * import { of } from 'rxjs';\n * import { every } from 'rxjs/operators';\n *\n * of(1, 2, 3, 4, 5, 6).pipe(\n * every(x => x < 5),\n * )\n * .subscribe(x => console.log(x)); // -> false\n * ```\n *\n * @param {function} predicate A function for determining if an item meets a specified condition.\n * @param {any} [thisArg] Optional object to use for `this` in the callback.\n * @return {Observable} An Observable of booleans that determines if all items of the source Observable meet the condition specified.\n * @method every\n * @owner Observable\n */\nexport function every(predicate: (value: T, index: number, source: Observable) => boolean,\n thisArg?: any): OperatorFunction {\n return (source: Observable) => source.lift(new EveryOperator(predicate, thisArg, source));\n}\n\nclass EveryOperator implements Operator {\n constructor(private predicate: (value: T, index: number, source: Observable) => boolean,\n private thisArg?: any,\n private source?: Observable) {\n }\n\n call(observer: Subscriber, source: any): any {\n return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass EverySubscriber extends Subscriber {\n private index: number = 0;\n\n constructor(destination: Observer,\n private predicate: (value: T, index: number, source: Observable) => boolean,\n private thisArg: any,\n private source?: Observable) {\n super(destination);\n this.thisArg = thisArg || this;\n }\n\n private notifyComplete(everyValueMatch: boolean): void {\n this.destination.next(everyValueMatch);\n this.destination.complete();\n }\n\n protected _next(value: T): void {\n let result = false;\n try {\n result = this.predicate.call(this.thisArg, value, this.index++, this.source);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n\n if (!result) {\n this.notifyComplete(false);\n }\n }\n\n protected _complete(): void {\n this.notifyComplete(true);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { ObservableInput, OperatorFunction, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\nexport function exhaust(): OperatorFunction, T>;\nexport function exhaust(): OperatorFunction;\n\n/**\n * Converts a higher-order Observable into a first-order Observable by dropping\n * inner Observables while the previous inner Observable has not yet completed.\n *\n * Flattens an Observable-of-Observables by dropping the\n * next inner Observables while the current inner is still executing.\n *\n * ![](exhaust.png)\n *\n * `exhaust` subscribes to an Observable that emits Observables, also known as a\n * higher-order Observable. Each time it observes one of these emitted inner\n * Observables, the output Observable begins emitting the items emitted by that\n * inner Observable. So far, it behaves like {@link mergeAll}. However,\n * `exhaust` ignores every new inner Observable if the previous Observable has\n * not yet completed. Once that one completes, it will accept and flatten the\n * next inner Observable and repeat this process.\n *\n * ## Example\n * Run a finite timer for each click, only if there is no currently active timer\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { exhaust, map, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map((ev) => interval(1000).pipe(take(5))),\n * );\n * const result = higherOrder.pipe(exhaust());\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link mergeAll}\n * @see {@link exhaustMap}\n * @see {@link zipAll}\n *\n * @return {Observable} An Observable that takes a source of Observables and propagates the first observable\n * exclusively until it completes before subscribing to the next.\n * @method exhaust\n * @owner Observable\n */\nexport function exhaust(): OperatorFunction {\n return (source: Observable) => source.lift(new SwitchFirstOperator());\n}\n\nclass SwitchFirstOperator implements Operator {\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new SwitchFirstSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SwitchFirstSubscriber extends SimpleOuterSubscriber {\n private hasCompleted: boolean = false;\n private hasSubscription: boolean = false;\n\n constructor(destination: Subscriber) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (!this.hasSubscription) {\n this.hasSubscription = true;\n this.add(innerSubscribe(value, new SimpleInnerSubscriber(this)));\n }\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete!();\n }\n }\n\n notifyComplete(): void {\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete!();\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function exhaustMap>(project: (value: T, index: number) => O): OperatorFunction>;\n/** @deprecated resultSelector is no longer supported. Use inner map instead. */\nexport function exhaustMap>(project: (value: T, index: number) => O, resultSelector: undefined): OperatorFunction>;\n/** @deprecated resultSelector is no longer supported. Use inner map instead. */\nexport function exhaustMap(project: (value: T, index: number) => ObservableInput, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable only if the previous projected Observable has completed.\n *\n * Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link exhaust}.\n *\n * ![](exhaustMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. When it projects a source value to\n * an Observable, the output Observable begins emitting the items emitted by\n * that projected Observable. However, `exhaustMap` ignores every new projected\n * Observable if the previous projected Observable has not yet completed. Once\n * that one completes, it will accept and flatten the next projected Observable\n * and repeat this process.\n *\n * ## Example\n * Run a finite timer for each click, only if there is no currently active timer\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { exhaustMap, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * exhaustMap(ev => interval(1000).pipe(take(5)))\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaust}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable containing projected Observables\n * of each item of the source, ignoring projected Observables that start before\n * their preceding Observable has completed.\n * @method exhaustMap\n * @owner Observable\n */\nexport function exhaustMap>(\n project: (value: T, index: number) => O,\n resultSelector?: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R,\n): OperatorFunction|R> {\n if (resultSelector) {\n // DEPRECATED PATH\n return (source: Observable) => source.pipe(\n exhaustMap((a, i) => from(project(a, i)).pipe(\n map((b: any, ii: any) => resultSelector(a, b, i, ii)),\n )),\n );\n }\n return (source: Observable) =>\n source.lift(new ExhaustMapOperator(project));\n}\n\nclass ExhaustMapOperator implements Operator {\n constructor(private project: (value: T, index: number) => ObservableInput) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ExhaustMapSubscriber extends SimpleOuterSubscriber {\n private hasSubscription = false;\n private hasCompleted = false;\n private index = 0;\n\n constructor(destination: Subscriber,\n private project: (value: T, index: number) => ObservableInput) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (!this.hasSubscription) {\n this.tryNext(value);\n }\n }\n\n private tryNext(value: T): void {\n let result: ObservableInput;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.hasSubscription = true;\n this._innerSub(result);\n }\n\n private _innerSub(result: ObservableInput): void {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(result, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete!();\n }\n this.unsubscribe();\n }\n\n notifyNext(innerValue: R): void {\n this.destination.next!(innerValue);\n }\n\n notifyError(err: any): void {\n this.destination.error!(err);\n }\n\n notifyComplete(): void {\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete!();\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, OperatorFunction, ObservableInput, SchedulerLike } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function expand(project: (value: T, index: number) => ObservableInput, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction;\nexport function expand(project: (value: T, index: number) => ObservableInput, concurrent?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Recursively projects each source value to an Observable which is merged in\n * the output Observable.\n *\n * It's similar to {@link mergeMap}, but applies the\n * projection function to every source value as well as every output value.\n * It's recursive.\n *\n * ![](expand.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger. *Expand* will re-emit on the output\n * Observable every source value. Then, each output value is given to the\n * `project` function which returns an inner Observable to be merged on the\n * output Observable. Those output values resulting from the projection are also\n * given to the `project` function to produce new output values. This is how\n * *expand* behaves recursively.\n *\n * ## Example\n * Start emitting the powers of two on every click, at most 10 of them\n * ```ts\n * import { fromEvent, of } from 'rxjs';\n * import { expand, mapTo, delay, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const powersOfTwo = clicks.pipe(\n * mapTo(1),\n * expand(x => of(2 * x).pipe(delay(1000))),\n * take(10),\n * );\n * powersOfTwo.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link mergeMap}\n * @see {@link mergeScan}\n *\n * @param {function(value: T, index: number) => Observable} project A function\n * that, when applied to an item emitted by the source or the output Observable,\n * returns an Observable.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for subscribing to\n * each projected inner Observable.\n * @return {Observable} An Observable that emits the source values and also\n * result of applying the projection function to each value emitted on the\n * output Observable and and merging the results of the Observables obtained\n * from this transformation.\n * @method expand\n * @owner Observable\n */\nexport function expand(project: (value: T, index: number) => ObservableInput,\n concurrent: number = Number.POSITIVE_INFINITY,\n scheduler?: SchedulerLike): OperatorFunction {\n concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;\n\n return (source: Observable) => source.lift(new ExpandOperator(project, concurrent, scheduler));\n}\n\nexport class ExpandOperator implements Operator {\n constructor(private project: (value: T, index: number) => ObservableInput,\n private concurrent: number,\n private scheduler?: SchedulerLike) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));\n }\n}\n\ninterface DispatchArg {\n subscriber: ExpandSubscriber;\n result: ObservableInput;\n value: any;\n index: number;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ExpandSubscriber extends SimpleOuterSubscriber {\n private index: number = 0;\n private active: number = 0;\n private hasCompleted: boolean = false;\n private buffer?: any[];\n\n constructor(destination: Subscriber,\n private project: (value: T, index: number) => ObservableInput,\n private concurrent: number,\n private scheduler?: SchedulerLike) {\n super(destination);\n if (concurrent < Number.POSITIVE_INFINITY) {\n this.buffer = [];\n }\n }\n\n private static dispatch(arg: DispatchArg): void {\n const {subscriber, result, value, index} = arg;\n subscriber.subscribeToProjection(result, value, index);\n }\n\n protected _next(value: any): void {\n const destination = this.destination;\n\n if (destination.closed) {\n this._complete();\n return;\n }\n\n const index = this.index++;\n if (this.active < this.concurrent) {\n destination.next!(value);\n try {\n const { project } = this;\n const result = project(value, index);\n if (!this.scheduler) {\n this.subscribeToProjection(result, value, index);\n } else {\n const state: DispatchArg = { subscriber: this, result, value, index };\n const destination = this.destination as Subscription;\n destination.add(this.scheduler.schedule>(ExpandSubscriber.dispatch as any, 0, state));\n }\n } catch (e) {\n destination.error!(e);\n }\n } else {\n this.buffer!.push(value);\n }\n }\n\n private subscribeToProjection(result: any, value: T, index: number): void {\n this.active++;\n const destination = this.destination as Subscription;\n destination.add(innerSubscribe(result, new SimpleInnerSubscriber(this)));\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (this.hasCompleted && this.active === 0) {\n this.destination.complete!();\n }\n this.unsubscribe();\n }\n\n notifyNext(innerValue: R): void {\n this._next(innerValue);\n }\n\n notifyComplete(): void {\n const buffer = this.buffer;\n this.active--;\n if (buffer && buffer.length > 0) {\n this._next(buffer.shift());\n }\n if (this.hasCompleted && this.active === 0) {\n this.destination.complete!();\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that mirrors the source Observable, but will call a specified function when\n * the source terminates on complete or error.\n * @param {function} callback Function to be called when source terminates.\n * @return {Observable} An Observable that mirrors the source, but will call the specified function on termination.\n * @method finally\n * @owner Observable\n */\nexport function finalize(callback: () => void): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new FinallyOperator(callback));\n}\n\nclass FinallyOperator implements Operator {\n constructor(private callback: () => void) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new FinallySubscriber(subscriber, this.callback));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass FinallySubscriber extends Subscriber {\n constructor(destination: Subscriber, callback: () => void) {\n super(destination);\n this.add(new Subscription(callback));\n }\n}\n","import {Observable} from '../Observable';\nimport {Operator} from '../Operator';\nimport {Subscriber} from '../Subscriber';\nimport {OperatorFunction} from '../types';\n\nexport function find(predicate: (value: T, index: number, source: Observable) => value is S,\n thisArg?: any): OperatorFunction;\nexport function find(predicate: (value: T, index: number, source: Observable) => boolean,\n thisArg?: any): OperatorFunction;\n/**\n * Emits only the first value emitted by the source Observable that meets some\n * condition.\n *\n * Finds the first value that passes some test and emits\n * that.\n *\n * ![](find.png)\n *\n * `find` searches for the first item in the source Observable that matches the\n * specified condition embodied by the `predicate`, and returns the first\n * occurrence in the source. Unlike {@link first}, the `predicate` is required\n * in `find`, and does not emit an error if a valid value is not found.\n *\n * ## Example\n * Find and emit the first click that happens on a DIV element\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { find } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(find(ev => ev.target.tagName === 'DIV'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link filter}\n * @see {@link first}\n * @see {@link findIndex}\n * @see {@link take}\n *\n * @param {function(value: T, index: number, source: Observable): boolean} predicate\n * A function called with each item to test for condition matching.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of the first item that matches the\n * condition.\n * @method find\n * @owner Observable\n */\nexport function find(predicate: (value: T, index: number, source: Observable) => boolean,\n thisArg?: any): OperatorFunction {\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate is not a function');\n }\n return (source: Observable) => source.lift(new FindValueOperator(predicate, source, false, thisArg)) as Observable;\n}\n\nexport class FindValueOperator implements Operator {\n constructor(private predicate: (value: T, index: number, source: Observable) => boolean,\n private source: Observable,\n private yieldIndex: boolean,\n private thisArg?: any) {\n }\n\n call(observer: Subscriber, source: any): any {\n return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class FindValueSubscriber extends Subscriber {\n private index: number = 0;\n\n constructor(destination: Subscriber,\n private predicate: (value: T, index: number, source: Observable) => boolean,\n private source: Observable,\n private yieldIndex: boolean,\n private thisArg?: any) {\n super(destination);\n }\n\n private notifyComplete(value: any): void {\n const destination = this.destination;\n\n destination.next(value);\n destination.complete();\n this.unsubscribe();\n }\n\n protected _next(value: T): void {\n const {predicate, thisArg} = this;\n const index = this.index++;\n try {\n const result = predicate.call(thisArg || this, value, index, this.source);\n if (result) {\n this.notifyComplete(this.yieldIndex ? index : value);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n\n protected _complete(): void {\n this.notifyComplete(this.yieldIndex ? -1 : undefined);\n }\n}\n","import { Observable } from '../Observable';\nimport { FindValueOperator } from '../operators/find';\nimport { OperatorFunction } from '../types';\n/**\n * Emits only the index of the first value emitted by the source Observable that\n * meets some condition.\n *\n * It's like {@link find}, but emits the index of the\n * found value, not the value itself.\n *\n * ![](findIndex.png)\n *\n * `findIndex` searches for the first item in the source Observable that matches\n * the specified condition embodied by the `predicate`, and returns the\n * (zero-based) index of the first occurrence in the source. Unlike\n * {@link first}, the `predicate` is required in `findIndex`, and does not emit\n * an error if a valid value is not found.\n *\n * ## Example\n * Emit the index of first click that happens on a DIV element\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { findIndex } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(findIndex(ev => ev.target.tagName === 'DIV'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link filter}\n * @see {@link find}\n * @see {@link first}\n * @see {@link take}\n *\n * @param {function(value: T, index: number, source: Observable): boolean} predicate\n * A function called with each item to test for condition matching.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of the index of the first item that\n * matches the condition.\n * @method find\n * @owner Observable\n */\nexport function findIndex(predicate: (value: T, index: number, source: Observable) => boolean,\n thisArg?: any): OperatorFunction {\n return (source: Observable) => source.lift(new FindValueOperator(predicate, source, true, thisArg)) as Observable;\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { EmptyError } from '../util/EmptyError';\nimport { OperatorFunction } from '../../internal/types';\nimport { filter } from './filter';\nimport { take } from './take';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { identity } from '../util/identity';\n\n/* tslint:disable:max-line-length */\nexport function first(\n predicate?: null,\n defaultValue?: D\n): OperatorFunction;\nexport function first(\n predicate: (value: T, index: number, source: Observable) => value is S,\n defaultValue?: S\n): OperatorFunction;\nexport function first(\n predicate: (value: T, index: number, source: Observable) => boolean,\n defaultValue?: D\n): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Emits only the first value (or the first value that meets some condition)\n * emitted by the source Observable.\n *\n * Emits only the first value. Or emits only the first\n * value that passes some test.\n *\n * ![](first.png)\n *\n * If called with no arguments, `first` emits the first value of the source\n * Observable, then completes. If called with a `predicate` function, `first`\n * emits the first value of the source that matches the specified condition. It\n * may also take a deprecated `resultSelector` function to produce the output\n * value from the input value, and a `defaultValue` to emit in case the source\n * completes before it is able to emit a valid value. Throws an error if\n * `defaultValue` was not provided and a matching element is not found.\n *\n * ## Examples\n * Emit only the first click that happens on the DOM\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { first } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(first());\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Emits the first click that happens on a DIV\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { first } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(first(ev => ev.target.tagName === 'DIV'));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link filter}\n * @see {@link find}\n * @see {@link take}\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n *\n * @param {function(value: T, index: number, source: Observable): boolean} [predicate]\n * An optional function called with each item to test for condition matching.\n * @param {R} [defaultValue] The default value emitted in case no valid value\n * was found on the source.\n * @return {Observable} An Observable of the first item that matches the\n * condition.\n * @method first\n * @owner Observable\n */\nexport function first(\n predicate?: ((value: T, index: number, source: Observable) => boolean) | null,\n defaultValue?: D\n): OperatorFunction {\n const hasDefaultValue = arguments.length >= 2;\n return (source: Observable) => source.pipe(\n predicate ? filter((v, i) => predicate(v, i, source)) : identity,\n take(1),\n hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()),\n );\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\n\n/**\n * Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`.\n *\n * ![](ignoreElements.png)\n *\n * ## Examples\n * ### Ignores emitted values, reacts to observable's completion.\n * ```ts\n * import { of } from 'rxjs';\n * import { ignoreElements } from 'rxjs/operators';\n *\n * of('you', 'talking', 'to', 'me').pipe(\n * ignoreElements(),\n * )\n * .subscribe(\n * word => console.log(word),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'the end'\n * ```\n * @return {Observable} An empty Observable that only calls `complete`\n * or `error`, based on which one is called by the source Observable.\n * @method ignoreElements\n * @owner Observable\n */\nexport function ignoreElements(): OperatorFunction {\n return function ignoreElementsOperatorFunction(source: Observable) {\n return source.lift(new IgnoreElementsOperator());\n };\n}\n\nclass IgnoreElementsOperator implements Operator {\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new IgnoreElementsSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass IgnoreElementsSubscriber extends Subscriber {\n protected _next(unused: T): void {\n // Do nothing\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\n/**\n * Emits false if the input observable emits any values, or emits true if the\n * input observable completes without emitting any values.\n *\n * Tells whether any values are emitted by an observable\n *\n * ![](isEmpty.png)\n *\n * `isEmpty` transforms an Observable that emits values into an Observable that\n * emits a single boolean value representing whether or not any values were\n * emitted by the source Observable. As soon as the source Observable emits a\n * value, `isEmpty` will emit a `false` and complete. If the source Observable\n * completes having not emitted anything, `isEmpty` will emit a `true` and\n * complete.\n *\n * A similar effect could be achieved with {@link count}, but `isEmpty` can emit\n * a `false` value sooner.\n *\n * ## Examples\n *\n * Emit `false` for a non-empty Observable\n * ```javascript\n * import { Subject } from 'rxjs';\n * import { isEmpty } from 'rxjs/operators';\n *\n * const source = new Subject();\n * const result = source.pipe(isEmpty());\n * source.subscribe(x => console.log(x));\n * result.subscribe(x => console.log(x));\n * source.next('a');\n * source.next('b');\n * source.next('c');\n * source.complete();\n *\n * // Results in:\n * // a\n * // false\n * // b\n * // c\n * ```\n *\n * Emit `true` for an empty Observable\n * ```javascript\n * import { EMPTY } from 'rxjs';\n * import { isEmpty } from 'rxjs/operators';\n *\n * const result = EMPTY.pipe(isEmpty());\n * result.subscribe(x => console.log(x));\n * // Results in:\n * // true\n * ```\n *\n * @see {@link count}\n * @see {@link EMPTY}\n *\n * @return {OperatorFunction} An Observable of a boolean value indicating whether observable was empty or not\n * @method isEmpty\n * @owner Observable\n */\n\nexport function isEmpty(): OperatorFunction {\n return (source: Observable) => source.lift(new IsEmptyOperator());\n}\n\nclass IsEmptyOperator implements Operator {\n call (observer: Subscriber, source: any): any {\n return source.subscribe(new IsEmptySubscriber(observer));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass IsEmptySubscriber extends Subscriber {\n constructor(destination: Subscriber) {\n super(destination);\n }\n\n private notifyComplete(isEmpty: boolean): void {\n const destination = this.destination;\n\n destination.next(isEmpty);\n destination.complete();\n }\n\n protected _next(value: boolean) {\n this.notifyComplete(false);\n }\n\n protected _complete() {\n this.notifyComplete(true);\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Emits only the last `count` values emitted by the source Observable.\n *\n * Remembers the latest `count` values, then emits those\n * only when the source completes.\n *\n * ![](takeLast.png)\n *\n * `takeLast` returns an Observable that emits at most the last `count` values\n * emitted by the source Observable. If the source emits fewer than `count`\n * values then all of its values are emitted. This operator must wait until the\n * `complete` notification emission from the source in order to emit the `next`\n * values on the output Observable, because otherwise it is impossible to know\n * whether or not more values will be emitted on the source. For this reason,\n * all values are emitted synchronously, followed by the complete notification.\n *\n * ## Example\n * Take the last 3 values of an Observable with many values\n * ```ts\n * import { range } from 'rxjs';\n * import { takeLast } from 'rxjs/operators';\n *\n * const many = range(1, 100);\n * const lastThree = many.pipe(takeLast(3));\n * lastThree.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeUntil}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @throws {ArgumentOutOfRangeError} When using `takeLast(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.\n *\n * @param {number} count The maximum number of values to emit from the end of\n * the sequence of values emitted by the source Observable.\n * @return {Observable} An Observable that emits at most the last count\n * values emitted by the source Observable.\n * @method takeLast\n * @owner Observable\n */\nexport function takeLast(count: number): MonoTypeOperatorFunction {\n return function takeLastOperatorFunction(source: Observable): Observable {\n if (count === 0) {\n return empty();\n } else {\n return source.lift(new TakeLastOperator(count));\n }\n };\n}\n\nclass TakeLastOperator implements Operator {\n constructor(private total: number) {\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new TakeLastSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeLastSubscriber extends Subscriber {\n private ring: Array = new Array();\n private count: number = 0;\n\n constructor(destination: Subscriber, private total: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const ring = this.ring;\n const total = this.total;\n const count = this.count++;\n\n if (ring.length < total) {\n ring.push(value);\n } else {\n const index = count % total;\n ring[index] = value;\n }\n }\n\n protected _complete(): void {\n const destination = this.destination;\n let count = this.count;\n\n if (count > 0) {\n const total = this.count >= this.total ? this.total : this.count;\n const ring = this.ring;\n\n for (let i = 0; i < total; i++) {\n const idx = (count++) % total;\n destination.next(ring[idx]);\n }\n }\n\n destination.complete();\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { EmptyError } from '../util/EmptyError';\nimport { OperatorFunction } from '../../internal/types';\nimport { filter } from './filter';\nimport { takeLast } from './takeLast';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { identity } from '../util/identity';\n\n/* tslint:disable:max-line-length */\nexport function last(\n predicate?: null,\n defaultValue?: D\n): OperatorFunction;\nexport function last(\n predicate: (value: T, index: number, source: Observable) => value is S,\n defaultValue?: S\n): OperatorFunction;\nexport function last(\n predicate: (value: T, index: number, source: Observable) => boolean,\n defaultValue?: D\n): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits only the last item emitted by the source Observable.\n * It optionally takes a predicate function as a parameter, in which case, rather than emitting\n * the last item from the source Observable, the resulting Observable will emit the last item\n * from the source Observable that satisfies the predicate.\n *\n * ![](last.png)\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n * @param {function} [predicate] - The condition any source emitted item has to satisfy.\n * @param {any} [defaultValue] - An optional default value to provide if last\n * predicate isn't met or no values were emitted.\n * @return {Observable} An Observable that emits only the last item satisfying the given condition\n * from the source, or an NoSuchElementException if no such items are emitted.\n * @throws - Throws if no items that match the predicate are emitted by the source Observable.\n */\nexport function last(\n predicate?: ((value: T, index: number, source: Observable) => boolean) | null,\n defaultValue?: D\n): OperatorFunction {\n const hasDefaultValue = arguments.length >= 2;\n return (source: Observable) => source.pipe(\n predicate ? filter((v, i) => predicate(v, i, source)) : identity,\n takeLast(1),\n hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()),\n );\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\n/**\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * Like {@link map}, but it maps every source value to\n * the same output value every time.\n *\n * ![](mapTo.png)\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * ## Example\n * Map every click to the string 'Hi'\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { mapTo } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const greetings = clicks.pipe(mapTo('Hi'));\n * greetings.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n */\nexport function mapTo(value: R): OperatorFunction {\n return (source: Observable) => source.lift(new MapToOperator(value));\n}\n\nclass MapToOperator implements Operator {\n\n value: R;\n\n constructor(value: R) {\n this.value = value;\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MapToSubscriber extends Subscriber {\n\n value: R;\n\n constructor(destination: Subscriber, value: R) {\n super(destination);\n this.value = value;\n }\n\n protected _next(x: T) {\n this.destination.next(this.value);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nimport { OperatorFunction } from '../types';\n\n/**\n * Represents all of the notifications from the source Observable as `next`\n * emissions marked with their original types within {@link Notification}\n * objects.\n *\n * Wraps `next`, `error` and `complete` emissions in\n * {@link Notification} objects, emitted as `next` on the output Observable.\n * \n *\n * ![](materialize.png)\n *\n * `materialize` returns an Observable that emits a `next` notification for each\n * `next`, `error`, or `complete` emission of the source Observable. When the\n * source Observable emits `complete`, the output Observable will emit `next` as\n * a Notification of type \"complete\", and then it will emit `complete` as well.\n * When the source Observable emits `error`, the output will emit `next` as a\n * Notification of type \"error\", and then `complete`.\n *\n * This operator is useful for producing metadata of the source Observable, to\n * be consumed as `next` emissions. Use it in conjunction with\n * {@link dematerialize}.\n *\n * ## Example\n * Convert a faulty Observable to an Observable of Notifications\n * ```ts\n * import { of } from 'rxjs';\n * import { materialize, map } from 'rxjs/operators';\n *\n * const letters = of('a', 'b', 13, 'd');\n * const upperCase = letters.pipe(map(x => x.toUpperCase()));\n * const materialized = upperCase.pipe(materialize());\n * materialized.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // - Notification {kind: \"N\", value: \"A\", error: undefined, hasValue: true}\n * // - Notification {kind: \"N\", value: \"B\", error: undefined, hasValue: true}\n * // - Notification {kind: \"E\", value: undefined, error: TypeError:\n * // x.toUpperCase is not a function at MapSubscriber.letters.map.x\n * // [as project] (http://1…, hasValue: false}\n * ```\n *\n * @see {@link Notification}\n * @see {@link dematerialize}\n *\n * @return {Observable>} An Observable that emits\n * {@link Notification} objects that wrap the original emissions from the source\n * Observable with metadata.\n * @method materialize\n * @owner Observable\n */\nexport function materialize(): OperatorFunction> {\n return function materializeOperatorFunction(source: Observable) {\n return source.lift(new MaterializeOperator());\n };\n}\n\nclass MaterializeOperator implements Operator> {\n call(subscriber: Subscriber>, source: any): any {\n return source.subscribe(new MaterializeSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MaterializeSubscriber extends Subscriber {\n constructor(destination: Subscriber>) {\n super(destination);\n }\n\n protected _next(value: T) {\n this.destination.next(Notification.createNext(value));\n }\n\n protected _error(err: any) {\n const destination = this.destination;\n destination.next(Notification.createError(err));\n destination.complete();\n }\n\n protected _complete() {\n const destination = this.destination;\n destination.next(Notification.createComplete());\n destination.complete();\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function scan(accumulator: (acc: R, value: T, index: number) => R, seed: R): OperatorFunction;\nexport function scan(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction;\nexport function scan(accumulator: (acc: R, value: T, index: number) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Applies an accumulator function over the source Observable, and returns each\n * intermediate result, with an optional seed value.\n *\n * It's like {@link reduce}, but emits the current\n * accumulation whenever the source emits a value.\n *\n * ![](scan.png)\n *\n * Combines together all values emitted on the source, using an accumulator\n * function that knows how to join a new source value into the accumulation from\n * the past. Is similar to {@link reduce}, but emits the intermediate\n * accumulations.\n *\n * Returns an Observable that applies a specified `accumulator` function to each\n * item emitted by the source Observable. If a `seed` value is specified, then\n * that value will be used as the initial value for the accumulator. If no seed\n * value is specified, the first item of the source is used as the seed.\n *\n * ## Example\n * Count the number of click events\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { scan, mapTo } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const ones = clicks.pipe(mapTo(1));\n * const seed = 0;\n * const count = ones.pipe(scan((acc, one) => acc + one, seed));\n * count.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link expand}\n * @see {@link mergeScan}\n * @see {@link reduce}\n *\n * @param {function(acc: R, value: T, index: number): R} accumulator\n * The accumulator function called on each source value.\n * @param {T|R} [seed] The initial accumulation value.\n * @return {Observable} An observable of the accumulated values.\n * @method scan\n * @owner Observable\n */\nexport function scan(accumulator: (acc: R, value: T, index: number) => R, seed?: T | R): OperatorFunction {\n let hasSeed = false;\n // providing a seed of `undefined` *should* be valid and trigger\n // hasSeed! so don't use `seed !== undefined` checks!\n // For this reason, we have to check it here at the original call site\n // otherwise inside Operator/Subscriber we won't know if `undefined`\n // means they didn't provide anything or if they literally provided `undefined`\n if (arguments.length >= 2) {\n hasSeed = true;\n }\n\n return function scanOperatorFunction(source: Observable): Observable {\n return source.lift(new ScanOperator(accumulator, seed, hasSeed));\n };\n}\n\nclass ScanOperator implements Operator {\n constructor(private accumulator: (acc: R, value: T, index: number) => R, private seed?: T | R, private hasSeed: boolean = false) {}\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ScanSubscriber extends Subscriber {\n private index: number = 0;\n\n get seed(): T | R {\n return this._seed;\n }\n\n set seed(value: T | R) {\n this.hasSeed = true;\n this._seed = value;\n }\n\n constructor(destination: Subscriber, private accumulator: (acc: R, value: T, index: number) => R, private _seed: T | R,\n private hasSeed: boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (!this.hasSeed) {\n this.seed = value;\n this.destination.next(value);\n } else {\n return this._tryNext(value);\n }\n }\n\n private _tryNext(value: T): void {\n const index = this.index++;\n let result: any;\n try {\n result = this.accumulator(this.seed, value, index);\n } catch (err) {\n this.destination.error(err);\n }\n this.seed = result;\n this.destination.next(result);\n }\n}\n","import { Observable } from '../Observable';\nimport { scan } from './scan';\nimport { takeLast } from './takeLast';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\nimport { pipe } from '../util/pipe';\n\n/* tslint:disable:max-line-length */\nexport function reduce(accumulator: (acc: R, value: T, index: number) => R, seed: R): OperatorFunction;\nexport function reduce(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction;\nexport function reduce(accumulator: (acc: R, value: T, index: number) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Applies an accumulator function over the source Observable, and returns the\n * accumulated result when the source completes, given an optional seed value.\n *\n * Combines together all values emitted on the source,\n * using an accumulator function that knows how to join a new source value into\n * the accumulation from the past.\n *\n * ![](reduce.png)\n *\n * Like\n * [Array.prototype.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce),\n * `reduce` applies an `accumulator` function against an accumulation and each\n * value of the source Observable (from the past) to reduce it to a single\n * value, emitted on the output Observable. Note that `reduce` will only emit\n * one value, only when the source Observable completes. It is equivalent to\n * applying operator {@link scan} followed by operator {@link last}.\n *\n * Returns an Observable that applies a specified `accumulator` function to each\n * item emitted by the source Observable. If a `seed` value is specified, then\n * that value will be used as the initial value for the accumulator. If no seed\n * value is specified, the first item of the source is used as the seed.\n *\n * ## Example\n * Count the number of click events that happened in 5 seconds\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { reduce, takeUntil, mapTo } from 'rxjs/operators';\n *\n * const clicksInFiveSeconds = fromEvent(document, 'click').pipe(\n * takeUntil(interval(5000)),\n * );\n * const ones = clicksInFiveSeconds.pipe(mapTo(1));\n * const seed = 0;\n * const count = ones.pipe(reduce((acc, one) => acc + one, seed));\n * count.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link count}\n * @see {@link expand}\n * @see {@link mergeScan}\n * @see {@link scan}\n *\n * @param {function(acc: R, value: T, index: number): R} accumulator The accumulator function\n * called on each source value.\n * @param {R} [seed] The initial accumulation value.\n * @return {Observable} An Observable that emits a single value that is the\n * result of accumulating the values emitted by the source Observable.\n * @method reduce\n * @owner Observable\n */\nexport function reduce(accumulator: (acc: T | R, value: T, index?: number) => T | R, seed?: T | R): OperatorFunction {\n // providing a seed of `undefined` *should* be valid and trigger\n // hasSeed! so don't use `seed !== undefined` checks!\n // For this reason, we have to check it here at the original call site\n // otherwise inside Operator/Subscriber we won't know if `undefined`\n // means they didn't provide anything or if they literally provided `undefined`\n if (arguments.length >= 2) {\n return function reduceOperatorFunctionWithSeed(source: Observable): Observable {\n return pipe(scan(accumulator, seed), takeLast(1), defaultIfEmpty(seed))(source);\n };\n }\n return function reduceOperatorFunction(source: Observable): Observable {\n return pipe(\n scan((acc, value, index) => accumulator(acc, value, index + 1)),\n takeLast(1),\n )(source);\n };\n}\n","import { reduce } from './reduce';\nimport { MonoTypeOperatorFunction } from '../types';\n\n/**\n * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function),\n * and when source Observable completes it emits a single item: the item with the largest value.\n *\n * ![](max.png)\n *\n * ## Examples\n * Get the maximal value of a series of numbers\n * ```ts\n * import { of } from 'rxjs';\n * import { max } from 'rxjs/operators';\n *\n * of(5, 4, 7, 2, 8).pipe(\n * max(),\n * )\n * .subscribe(x => console.log(x)); // -> 8\n * ```\n *\n * Use a comparer function to get the maximal item\n * ```typescript\n * import { of } from 'rxjs';\n * import { max } from 'rxjs/operators';\n *\n * interface Person {\n * age: number,\n * name: string\n * }\n * of(\n * {age: 7, name: 'Foo'},\n * {age: 5, name: 'Bar'},\n * {age: 9, name: 'Beer'},\n * ).pipe(\n * max((a: Person, b: Person) => a.age < b.age ? -1 : 1),\n * )\n * .subscribe((x: Person) => console.log(x.name)); // -> 'Beer'\n * ```\n *\n * @see {@link min}\n *\n * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the\n * value of two items.\n * @return {Observable} An Observable that emits item with the largest value.\n * @method max\n * @owner Observable\n */\nexport function max(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction {\n const max: (x: T, y: T) => T = (typeof comparer === 'function')\n ? (x, y) => comparer(x, y) > 0 ? x : y\n : (x, y) => x > y ? x : y;\n\n return reduce(max);\n}\n","import { merge as mergeStatic } from '../observable/merge';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction, MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(scheduler?: SchedulerLike): MonoTypeOperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(concurrent?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(...observables: Array | SchedulerLike | number>): MonoTypeOperatorFunction;\n/** @deprecated Deprecated in favor of static merge. */\nexport function merge(...observables: Array | SchedulerLike | number>): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link merge}.\n */\nexport function merge(...observables: Array | SchedulerLike | number>): OperatorFunction {\n return (source: Observable) => source.lift.call(mergeStatic(source, ...observables));\n}\n","import { Observable } from '../Observable';\nimport { OperatorFunction, ObservedValueOf } from '../../internal/types';\nimport { mergeMap } from './mergeMap';\nimport { ObservableInput } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function mergeMapTo>(innerObservable: O, concurrent?: number): OperatorFunction>;\n/** @deprecated */\nexport function mergeMapTo>(innerObservable: O, resultSelector: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R, concurrent?: number): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to the same Observable which is merged multiple\n * times in the output Observable.\n *\n * It's like {@link mergeMap}, but maps each value always\n * to the same inner Observable.\n *\n * ![](mergeMapTo.png)\n *\n * Maps each source value to the given Observable `innerObservable` regardless\n * of the source value, and then merges those resulting Observables into one\n * single Observable, which is the output Observable.\n *\n * ## Example\n * For each click event, start an interval Observable ticking every 1 second\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { mergeMapTo } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(mergeMapTo(interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMapTo}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeScan}\n * @see {@link switchMapTo}\n *\n * @param {ObservableInput} innerObservable An Observable to replace each value from\n * the source Observable.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits items from the given\n * `innerObservable`\n * @method mergeMapTo\n * @owner Observable\n */\nexport function mergeMapTo>(\n innerObservable: O,\n resultSelector?: ((outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R) | number,\n concurrent: number = Number.POSITIVE_INFINITY\n): OperatorFunction|R> {\n if (typeof resultSelector === 'function') {\n return mergeMap(() => innerObservable, resultSelector, concurrent);\n }\n if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return mergeMap(() => innerObservable, concurrent);\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { ObservableInput, OperatorFunction } from '../types';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/**\n * Applies an accumulator function over the source Observable where the\n * accumulator function itself returns an Observable, then each intermediate\n * Observable returned is merged into the output Observable.\n *\n * It's like {@link scan}, but the Observables returned\n * by the accumulator are merged into the outer Observable.\n *\n * ## Example\n * Count the number of click events\n * ```ts\n * import { fromEvent, of } from 'rxjs';\n * import { mapTo, mergeScan } from 'rxjs/operators';\n *\n * const click$ = fromEvent(document, 'click');\n * const one$ = click$.pipe(mapTo(1));\n * const seed = 0;\n * const count$ = one$.pipe(\n * mergeScan((acc, one) => of(acc + one), seed),\n * );\n * count$.subscribe(x => console.log(x));\n *\n * // Results:\n * // 1\n * // 2\n * // 3\n * // 4\n * // ...and so on for each click\n * ```\n *\n * @param {function(acc: R, value: T): Observable} accumulator\n * The accumulator function called on each source value.\n * @param seed The initial accumulation value.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of\n * input Observables being subscribed to concurrently.\n * @return {Observable} An observable of the accumulated values.\n * @method mergeScan\n * @owner Observable\n */\nexport function mergeScan(accumulator: (acc: R, value: T, index: number) => ObservableInput,\n seed: R,\n concurrent: number = Number.POSITIVE_INFINITY): OperatorFunction {\n return (source: Observable) => source.lift(new MergeScanOperator(accumulator, seed, concurrent));\n}\n\nexport class MergeScanOperator implements Operator {\n constructor(private accumulator: (acc: R, value: T, index: number) => ObservableInput,\n private seed: R,\n private concurrent: number) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new MergeScanSubscriber(\n subscriber, this.accumulator, this.seed, this.concurrent\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class MergeScanSubscriber extends SimpleOuterSubscriber {\n private hasValue: boolean = false;\n private hasCompleted: boolean = false;\n private buffer: Observable[] = [];\n private active: number = 0;\n protected index: number = 0;\n\n constructor(destination: Subscriber,\n private accumulator: (acc: R, value: T, index: number) => ObservableInput,\n private acc: R,\n private concurrent: number) {\n super(destination);\n }\n\n protected _next(value: any): void {\n if (this.active < this.concurrent) {\n const index = this.index++;\n const destination = this.destination;\n let ish;\n try {\n const { accumulator } = this;\n ish = accumulator(this.acc, value, index);\n } catch (e) {\n return destination.error!(e);\n }\n this.active++;\n this._innerSub(ish);\n } else {\n this.buffer.push(value);\n }\n }\n\n private _innerSub(ish: any): void {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(ish, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n if (this.hasValue === false) {\n this.destination.next!(this.acc);\n }\n this.destination.complete!();\n }\n this.unsubscribe();\n }\n\n notifyNext(innerValue: R): void {\n const { destination } = this;\n this.acc = innerValue;\n this.hasValue = true;\n destination.next!(innerValue);\n }\n\n notifyComplete(): void {\n const buffer = this.buffer;\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n } else if (this.active === 0 && this.hasCompleted) {\n if (this.hasValue === false) {\n this.destination.next!(this.acc);\n }\n this.destination.complete!();\n }\n }\n}\n","import { reduce } from './reduce';\nimport { MonoTypeOperatorFunction } from '../types';\n\n/**\n * The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function),\n * and when source Observable completes it emits a single item: the item with the smallest value.\n *\n * ![](min.png)\n *\n * ## Examples\n * Get the minimal value of a series of numbers\n * ```ts\n * import { of } from 'rxjs';\n * import { min } from 'rxjs/operators';\n *\n * of(5, 4, 7, 2, 8).pipe(\n * min(),\n * )\n * .subscribe(x => console.log(x)); // -> 2\n * ```\n *\n * Use a comparer function to get the minimal item\n * ```typescript\n * import { of } from 'rxjs';\n * import { min } from 'rxjs/operators';\n *\n * interface Person {\n * age: number,\n * name: string\n * }\n * of(\n * {age: 7, name: 'Foo'},\n * {age: 5, name: 'Bar'},\n * {age: 9, name: 'Beer'},\n * ).pipe(\n * min( (a: Person, b: Person) => a.age < b.age ? -1 : 1),\n * )\n * .subscribe((x: Person) => console.log(x.name)); // -> 'Bar'\n * ```\n * @see {@link max}\n *\n * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the\n * value of two items.\n * @return {Observable} An Observable that emits item with the smallest value.\n * @method min\n * @owner Observable\n */\nexport function min(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction {\n const min: (x: T, y: T) => T = (typeof comparer === 'function')\n ? (x, y) => comparer(x, y) < 0 ? x : y\n : (x, y) => x < y ? x : y;\n return reduce(min);\n}\n","import { Subject } from '../Subject';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { ConnectableObservable, connectableObservableDescriptor } from '../observable/ConnectableObservable';\nimport { MonoTypeOperatorFunction, OperatorFunction, UnaryFunction, ObservedValueOf, ObservableInput } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function multicast(subject: Subject): UnaryFunction, ConnectableObservable>;\nexport function multicast>(subject: Subject, selector: (shared: Observable) => O): UnaryFunction, ConnectableObservable>>;\nexport function multicast(subjectFactory: (this: Observable) => Subject): UnaryFunction, ConnectableObservable>;\nexport function multicast>(SubjectFactory: (this: Observable) => Subject, selector: (shared: Observable) => O): OperatorFunction>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the results of invoking a specified selector on items\n * emitted by a ConnectableObservable that shares a single subscription to the underlying stream.\n *\n * ![](multicast.png)\n *\n * @param {Function|Subject} subjectOrSubjectFactory - Factory function to create an intermediate subject through\n * which the source sequence's elements will be multicast to the selector function\n * or Subject to push source elements into.\n * @param {Function} [selector] - Optional selector function that can use the multicasted source stream\n * as many times as needed, without causing multiple subscriptions to the source stream.\n * Subscribers to the given source will receive all notifications of the source from the\n * time of the subscription forward.\n * @return {Observable} An Observable that emits the results of invoking the selector\n * on the items emitted by a `ConnectableObservable` that shares a single subscription to\n * the underlying stream.\n * @method multicast\n * @owner Observable\n */\nexport function multicast(subjectOrSubjectFactory: Subject | (() => Subject),\n selector?: (source: Observable) => Observable): OperatorFunction {\n return function multicastOperatorFunction(source: Observable): Observable {\n let subjectFactory: () => Subject;\n if (typeof subjectOrSubjectFactory === 'function') {\n subjectFactory = <() => Subject>subjectOrSubjectFactory;\n } else {\n subjectFactory = function subjectFactory() {\n return >subjectOrSubjectFactory;\n };\n }\n\n if (typeof selector === 'function') {\n return source.lift(new MulticastOperator(subjectFactory, selector));\n }\n\n const connectable: any = Object.create(source, connectableObservableDescriptor);\n connectable.source = source;\n connectable.subjectFactory = subjectFactory;\n\n return > connectable;\n };\n}\n\nexport class MulticastOperator implements Operator {\n constructor(private subjectFactory: () => Subject,\n private selector: (source: Observable) => Observable) {\n }\n call(subscriber: Subscriber, source: any): any {\n const { selector } = this;\n const subject = this.subjectFactory();\n const subscription = selector(subject).subscribe(subscriber);\n subscription.add(source.subscribe(subject));\n return subscription;\n }\n}\n","import { Observable } from '../Observable';\nimport { from } from '../observable/from';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { isArray } from '../util/isArray';\nimport { ObservableInput, OperatorFunction } from '../types';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function onErrorResumeNext(): OperatorFunction;\nexport function onErrorResumeNext(v: ObservableInput): OperatorFunction;\nexport function onErrorResumeNext(v: ObservableInput, v2: ObservableInput): OperatorFunction;\nexport function onErrorResumeNext(v: ObservableInput, v2: ObservableInput, v3: ObservableInput): OperatorFunction;\nexport function onErrorResumeNext(v: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput): OperatorFunction;\nexport function onErrorResumeNext(v: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput): OperatorFunction;\nexport function onErrorResumeNext(v: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput): OperatorFunction;\nexport function onErrorResumeNext(...observables: Array>): OperatorFunction;\nexport function onErrorResumeNext(array: ObservableInput[]): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one\n * that was passed.\n *\n * Execute series of Observables no matter what, even if it means swallowing errors.\n *\n * ![](onErrorResumeNext.png)\n *\n * `onErrorResumeNext` is an operator that accepts a series of Observables, provided either directly as\n * arguments or as an array. If no single Observable is provided, returned Observable will simply behave the same\n * as the source.\n *\n * `onErrorResumeNext` returns an Observable that starts by subscribing and re-emitting values from the source Observable.\n * When its stream of values ends - no matter if Observable completed or emitted an error - `onErrorResumeNext`\n * will subscribe to the first Observable that was passed as an argument to the method. It will start re-emitting\n * its values as well and - again - when that stream ends, `onErrorResumeNext` will proceed to subscribing yet another\n * Observable in provided series, no matter if previous Observable completed or ended with an error. This will\n * be happening until there is no more Observables left in the series, at which point returned Observable will\n * complete - even if the last subscribed stream ended with an error.\n *\n * `onErrorResumeNext` can be therefore thought of as version of {@link concat} operator, which is more permissive\n * when it comes to the errors emitted by its input Observables. While `concat` subscribes to the next Observable\n * in series only if previous one successfully completed, `onErrorResumeNext` subscribes even if it ended with\n * an error.\n *\n * Note that you do not get any access to errors emitted by the Observables. In particular do not\n * expect these errors to appear in error callback passed to {@link Observable#subscribe}. If you want to take\n * specific actions based on what error was emitted by an Observable, you should try out {@link catchError} instead.\n *\n *\n * ## Example\n * Subscribe to the next Observable after map fails\n * ```ts\n * import { of } from 'rxjs';\n * import { onErrorResumeNext, map } from 'rxjs/operators';\n *\n * of(1, 2, 3, 0).pipe(\n * map(x => {\n * if (x === 0) { throw Error(); }\n * return 10 / x;\n * }),\n * onErrorResumeNext(of(1, 2, 3)),\n * )\n * .subscribe(\n * val => console.log(val),\n * err => console.log(err), // Will never be called.\n * () => console.log('that\\'s it!')\n * );\n *\n * // Logs:\n * // 10\n * // 5\n * // 3.3333333333333335\n * // 1\n * // 2\n * // 3\n * // \"that's it!\"\n * ```\n *\n * @see {@link concat}\n * @see {@link catchError}\n *\n * @param {...ObservableInput} observables Observables passed either directly or as an array.\n * @return {Observable} An Observable that emits values from source Observable, but - if it errors - subscribes\n * to the next passed Observable and so on, until it completes or runs out of Observables.\n * @method onErrorResumeNext\n * @owner Observable\n */\n\nexport function onErrorResumeNext(...nextSources: Array |\n Array>>): OperatorFunction {\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = >>nextSources[0];\n }\n\n return (source: Observable) => source.lift(new OnErrorResumeNextOperator(nextSources));\n}\n\n/* tslint:disable:max-line-length */\nexport function onErrorResumeNextStatic(v: ObservableInput): Observable;\nexport function onErrorResumeNextStatic(v2: ObservableInput, v3: ObservableInput): Observable;\nexport function onErrorResumeNextStatic(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput): Observable;\nexport function onErrorResumeNextStatic(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput): Observable;\nexport function onErrorResumeNextStatic(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput): Observable;\n\nexport function onErrorResumeNextStatic(...observables: Array | ((...values: Array) => R)>): Observable;\nexport function onErrorResumeNextStatic(array: ObservableInput[]): Observable;\n/* tslint:enable:max-line-length */\n\nexport function onErrorResumeNextStatic(...nextSources: Array |\n Array> |\n ((...values: Array) => R)>): Observable {\n let source: ObservableInput|undefined = undefined;\n\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = nextSources[0] as ObservableInput[];\n }\n // TODO: resolve issue with passing no arguments.\n source = nextSources.shift()!;\n\n return from(source).lift(new OnErrorResumeNextOperator(nextSources));\n}\n\nclass OnErrorResumeNextOperator implements Operator {\n constructor(private nextSources: Array>) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));\n }\n}\n\nclass OnErrorResumeNextSubscriber extends SimpleOuterSubscriber {\n constructor(protected destination: Subscriber,\n private nextSources: Array>) {\n super(destination);\n }\n\n notifyError(): void {\n this.subscribeToNextSource();\n }\n\n notifyComplete(): void {\n this.subscribeToNextSource();\n }\n\n protected _error(err: any): void {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n\n private subscribeToNextSource(): void {\n const next = this.nextSources.shift();\n if (!!next) {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(next, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n } else {\n this.destination.complete();\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\n\n/**\n * Groups pairs of consecutive emissions together and emits them as an array of\n * two values.\n *\n * Puts the current value and previous value together as\n * an array, and emits that.\n *\n * ![](pairwise.png)\n *\n * The Nth emission from the source Observable will cause the output Observable\n * to emit an array [(N-1)th, Nth] of the previous and the current value, as a\n * pair. For this reason, `pairwise` emits on the second and subsequent\n * emissions from the source Observable, but not on the first emission, because\n * there is no previous value in that case.\n *\n * ## Example\n * On every click (starting from the second), emit the relative distance to the previous click\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { pairwise, map } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const pairs = clicks.pipe(pairwise());\n * const distance = pairs.pipe(\n * map(pair => {\n * const x0 = pair[0].clientX;\n * const y0 = pair[0].clientY;\n * const x1 = pair[1].clientX;\n * const y1 = pair[1].clientY;\n * return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2));\n * }),\n * );\n * distance.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link buffer}\n * @see {@link bufferCount}\n *\n * @return {Observable>} An Observable of pairs (as arrays) of\n * consecutive values from the source Observable.\n * @method pairwise\n * @owner Observable\n */\nexport function pairwise(): OperatorFunction {\n return (source: Observable) => source.lift(new PairwiseOperator());\n}\n\nclass PairwiseOperator implements Operator {\n call(subscriber: Subscriber<[T, T]>, source: any): any {\n return source.subscribe(new PairwiseSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass PairwiseSubscriber extends Subscriber {\n private prev: T;\n private hasPrev: boolean = false;\n\n constructor(destination: Subscriber<[T, T]>) {\n super(destination);\n }\n\n _next(value: T): void {\n let pair: [T, T] | undefined;\n\n if (this.hasPrev) {\n pair = [this.prev, value];\n } else {\n this.hasPrev = true;\n }\n\n this.prev = value;\n\n if (pair) {\n this.destination.next(pair);\n }\n }\n}\n","import { not } from '../util/not';\nimport { filter } from './filter';\nimport { Observable } from '../Observable';\nimport { UnaryFunction } from '../types';\n\n/**\n * Splits the source Observable into two, one with values that satisfy a\n * predicate, and another with values that don't satisfy the predicate.\n *\n * It's like {@link filter}, but returns two Observables:\n * one like the output of {@link filter}, and the other with values that did not\n * pass the condition.\n *\n * ![](partition.png)\n *\n * `partition` outputs an array with two Observables that partition the values\n * from the source Observable through the given `predicate` function. The first\n * Observable in that array emits source values for which the predicate argument\n * returns true. The second Observable emits source values for which the\n * predicate returns false. The first behaves like {@link filter} and the second\n * behaves like {@link filter} with the predicate negated.\n *\n * ## Example\n * Partition click events into those on DIV elements and those elsewhere\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { partition } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const parts = clicks.pipe(partition(ev => ev.target.tagName === 'DIV'));\n * const clicksOnDivs = parts[0];\n * const clicksElsewhere = parts[1];\n * clicksOnDivs.subscribe(x => console.log('DIV clicked: ', x));\n * clicksElsewhere.subscribe(x => console.log('Other clicked: ', x));\n * ```\n *\n * @see {@link filter}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted on the first Observable in the returned array, if\n * `false` the value is emitted on the second Observable in the array. The\n * `index` parameter is the number `i` for the i-th source emission that has\n * happened since the subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {[Observable, Observable]} An array with two Observables: one\n * with values that passed the predicate, and another with values that did not\n * pass the predicate.\n * @method partition\n * @owner Observable\n * @deprecated use `partition` static creation function instead\n */\nexport function partition(predicate: (value: T, index: number) => boolean,\n thisArg?: any): UnaryFunction, [Observable, Observable]> {\n return (source: Observable) => [\n filter(predicate, thisArg)(source),\n filter(not(predicate, thisArg) as any)(source)\n ] as [Observable, Observable];\n}\n","import { Observable } from '../Observable';\nimport { map } from './map';\nimport { OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function pluck(k1: K1): OperatorFunction;\nexport function pluck(k1: K1, k2: K2): OperatorFunction;\nexport function pluck(k1: K1, k2: K2, k3: K3): OperatorFunction;\nexport function pluck(k1: K1, k2: K2, k3: K3, k4: K4): OperatorFunction;\nexport function pluck(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5): OperatorFunction;\nexport function pluck(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6): OperatorFunction;\nexport function pluck(...properties: string[]): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Maps each source value (an object) to its specified nested property.\n *\n * Like {@link map}, but meant only for picking one of\n * the nested properties of every emitted object.\n *\n * ![](pluck.png)\n *\n * Given a list of strings describing a path to an object property, retrieves\n * the value of a specified nested property from all values in the source\n * Observable. If a property can't be resolved, it will return `undefined` for\n * that value.\n *\n * ## Example\n * Map every click to the tagName of the clicked target element\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { pluck } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const tagNames = clicks.pipe(pluck('target', 'tagName'));\n * tagNames.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n *\n * @param {...string} properties The nested properties to pluck from each source\n * value (an object).\n * @return {Observable} A new Observable of property values from the source values.\n * @method pluck\n * @owner Observable\n */\nexport function pluck(...properties: string[]): OperatorFunction {\n const length = properties.length;\n if (length === 0) {\n throw new Error('list of properties cannot be empty.');\n }\n return (source: Observable) => map(plucker(properties, length))(source as any);\n}\n\nfunction plucker(props: string[], length: number): (x: string) => any {\n const mapper = (x: string) => {\n let currentProp = x;\n for (let i = 0; i < length; i++) {\n const p = currentProp != null ? currentProp[props[i]] : undefined;\n if (p !== void 0) {\n currentProp = p;\n } else {\n return undefined;\n }\n }\n return currentProp;\n };\n\n return mapper;\n}\n","import { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { MonoTypeOperatorFunction, OperatorFunction, UnaryFunction, ObservableInput, ObservedValueOf } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function publish(): UnaryFunction, ConnectableObservable>;\nexport function publish>(selector: (shared: Observable) => O): OperatorFunction>;\nexport function publish(selector: MonoTypeOperatorFunction): MonoTypeOperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called\n * before it begins emitting items to those Observers that have subscribed to it.\n *\n * Makes a cold Observable hot\n *\n * ![](publish.png)\n *\n * ## Examples\n * Make source$ hot by applying publish operator, then merge each inner observable into a single one\n * and subscribe.\n * ```ts\n * import { of, zip, interval, merge } from \"rxjs\";\n * import { map, publish, tap } from \"rxjs/operators\";\n *\n * const source$ = zip(interval(2000), of(1, 2, 3, 4, 5, 6, 7, 8, 9)).pipe(\n * map(values => values[1])\n * );\n *\n * source$\n * .pipe(\n * publish(multicasted$ =>\n * merge(\n * multicasted$.pipe(tap(x => console.log('Stream 1:', x))),\n * multicasted$.pipe(tap(x => console.log('Stream 2:', x))),\n * multicasted$.pipe(tap(x => console.log('Stream 3:', x))),\n * )\n * )\n * )\n * .subscribe();\n *\n * // Results every two seconds\n * // Stream 1: 1\n * // Stream 2: 1\n * // Stream 3: 1\n * // ...\n * // Stream 1: 9\n * // Stream 2: 9\n * // Stream 3: 9\n * ```\n *\n * @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times\n * as needed, without causing multiple subscriptions to the source sequence.\n * Subscribers to the given source will receive all notifications of the source from the time of the subscription on.\n * @return A ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.\n * @method publish\n * @owner Observable\n *\n *\n */\nexport function publish(selector?: OperatorFunction): MonoTypeOperatorFunction | OperatorFunction {\n return selector ?\n multicast(() => new Subject(), selector) :\n multicast(new Subject());\n}\n","import { Observable } from '../Observable';\nimport { BehaviorSubject } from '../BehaviorSubject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { UnaryFunction } from '../types';\n\n/**\n * @param value\n * @return {ConnectableObservable}\n * @method publishBehavior\n * @owner Observable\n */\nexport function publishBehavior(value: T): UnaryFunction, ConnectableObservable> {\n return (source: Observable) => multicast(new BehaviorSubject(value))(source) as ConnectableObservable;\n}\n","import { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { UnaryFunction } from '../types';\n\n/**\n * Returns a connectable observable sequence that shares a single subscription to the\n * underlying sequence containing only the last notification.\n *\n * ![](publishLast.png)\n *\n * Similar to {@link publish}, but it waits until the source observable completes and stores\n * the last emitted value.\n * Similarly to {@link publishReplay} and {@link publishBehavior}, this keeps storing the last\n * value even if it has no more subscribers. If subsequent subscriptions happen, they will\n * immediately get that last stored value and complete.\n *\n * ## Example\n *\n * ```ts\n * import { interval } from 'rxjs';\n * import { publishLast, tap, take } from 'rxjs/operators';\n *\n * const connectable =\n * interval(1000)\n * .pipe(\n * tap(x => console.log(\"side effect\", x)),\n * take(3),\n * publishLast());\n *\n * connectable.subscribe(\n * x => console.log( \"Sub. A\", x),\n * err => console.log(\"Sub. A Error\", err),\n * () => console.log( \"Sub. A Complete\"));\n *\n * connectable.subscribe(\n * x => console.log( \"Sub. B\", x),\n * err => console.log(\"Sub. B Error\", err),\n * () => console.log( \"Sub. B Complete\"));\n *\n * connectable.connect();\n *\n * // Results:\n * // \"side effect 0\"\n * // \"side effect 1\"\n * // \"side effect 2\"\n * // \"Sub. A 2\"\n * // \"Sub. B 2\"\n * // \"Sub. A Complete\"\n * // \"Sub. B Complete\"\n * ```\n *\n * @see {@link ConnectableObservable}\n * @see {@link publish}\n * @see {@link publishReplay}\n * @see {@link publishBehavior}\n *\n * @return {ConnectableObservable} An observable sequence that contains the elements of a\n * sequence produced by multicasting the source sequence.\n * @method publishLast\n * @owner Observable\n */\n\nexport function publishLast(): UnaryFunction, ConnectableObservable> {\n return (source: Observable) => multicast(new AsyncSubject())(source);\n}\n","import { Observable } from '../Observable';\nimport { ReplaySubject } from '../ReplaySubject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { UnaryFunction, MonoTypeOperatorFunction, OperatorFunction, SchedulerLike, ObservableInput, ObservedValueOf } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function publishReplay(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction;\nexport function publishReplay>(bufferSize?: number, windowTime?: number, selector?: (shared: Observable) => O, scheduler?: SchedulerLike): OperatorFunction>;\n/* tslint:enable:max-line-length */\n\nexport function publishReplay(bufferSize?: number,\n windowTime?: number,\n selectorOrScheduler?: SchedulerLike | OperatorFunction,\n scheduler?: SchedulerLike): UnaryFunction, ConnectableObservable> {\n\n if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {\n scheduler = selectorOrScheduler;\n }\n\n const selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;\n const subject = new ReplaySubject(bufferSize, windowTime, scheduler);\n\n return (source: Observable) => multicast(() => subject, selector)(source) as ConnectableObservable;\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { MonoTypeOperatorFunction, OperatorFunction } from '../types';\nimport { race as raceStatic } from '../observable/race';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static race. */\nexport function race(observables: Array>): MonoTypeOperatorFunction;\n/** @deprecated Deprecated in favor of static race. */\nexport function race(observables: Array>): OperatorFunction;\n/** @deprecated Deprecated in favor of static race. */\nexport function race(...observables: Array | Array>>): MonoTypeOperatorFunction;\n/** @deprecated Deprecated in favor of static race. */\nexport function race(...observables: Array | Array>>): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that mirrors the first source Observable to emit a next,\n * error or complete notification from the combination of this Observable and supplied Observables.\n * @param {...Observables} ...observables Sources used to race for which Observable emits first.\n * @return {Observable} An Observable that mirrors the output of the first Observable to emit an item.\n * @method race\n * @owner Observable\n * @deprecated Deprecated in favor of static {@link race}.\n */\nexport function race(...observables: (Observable | Observable[])[]): MonoTypeOperatorFunction {\n return function raceOperatorFunction(source: Observable) {\n // if the only argument is an array, it was most likely called with\n // `pair([obs1, obs2, ...])`\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0] as Observable[];\n }\n\n return source.lift.call(raceStatic(source, ...(observables as Observable[])));\n };\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { empty } from '../observable/empty';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that will resubscribe to the source stream when the source stream completes, at most count times.\n *\n * Repeats all values emitted on the source. It's like {@link retry}, but for non error cases.\n *\n * ![](repeat.png)\n *\n * Similar to {@link retry}, this operator repeats the stream of items emitted by the source for non error cases.\n * Repeat can be useful for creating observables that are meant to have some repeated pattern or rhythm.\n *\n * Note: `repeat(0)` returns an empty observable and `repeat()` will repeat forever\n *\n * ## Example\n * Repeat a message stream\n * ```ts\n * import { of } from 'rxjs';\n * import { repeat, delay } from 'rxjs/operators';\n *\n * const source = of('Repeat message');\n * const example = source.pipe(repeat(3));\n * example.subscribe(x => console.log(x));\n *\n * // Results\n * // Repeat message\n * // Repeat message\n * // Repeat message\n * ```\n *\n * Repeat 3 values, 2 times\n * ```ts\n * import { interval } from 'rxjs';\n * import { repeat, take } from 'rxjs/operators';\n *\n * const source = interval(1000);\n * const example = source.pipe(take(3), repeat(2));\n * example.subscribe(x => console.log(x));\n *\n * // Results every second\n * // 0\n * // 1\n * // 2\n * // 0\n * // 1\n * // 2\n * ```\n *\n * @see {@link repeatWhen}\n * @see {@link retry}\n *\n * @param {number} [count] The number of times the source Observable items are repeated, a count of 0 will yield\n * an empty Observable.\n * @return {Observable} An Observable that will resubscribe to the source stream when the source stream completes\n * , at most count times.\n * @method repeat\n * @owner Observable\n */\nexport function repeat(count: number = -1): MonoTypeOperatorFunction {\n return (source: Observable) => {\n if (count === 0) {\n return empty();\n } else if (count < 0) {\n return source.lift(new RepeatOperator(-1, source));\n } else {\n return source.lift(new RepeatOperator(count - 1, source));\n }\n };\n}\n\nclass RepeatOperator implements Operator {\n constructor(private count: number,\n private source: Observable) {\n }\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RepeatSubscriber extends Subscriber {\n constructor(destination: Subscriber,\n private count: number,\n private source: Observable) {\n super(destination);\n }\n complete() {\n if (!this.isStopped) {\n const { source, count } = this;\n if (count === 0) {\n return super.complete();\n } else if (count > -1) {\n this.count = count - 1;\n }\n source.subscribe(this._unsubscribeAndRecycle());\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source\n * Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable\n * calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise\n * this method will resubscribe to the source Observable.\n *\n * ![](repeatWhen.png)\n *\n * ## Example\n * Repeat a message stream on click\n * ```ts\n * import { of, fromEvent } from 'rxjs';\n * import { repeatWhen } from 'rxjs/operators';\n *\n * const source = of('Repeat message');\n * const documentClick$ = fromEvent(document, 'click');\n *\n * source.pipe(repeatWhen(() => documentClick$)\n * ).subscribe(data => console.log(data))\n * ```\n * @see {@link repeat}\n * @see {@link retry}\n * @see {@link retryWhen}\n *\n * @param {function(notifications: Observable): Observable} notifier - Receives an Observable of notifications with\n * which a user can `complete` or `error`, aborting the repetition.\n * @return {Observable} The source Observable modified with repeat logic.\n * @method repeatWhen\n * @owner Observable\n */\nexport function repeatWhen(notifier: (notifications: Observable) => Observable): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new RepeatWhenOperator(notifier));\n}\n\nclass RepeatWhenOperator implements Operator {\n constructor(protected notifier: (notifications: Observable) => Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RepeatWhenSubscriber extends SimpleOuterSubscriber {\n\n private notifications?: Subject;\n private retries?: Observable;\n private retriesSubscription?: Subscription;\n private sourceIsBeingSubscribedTo: boolean = true;\n\n constructor(destination: Subscriber,\n private notifier: (notifications: Observable) => Observable,\n private source: Observable) {\n super(destination);\n }\n\n notifyNext(): void {\n this.sourceIsBeingSubscribedTo = true;\n this.source.subscribe(this);\n }\n\n notifyComplete(): void {\n if (this.sourceIsBeingSubscribedTo === false) {\n return super.complete();\n }\n }\n\n complete() {\n this.sourceIsBeingSubscribedTo = false;\n\n if (!this.isStopped) {\n if (!this.retries) {\n this.subscribeToRetries();\n }\n if (!this.retriesSubscription || this.retriesSubscription.closed) {\n return super.complete();\n }\n\n this._unsubscribeAndRecycle();\n this.notifications!.next(undefined);\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { notifications, retriesSubscription } = this;\n if (notifications) {\n notifications.unsubscribe();\n this.notifications = undefined;\n }\n if (retriesSubscription) {\n retriesSubscription.unsubscribe();\n this.retriesSubscription = undefined;\n }\n this.retries = undefined;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribeAndRecycle(): Subscriber {\n const { _unsubscribe } = this;\n\n this._unsubscribe = null!;\n super._unsubscribeAndRecycle();\n this._unsubscribe = _unsubscribe;\n\n return this;\n }\n\n private subscribeToRetries() {\n this.notifications = new Subject();\n let retries;\n try {\n const { notifier } = this;\n retries = notifier(this.notifications);\n } catch (e) {\n return super.complete();\n }\n this.retries = retries;\n this.retriesSubscription = innerSubscribe(retries, new SimpleInnerSubscriber(this));\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable\n * calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given\n * as a number parameter) rather than propagating the `error` call.\n *\n * ![](retry.png)\n *\n * Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those emitted\n * during failed subscriptions. For example, if an Observable fails at first but emits [1, 2] then succeeds the second\n * time and emits: [1, 2, 3, 4, 5] then the complete stream of emissions and notifications\n * would be: [1, 2, 1, 2, 3, 4, 5, `complete`].\n *\n * ## Example\n * ```ts\n * import { interval, of, throwError } from 'rxjs';\n * import { mergeMap, retry } from 'rxjs/operators';\n *\n * const source = interval(1000);\n * const example = source.pipe(\n * mergeMap(val => {\n * if(val > 5){\n * return throwError('Error!');\n * }\n * return of(val);\n * }),\n * //retry 2 times on error\n * retry(2)\n * );\n *\n * const subscribe = example.subscribe({\n * next: val => console.log(val),\n * error: val => console.log(`${val}: Retried 2 times then quit!`)\n * });\n *\n * // Output:\n * // 0..1..2..3..4..5..\n * // 0..1..2..3..4..5..\n * // 0..1..2..3..4..5..\n * // \"Error!: Retried 2 times then quit!\"\n * ```\n *\n * @param {number} count - Number of retry attempts before failing.\n * @return {Observable} The source Observable modified with the retry logic.\n * @method retry\n * @owner Observable\n */\nexport function retry(count: number = -1): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new RetryOperator(count, source));\n}\n\nclass RetryOperator implements Operator {\n constructor(private count: number,\n private source: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RetrySubscriber extends Subscriber {\n constructor(destination: Subscriber,\n private count: number,\n private source: Observable) {\n super(destination);\n }\n error(err: any) {\n if (!this.isStopped) {\n const { source, count } = this;\n if (count === 0) {\n return super.error(err);\n } else if (count > -1) {\n this.count = count - 1;\n }\n source.subscribe(this._unsubscribeAndRecycle());\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable\n * calls `error`, this method will emit the Throwable that caused the error to the Observable returned from `notifier`.\n * If that Observable calls `complete` or `error` then this method will call `complete` or `error` on the child\n * subscription. Otherwise this method will resubscribe to the source Observable.\n *\n * ![](retryWhen.png)\n *\n * @param {function(errors: Observable): Observable} notifier - Receives an Observable of notifications with which a\n * user can `complete` or `error`, aborting the retry.\n * @return {Observable} The source Observable modified with retry logic.\n * @method retryWhen\n * @owner Observable\n */\nexport function retryWhen(notifier: (errors: Observable) => Observable): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new RetryWhenOperator(notifier, source));\n}\n\nclass RetryWhenOperator implements Operator {\n constructor(protected notifier: (errors: Observable) => Observable,\n protected source: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass RetryWhenSubscriber extends SimpleOuterSubscriber {\n\n private errors?: Subject;\n private retries?: Observable;\n private retriesSubscription?: Subscription;\n\n constructor(destination: Subscriber,\n private notifier: (errors: Observable) => Observable,\n private source: Observable) {\n super(destination);\n }\n\n error(err: any) {\n if (!this.isStopped) {\n\n let errors = this.errors;\n let retries: any = this.retries;\n let retriesSubscription = this.retriesSubscription;\n\n if (!retries) {\n errors = new Subject();\n try {\n const { notifier } = this;\n retries = notifier(errors);\n } catch (e) {\n return super.error(e);\n }\n retriesSubscription = innerSubscribe(retries, new SimpleInnerSubscriber(this));\n } else {\n this.errors = undefined;\n this.retriesSubscription = undefined;\n }\n\n this._unsubscribeAndRecycle();\n\n this.errors = errors;\n this.retries = retries;\n this.retriesSubscription = retriesSubscription;\n\n errors!.next(err);\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { errors, retriesSubscription } = this;\n if (errors) {\n errors.unsubscribe();\n this.errors = undefined;\n }\n if (retriesSubscription) {\n retriesSubscription.unsubscribe();\n this.retriesSubscription = undefined;\n }\n this.retries = undefined;\n }\n\n notifyNext(): void {\n const { _unsubscribe } = this;\n\n this._unsubscribe = null!;\n this._unsubscribeAndRecycle();\n this._unsubscribe = _unsubscribe;\n\n this.source.subscribe(this);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Emits the most recently emitted value from the source Observable whenever\n * another Observable, the `notifier`, emits.\n *\n * It's like {@link sampleTime}, but samples whenever\n * the `notifier` Observable emits something.\n *\n * ![](sample.png)\n *\n * Whenever the `notifier` Observable emits a value or completes, `sample`\n * looks at the source Observable and emits whichever value it has most recently\n * emitted since the previous sampling, unless the source has not emitted\n * anything since the previous sampling. The `notifier` is subscribed to as soon\n * as the output Observable is subscribed.\n *\n * ## Example\n * On every click, sample the most recent \"seconds\" timer\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { sample } from 'rxjs/operators';\n *\n * const seconds = interval(1000);\n * const clicks = fromEvent(document, 'click');\n * const result = seconds.pipe(sample(clicks));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounce}\n * @see {@link sampleTime}\n * @see {@link throttle}\n *\n * @param {Observable} notifier The Observable to use for sampling the\n * source Observable.\n * @return {Observable} An Observable that emits the results of sampling the\n * values emitted by the source Observable whenever the notifier Observable\n * emits value or completes.\n * @method sample\n * @owner Observable\n */\nexport function sample(notifier: Observable): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new SampleOperator(notifier));\n}\n\nclass SampleOperator implements Operator {\n constructor(private notifier: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n const sampleSubscriber = new SampleSubscriber(subscriber);\n const subscription = source.subscribe(sampleSubscriber);\n subscription.add(innerSubscribe(this.notifier, new SimpleInnerSubscriber(sampleSubscriber)));\n return subscription;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SampleSubscriber extends SimpleOuterSubscriber {\n private value?: T;\n private hasValue: boolean = false;\n\n protected _next(value: T) {\n this.value = value;\n this.hasValue = true;\n }\n\n notifyNext(): void {\n this.emitValue();\n }\n\n notifyComplete(): void {\n this.emitValue();\n }\n\n emitValue() {\n if (this.hasValue) {\n this.hasValue = false;\n this.destination.next!(this.value!);\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { MonoTypeOperatorFunction, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Emits the most recently emitted value from the source Observable within\n * periodic time intervals.\n *\n * Samples the source Observable at periodic time\n * intervals, emitting what it samples.\n *\n * ![](sampleTime.png)\n *\n * `sampleTime` periodically looks at the source Observable and emits whichever\n * value it has most recently emitted since the previous sampling, unless the\n * source has not emitted anything since the previous sampling. The sampling\n * happens periodically in time every `period` milliseconds (or the time unit\n * defined by the optional `scheduler` argument). The sampling starts as soon as\n * the output Observable is subscribed.\n *\n * ## Example\n * Every second, emit the most recent click at most once\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { sampleTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(sampleTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link auditTime}\n * @see {@link debounceTime}\n * @see {@link delay}\n * @see {@link sample}\n * @see {@link throttleTime}\n *\n * @param {number} period The sampling period expressed in milliseconds or the\n * time unit determined internally by the optional `scheduler`.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the sampling.\n * @return {Observable} An Observable that emits the results of sampling the\n * values emitted by the source Observable at the specified time interval.\n * @method sampleTime\n * @owner Observable\n */\nexport function sampleTime(period: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new SampleTimeOperator(period, scheduler));\n}\n\nclass SampleTimeOperator implements Operator {\n constructor(private period: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SampleTimeSubscriber extends Subscriber {\n lastValue: T;\n hasValue: boolean = false;\n\n constructor(destination: Subscriber,\n private period: number,\n private scheduler: SchedulerLike) {\n super(destination);\n this.add(scheduler.schedule(dispatchNotification, period, { subscriber: this, period }));\n }\n\n protected _next(value: T) {\n this.lastValue = value;\n this.hasValue = true;\n }\n\n notifyNext() {\n if (this.hasValue) {\n this.hasValue = false;\n this.destination.next(this.lastValue);\n }\n }\n}\n\nfunction dispatchNotification(this: SchedulerAction, state: any) {\n let { subscriber, period } = state;\n subscriber.notifyNext();\n this.schedule(state, period);\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\n\nimport { Observer, OperatorFunction } from '../types';\n\n/**\n * Compares all values of two observables in sequence using an optional comparator function\n * and returns an observable of a single boolean value representing whether or not the two sequences\n * are equal.\n *\n * Checks to see of all values emitted by both observables are equal, in order.\n *\n * ![](sequenceEqual.png)\n *\n * `sequenceEqual` subscribes to two observables and buffers incoming values from each observable. Whenever either\n * observable emits a value, the value is buffered and the buffers are shifted and compared from the bottom\n * up; If any value pair doesn't match, the returned observable will emit `false` and complete. If one of the\n * observables completes, the operator will wait for the other observable to complete; If the other\n * observable emits before completing, the returned observable will emit `false` and complete. If one observable never\n * completes or emits after the other complets, the returned observable will never complete.\n *\n * ## Example\n * figure out if the Konami code matches\n * ```ts\n * import { from, fromEvent } from 'rxjs';\n * import { sequenceEqual, bufferCount, mergeMap, map } from 'rxjs/operators';\n *\n * const codes = from([\n * 'ArrowUp',\n * 'ArrowUp',\n * 'ArrowDown',\n * 'ArrowDown',\n * 'ArrowLeft',\n * 'ArrowRight',\n * 'ArrowLeft',\n * 'ArrowRight',\n * 'KeyB',\n * 'KeyA',\n * 'Enter', // no start key, clearly.\n * ]);\n *\n * const keys = fromEvent(document, 'keyup').pipe(map(e => e.code));\n * const matches = keys.pipe(\n * bufferCount(11, 1),\n * mergeMap(\n * last11 => from(last11).pipe(sequenceEqual(codes)),\n * ),\n * );\n * matches.subscribe(matched => console.log('Successful cheat at Contra? ', matched));\n * ```\n *\n * @see {@link combineLatest}\n * @see {@link zip}\n * @see {@link withLatestFrom}\n *\n * @param {Observable} compareTo The observable sequence to compare the source sequence to.\n * @param {function} [comparator] An optional function to compare each value pair\n * @return {Observable} An Observable of a single boolean value representing whether or not\n * the values emitted by both observables were equal in sequence.\n * @method sequenceEqual\n * @owner Observable\n */\nexport function sequenceEqual(compareTo: Observable,\n comparator?: (a: T, b: T) => boolean): OperatorFunction {\n return (source: Observable) => source.lift(new SequenceEqualOperator(compareTo, comparator));\n}\n\nexport class SequenceEqualOperator implements Operator {\n constructor(private compareTo: Observable,\n private comparator: (a: T, b: T) => boolean) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparator));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SequenceEqualSubscriber extends Subscriber {\n private _a: T[] = [];\n private _b: T[] = [];\n private _oneComplete = false;\n\n constructor(destination: Observer,\n private compareTo: Observable,\n private comparator: (a: T, b: T) => boolean) {\n super(destination);\n (this.destination as Subscription).add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this)));\n }\n\n protected _next(value: T): void {\n if (this._oneComplete && this._b.length === 0) {\n this.emit(false);\n } else {\n this._a.push(value);\n this.checkValues();\n }\n }\n\n public _complete(): void {\n if (this._oneComplete) {\n this.emit(this._a.length === 0 && this._b.length === 0);\n } else {\n this._oneComplete = true;\n }\n this.unsubscribe();\n }\n\n checkValues() {\n const { _a, _b, comparator } = this;\n while (_a.length > 0 && _b.length > 0) {\n let a = _a.shift();\n let b = _b.shift();\n let areEqual = false;\n try {\n areEqual = comparator ? comparator(a, b) : a === b;\n } catch (e) {\n this.destination.error(e);\n }\n if (!areEqual) {\n this.emit(false);\n }\n }\n }\n\n emit(value: boolean) {\n const { destination } = this;\n destination.next(value);\n destination.complete();\n }\n\n nextB(value: T) {\n if (this._oneComplete && this._a.length === 0) {\n this.emit(false);\n } else {\n this._b.push(value);\n this.checkValues();\n }\n }\n\n completeB() {\n if (this._oneComplete) {\n this.emit(this._a.length === 0 && this._b.length === 0);\n } else {\n this._oneComplete = true;\n }\n }\n}\n\nclass SequenceEqualCompareToSubscriber extends Subscriber {\n constructor(destination: Observer, private parent: SequenceEqualSubscriber) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.parent.nextB(value);\n }\n\n protected _error(err: any): void {\n this.parent.error(err);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.completeB();\n this.unsubscribe();\n }\n}\n","import { Observable } from '../Observable';\nimport { multicast } from './multicast';\nimport { refCount } from './refCount';\nimport { Subject } from '../Subject';\n\nimport { MonoTypeOperatorFunction } from '../types';\n\nfunction shareSubjectFactory() {\n return new Subject();\n}\n\n/**\n * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one\n * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will\n * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.\n * This is an alias for `multicast(() => new Subject()), refCount()`.\n *\n * ![](share.png)\n *\n * @return {Observable} An Observable that upon connection causes the source Observable to emit items to its Observers.\n * @method share\n * @owner Observable\n */\nexport function share(): MonoTypeOperatorFunction {\n return (source: Observable) => refCount()(multicast(shareSubjectFactory)(source)) as Observable;\n}\n","import { Observable } from '../Observable';\nimport { ReplaySubject } from '../ReplaySubject';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\n\nexport interface ShareReplayConfig {\n bufferSize?: number;\n windowTime?: number;\n refCount: boolean;\n scheduler?: SchedulerLike;\n}\n\n/**\n * Share source and replay specified number of emissions on subscription.\n *\n * This operator is a specialization of `replay` that connects to a source observable\n * and multicasts through a `ReplaySubject` constructed with the specified arguments.\n * A successfully completed source will stay cached in the `shareReplayed observable` forever,\n * but an errored source can be retried.\n *\n * ## Why use shareReplay?\n * You generally want to use `shareReplay` when you have side-effects or taxing computations\n * that you do not wish to be executed amongst multiple subscribers.\n * It may also be valuable in situations where you know you will have late subscribers to\n * a stream that need access to previously emitted values.\n * This ability to replay values on subscription is what differentiates {@link share} and `shareReplay`.\n *\n * ![](shareReplay.png)\n *\n * ## Example\n * ```ts\n * import { interval } from 'rxjs';\n * import { shareReplay, take } from 'rxjs/operators';\n *\n * const obs$ = interval(1000);\n * const shared$ = obs$.pipe(\n * take(4),\n * shareReplay(3)\n * );\n * shared$.subscribe(x => console.log('source A: ', x));\n * shared$.subscribe(y => console.log('source B: ', y));\n *\n * ```\n *\n * @see {@link publish}\n * @see {@link share}\n * @see {@link publishReplay}\n *\n * @param {Number} [bufferSize=Number.POSITIVE_INFINITY] Maximum element count of the replay buffer.\n * @param {Number} [windowTime=Number.POSITIVE_INFINITY] Maximum time length of the replay buffer in milliseconds.\n * @param {Scheduler} [scheduler] Scheduler where connected observers within the selector function\n * will be invoked on.\n * @return {Observable} An observable sequence that contains the elements of a sequence produced\n * by multicasting the source sequence within a selector function.\n * @method shareReplay\n * @owner Observable\n */\nexport function shareReplay(\n config: ShareReplayConfig\n): MonoTypeOperatorFunction;\nexport function shareReplay(\n bufferSize?: number,\n windowTime?: number,\n scheduler?: SchedulerLike\n): MonoTypeOperatorFunction;\nexport function shareReplay(\n configOrBufferSize?: ShareReplayConfig | number,\n windowTime?: number,\n scheduler?: SchedulerLike\n): MonoTypeOperatorFunction {\n let config: ShareReplayConfig;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n config = configOrBufferSize as ShareReplayConfig;\n } else {\n config = {\n bufferSize: configOrBufferSize as number | undefined,\n windowTime,\n refCount: false,\n scheduler,\n };\n }\n return (source: Observable) => source.lift(shareReplayOperator(config));\n}\n\nfunction shareReplayOperator({\n bufferSize = Number.POSITIVE_INFINITY,\n windowTime = Number.POSITIVE_INFINITY,\n refCount: useRefCount,\n scheduler,\n}: ShareReplayConfig) {\n let subject: ReplaySubject | undefined;\n let refCount = 0;\n let subscription: Subscription | undefined;\n let hasError = false;\n let isComplete = false;\n\n return function shareReplayOperation(\n this: Subscriber,\n source: Observable\n ) {\n refCount++;\n let innerSub: Subscription;\n if (!subject || hasError) {\n hasError = false;\n subject = new ReplaySubject(bufferSize, windowTime, scheduler);\n innerSub = subject.subscribe(this);\n subscription = source.subscribe({\n next(value) {\n subject.next(value);\n },\n error(err) {\n hasError = true;\n subject.error(err);\n },\n complete() {\n isComplete = true;\n subscription = undefined;\n subject.complete();\n },\n });\n\n // Here we need to check to see if the source synchronously completed. Although\n // we're setting `subscription = undefined` in the completion handler, if the source\n // is synchronous, that will happen *before* subscription is set by the return of\n // the `subscribe` call.\n if (isComplete) {\n subscription = undefined;\n }\n } else {\n innerSub = subject.subscribe(this);\n }\n\n this.add(() => {\n refCount--;\n innerSub.unsubscribe();\n innerSub = undefined;\n if (subscription && !isComplete && useRefCount && refCount === 0) {\n subscription.unsubscribe();\n subscription = undefined;\n subject = undefined;\n }\n });\n };\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { EmptyError } from '../util/EmptyError';\n\nimport { Observer, MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that emits the single item emitted by the source Observable that matches a specified\n * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no\n * items, notify of an IllegalArgumentException or NoSuchElementException respectively. If the source Observable\n * emits items but none match the specified predicate then `undefined` is emitted.\n *\n * Like {@link first}, but emit with error notification if there is more than one value.\n * ![](single.png)\n *\n * ## Example\n * emits 'error'\n * ```ts\n * import { range } from 'rxjs';\n * import { single } from 'rxjs/operators';\n *\n * const numbers = range(1,5).pipe(single());\n * numbers.subscribe(x => console.log('never get called'), e => console.log('error'));\n * // result\n * // 'error'\n * ```\n *\n * emits 'undefined'\n * ```ts\n * import { range } from 'rxjs';\n * import { single } from 'rxjs/operators';\n *\n * const numbers = range(1,5).pipe(single(x => x === 10));\n * numbers.subscribe(x => console.log(x));\n * // result\n * // 'undefined'\n * ```\n *\n * @see {@link first}\n * @see {@link find}\n * @see {@link findIndex}\n * @see {@link elementAt}\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n * @param {Function} predicate - A predicate function to evaluate items emitted by the source Observable.\n * @return {Observable} An Observable that emits the single item emitted by the source Observable that matches\n * the predicate or `undefined` when no items match.\n *\n * @method single\n * @owner Observable\n */\nexport function single(predicate?: (value: T, index: number, source: Observable) => boolean): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new SingleOperator(predicate, source));\n}\n\nclass SingleOperator implements Operator {\n constructor(private predicate?: (value: T, index: number, source: Observable) => boolean,\n private source?: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SingleSubscriber extends Subscriber {\n private seenValue: boolean = false;\n private singleValue: T;\n private index: number = 0;\n\n constructor(destination: Observer,\n private predicate?: (value: T, index: number, source: Observable) => boolean,\n private source?: Observable) {\n super(destination);\n }\n\n private applySingleValue(value: T): void {\n if (this.seenValue) {\n this.destination.error('Sequence contains more than one element');\n } else {\n this.seenValue = true;\n this.singleValue = value;\n }\n }\n\n protected _next(value: T): void {\n const index = this.index++;\n\n if (this.predicate) {\n this.tryNext(value, index);\n } else {\n this.applySingleValue(value);\n }\n }\n\n private tryNext(value: T, index: number): void {\n try {\n if (this.predicate(value, index, this.source)) {\n this.applySingleValue(value);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n\n protected _complete(): void {\n const destination = this.destination;\n\n if (this.index > 0) {\n destination.next(this.seenValue ? this.singleValue : undefined);\n destination.complete();\n } else {\n destination.error(new EmptyError);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that skips the first `count` items emitted by the source Observable.\n *\n * ![](skip.png)\n *\n * @param {Number} count - The number of times, items emitted by source Observable should be skipped.\n * @return {Observable} An Observable that skips values emitted by the source Observable.\n *\n * @method skip\n * @owner Observable\n */\nexport function skip(count: number): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new SkipOperator(count));\n}\n\nclass SkipOperator implements Operator {\n constructor(private total: number) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new SkipSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipSubscriber extends Subscriber {\n count: number = 0;\n\n constructor(destination: Subscriber, private total: number) {\n super(destination);\n }\n\n protected _next(x: T) {\n if (++this.count > this.total) {\n this.destination.next(x);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Skip the last `count` values emitted by the source Observable.\n *\n * ![](skipLast.png)\n *\n * `skipLast` returns an Observable that accumulates a queue with a length\n * enough to store the first `count` values. As more values are received,\n * values are taken from the front of the queue and produced on the result\n * sequence. This causes values to be delayed.\n *\n * ## Example\n * Skip the last 2 values of an Observable with many values\n * ```ts\n * import { range } from 'rxjs';\n * import { skipLast } from 'rxjs/operators';\n *\n * const many = range(1, 5);\n * const skipLastTwo = many.pipe(skipLast(2));\n * skipLastTwo.subscribe(x => console.log(x));\n *\n * // Results in:\n * // 1 2 3\n * ```\n *\n * @see {@link skip}\n * @see {@link skipUntil}\n * @see {@link skipWhile}\n * @see {@link take}\n *\n * @throws {ArgumentOutOfRangeError} When using `skipLast(i)`, it throws\n * ArgumentOutOrRangeError if `i < 0`.\n *\n * @param {number} count Number of elements to skip from the end of the source Observable.\n * @returns {Observable} An Observable that skips the last count values\n * emitted by the source Observable.\n * @method skipLast\n * @owner Observable\n */\nexport function skipLast(count: number): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new SkipLastOperator(count));\n}\n\nclass SkipLastOperator implements Operator {\n constructor(private _skipCount: number) {\n if (this._skipCount < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n if (this._skipCount === 0) {\n // If we don't want to skip any values then just subscribe\n // to Subscriber without any further logic.\n return source.subscribe(new Subscriber(subscriber));\n } else {\n return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));\n }\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipLastSubscriber extends Subscriber {\n private _ring: T[];\n private _count: number = 0;\n\n constructor(destination: Subscriber, private _skipCount: number) {\n super(destination);\n this._ring = new Array(_skipCount);\n }\n\n protected _next(value: T): void {\n const skipCount = this._skipCount;\n const count = this._count++;\n\n if (count < skipCount) {\n this._ring[count] = value;\n } else {\n const currentIndex = count % skipCount;\n const ring = this._ring;\n const oldValue = ring[currentIndex];\n\n ring[currentIndex] = value;\n this.destination.next(oldValue);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic, ObservableInput } from '../types';\nimport { Subscription } from '../Subscription';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/**\n * Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.\n *\n * The `skipUntil` operator causes the observable stream to skip the emission of values ​​until the passed in observable emits the first value.\n * This can be particularly useful in combination with user interactions, responses of http requests or waiting for specific times to pass by.\n *\n * ![](skipUntil.png)\n *\n * Internally the `skipUntil` operator subscribes to the passed in observable (in the following called *notifier*) in order to recognize the emission\n * of its first value. When this happens, the operator unsubscribes from the *notifier* and starts emitting the values of the *source*\n * observable. It will never let the *source* observable emit any values if the *notifier* completes or throws an error without emitting\n * a value before.\n *\n * ## Example\n *\n * In the following example, all emitted values ​​of the interval observable are skipped until the user clicks anywhere within the page.\n *\n * ```ts\n * import { interval, fromEvent } from 'rxjs';\n * import { skipUntil } from 'rxjs/operators';\n *\n * const intervalObservable = interval(1000);\n * const click = fromEvent(document, 'click');\n *\n * const emitAfterClick = intervalObservable.pipe(\n * skipUntil(click)\n * );\n * // clicked at 4.6s. output: 5...6...7...8........ or\n * // clicked at 7.3s. output: 8...9...10..11.......\n * const subscribe = emitAfterClick.subscribe(value => console.log(value));\n * ```\n *\n * @param {Observable} notifier - The second Observable that has to emit an item before the source Observable's elements begin to\n * be mirrored by the resulting Observable.\n * @return {Observable} An Observable that skips items from the source Observable until the second Observable emits\n * an item, then emits the remaining items.\n * @method skipUntil\n * @owner Observable\n */\nexport function skipUntil(notifier: Observable): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new SkipUntilOperator(notifier));\n}\n\nclass SkipUntilOperator implements Operator {\n constructor(private notifier: Observable) {\n }\n\n call(destination: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipUntilSubscriber extends SimpleOuterSubscriber {\n\n private hasValue: boolean = false;\n private innerSubscription?: Subscription;\n\n constructor(destination: Subscriber, notifier: ObservableInput) {\n super(destination);\n const innerSubscriber = new SimpleInnerSubscriber(this);\n this.add(innerSubscriber);\n this.innerSubscription = innerSubscriber;\n const innerSubscription = innerSubscribe(notifier, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (innerSubscription !== innerSubscriber) {\n this.add(innerSubscription);\n this.innerSubscription = innerSubscription;\n }\n }\n\n protected _next(value: T) {\n if (this.hasValue) {\n super._next(value);\n }\n }\n\n notifyNext(): void {\n this.hasValue = true;\n if (this.innerSubscription) {\n this.innerSubscription.unsubscribe();\n }\n }\n\n notifyComplete() {\n /* do nothing */\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds\n * true, but emits all further source items as soon as the condition becomes false.\n *\n * ![](skipWhile.png)\n *\n * @param {Function} predicate - A function to test each item emitted from the source Observable.\n * @return {Observable} An Observable that begins emitting items emitted by the source Observable when the\n * specified predicate becomes false.\n * @method skipWhile\n * @owner Observable\n */\nexport function skipWhile(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new SkipWhileOperator(predicate));\n}\n\nclass SkipWhileOperator implements Operator {\n constructor(private predicate: (value: T, index: number) => boolean) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipWhileSubscriber extends Subscriber {\n private skipping: boolean = true;\n private index: number = 0;\n\n constructor(destination: Subscriber,\n private predicate: (value: T, index: number) => boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const destination = this.destination;\n if (this.skipping) {\n this.tryCallPredicate(value);\n }\n\n if (!this.skipping) {\n destination.next(value);\n }\n }\n\n private tryCallPredicate(value: T): void {\n try {\n const result = this.predicate(value, this.index++);\n this.skipping = Boolean(result);\n } catch (err) {\n this.destination.error(err);\n }\n }\n}\n","import { Observable } from '../Observable';\nimport { concat } from '../observable/concat';\nimport { isScheduler } from '../util/isScheduler';\nimport { MonoTypeOperatorFunction, OperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(scheduler: SchedulerLike): MonoTypeOperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(v1: D, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(v1: D, v2: E, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(v1: D, v2: E, v3: F, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(v1: D, v2: E, v3: F, v4: G, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(v1: D, v2: E, v3: F, v4: G, v5: H, scheduler: SchedulerLike): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(v1: D, v2: E, v3: F, v4: G, v5: H, v6: I, scheduler: SchedulerLike): OperatorFunction;\n\nexport function startWith(v1: D): OperatorFunction;\nexport function startWith(v1: D, v2: E): OperatorFunction;\nexport function startWith(v1: D, v2: E, v3: F): OperatorFunction;\nexport function startWith(v1: D, v2: E, v3: F, v4: G): OperatorFunction;\nexport function startWith(v1: D, v2: E, v3: F, v4: G, v5: H): OperatorFunction;\nexport function startWith(v1: D, v2: E, v3: F, v4: G, v5: H, v6: I): OperatorFunction;\nexport function startWith(...array: D[]): OperatorFunction;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith(...array: Array): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the items you specify as arguments before it begins to emit\n * items emitted by the source Observable.\n *\n * First emits its arguments in order, and then any\n * emissions from the source.\n *\n * ![](startWith.png)\n *\n * ## Examples\n *\n * Start the chain of emissions with `\"first\"`, `\"second\"`\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { startWith } from 'rxjs/operators';\n *\n * of(\"from source\")\n * .pipe(startWith(\"first\", \"second\"))\n * .subscribe(x => console.log(x));\n *\n * // results:\n * // \"first\"\n * // \"second\"\n * // \"from source\"\n * ```\n *\n * @param {...T} values - Items you want the modified Observable to emit first.\n * @param {SchedulerLike} [scheduler] - A {@link SchedulerLike} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable} An Observable that emits the items in the specified Iterable and then emits the items\n * emitted by the source Observable.\n * @method startWith\n * @owner Observable\n */\nexport function startWith(...array: Array): OperatorFunction {\n const scheduler = array[array.length - 1] as SchedulerLike;\n if (isScheduler(scheduler)) {\n // deprecated path\n array.pop();\n return (source: Observable) => concat(array as T[], source, scheduler);\n } else {\n return (source: Observable) => concat(array as T[], source);\n }\n}\n","import { SchedulerLike, SchedulerAction } from '../types';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { asap } from '../scheduler/asap';\nimport { isNumeric } from '../util/isNumeric';\n\nexport interface DispatchArg {\n source: Observable;\n subscriber: Subscriber;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nexport class SubscribeOnObservable extends Observable {\n /** @nocollapse */\n static create(source: Observable, delay: number = 0, scheduler: SchedulerLike = asap): Observable {\n return new SubscribeOnObservable(source, delay, scheduler);\n }\n\n /** @nocollapse */\n static dispatch(this: SchedulerAction, arg: DispatchArg): Subscription {\n const { source, subscriber } = arg;\n return this.add(source.subscribe(subscriber));\n }\n\n constructor(public source: Observable,\n private delayTime: number = 0,\n private scheduler: SchedulerLike = asap) {\n super();\n if (!isNumeric(delayTime) || delayTime < 0) {\n this.delayTime = 0;\n }\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n this.scheduler = asap;\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber) {\n const delay = this.delayTime;\n const source = this.source;\n const scheduler = this.scheduler;\n\n return scheduler.schedule>(SubscribeOnObservable.dispatch, delay, {\n source, subscriber\n });\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { SubscribeOnObservable } from '../observable/SubscribeOnObservable';\nimport { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Asynchronously subscribes Observers to this Observable on the specified {@link SchedulerLike}.\n *\n * With `subscribeOn` you can decide what type of scheduler a specific Observable will be using when it is subscribed to.\n *\n * Schedulers control the speed and order of emissions to observers from an Observable stream.\n *\n * ![](subscribeOn.png)\n *\n * ## Example\n * Given the following code:\n * ```javascript\n * import { of, merge } from 'rxjs';\n *\n * const a = of(1, 2, 3, 4);\n * const b = of(5, 6, 7, 8, 9);\n * merge(a, b).subscribe(console.log);\n * ```\n *\n * Both Observable `a` and `b` will emit their values directly and synchronously once they are subscribed to.\n * This will result in the output of `1 2 3 4 5 6 7 8 9`.\n *\n * But if we instead us the `subscribeOn` operator declaring that we want to use the {@link asyncScheduler} for values emited by Observable `a`:\n * ```javascript\n * import { of, merge, asyncScheduler } from 'rxjs';\n * import { subscribeOn } from 'rxjs/operators';\n *\n * const a = of(1, 2, 3, 4).pipe(subscribeOn(asyncScheduler));\n * const b = of(5, 6, 7, 8, 9);\n * merge(a, b).subscribe(console.log);\n * ```\n *\n * The output will instead be `5 6 7 8 9 1 2 3 4`.\n * The reason for this is that Observable `b` emits its values directly and synchronously like before\n * but the emissions from `a` are scheduled on the event loop because we are now using the {@link asyncScheduler} for that specific Observable.\n *\n * @param {SchedulerLike} scheduler - The {@link SchedulerLike} to perform subscription actions on.\n * @return {Observable} The source Observable modified so that its subscriptions happen on the specified {@link SchedulerLike}.\n .\n * @method subscribeOn\n * @owner Observable\n */\nexport function subscribeOn(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction {\n return function subscribeOnOperatorFunction(source: Observable): Observable {\n return source.lift(new SubscribeOnOperator(scheduler, delay));\n };\n}\n\nclass SubscribeOnOperator implements Operator {\n constructor(private scheduler: SchedulerLike,\n private delay: number) {\n }\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return new SubscribeOnObservable(\n source, this.delay, this.scheduler\n ).subscribe(subscriber);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function switchMap>(project: (value: T, index: number) => O): OperatorFunction>;\n/** @deprecated resultSelector is no longer supported, use inner map instead */\nexport function switchMap>(project: (value: T, index: number) => O, resultSelector: undefined): OperatorFunction>;\n/** @deprecated resultSelector is no longer supported, use inner map instead */\nexport function switchMap>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, emitting values only from the most recently projected Observable.\n *\n * Maps each value to an Observable, then flattens all of\n * these inner Observables.\n *\n * ![](switchMap.png)\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each time it observes one of these\n * inner Observables, the output Observable begins emitting the items emitted by\n * that inner Observable. When a new inner Observable is emitted, `switchMap`\n * stops emitting items from the earlier-emitted inner Observable and begins\n * emitting items from the new one. It continues to behave like this for\n * subsequent inner Observables.\n *\n * ## Example\n * Generate new Observable according to source Observable values\n * ```typescript\n * import { of } from 'rxjs';\n * import { switchMap } from 'rxjs/operators';\n *\n * const switched = of(1, 2, 3).pipe(switchMap((x: number) => of(x, x ** 2, x ** 3)));\n * switched.subscribe(x => console.log(x));\n * // outputs\n * // 1\n * // 1\n * // 1\n * // 2\n * // 4\n * // 8\n * // ... and so on\n * ```\n *\n * Rerun an interval Observable on every click event\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { switchMap } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(switchMap((ev) => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchAll}\n * @see {@link switchMapTo}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item\n * emitted by the source Observable and taking only the values from the most recently\n * projected inner Observable.\n * @method switchMap\n * @owner Observable\n */\nexport function switchMap>(\n project: (value: T, index: number) => O,\n resultSelector?: (outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R,\n): OperatorFunction|R> {\n if (typeof resultSelector === 'function') {\n return (source: Observable) => source.pipe(\n switchMap((a, i) => from(project(a, i)).pipe(\n map((b, ii) => resultSelector(a, b, i, ii))\n ))\n );\n }\n return (source: Observable) => source.lift(new SwitchMapOperator(project));\n}\n\nclass SwitchMapOperator implements Operator {\n constructor(private project: (value: T, index: number) => ObservableInput) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SwitchMapSubscriber extends SimpleOuterSubscriber {\n private index = 0;\n private innerSubscription?: Subscription;\n\n constructor(destination: Subscriber,\n private project: (value: T, index: number) => ObservableInput) {\n super(destination);\n }\n\n protected _next(value: T) {\n let result: ObservableInput;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (error) {\n this.destination.error!(error);\n return;\n }\n this._innerSub(result);\n }\n\n private _innerSub(result: ObservableInput) {\n const innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n this.innerSubscription = innerSubscribe(result, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (this.innerSubscription !== innerSubscriber) {\n destination.add(this.innerSubscription);\n }\n }\n\n protected _complete(): void {\n const {innerSubscription} = this;\n if (!innerSubscription || innerSubscription.closed) {\n super._complete();\n }\n this.unsubscribe();\n }\n\n protected _unsubscribe() {\n this.innerSubscription = undefined;\n }\n\n notifyComplete(): void {\n this.innerSubscription = undefined;\n if (this.isStopped) {\n super._complete();\n }\n }\n\n notifyNext(innerValue: R): void {\n this.destination.next!(innerValue);\n }\n}\n","import {OperatorFunction, ObservableInput} from '../types';\nimport { switchMap } from './switchMap';\nimport { identity } from '../util/identity';\n\nexport function switchAll(): OperatorFunction, T>;\nexport function switchAll(): OperatorFunction;\n\n/**\n * Converts a higher-order Observable into a first-order Observable\n * producing values only from the most recent observable sequence\n *\n * Flattens an Observable-of-Observables.\n *\n * ![](switchAll.png)\n *\n * `switchAll` subscribes to a source that is an observable of observables, also known as a\n * \"higher-order observable\" (or `Observable>`). It subscribes to the most recently\n * provided \"inner observable\" emitted by the source, unsubscribing from any previously subscribed\n * to inner observable, such that only the most recent inner observable may be subscribed to at\n * any point in time. The resulting observable returned by `switchAll` will only complete if the\n * source observable completes, *and* any currently subscribed to inner observable also has completed,\n * if there are any.\n *\n * ## Examples\n * Spawn a new interval observable for each click event, but for every new\n * click, cancel the previous interval and subscribe to the new one.\n *\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { switchAll, map, tap } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click').pipe(tap(() => console.log('click')));\n * const source = clicks.pipe(map((ev) => interval(1000)));\n *\n * source.pipe(\n * switchAll()\n * ).subscribe(x => console.log(x));\n *\n * // Output\n * // click\n * // 1\n * // 2\n * // 3\n * // 4\n * // ...\n * // click\n * // 1\n * // 2\n * // 3\n * // ...\n * // click\n * // ...\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link exhaust}\n * @see {@link switchMap}\n * @see {@link switchMapTo}\n * @see {@link mergeAll}\n */\n\nexport function switchAll(): OperatorFunction, T> {\n return switchMap(identity);\n}\n","import { ObservableInput, OperatorFunction } from '../types';\nimport { switchMap } from './switchMap';\n\n/* tslint:disable:max-line-length */\nexport function switchMapTo(observable: ObservableInput): OperatorFunction;\n/** @deprecated resultSelector is no longer supported. Switch to using switchMap with an inner map */\nexport function switchMapTo(observable: ObservableInput, resultSelector: undefined): OperatorFunction;\n/** @deprecated resultSelector is no longer supported. Switch to using switchMap with an inner map */\nexport function switchMapTo(observable: ObservableInput, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to the same Observable which is flattened multiple\n * times with {@link switchMap} in the output Observable.\n *\n * It's like {@link switchMap}, but maps each value\n * always to the same inner Observable.\n *\n * ![](switchMapTo.png)\n *\n * Maps each source value to the given Observable `innerObservable` regardless\n * of the source value, and then flattens those resulting Observables into one\n * single Observable, which is the output Observable. The output Observables\n * emits values only from the most recently emitted instance of\n * `innerObservable`.\n *\n * ## Example\n * Rerun an interval Observable on every click event\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { switchMapTo } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(switchMapTo(interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMapTo}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link mergeMapTo}\n *\n * @param {ObservableInput} innerObservable An Observable to replace each value from\n * the source Observable.\n * @return {Observable} An Observable that emits items from the given\n * `innerObservable` (and optionally transformed through the deprecated `resultSelector`)\n * every time a value is emitted on the source Observable, and taking only the values\n * from the most recently projected inner Observable.\n * @method switchMapTo\n * @owner Observable\n */\nexport function switchMapTo(\n innerObservable: ObservableInput,\n resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R\n): OperatorFunction {\n return resultSelector ? switchMap(() => innerObservable, resultSelector) : switchMap(() => innerObservable);\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { innerSubscribe, SimpleInnerSubscriber, SimpleOuterSubscriber } from '../innerSubscribe';\n\n/**\n * Emits the values emitted by the source Observable until a `notifier`\n * Observable emits a value.\n *\n * Lets values pass until a second Observable,\n * `notifier`, emits a value. Then, it completes.\n *\n * ![](takeUntil.png)\n *\n * `takeUntil` subscribes and begins mirroring the source Observable. It also\n * monitors a second Observable, `notifier` that you provide. If the `notifier`\n * emits a value, the output Observable stops mirroring the source Observable\n * and completes. If the `notifier` doesn't emit any value and completes\n * then `takeUntil` will pass all values.\n *\n * ## Example\n * Tick every second until the first click happens\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { takeUntil } from 'rxjs/operators';\n *\n * const source = interval(1000);\n * const clicks = fromEvent(document, 'click');\n * const result = source.pipe(takeUntil(clicks));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @param {Observable} notifier The Observable whose first emitted value will\n * cause the output Observable of `takeUntil` to stop emitting values from the\n * source Observable.\n * @return {Observable} An Observable that emits the values from the source\n * Observable until such time as `notifier` emits its first value.\n * @method takeUntil\n * @owner Observable\n */\nexport function takeUntil(notifier: Observable): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new TakeUntilOperator(notifier));\n}\n\nclass TakeUntilOperator implements Operator {\n constructor(private notifier: Observable) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n const takeUntilSubscriber = new TakeUntilSubscriber(subscriber);\n const notifierSubscription = innerSubscribe(this.notifier, new SimpleInnerSubscriber(takeUntilSubscriber));\n if (notifierSubscription && !takeUntilSubscriber.seenValue) {\n takeUntilSubscriber.add(notifierSubscription);\n return source.subscribe(takeUntilSubscriber);\n }\n return takeUntilSubscriber;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeUntilSubscriber extends SimpleOuterSubscriber {\n seenValue = false;\n\n constructor(destination: Subscriber, ) {\n super(destination);\n }\n\n notifyNext(): void {\n this.seenValue = true;\n this.complete();\n }\n\n notifyComplete(): void {\n // noop\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction, MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\nexport function takeWhile(predicate: (value: T, index: number) => value is S): OperatorFunction;\nexport function takeWhile(predicate: (value: T, index: number) => value is S, inclusive: false): OperatorFunction;\nexport function takeWhile(predicate: (value: T, index: number) => boolean, inclusive?: boolean): MonoTypeOperatorFunction;\n\n/**\n * Emits values emitted by the source Observable so long as each value satisfies\n * the given `predicate`, and then completes as soon as this `predicate` is not\n * satisfied.\n *\n * Takes values from the source only while they pass the\n * condition given. When the first value does not satisfy, it completes.\n *\n * ![](takeWhile.png)\n *\n * `takeWhile` subscribes and begins mirroring the source Observable. Each value\n * emitted on the source is given to the `predicate` function which returns a\n * boolean, representing a condition to be satisfied by the source values. The\n * output Observable emits the source values until such time as the `predicate`\n * returns false, at which point `takeWhile` stops mirroring the source\n * Observable and completes the output Observable.\n *\n * ## Example\n * Emit click events only while the clientX property is greater than 200\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { takeWhile } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(takeWhile(ev => ev.clientX > 200));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeUntil}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates a value emitted by the source Observable and returns a boolean.\n * Also takes the (zero-based) index as the second argument.\n * @param {boolean} inclusive When set to `true` the value that caused\n * `predicate` to return `false` will also be emitted.\n * @return {Observable} An Observable that emits the values from the source\n * Observable so long as each value satisfies the condition defined by the\n * `predicate`, then completes.\n * @method takeWhile\n * @owner Observable\n */\nexport function takeWhile(\n predicate: (value: T, index: number) => boolean,\n inclusive = false): MonoTypeOperatorFunction {\n return (source: Observable) =>\n source.lift(new TakeWhileOperator(predicate, inclusive));\n}\n\nclass TakeWhileOperator implements Operator {\n constructor(\n private predicate: (value: T, index: number) => boolean,\n private inclusive: boolean) {}\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(\n new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeWhileSubscriber extends Subscriber {\n private index: number = 0;\n\n constructor(\n destination: Subscriber,\n private predicate: (value: T, index: number) => boolean,\n private inclusive: boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const destination = this.destination;\n let result: boolean;\n try {\n result = this.predicate(value, this.index++);\n } catch (err) {\n destination.error(err);\n return;\n }\n this.nextOrComplete(value, result);\n }\n\n private nextOrComplete(value: T, predicateResult: boolean): void {\n const destination = this.destination;\n if (Boolean(predicateResult)) {\n destination.next(value);\n } else {\n if (this.inclusive) {\n destination.next(value);\n }\n destination.complete();\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, PartialObserver, TeardownLogic } from '../types';\nimport { noop } from '../util/noop';\nimport { isFunction } from '../util/isFunction';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Use an observer instead of a complete callback */\nexport function tap(next: null | undefined, error: null | undefined, complete: () => void): MonoTypeOperatorFunction;\n/** @deprecated Use an observer instead of an error callback */\nexport function tap(next: null | undefined, error: (error: any) => void, complete?: () => void): MonoTypeOperatorFunction;\n/** @deprecated Use an observer instead of a complete callback */\nexport function tap(next: (value: T) => void, error: null | undefined, complete: () => void): MonoTypeOperatorFunction;\nexport function tap(next?: (x: T) => void, error?: (e: any) => void, complete?: () => void): MonoTypeOperatorFunction;\nexport function tap(observer: PartialObserver): MonoTypeOperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * Perform a side effect for every emission on the source Observable, but return\n * an Observable that is identical to the source.\n *\n * Intercepts each emission on the source and runs a\n * function, but returns an output which is identical to the source as long as errors don't occur.\n *\n * ![](do.png)\n *\n * Returns a mirrored Observable of the source Observable, but modified so that\n * the provided Observer is called to perform a side effect for every value,\n * error, and completion emitted by the source. Any errors that are thrown in\n * the aforementioned Observer or handlers are safely sent down the error path\n * of the output Observable.\n *\n * This operator is useful for debugging your Observables for the correct values\n * or performing other side effects.\n *\n * Note: this is different to a `subscribe` on the Observable. If the Observable\n * returned by `tap` is not subscribed, the side effects specified by the\n * Observer will never happen. `tap` therefore simply spies on existing\n * execution, it does not trigger an execution to happen like `subscribe` does.\n *\n * ## Example\n * Map every click to the clientX position of that click, while also logging the click event\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { tap, map } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const positions = clicks.pipe(\n * tap(ev => console.log(ev)),\n * map(ev => ev.clientX),\n * );\n * positions.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n * @see {@link Observable#subscribe}\n *\n * @param {Observer|function} [nextOrObserver] A normal Observer object or a\n * callback for `next`.\n * @param {function} [error] Callback for errors in the source.\n * @param {function} [complete] Callback for the completion of the source.\n * @return {Observable} An Observable identical to the source, but runs the\n * specified Observer or callback(s) for each item.\n * @name tap\n */\nexport function tap(nextOrObserver?: PartialObserver | ((x: T) => void),\n error?: (e: any) => void,\n complete?: () => void): MonoTypeOperatorFunction {\n return function tapOperatorFunction(source: Observable): Observable {\n return source.lift(new DoOperator(nextOrObserver, error, complete));\n };\n}\n\nclass DoOperator implements Operator {\n constructor(private nextOrObserver?: PartialObserver | ((x: T) => void),\n private error?: (e: any) => void,\n private complete?: () => void) {\n }\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\n\nclass TapSubscriber extends Subscriber {\n private _context: any;\n\n private _tapNext: ((value: T) => void) = noop;\n\n private _tapError: ((err: any) => void) = noop;\n\n private _tapComplete: (() => void) = noop;\n\n constructor(destination: Subscriber,\n observerOrNext?: PartialObserver | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super(destination);\n this._tapError = error || noop;\n this._tapComplete = complete || noop;\n if (isFunction(observerOrNext)) {\n this._context = this;\n this._tapNext = observerOrNext;\n } else if (observerOrNext) {\n this._context = observerOrNext;\n this._tapNext = observerOrNext.next || noop;\n this._tapError = observerOrNext.error || noop;\n this._tapComplete = observerOrNext.complete || noop;\n }\n }\n\n _next(value: T) {\n try {\n this._tapNext.call(this._context, value);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(value);\n }\n\n _error(err: any) {\n try {\n this._tapError.call(this._context, err);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.error(err);\n }\n\n _complete() {\n try {\n this._tapComplete.call(this._context, );\n } catch (err) {\n this.destination.error(err);\n return;\n }\n return this.destination.complete();\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\n\nimport { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\nexport interface ThrottleConfig {\n leading?: boolean;\n trailing?: boolean;\n}\n\nexport const defaultThrottleConfig: ThrottleConfig = {\n leading: true,\n trailing: false\n};\n\n/**\n * Emits a value from the source Observable, then ignores subsequent source\n * values for a duration determined by another Observable, then repeats this\n * process.\n *\n * It's like {@link throttleTime}, but the silencing\n * duration is determined by a second Observable.\n *\n * ![](throttle.png)\n *\n * `throttle` emits the source Observable values on the output Observable\n * when its internal timer is disabled, and ignores source values when the timer\n * is enabled. Initially, the timer is disabled. As soon as the first source\n * value arrives, it is forwarded to the output Observable, and then the timer\n * is enabled by calling the `durationSelector` function with the source value,\n * which returns the \"duration\" Observable. When the duration Observable emits a\n * value or completes, the timer is disabled, and this process repeats for the\n * next source value.\n *\n * ## Example\n * Emit clicks at a rate of at most one click per second\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { throttle } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(throttle(ev => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttleTime}\n *\n * @param {function(value: T): SubscribableOrPromise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration for each source value, returned as an Observable or a Promise.\n * @param {Object} config a configuration object to define `leading` and `trailing` behavior. Defaults\n * to `{ leading: true, trailing: false }`.\n * @return {Observable} An Observable that performs the throttle operation to\n * limit the rate of emissions from the source.\n * @method throttle\n * @owner Observable\n */\nexport function throttle(durationSelector: (value: T) => SubscribableOrPromise,\n config: ThrottleConfig = defaultThrottleConfig): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new ThrottleOperator(durationSelector, !!config.leading, !!config.trailing));\n}\n\nclass ThrottleOperator implements Operator {\n constructor(private durationSelector: (value: T) => SubscribableOrPromise,\n private leading: boolean,\n private trailing: boolean) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(\n new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing)\n );\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc\n * @ignore\n * @extends {Ignored}\n */\nclass ThrottleSubscriber extends SimpleOuterSubscriber {\n private _throttled?: Subscription;\n private _sendValue?: T;\n private _hasValue = false;\n\n constructor(protected destination: Subscriber,\n private durationSelector: (value: T) => SubscribableOrPromise,\n private _leading: boolean,\n private _trailing: boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this._hasValue = true;\n this._sendValue = value;\n\n if (!this._throttled) {\n if (this._leading) {\n this.send();\n } else {\n this.throttle(value);\n }\n }\n }\n\n private send() {\n const { _hasValue, _sendValue } = this;\n if (_hasValue) {\n this.destination.next(_sendValue);\n this.throttle(_sendValue!);\n }\n this._hasValue = false;\n this._sendValue = undefined;\n }\n\n private throttle(value: T): void {\n const duration = this.tryDurationSelector(value);\n if (!!duration) {\n this.add(this._throttled = innerSubscribe(duration, new SimpleInnerSubscriber(this)));\n }\n }\n\n private tryDurationSelector(value: T): SubscribableOrPromise | null {\n try {\n return this.durationSelector(value);\n } catch (err) {\n this.destination.error(err);\n return null;\n }\n }\n\n private throttlingDone() {\n const { _throttled, _trailing } = this;\n if (_throttled) {\n _throttled.unsubscribe();\n }\n this._throttled = undefined;\n\n if (_trailing) {\n this.send();\n }\n }\n\n notifyNext(): void {\n this.throttlingDone();\n }\n\n notifyComplete(): void {\n this.throttlingDone();\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { async } from '../scheduler/async';\nimport { Observable } from '../Observable';\nimport { ThrottleConfig, defaultThrottleConfig } from './throttle';\nimport { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Emits a value from the source Observable, then ignores subsequent source\n * values for `duration` milliseconds, then repeats this process.\n *\n * Lets a value pass, then ignores source values for the\n * next `duration` milliseconds.\n *\n * ![](throttleTime.png)\n *\n * `throttleTime` emits the source Observable values on the output Observable\n * when its internal timer is disabled, and ignores source values when the timer\n * is enabled. Initially, the timer is disabled. As soon as the first source\n * value arrives, it is forwarded to the output Observable, and then the timer\n * is enabled. After `duration` milliseconds (or the time unit determined\n * internally by the optional `scheduler`) has passed, the timer is disabled,\n * and this process repeats for the next source value. Optionally takes a\n * {@link SchedulerLike} for managing timers.\n *\n * ## Examples\n *\n * #### Limit click rate\n *\n * Emit clicks at a rate of at most one click per second\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { throttleTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(throttleTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * #### Double Click\n *\n * The following example only emits clicks which happen within a subsequent\n * delay of 400ms of the previous click. This for example can emulate a double\n * click. It makes use of the `trailing` parameter of the throttle configuration.\n *\n * ```ts\n * import { fromEvent, asyncScheduler } from 'rxjs';\n * import { throttleTime, withLatestFrom } from 'rxjs/operators';\n *\n * // defaultThottleConfig = { leading: true, trailing: false }\n * const throttleConfig = {\n * leading: false,\n * trailing: true\n * }\n *\n * const click = fromEvent(document, 'click');\n * const doubleClick = click.pipe(\n * throttleTime(400, asyncScheduler, throttleConfig)\n * );\n *\n * doubleClick.subscribe((throttleValue: Event) => {\n * console.log(`Double-clicked! Timestamp: ${throttleValue.timeStamp}`);\n * });\n * ```\n *\n * If you enable the `leading` parameter in this example, the output would be the primary click and\n * the double click, but restricts additional clicks within 400ms.\n *\n * @see {@link auditTime}\n * @see {@link debounceTime}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttle}\n *\n * @param {number} duration Time to wait before emitting another value after\n * emitting the last value, measured in milliseconds or the time unit determined\n * internally by the optional `scheduler`.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the throttling.\n * @param {Object} config a configuration object to define `leading` and\n * `trailing` behavior. Defaults to `{ leading: true, trailing: false }`.\n * @return {Observable} An Observable that performs the throttle operation to\n * limit the rate of emissions from the source.\n * @method throttleTime\n * @owner Observable\n */\nexport function throttleTime(duration: number,\n scheduler: SchedulerLike = async,\n config: ThrottleConfig = defaultThrottleConfig): MonoTypeOperatorFunction {\n return (source: Observable) => source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));\n}\n\nclass ThrottleTimeOperator implements Operator {\n constructor(private duration: number,\n private scheduler: SchedulerLike,\n private leading: boolean,\n private trailing: boolean) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(\n new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing)\n );\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ThrottleTimeSubscriber extends Subscriber {\n private throttled: Subscription;\n private _hasTrailingValue: boolean = false;\n private _trailingValue: T = null;\n\n constructor(destination: Subscriber,\n private duration: number,\n private scheduler: SchedulerLike,\n private leading: boolean,\n private trailing: boolean) {\n super(destination);\n }\n\n protected _next(value: T) {\n if (this.throttled) {\n if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n } else {\n this.add(this.throttled = this.scheduler.schedule>(dispatchNext, this.duration, { subscriber: this }));\n if (this.leading) {\n this.destination.next(value);\n } else if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n }\n }\n\n protected _complete() {\n if (this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this.destination.complete();\n } else {\n this.destination.complete();\n }\n }\n\n clearThrottle() {\n const throttled = this.throttled;\n if (throttled) {\n if (this.trailing && this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this._trailingValue = null;\n this._hasTrailingValue = false;\n }\n throttled.unsubscribe();\n this.remove(throttled);\n this.throttled = null;\n }\n }\n}\n\ninterface DispatchArg {\n subscriber: ThrottleTimeSubscriber;\n}\n\nfunction dispatchNext(arg: DispatchArg) {\n const { subscriber } = arg;\n subscriber.clearThrottle();\n}\n","\nimport { Observable } from '../Observable';\nimport { async } from '../scheduler/async';\nimport { SchedulerLike, OperatorFunction } from '../types';\nimport { scan } from './scan';\nimport { defer } from '../observable/defer';\nimport { map } from './map';\n\n/**\n *\n * Emits an object containing the current value, and the time that has\n * passed between emitting the current value and the previous value, which is\n * calculated by using the provided `scheduler`'s `now()` method to retrieve\n * the current time at each emission, then calculating the difference. The `scheduler`\n * defaults to {@link asyncScheduler}, so by default, the `interval` will be in\n * milliseconds.\n *\n * Convert an Observable that emits items into one that\n * emits indications of the amount of time elapsed between those emissions.\n *\n * ![](timeinterval.png)\n *\n * ## Examples\n * Emit inteval between current value with the last value\n *\n * ```ts\n * const seconds = interval(1000);\n *\n * seconds.pipe(timeInterval())\n * .subscribe(\n * value => console.log(value),\n * err => console.log(err),\n * );\n *\n * seconds.pipe(timeout(900))\n * .subscribe(\n * value => console.log(value),\n * err => console.log(err),\n * );\n *\n * // NOTE: The values will never be this precise,\n * // intervals created with `interval` or `setInterval`\n * // are non-deterministic.\n *\n * // {value: 0, interval: 1000}\n * // {value: 1, interval: 1000}\n * // {value: 2, interval: 1000}\n * ```\n *\n * @param {SchedulerLike} [scheduler] Scheduler used to get the current time.\n * @return {Observable<{ interval: number, value: T }>} Observable that emit infomation about value and interval\n * @method timeInterval\n */\nexport function timeInterval(scheduler: SchedulerLike = async): OperatorFunction> {\n return (source: Observable) => defer(() => {\n return source.pipe(\n // TODO(benlesh): correct these typings.\n scan(\n ({ current }, value) => ({ value, current: scheduler.now(), last: current }),\n { current: scheduler.now(), value: undefined, last: undefined }\n ) as any,\n map>(({ current, last, value }) => new TimeInterval(value, current - last)),\n );\n });\n}\n\n// TODO(benlesh): make this an interface, export the interface, but not the implemented class,\n// there's no reason users should be manually creating this type.\n\n/**\n * @deprecated exposed API, use as interface only.\n */\nexport class TimeInterval {\n constructor(public value: T, public interval: number) {}\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { Observable } from '../Observable';\nimport { isDate } from '../util/isDate';\nimport { ObservableInput, OperatorFunction, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function timeoutWith(due: number | Date, withObservable: ObservableInput, scheduler?: SchedulerLike): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n *\n * Errors if Observable does not emit a value in given time span, in case of which\n * subscribes to the second Observable.\n *\n * It's a version of `timeout` operator that let's you specify fallback Observable.\n *\n * ![](timeoutWith.png)\n *\n * `timeoutWith` is a variation of `timeout` operator. It behaves exactly the same,\n * still accepting as a first argument either a number or a Date, which control - respectively -\n * when values of source Observable should be emitted or when it should complete.\n *\n * The only difference is that it accepts a second, required parameter. This parameter\n * should be an Observable which will be subscribed when source Observable fails any timeout check.\n * So whenever regular `timeout` would emit an error, `timeoutWith` will instead start re-emitting\n * values from second Observable. Note that this fallback Observable is not checked for timeouts\n * itself, so it can emit values and complete at arbitrary points in time. From the moment of a second\n * subscription, Observable returned from `timeoutWith` simply mirrors fallback stream. When that\n * stream completes, it completes as well.\n *\n * Scheduler, which in case of `timeout` is provided as as second argument, can be still provided\n * here - as a third, optional parameter. It still is used to schedule timeout checks and -\n * as a consequence - when second Observable will be subscribed, since subscription happens\n * immediately after failing check.\n *\n * ## Example\n * Add fallback observable\n * ```ts\n * import { interval } from 'rxjs';\n * import { timeoutWith } from 'rxjs/operators';\n *\n * const seconds = interval(1000);\n * const minutes = interval(60 * 1000);\n *\n * seconds.pipe(timeoutWith(900, minutes))\n * .subscribe(\n * value => console.log(value), // After 900ms, will start emitting `minutes`,\n * // since first value of `seconds` will not arrive fast enough.\n * err => console.log(err), // Would be called after 900ms in case of `timeout`,\n * // but here will never be called.\n * );\n * ```\n *\n * @param {number|Date} due Number specifying period within which Observable must emit values\n * or Date specifying before when Observable should complete\n * @param {Observable} withObservable Observable which will be subscribed if source fails timeout check.\n * @param {SchedulerLike} [scheduler] Scheduler controlling when timeout checks occur.\n * @return {Observable} Observable that mirrors behaviour of source or, when timeout check fails, of an Observable\n * passed as a second parameter.\n * @method timeoutWith\n * @owner Observable\n */\nexport function timeoutWith(due: number | Date,\n withObservable: ObservableInput,\n scheduler: SchedulerLike = async): OperatorFunction {\n return (source: Observable) => {\n let absoluteTimeout = isDate(due);\n let waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);\n return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));\n };\n}\n\nclass TimeoutWithOperator implements Operator {\n constructor(private waitFor: number,\n private absoluteTimeout: boolean,\n private withObservable: ObservableInput,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new TimeoutWithSubscriber(\n subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TimeoutWithSubscriber extends SimpleOuterSubscriber {\n\n private action?: SchedulerAction>;\n\n constructor(destination: Subscriber,\n private absoluteTimeout: boolean,\n private waitFor: number,\n private withObservable: ObservableInput,\n private scheduler: SchedulerLike) {\n super(destination);\n this.scheduleTimeout();\n }\n\n private static dispatchTimeout(subscriber: TimeoutWithSubscriber): void {\n const { withObservable } = subscriber;\n subscriber._unsubscribeAndRecycle();\n subscriber.add(innerSubscribe(withObservable, new SimpleInnerSubscriber(subscriber)));\n }\n\n private scheduleTimeout(): void {\n const { action } = this;\n if (action) {\n // Recycle the action if we've already scheduled one. All the production\n // Scheduler Actions mutate their state/delay time and return themeselves.\n // VirtualActions are immutable, so they create and return a clone. In this\n // case, we need to set the action reference to the most recent VirtualAction,\n // to ensure that's the one we clone from next time.\n this.action = (>> action.schedule(this, this.waitFor));\n } else {\n this.add(this.action = (>> this.scheduler.schedule>(\n TimeoutWithSubscriber.dispatchTimeout as any, this.waitFor, this\n )));\n }\n }\n\n protected _next(value: T): void {\n if (!this.absoluteTimeout) {\n this.scheduleTimeout();\n }\n super._next(value);\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.action = undefined;\n this.scheduler = null!;\n this.withObservable = null!;\n }\n}\n","import { async } from '../scheduler/async';\nimport { isDate } from '../util/isDate';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { TimeoutError } from '../util/TimeoutError';\nimport { MonoTypeOperatorFunction, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\nimport { timeoutWith } from './timeoutWith';\nimport { throwError } from '../observable/throwError';\n\n/**\n *\n * Errors if Observable does not emit a value in given time span.\n *\n * Timeouts on Observable that doesn't emit values fast enough.\n *\n * ![](timeout.png)\n *\n * `timeout` operator accepts as an argument either a number or a Date.\n *\n * If number was provided, it returns an Observable that behaves like a source\n * Observable, unless there is a period of time where there is no value emitted.\n * So if you provide `100` as argument and first value comes after 50ms from\n * the moment of subscription, this value will be simply re-emitted by the resulting\n * Observable. If however after that 100ms passes without a second value being emitted,\n * stream will end with an error and source Observable will be unsubscribed.\n * These checks are performed throughout whole lifecycle of Observable - from the moment\n * it was subscribed to, until it completes or errors itself. Thus every value must be\n * emitted within specified period since previous value.\n *\n * If provided argument was Date, returned Observable behaves differently. It throws\n * if Observable did not complete before provided Date. This means that periods between\n * emission of particular values do not matter in this case. If Observable did not complete\n * before provided Date, source Observable will be unsubscribed. Other than that, resulting\n * stream behaves just as source Observable.\n *\n * `timeout` accepts also a Scheduler as a second parameter. It is used to schedule moment (or moments)\n * when returned Observable will check if source stream emitted value or completed.\n *\n * ## Examples\n * Check if ticks are emitted within certain timespan\n * ```ts\n * import { interval } from 'rxjs';\n * import { timeout } from 'rxjs/operators';\n *\n * const seconds = interval(1000);\n *\n * seconds.pipe(timeout(1100)) // Let's use bigger timespan to be safe,\n * // since `interval` might fire a bit later then scheduled.\n * .subscribe(\n * value => console.log(value), // Will emit numbers just as regular `interval` would.\n * err => console.log(err), // Will never be called.\n * );\n *\n * seconds.pipe(timeout(900))\n * .subscribe(\n * value => console.log(value), // Will never be called.\n * err => console.log(err), // Will emit error before even first value is emitted,\n * // since it did not arrive within 900ms period.\n * );\n * ```\n *\n * Use Date to check if Observable completed\n * ```ts\n * import { interval } from 'rxjs';\n * import { timeout } from 'rxjs/operators';\n *\n * const seconds = interval(1000);\n *\n * seconds.pipe(\n * timeout(new Date(\"December 17, 2020 03:24:00\")),\n * )\n * .subscribe(\n * value => console.log(value), // Will emit values as regular `interval` would\n * // until December 17, 2020 at 03:24:00.\n * err => console.log(err) // On December 17, 2020 at 03:24:00 it will emit an error,\n * // since Observable did not complete by then.\n * );\n * ```\n * @see {@link timeoutWith}\n *\n * @param {number|Date} due Number specifying period within which Observable must emit values\n * or Date specifying before when Observable should complete\n * @param {SchedulerLike} [scheduler] Scheduler controlling when timeout checks occur.\n * @return {Observable} Observable that mirrors behaviour of source, unless timeout checks fail.\n * @method timeout\n * @owner Observable\n */\nexport function timeout(due: number | Date,\n scheduler: SchedulerLike = async): MonoTypeOperatorFunction {\n return timeoutWith(due, throwError(new TimeoutError()), scheduler);\n}\n","\nimport { async } from '../scheduler/async';\nimport { OperatorFunction, SchedulerLike, Timestamp as TimestampInterface } from '../types';\nimport { map } from './map';\n\n/**\n * Attaches a timestamp to each item emitted by an observable indicating when it was emitted\n *\n * The `timestamp` operator maps the *source* observable stream to an object of type\n * `{value: T, timestamp: R}`. The properties are generically typed. The `value` property contains the value\n * and type of the *source* observable. The `timestamp` is generated by the schedulers `now` function. By\n * default it uses the *async* scheduler which simply returns `Date.now()` (milliseconds since 1970/01/01\n * 00:00:00:000) and therefore is of type `number`.\n *\n * ![](timestamp.png)\n *\n * ## Example\n *\n * In this example there is a timestamp attached to the documents click event.\n *\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { timestamp } from 'rxjs/operators';\n *\n * const clickWithTimestamp = fromEvent(document, 'click').pipe(\n * timestamp()\n * );\n *\n * // Emits data of type {value: MouseEvent, timestamp: number}\n * clickWithTimestamp.subscribe(data => {\n * console.log(data);\n * });\n * ```\n *\n * @param scheduler\n * @return {Observable>|WebSocketSubject|Observable}\n * @method timestamp\n * @owner Observable\n */\nexport function timestamp(scheduler: SchedulerLike = async): OperatorFunction> {\n return map((value: T) => new Timestamp(value, scheduler.now()));\n // return (source: Observable) => source.lift(new TimestampOperator(scheduler));\n}\n\nexport class Timestamp implements TimestampInterface {\n constructor(public value: T, public timestamp: number) {\n }\n}\n","import { reduce } from './reduce';\nimport { OperatorFunction } from '../types';\n\nfunction toArrayReducer(arr: T[], item: T, index: number) {\n if (index === 0) {\n return [item];\n }\n arr.push(item);\n return arr;\n}\n\n/**\n * Collects all source emissions and emits them as an array when the source completes.\n *\n * Get all values inside an array when the source completes\n *\n * ![](toArray.png)\n *\n * `toArray` will wait until the source Observable completes before emitting\n * the array containing all emissions. When the source Observable errors no\n * array will be emitted.\n *\n * ## Example\n * ```ts\n * import { interval } from 'rxjs';\n * import { toArray, take } from 'rxjs/operators';\n *\n * const source = interval(1000);\n * const example = source.pipe(\n * take(10),\n * toArray()\n * );\n *\n * const subscribe = example.subscribe(val => console.log(val));\n *\n * // output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n *\n * ```\n* @return An array from an observable sequence.\n* @method toArray\n* @owner Observable\n*/\nexport function toArray(): OperatorFunction {\n return reduce(toArrayReducer, [] as T[]);\n}\n","import { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\nimport { Subject } from '../Subject';\nimport { Subscriber } from '../Subscriber';\nimport { Operator } from '../Operator';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Branch out the source Observable values as a nested Observable whenever\n * `windowBoundaries` emits.\n *\n * It's like {@link buffer}, but emits a nested Observable\n * instead of an array.\n *\n * ![](window.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits connected, non-overlapping\n * windows. It emits the current window and opens a new one whenever the\n * Observable `windowBoundaries` emits an item. Because each window is an\n * Observable, the output is a higher-order Observable.\n *\n * ## Example\n * In every window of 1 second each, emit at most 2 click events\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { window, mergeAll, map, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const sec = interval(1000);\n * const result = clicks.pipe(\n * window(sec),\n * map(win => win.pipe(take(2))), // each window has at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n * @see {@link windowCount}\n * @see {@link windowTime}\n * @see {@link windowToggle}\n * @see {@link windowWhen}\n * @see {@link buffer}\n *\n * @param {Observable} windowBoundaries An Observable that completes the\n * previous window and starts a new window.\n * @return {Observable>} An Observable of windows, which are\n * Observables emitting values of the source Observable.\n * @method window\n * @owner Observable\n */\nexport function window(windowBoundaries: Observable): OperatorFunction> {\n return function windowOperatorFunction(source: Observable) {\n return source.lift(new WindowOperator(windowBoundaries));\n };\n}\n\nclass WindowOperator implements Operator> {\n\n constructor(private windowBoundaries: Observable) {\n }\n\n call(subscriber: Subscriber>, source: any): any {\n const windowSubscriber = new WindowSubscriber(subscriber);\n const sourceSubscription = source.subscribe(windowSubscriber);\n if (!sourceSubscription.closed) {\n windowSubscriber.add(innerSubscribe(this.windowBoundaries, new SimpleInnerSubscriber(windowSubscriber)));\n }\n return sourceSubscription;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowSubscriber extends SimpleOuterSubscriber {\n\n private window: Subject = new Subject();\n\n constructor(destination: Subscriber>) {\n super(destination);\n destination.next(this.window);\n }\n\n notifyNext(): void {\n this.openWindow();\n }\n\n notifyError(error: any): void {\n this._error(error);\n }\n\n notifyComplete(): void {\n this._complete();\n }\n\n protected _next(value: T): void {\n this.window.next(value);\n }\n\n protected _error(err: any): void {\n this.window.error(err);\n this.destination.error!(err);\n }\n\n protected _complete(): void {\n this.window.complete();\n this.destination.complete!();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n this.window = null!;\n }\n\n private openWindow(): void {\n const prevWindow = this.window;\n if (prevWindow) {\n prevWindow.complete();\n }\n const destination = this.destination;\n const newWindow = this.window = new Subject();\n destination.next!(newWindow);\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { OperatorFunction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable with each\n * nested Observable emitting at most `windowSize` values.\n *\n * It's like {@link bufferCount}, but emits a nested\n * Observable instead of an array.\n *\n * ![](windowCount.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits windows every `startWindowEvery`\n * items, each containing no more than `windowSize` items. When the source\n * Observable completes or encounters an error, the output Observable emits\n * the current window and propagates the notification from the source\n * Observable. If `startWindowEvery` is not provided, then new windows are\n * started immediately at the start of the source and when each window completes\n * with size `windowSize`.\n *\n * ## Examples\n * Ignore every 3rd click event, starting from the first one\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { windowCount, map, mergeAll, skip } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowCount(3),\n * map(win => win.pipe(skip(1))), // skip first of every 3 clicks\n * mergeAll() // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Ignore every 3rd click event, starting from the third one\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { windowCount, mergeAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowCount(2, 3),\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowTime}\n * @see {@link windowToggle}\n * @see {@link windowWhen}\n * @see {@link bufferCount}\n *\n * @param {number} windowSize The maximum number of values emitted by each\n * window.\n * @param {number} [startWindowEvery] Interval at which to start a new window.\n * For example if `startWindowEvery` is `2`, then a new window will be started\n * on every other value from the source. A new window is started at the\n * beginning of the source by default.\n * @return {Observable>} An Observable of windows, which in turn\n * are Observable of values.\n * @method windowCount\n * @owner Observable\n */\nexport function windowCount(windowSize: number,\n startWindowEvery: number = 0): OperatorFunction> {\n return function windowCountOperatorFunction(source: Observable) {\n return source.lift(new WindowCountOperator(windowSize, startWindowEvery));\n };\n}\n\nclass WindowCountOperator implements Operator> {\n\n constructor(private windowSize: number,\n private startWindowEvery: number) {\n }\n\n call(subscriber: Subscriber>, source: any): any {\n return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowCountSubscriber extends Subscriber {\n private windows: Subject[] = [ new Subject() ];\n private count: number = 0;\n\n constructor(protected destination: Subscriber>,\n private windowSize: number,\n private startWindowEvery: number) {\n super(destination);\n destination.next(this.windows[0]);\n }\n\n protected _next(value: T) {\n const startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;\n const destination = this.destination;\n const windowSize = this.windowSize;\n const windows = this.windows;\n const len = windows.length;\n\n for (let i = 0; i < len && !this.closed; i++) {\n windows[i].next(value);\n }\n const c = this.count - windowSize + 1;\n if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {\n windows.shift().complete();\n }\n if (++this.count % startWindowEvery === 0 && !this.closed) {\n const window = new Subject();\n windows.push(window);\n destination.next(window);\n }\n }\n\n protected _error(err: any) {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().error(err);\n }\n }\n this.destination.error(err);\n }\n\n protected _complete() {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().complete();\n }\n }\n this.destination.complete();\n }\n\n protected _unsubscribe() {\n this.count = 0;\n this.windows = null;\n }\n}\n","import { Subject } from '../Subject';\nimport { Operator } from '../Operator';\nimport { async } from '../scheduler/async';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nimport { OperatorFunction, SchedulerLike, SchedulerAction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable periodically\n * in time.\n *\n * It's like {@link bufferTime}, but emits a nested\n * Observable instead of an array.\n *\n * ![](windowTime.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable starts a new window periodically, as\n * determined by the `windowCreationInterval` argument. It emits each window\n * after a fixed timespan, specified by the `windowTimeSpan` argument. When the\n * source Observable completes or encounters an error, the output Observable\n * emits the current window and propagates the notification from the source\n * Observable. If `windowCreationInterval` is not provided, the output\n * Observable starts a new window when the previous window of duration\n * `windowTimeSpan` completes. If `maxWindowCount` is provided, each window\n * will emit at most fixed number of values. Window will complete immediately\n * after emitting last value and next one still will open as specified by\n * `windowTimeSpan` and `windowCreationInterval` arguments.\n *\n * ## Examples\n * In every window of 1 second each, emit at most 2 click events\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { windowTime, map, mergeAll, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowTime(1000),\n * map(win => win.pipe(take(2))), // each window has at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Every 5 seconds start a window 1 second long, and emit at most 2 click events per window\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { windowTime, map, mergeAll, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowTime(1000, 5000),\n * map(win => win.pipe(take(2))), // each window has at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * Same as example above but with maxWindowCount instead of take\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { windowTime, mergeAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowTime(1000, 5000, 2), // each window has still at most 2 emissions\n * mergeAll(), // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowCount}\n * @see {@link windowToggle}\n * @see {@link windowWhen}\n * @see {@link bufferTime}\n *\n * @param {number} windowTimeSpan The amount of time to fill each window.\n * @param {number} [windowCreationInterval] The interval at which to start new\n * windows.\n * @param {number} [maxWindowSize=Number.POSITIVE_INFINITY] Max number of\n * values each window can emit before completion.\n * @param {SchedulerLike} [scheduler=async] The scheduler on which to schedule the\n * intervals that determine window boundaries.\n * @return {Observable>} An observable of windows, which in turn\n * are Observables.\n * @method windowTime\n * @owner Observable\n */\nexport function windowTime(windowTimeSpan: number,\n scheduler?: SchedulerLike): OperatorFunction>;\nexport function windowTime(windowTimeSpan: number,\n windowCreationInterval: number,\n scheduler?: SchedulerLike): OperatorFunction>;\nexport function windowTime(windowTimeSpan: number,\n windowCreationInterval: number,\n maxWindowSize: number,\n scheduler?: SchedulerLike): OperatorFunction>;\n\nexport function windowTime(windowTimeSpan: number): OperatorFunction> {\n let scheduler: SchedulerLike = async;\n let windowCreationInterval: number = null;\n let maxWindowSize: number = Number.POSITIVE_INFINITY;\n\n if (isScheduler(arguments[3])) {\n scheduler = arguments[3];\n }\n\n if (isScheduler(arguments[2])) {\n scheduler = arguments[2];\n } else if (isNumeric(arguments[2])) {\n maxWindowSize = Number(arguments[2]);\n }\n\n if (isScheduler(arguments[1])) {\n scheduler = arguments[1];\n } else if (isNumeric(arguments[1])) {\n windowCreationInterval = Number(arguments[1]);\n }\n\n return function windowTimeOperatorFunction(source: Observable) {\n return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));\n };\n}\n\nclass WindowTimeOperator implements Operator> {\n\n constructor(private windowTimeSpan: number,\n private windowCreationInterval: number | null,\n private maxWindowSize: number,\n private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber>, source: any): any {\n return source.subscribe(new WindowTimeSubscriber(\n subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler\n ));\n }\n}\n\ninterface CreationState {\n windowTimeSpan: number;\n windowCreationInterval: number;\n subscriber: WindowTimeSubscriber;\n scheduler: SchedulerLike;\n}\n\ninterface TimeSpanOnlyState {\n window: CountedSubject;\n windowTimeSpan: number;\n subscriber: WindowTimeSubscriber;\n }\n\ninterface CloseWindowContext {\n action: SchedulerAction>;\n subscription: Subscription;\n}\n\ninterface CloseState {\n subscriber: WindowTimeSubscriber;\n window: CountedSubject;\n context: CloseWindowContext;\n}\n\nclass CountedSubject extends Subject {\n private _numberOfNextedValues: number = 0;\n\n next(value?: T): void {\n this._numberOfNextedValues++;\n super.next(value);\n }\n\n get numberOfNextedValues(): number {\n return this._numberOfNextedValues;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowTimeSubscriber extends Subscriber {\n private windows: CountedSubject[] = [];\n\n constructor(protected destination: Subscriber>,\n private windowTimeSpan: number,\n private windowCreationInterval: number | null,\n private maxWindowSize: number,\n private scheduler: SchedulerLike) {\n super(destination);\n\n const window = this.openWindow();\n if (windowCreationInterval !== null && windowCreationInterval >= 0) {\n const closeState: CloseState = { subscriber: this, window, context: null };\n const creationState: CreationState = { windowTimeSpan, windowCreationInterval, subscriber: this, scheduler };\n this.add(scheduler.schedule>(dispatchWindowClose, windowTimeSpan, closeState));\n this.add(scheduler.schedule>(dispatchWindowCreation, windowCreationInterval, creationState));\n } else {\n const timeSpanOnlyState: TimeSpanOnlyState = { subscriber: this, window, windowTimeSpan };\n this.add(scheduler.schedule>(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));\n }\n }\n\n protected _next(value: T): void {\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len; i++) {\n const window = windows[i];\n if (!window.closed) {\n window.next(value);\n if (window.numberOfNextedValues >= this.maxWindowSize) {\n this.closeWindow(window);\n }\n }\n }\n }\n\n protected _error(err: any): void {\n const windows = this.windows;\n while (windows.length > 0) {\n windows.shift().error(err);\n }\n this.destination.error(err);\n }\n\n protected _complete(): void {\n const windows = this.windows;\n while (windows.length > 0) {\n const window = windows.shift();\n if (!window.closed) {\n window.complete();\n }\n }\n this.destination.complete();\n }\n\n public openWindow(): CountedSubject {\n const window = new CountedSubject();\n this.windows.push(window);\n const destination = this.destination;\n destination.next(window);\n return window;\n }\n\n public closeWindow(window: CountedSubject): void {\n window.complete();\n const windows = this.windows;\n windows.splice(windows.indexOf(window), 1);\n }\n}\n\nfunction dispatchWindowTimeSpanOnly(this: SchedulerAction>, state: TimeSpanOnlyState): void {\n const { subscriber, windowTimeSpan, window } = state;\n if (window) {\n subscriber.closeWindow(window);\n }\n state.window = subscriber.openWindow();\n this.schedule(state, windowTimeSpan);\n}\n\nfunction dispatchWindowCreation(this: SchedulerAction>, state: CreationState): void {\n const { windowTimeSpan, subscriber, scheduler, windowCreationInterval } = state;\n const window = subscriber.openWindow();\n const action = this;\n let context: CloseWindowContext = { action, subscription: null };\n const timeSpanState: CloseState = { subscriber, window, context };\n context.subscription = scheduler.schedule>(dispatchWindowClose, windowTimeSpan, timeSpanState);\n action.add(context.subscription);\n action.schedule(state, windowCreationInterval);\n}\n\nfunction dispatchWindowClose(state: CloseState): void {\n const { subscriber, window, context } = state;\n if (context && context.action && context.subscription) {\n context.action.remove(context.subscription);\n }\n subscriber.closeWindow(window);\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OperatorFunction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable starting from\n * an emission from `openings` and ending when the output of `closingSelector`\n * emits.\n *\n * It's like {@link bufferToggle}, but emits a nested\n * Observable instead of an array.\n *\n * ![](windowToggle.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits windows that contain those items\n * emitted by the source Observable between the time when the `openings`\n * Observable emits an item and when the Observable returned by\n * `closingSelector` emits an item.\n *\n * ## Example\n * Every other second, emit the click events from the next 500ms\n * ```ts\n * import { fromEvent, interval, EMPTY } from 'rxjs';\n * import { windowToggle, mergeAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const openings = interval(1000);\n * const result = clicks.pipe(\n * windowToggle(openings, i => i % 2 ? interval(500) : EMPTY),\n * mergeAll()\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowCount}\n * @see {@link windowTime}\n * @see {@link windowWhen}\n * @see {@link bufferToggle}\n *\n * @param {Observable} openings An observable of notifications to start new\n * windows.\n * @param {function(value: O): Observable} closingSelector A function that takes\n * the value emitted by the `openings` observable and returns an Observable,\n * which, when it emits (either `next` or `complete`), signals that the\n * associated window should complete.\n * @return {Observable>} An observable of windows, which in turn\n * are Observables.\n * @method windowToggle\n * @owner Observable\n */\nexport function windowToggle(openings: Observable,\n closingSelector: (openValue: O) => Observable): OperatorFunction> {\n return (source: Observable) => source.lift(new WindowToggleOperator(openings, closingSelector));\n}\n\nclass WindowToggleOperator implements Operator> {\n\n constructor(private openings: Observable,\n private closingSelector: (openValue: O) => Observable) {\n }\n\n call(subscriber: Subscriber>, source: any): any {\n return source.subscribe(new WindowToggleSubscriber(\n subscriber, this.openings, this.closingSelector\n ));\n }\n}\n\ninterface WindowContext {\n window: Subject;\n subscription: Subscription;\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowToggleSubscriber extends OuterSubscriber {\n private contexts: WindowContext[] = [];\n private openSubscription: Subscription;\n\n constructor(destination: Subscriber>,\n private openings: Observable,\n private closingSelector: (openValue: O) => Observable) {\n super(destination);\n this.add(this.openSubscription = subscribeToResult(this, openings, openings as any));\n }\n\n protected _next(value: T) {\n const { contexts } = this;\n if (contexts) {\n const len = contexts.length;\n for (let i = 0; i < len; i++) {\n contexts[i].window.next(value);\n }\n }\n }\n\n protected _error(err: any) {\n\n const { contexts } = this;\n this.contexts = null;\n\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n\n while (++index < len) {\n const context = contexts[index];\n context.window.error(err);\n context.subscription.unsubscribe();\n }\n }\n\n super._error(err);\n }\n\n protected _complete() {\n const { contexts } = this;\n this.contexts = null;\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n while (++index < len) {\n const context = contexts[index];\n context.window.complete();\n context.subscription.unsubscribe();\n }\n }\n super._complete();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n const { contexts } = this;\n this.contexts = null;\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n while (++index < len) {\n const context = contexts[index];\n context.window.unsubscribe();\n context.subscription.unsubscribe();\n }\n }\n }\n\n notifyNext(outerValue: any, innerValue: any,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber): void {\n\n if (outerValue === this.openings) {\n let closingNotifier;\n try {\n const { closingSelector } = this;\n closingNotifier = closingSelector(innerValue);\n } catch (e) {\n return this.error(e);\n }\n\n const window = new Subject();\n const subscription = new Subscription();\n const context = { window, subscription };\n this.contexts.push(context);\n const innerSubscription = subscribeToResult(this, closingNotifier, context as any);\n\n if (innerSubscription.closed) {\n this.closeWindow(this.contexts.length - 1);\n } else {\n (innerSubscription).context = context;\n subscription.add(innerSubscription);\n }\n\n this.destination.next(window);\n } else {\n this.closeWindow(this.contexts.indexOf(outerValue));\n }\n }\n\n notifyError(err: any): void {\n this.error(err);\n }\n\n notifyComplete(inner: Subscription): void {\n if (inner !== this.openSubscription) {\n this.closeWindow(this.contexts.indexOf(( inner).context));\n }\n }\n\n private closeWindow(index: number): void {\n if (index === -1) {\n return;\n }\n\n const { contexts } = this;\n const context = contexts[index];\n const { window, subscription } = context;\n contexts.splice(index, 1);\n window.complete();\n subscription.unsubscribe();\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OperatorFunction } from '../types';\n\n/**\n * Branch out the source Observable values as a nested Observable using a\n * factory function of closing Observables to determine when to start a new\n * window.\n *\n * It's like {@link bufferWhen}, but emits a nested\n * Observable instead of an array.\n *\n * ![](windowWhen.png)\n *\n * Returns an Observable that emits windows of items it collects from the source\n * Observable. The output Observable emits connected, non-overlapping windows.\n * It emits the current window and opens a new one whenever the Observable\n * produced by the specified `closingSelector` function emits an item. The first\n * window is opened immediately when subscribing to the output Observable.\n *\n * ## Example\n * Emit only the first two clicks events in every window of [1-5] random seconds\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { windowWhen, map, mergeAll, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * windowWhen(() => interval(1000 + Math.random() * 4000)),\n * map(win => win.pipe(take(2))), // each window has at most 2 emissions\n * mergeAll() // flatten the Observable-of-Observables\n * );\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link window}\n * @see {@link windowCount}\n * @see {@link windowTime}\n * @see {@link windowToggle}\n * @see {@link bufferWhen}\n *\n * @param {function(): Observable} closingSelector A function that takes no\n * arguments and returns an Observable that signals (on either `next` or\n * `complete`) when to close the previous window and start a new one.\n * @return {Observable>} An observable of windows, which in turn\n * are Observables.\n * @method windowWhen\n * @owner Observable\n */\nexport function windowWhen(closingSelector: () => Observable): OperatorFunction> {\n return function windowWhenOperatorFunction(source: Observable) {\n return source.lift(new WindowOperator(closingSelector));\n };\n}\n\nclass WindowOperator implements Operator> {\n constructor(private closingSelector: () => Observable) {\n }\n\n call(subscriber: Subscriber>, source: any): any {\n return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WindowSubscriber extends OuterSubscriber {\n private window?: Subject;\n private closingNotification?: Subscription;\n\n constructor(protected destination: Subscriber>,\n private closingSelector: () => Observable) {\n super(destination);\n this.openWindow();\n }\n\n notifyNext(_outerValue: T, _innerValue: any,\n _outerIndex: number, _innerIndex: number,\n innerSub: InnerSubscriber): void {\n this.openWindow(innerSub);\n }\n\n notifyError(error: any): void {\n this._error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber): void {\n this.openWindow(innerSub);\n }\n\n protected _next(value: T): void {\n this.window!.next(value);\n }\n\n protected _error(err: any): void {\n this.window!.error(err);\n this.destination.error(err);\n this.unsubscribeClosingNotification();\n }\n\n protected _complete(): void {\n this.window!.complete();\n this.destination.complete();\n this.unsubscribeClosingNotification();\n }\n\n private unsubscribeClosingNotification(): void {\n if (this.closingNotification) {\n this.closingNotification.unsubscribe();\n }\n }\n\n private openWindow(innerSub: InnerSubscriber | null = null): void {\n if (innerSub) {\n this.remove(innerSub);\n innerSub.unsubscribe();\n }\n\n const prevWindow = this.window;\n if (prevWindow) {\n prevWindow.complete();\n }\n\n const window = this.window = new Subject();\n this.destination.next(window);\n\n let closingNotifier;\n try {\n const { closingSelector } = this;\n closingNotifier = closingSelector();\n } catch (e) {\n this.destination.error(e);\n this.window.error(e);\n return;\n }\n this.add(this.closingNotification = subscribeToResult(this, closingNotifier));\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function withLatestFrom(project: (v1: T) => R): OperatorFunction;\nexport function withLatestFrom, R>(source2: O2, project: (v1: T, v2: ObservedValueOf) => R): OperatorFunction;\nexport function withLatestFrom, O3 extends ObservableInput, R>(v2: O2, v3: O3, project: (v1: T, v2: ObservedValueOf, v3: ObservedValueOf) => R): OperatorFunction;\nexport function withLatestFrom, O3 extends ObservableInput, O4 extends ObservableInput, R>(v2: O2, v3: O3, v4: O4, project: (v1: T, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf) => R): OperatorFunction;\nexport function withLatestFrom, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, R>(v2: O2, v3: O3, v4: O4, v5: O5, project: (v1: T, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf) => R): OperatorFunction;\nexport function withLatestFrom, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput, R>(v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, project: (v1: T, v2: ObservedValueOf, v3: ObservedValueOf, v4: ObservedValueOf, v5: ObservedValueOf, v6: ObservedValueOf) => R): OperatorFunction;\nexport function withLatestFrom>(source2: O2): OperatorFunction]>;\nexport function withLatestFrom, O3 extends ObservableInput>(v2: O2, v3: O3): OperatorFunction, ObservedValueOf]>;\nexport function withLatestFrom, O3 extends ObservableInput, O4 extends ObservableInput>(v2: O2, v3: O3, v4: O4): OperatorFunction, ObservedValueOf, ObservedValueOf]>;\nexport function withLatestFrom, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput>(v2: O2, v3: O3, v4: O4, v5: O5): OperatorFunction, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function withLatestFrom, O3 extends ObservableInput, O4 extends ObservableInput, O5 extends ObservableInput, O6 extends ObservableInput>(v2: O2, v3: O3, v4: O4, v5: O5, v6: O6): OperatorFunction, ObservedValueOf, ObservedValueOf, ObservedValueOf, ObservedValueOf]>;\nexport function withLatestFrom(...observables: Array | ((...values: Array) => R)>): OperatorFunction;\nexport function withLatestFrom(array: ObservableInput[]): OperatorFunction;\nexport function withLatestFrom(array: ObservableInput[], project: (...values: Array) => R): OperatorFunction;\n\n/* tslint:enable:max-line-length */\n\n/**\n * Combines the source Observable with other Observables to create an Observable\n * whose values are calculated from the latest values of each, only when the\n * source emits.\n *\n * Whenever the source Observable emits a value, it\n * computes a formula using that value plus the latest values from other input\n * Observables, then emits the output of that formula.\n *\n * ![](withLatestFrom.png)\n *\n * `withLatestFrom` combines each value from the source Observable (the\n * instance) with the latest values from the other input Observables only when\n * the source emits a value, optionally using a `project` function to determine\n * the value to be emitted on the output Observable. All input Observables must\n * emit at least one value before the output Observable will emit a value.\n *\n * ## Example\n * On every click event, emit an array with the latest timer event plus the click event\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { withLatestFrom } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const timer = interval(1000);\n * const result = clicks.pipe(withLatestFrom(timer));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineLatest}\n *\n * @param {ObservableInput} other An input Observable to combine with the source\n * Observable. More than one input Observables may be given as argument.\n * @param {Function} [project] Projection function for combining values\n * together. Receives all values in order of the Observables passed, where the\n * first parameter is a value from the source Observable. (e.g.\n * `a.pipe(withLatestFrom(b, c), map(([a1, b1, c1]) => a1 + b1 + c1))`). If this is not\n * passed, arrays will be emitted on the output Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n * @method withLatestFrom\n * @owner Observable\n */\nexport function withLatestFrom(...args: Array | ((...values: Array) => R)>): OperatorFunction {\n return (source: Observable) => {\n let project: any;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n const observables = []>args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\n\nclass WithLatestFromOperator implements Operator {\n constructor(private observables: Observable[],\n private project?: (...values: any[]) => Observable) {\n }\n\n call(subscriber: Subscriber, source: any): any {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WithLatestFromSubscriber extends OuterSubscriber {\n private values: any[];\n private toRespond: number[] = [];\n\n constructor(destination: Subscriber,\n private observables: Observable[],\n private project?: (...values: any[]) => Observable) {\n super(destination);\n const len = observables.length;\n this.values = new Array(len);\n\n for (let i = 0; i < len; i++) {\n this.toRespond.push(i);\n }\n\n for (let i = 0; i < len; i++) {\n let observable = observables[i];\n this.add(subscribeToResult(this, observable, undefined, i));\n }\n }\n\n notifyNext(_outerValue: T, innerValue: R,\n outerIndex: number): void {\n this.values[outerIndex] = innerValue;\n const toRespond = this.toRespond;\n if (toRespond.length > 0) {\n const found = toRespond.indexOf(outerIndex);\n if (found !== -1) {\n toRespond.splice(found, 1);\n }\n }\n }\n\n notifyComplete() {\n // noop\n }\n\n protected _next(value: T) {\n if (this.toRespond.length === 0) {\n const args = [value, ...this.values];\n if (this.project) {\n this._tryProject(args);\n } else {\n this.destination.next!(args);\n }\n }\n }\n\n private _tryProject(args: any[]) {\n let result: any;\n try {\n result = this.project!.apply(this, args);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.destination.next!(result);\n }\n}\n","import { zip as zipStatic } from '../observable/zip';\nimport { Observable } from '../Observable';\nimport { ObservableInput, OperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(project: (v1: T) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, project: (v1: T, v2: T2) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput, project: (v1: T, v2: T2, v3: T3) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R): OperatorFunction ;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput): OperatorFunction ;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(...observables: Array | ((...values: Array) => R)>): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(array: Array>): OperatorFunction;\n/** @deprecated Deprecated in favor of static zip. */\nexport function zip(array: Array>, project: (v1: T, ...values: Array) => R): OperatorFunction;\n/* tslint:enable:max-line-length */\n\n/**\n * @deprecated Deprecated in favor of static {@link zip}.\n */\nexport function zip(...observables: Array | ((...values: Array) => R)>): OperatorFunction {\n return function zipOperatorFunction(source: Observable) {\n return source.lift.call(zipStatic(source, ...observables));\n };\n}","import { ZipOperator } from '../observable/zip';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, ObservableInput } from '../types';\n\nexport function zipAll(): OperatorFunction, T[]>;\nexport function zipAll(): OperatorFunction;\nexport function zipAll(project: (...values: T[]) => R): OperatorFunction, R>;\nexport function zipAll(project: (...values: Array) => R): OperatorFunction;\n\nexport function zipAll(project?: (...values: Array) => R): OperatorFunction {\n return (source: Observable) => source.lift(new ZipOperator(project));\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/* eslint-disable node/no-deprecated-api */\n\n'use strict'\n\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\nvar safer = {}\n\nvar key\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue\n if (key === 'SlowBuffer' || key === 'Buffer') continue\n safer[key] = buffer[key]\n}\n\nvar Safer = safer.Buffer = {}\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue\n Safer[key] = Buffer[key]\n}\n\nsafer.Buffer.prototype = Buffer.prototype\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + typeof value)\n }\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)\n }\n return Buffer(value, encodingOrOffset, length)\n }\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size)\n }\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n var buf = Buffer(size)\n if (!fill || fill.length === 0) {\n buf.fill(0)\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n return buf\n }\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength\n } catch (e) {\n // we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength\n }\n}\n\nmodule.exports = safer\n","/** @license React v0.20.2\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f,g,h,k;if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}\nif(\"undefined\"===typeof window||\"function\"!==typeof MessageChannel){var t=null,u=null,w=function(){if(null!==t)try{var a=exports.unstable_now();t(!0,a);t=null}catch(b){throw setTimeout(w,0),b;}};f=function(a){null!==t?setTimeout(f,0,a):(t=a,setTimeout(w,0))};g=function(a,b){u=setTimeout(a,b)};h=function(){clearTimeout(u)};exports.unstable_shouldYield=function(){return!1};k=exports.unstable_forceFrameRate=function(){}}else{var x=window.setTimeout,y=window.clearTimeout;if(\"undefined\"!==typeof console){var z=\nwindow.cancelAnimationFrame;\"function\"!==typeof window.requestAnimationFrame&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\");\"function\"!==typeof z&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\")}var A=!1,B=null,C=-1,D=5,E=0;exports.unstable_shouldYield=function(){return exports.unstable_now()>=\nE};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;\nfunction T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M)}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else{var b=J(M);null!==b&&g(U,b.startTime-a)}}\nfunction V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if(\"function\"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?O.callback=e:O===J(L)&&K(L);T(b)}else K(L);O=J(L)}if(null!==O)var m=!0;else{var n=J(M);null!==n&&g(U,n.startTime-b);m=!1}return m}finally{O=null,P=c,Q=!1}}var W=k;exports.unstable_IdlePriority=5;\nexports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V))};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)};\nexports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P}var c=P;P=b;try{return a()}finally{P=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=P;P=a;try{return b()}finally{P=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();\"object\"===typeof c&&null!==c?(c=c.delay,c=\"number\"===typeof c&&0d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a};\nexports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","\"use strict\";\n\n(function(root) {\n const MAX_VALUE = 0x7fffffff;\n\n // The SHA256 and PBKDF2 implementation are from scrypt-async-js:\n // See: https://github.com/dchest/scrypt-async-js\n function SHA256(m) {\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n\n let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const w = new Uint32Array(64);\n\n function blocks(p) {\n let off = 0, len = p.length;\n while (len >= 64) {\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n let i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi >>> 24) & 0xff);\n p.push((bitLenHi >>> 16) & 0xff);\n p.push((bitLenHi >>> 8) & 0xff);\n p.push((bitLenHi >>> 0) & 0xff);\n p.push((bitLenLo >>> 24) & 0xff);\n p.push((bitLenLo >>> 16) & 0xff);\n p.push((bitLenLo >>> 8) & 0xff);\n p.push((bitLenLo >>> 0) & 0xff);\n\n blocks(p);\n\n return [\n (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n ];\n }\n\n function PBKDF2_HMAC_SHA256_OneIter(password, salt, dkLen) {\n // compress password if it's longer than hash block length\n password = (password.length <= 64) ? password : SHA256(password);\n\n const innerLen = 64 + salt.length + 4;\n const inner = new Array(innerLen);\n const outerKey = new Array(64);\n\n let i;\n let dk = [];\n\n // inner = (password ^ ipad) || salt || counter\n for (i = 0; i < 64; i++) { inner[i] = 0x36; }\n for (i = 0; i < password.length; i++) { inner[i] ^= password[i]; }\n for (i = 0; i < salt.length; i++) { inner[64 + i] = salt[i]; }\n for (i = innerLen - 4; i < innerLen; i++) { inner[i] = 0; }\n\n // outerKey = password ^ opad\n for (i = 0; i < 64; i++) outerKey[i] = 0x5c;\n for (i = 0; i < password.length; i++) outerKey[i] ^= password[i];\n\n // increments counter inside inner\n function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }\n\n // output blocks = SHA256(outerKey || SHA256(inner)) ...\n while (dkLen >= 32) {\n incrementCounter();\n dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))));\n dkLen -= 32;\n }\n if (dkLen > 0) {\n incrementCounter();\n dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen));\n }\n\n return dk;\n }\n\n // The following is an adaptation of scryptsy\n // See: https://www.npmjs.com/package/scryptsy\n function blockmix_salsa8(BY, Yi, r, x, _X) {\n let i;\n\n arraycopy(BY, (2 * r - 1) * 16, _X, 0, 16);\n for (i = 0; i < 2 * r; i++) {\n blockxor(BY, i * 16, _X, 16);\n salsa20_8(_X, x);\n arraycopy(_X, 0, BY, Yi + (i * 16), 16);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy(BY, Yi + (i * 2) * 16, BY, (i * 16), 16);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy(BY, Yi + (i * 2 + 1) * 16, BY, (i + r) * 16, 16);\n }\n }\n\n function R(a, b) {\n return (a << b) | (a >>> (32 - b));\n }\n\n function salsa20_8(B, x) {\n arraycopy(B, 0, x, 0, 16);\n\n for (let i = 8; i > 0; i -= 2) {\n x[ 4] ^= R(x[ 0] + x[12], 7);\n x[ 8] ^= R(x[ 4] + x[ 0], 9);\n x[12] ^= R(x[ 8] + x[ 4], 13);\n x[ 0] ^= R(x[12] + x[ 8], 18);\n x[ 9] ^= R(x[ 5] + x[ 1], 7);\n x[13] ^= R(x[ 9] + x[ 5], 9);\n x[ 1] ^= R(x[13] + x[ 9], 13);\n x[ 5] ^= R(x[ 1] + x[13], 18);\n x[14] ^= R(x[10] + x[ 6], 7);\n x[ 2] ^= R(x[14] + x[10], 9);\n x[ 6] ^= R(x[ 2] + x[14], 13);\n x[10] ^= R(x[ 6] + x[ 2], 18);\n x[ 3] ^= R(x[15] + x[11], 7);\n x[ 7] ^= R(x[ 3] + x[15], 9);\n x[11] ^= R(x[ 7] + x[ 3], 13);\n x[15] ^= R(x[11] + x[ 7], 18);\n x[ 1] ^= R(x[ 0] + x[ 3], 7);\n x[ 2] ^= R(x[ 1] + x[ 0], 9);\n x[ 3] ^= R(x[ 2] + x[ 1], 13);\n x[ 0] ^= R(x[ 3] + x[ 2], 18);\n x[ 6] ^= R(x[ 5] + x[ 4], 7);\n x[ 7] ^= R(x[ 6] + x[ 5], 9);\n x[ 4] ^= R(x[ 7] + x[ 6], 13);\n x[ 5] ^= R(x[ 4] + x[ 7], 18);\n x[11] ^= R(x[10] + x[ 9], 7);\n x[ 8] ^= R(x[11] + x[10], 9);\n x[ 9] ^= R(x[ 8] + x[11], 13);\n x[10] ^= R(x[ 9] + x[ 8], 18);\n x[12] ^= R(x[15] + x[14], 7);\n x[13] ^= R(x[12] + x[15], 9);\n x[14] ^= R(x[13] + x[12], 13);\n x[15] ^= R(x[14] + x[13], 18);\n }\n\n for (let i = 0; i < 16; ++i) {\n B[i] += x[i];\n }\n }\n\n // naive approach... going back to loop unrolling may yield additional performance\n function blockxor(S, Si, D, len) {\n for (let i = 0; i < len; i++) {\n D[i] ^= S[Si + i]\n }\n }\n\n function arraycopy(src, srcPos, dest, destPos, length) {\n while (length--) {\n dest[destPos++] = src[srcPos++];\n }\n }\n\n function checkBufferish(o) {\n if (!o || typeof(o.length) !== 'number') { return false; }\n\n for (let i = 0; i < o.length; i++) {\n const v = o[i];\n if (typeof(v) !== 'number' || v % 1 || v < 0 || v >= 256) {\n return false;\n }\n }\n\n return true;\n }\n\n function ensureInteger(value, name) {\n if (typeof(value) !== \"number\" || (value % 1)) { throw new Error('invalid ' + name); }\n return value;\n }\n\n // N = Cpu cost, r = Memory cost, p = parallelization cost\n // callback(error, progress, key)\n function _scrypt(password, salt, N, r, p, dkLen, callback) {\n\n N = ensureInteger(N, 'N');\n r = ensureInteger(r, 'r');\n p = ensureInteger(p, 'p');\n\n dkLen = ensureInteger(dkLen, 'dkLen');\n\n if (N === 0 || (N & (N - 1)) !== 0) { throw new Error('N must be power of 2'); }\n\n if (N > MAX_VALUE / 128 / r) { throw new Error('N too large'); }\n if (r > MAX_VALUE / 128 / p) { throw new Error('r too large'); }\n\n if (!checkBufferish(password)) {\n throw new Error('password must be an array or buffer');\n }\n password = Array.prototype.slice.call(password);\n\n if (!checkBufferish(salt)) {\n throw new Error('salt must be an array or buffer');\n }\n salt = Array.prototype.slice.call(salt);\n\n let b = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r);\n const B = new Uint32Array(p * 32 * r)\n for (let i = 0; i < B.length; i++) {\n const j = i * 4;\n B[i] = ((b[j + 3] & 0xff) << 24) |\n ((b[j + 2] & 0xff) << 16) |\n ((b[j + 1] & 0xff) << 8) |\n ((b[j + 0] & 0xff) << 0);\n }\n\n const XY = new Uint32Array(64 * r);\n const V = new Uint32Array(32 * r * N);\n\n const Yi = 32 * r;\n\n // scratch space\n const x = new Uint32Array(16); // salsa20_8\n const _X = new Uint32Array(16); // blockmix_salsa8\n\n const totalOps = p * N * 2;\n let currentOp = 0;\n let lastPercent10 = null;\n\n // Set this to true to abandon the scrypt on the next step\n let stop = false;\n\n // State information\n let state = 0;\n let i0 = 0, i1;\n let Bi;\n\n // How many blockmix_salsa8 can we do per step?\n const limit = callback ? parseInt(1000 / r): 0xffffffff;\n\n // Trick from scrypt-async; if there is a setImmediate shim in place, use it\n const nextTick = (typeof(setImmediate) !== 'undefined') ? setImmediate : setTimeout;\n\n // This is really all I changed; making scryptsy a state machine so we occasionally\n // stop and give other evnts on the evnt loop a chance to run. ~RicMoo\n const incrementalSMix = function() {\n if (stop) {\n return callback(new Error('cancelled'), currentOp / totalOps);\n }\n\n let steps;\n\n switch (state) {\n case 0:\n // for (var i = 0; i < p; i++)...\n Bi = i0 * 32 * r;\n\n arraycopy(B, Bi, XY, 0, Yi); // ROMix - 1\n\n state = 1; // Move to ROMix 2\n i1 = 0;\n\n // Fall through\n\n case 1:\n\n // Run up to 1000 steps of the first inner smix loop\n steps = N - i1;\n if (steps > limit) { steps = limit; }\n for (let i = 0; i < steps; i++) { // ROMix - 2\n arraycopy(XY, 0, V, (i1 + i) * Yi, Yi) // ROMix - 3\n blockmix_salsa8(XY, Yi, r, x, _X); // ROMix - 4\n }\n\n // for (var i = 0; i < N; i++)\n i1 += steps;\n currentOp += steps;\n\n if (callback) {\n // Call the callback with the progress (optionally stopping us)\n const percent10 = parseInt(1000 * currentOp / totalOps);\n if (percent10 !== lastPercent10) {\n stop = callback(null, currentOp / totalOps);\n if (stop) { break; }\n lastPercent10 = percent10;\n }\n }\n\n if (i1 < N) { break; }\n\n i1 = 0; // Move to ROMix 6\n state = 2;\n\n // Fall through\n\n case 2:\n\n // Run up to 1000 steps of the second inner smix loop\n steps = N - i1;\n if (steps > limit) { steps = limit; }\n for (let i = 0; i < steps; i++) { // ROMix - 6\n const offset = (2 * r - 1) * 16; // ROMix - 7\n const j = XY[offset] & (N - 1);\n blockxor(V, j * Yi, XY, Yi); // ROMix - 8 (inner)\n blockmix_salsa8(XY, Yi, r, x, _X); // ROMix - 9 (outer)\n }\n\n // for (var i = 0; i < N; i++)...\n i1 += steps;\n currentOp += steps;\n\n // Call the callback with the progress (optionally stopping us)\n if (callback) {\n const percent10 = parseInt(1000 * currentOp / totalOps);\n if (percent10 !== lastPercent10) {\n stop = callback(null, currentOp / totalOps);\n if (stop) { break; }\n lastPercent10 = percent10;\n }\n }\n\n if (i1 < N) { break; }\n\n arraycopy(XY, 0, B, Bi, Yi); // ROMix - 10\n\n // for (var i = 0; i < p; i++)...\n i0++;\n if (i0 < p) {\n state = 0;\n break;\n }\n\n b = [];\n for (let i = 0; i < B.length; i++) {\n b.push((B[i] >> 0) & 0xff);\n b.push((B[i] >> 8) & 0xff);\n b.push((B[i] >> 16) & 0xff);\n b.push((B[i] >> 24) & 0xff);\n }\n\n const derivedKey = PBKDF2_HMAC_SHA256_OneIter(password, b, dkLen);\n\n // Send the result to the callback\n if (callback) { callback(null, 1.0, derivedKey); }\n\n // Done; don't break (which would reschedule)\n return derivedKey;\n }\n\n // Schedule the next steps\n if (callback) { nextTick(incrementalSMix); }\n }\n\n // Run the smix state machine until completion\n if (!callback) {\n while (true) {\n const derivedKey = incrementalSMix();\n if (derivedKey != undefined) { return derivedKey; }\n }\n }\n\n // Bootstrap the async incremental smix\n incrementalSMix();\n }\n\n const lib = {\n scrypt: function(password, salt, N, r, p, dkLen, progressCallback) {\n return new Promise(function(resolve, reject) {\n let lastProgress = 0;\n if (progressCallback) { progressCallback(0); }\n _scrypt(password, salt, N, r, p, dkLen, function(error, progress, key) {\n if (error) {\n reject(error);\n } else if (key) {\n if (progressCallback && lastProgress !== 1) {\n progressCallback(1);\n }\n resolve(new Uint8Array(key));\n } else if (progressCallback && progress !== lastProgress) {\n lastProgress = progress;\n return progressCallback(progress);\n }\n });\n });\n },\n syncScrypt: function(password, salt, N, r, p, dkLen) {\n return new Uint8Array(_scrypt(password, salt, N, r, p, dkLen));\n }\n };\n\n // node.js\n if (typeof(exports) !== 'undefined') {\n module.exports = lib;\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define(lib);\n\n // Web Browsers\n } else if (root) {\n\n // If there was an existing library \"scrypt\", make sure it is still available\n if (root.scrypt) {\n root._scrypt = root.scrypt;\n }\n\n root.scrypt = lib;\n }\n\n})(this);\n","/**\n * Work around Safari 14 IndexedDB open bug.\n *\n * Safari has a horrible bug where IDB requests can hang while the browser is starting up. https://bugs.webkit.org/show_bug.cgi?id=226547\n * The only solution is to keep nudging it until it's awake.\n */\nfunction idbReady() {\n var isSafari = !navigator.userAgentData &&\n /Safari\\//.test(navigator.userAgent) &&\n !/Chrom(e|ium)\\//.test(navigator.userAgent);\n // No point putting other browsers or older versions of Safari through this mess.\n if (!isSafari || !indexedDB.databases)\n return Promise.resolve();\n var intervalId;\n return new Promise(function (resolve) {\n var tryIdb = function () { return indexedDB.databases().finally(resolve); };\n intervalId = setInterval(tryIdb, 100);\n tryIdb();\n }).finally(function () { return clearInterval(intervalId); });\n}\n\nexport default idbReady;\n"],"names":["Buffer","require","inherits","HashBase","ARRAY16","Array","zl","zr","sl","sr","hl","hr","RIPEMD160","call","this","_a","_b","_c","_d","_e","rotl","x","n","fn1","a","b","c","d","e","m","k","s","fn2","fn3","fn4","fn5","prototype","_update","words","j","_block","readInt32LE","al","bl","cl","dl","el","ar","br","cr","dr","er","i","tl","tr","t","_digest","_blockOffset","fill","writeUInt32LE","_length","buffer","alloc","writeInt32LE","module","exports","safeParseInt","v","base","Error","parseInt","encodeLength","len","offset","from","hexLength","intToHex","firstByte","length","_decode","input","llength","data","innerRemainder","decoded","slice","remainder","toString","push","totalLength","isHexPrefixed","str","integer","hex","toBuffer","isBuffer","intToBuffer","undefined","Uint8Array","bn_js_1","isBN","toArray","encode","isArray","output","buf","concat","inputBuf","stream","inputBuffer","assert","val","msg","ctor","superCtor","super_","TempCtor","constructor","BN","number","endian","negative","red","_init","wordSize","window","parseHex4Bits","string","index","charCodeAt","parseHexByte","lowerBound","r","parseBase","start","end","mul","Math","min","move","dest","src","num","max","left","right","cmp","_initNumber","_initArray","replace","_parseHex","_parseBase","ceil","w","off","_strip","limbLen","limbPow","total","mod","word","imuln","_iaddn","pow","copy","_move","clone","_expand","size","_normSign","Symbol","for","inspect","zeros","groupSizes","groupBases","padding","out","carry","groupSize","groupBase","isZero","modrn","idivn","toNumber","ret","toJSON","toArrayLike","smallMulTo","self","lo","ncarry","rword","maxJ","ArrayType","byteLength","reqLength","res","allocUnsafe","allocate","_toArrayLikeLE","position","shift","_toArrayLikeBE","clz32","_countBits","_zeroBits","bitLength","hi","zeroBits","toTwos","width","abs","inotn","iaddn","fromTwos","testn","notn","ineg","isNeg","neg","iuor","ior","or","uor","iuand","iand","and","uand","iuxor","ixor","xor","uxor","bytesNeeded","bitsLeft","setn","bit","wbit","iadd","isub","add","sub","comb10MulTo","mid","o","a0","al0","ah0","a1","al1","ah1","a2","al2","ah2","a3","al3","ah3","a4","al4","ah4","a5","al5","ah5","a6","al6","ah6","a7","al7","ah7","a8","al8","ah8","a9","al9","ah9","b0","bl0","bh0","b1","bl1","bh1","b2","bl2","bh2","b3","bl3","bh3","b4","bl4","bh4","b5","bl5","bh5","b6","bl6","bh6","b7","bl7","bh7","b8","bl8","bh8","b9","bl9","bh9","w0","imul","w1","w2","w3","w4","w5","w6","w7","w8","w9","w10","w11","w12","w13","w14","w15","w16","w17","w18","bigMulTo","hncarry","jumboMulTo","FFTM","y","mulTo","makeRBT","N","l","revBin","rb","permute","rbt","rws","iws","rtws","itws","transform","rtwdf","cos","PI","itwdf","sin","p","rtwdf_","itwdf_","re","ie","ro","io","rx","guessLen13b","odd","conjugate","normalize13b","ws","round","convert13b","stub","ph","mulp","_","rwst","iwst","nrws","nrwst","niwst","rmws","mulf","isNegNum","muln","sqr","isqr","toBitArray","q","iushln","bits","carryMask","newCarry","ishln","iushrn","hint","extended","h","mask","maskedWords","ishrn","shln","ushln","shrn","ushrn","imaskn","maskn","isubn","addn","subn","iabs","_ishlnsubmul","_wordDiv","mode","bhi","diff","qj","div","divmod","positive","divn","umod","divRound","dm","half","r2","andln","acc","modn","egcd","A","B","C","D","g","isEven","yp","xp","im","isOdd","jm","gcd","_invmp","x1","x2","delta","cmpn","invm","bincn","ucmp","gtn","gt","gten","gte","ltn","lt","lten","lte","eqn","eq","Red","toRed","ctx","convertTo","_forceRed","fromRed","convertFrom","forceRed","redAdd","redIAdd","redSub","redISub","redShl","shl","redMul","_verify2","redIMul","redSqr","_verify1","redISqr","redSqrt","sqrt","redInvm","redNeg","redPow","primes","k256","p224","p192","p25519","MPrime","name","tmp","_tmp","K256","P224","P192","P25519","prime","_prime","Mont","imod","rinv","minv","ireduce","rlen","split","imulK","strip","outLen","prev","next","mod3","one","nOne","lpow","z","inv","wnd","current","currentLen","mont","u","AnimationFrameAction","_super","scheduler","work","_this","tslib_1","delay","requestAsyncId","id","requestAnimationFrame","cancelAnimationFrame","AsyncAction","AnimationFrameScheduler","active","error","actions","action","count","AsyncScheduler","animationFrameScheduler","VirtualTimeScheduler","SchedulerAction","maxFrames","Number","flush","frame","VirtualAction","schedule","state","recycleAsyncId","isObservable","obj","bindCallback","callbackFunc","resultSelector","isScheduler","subject","context","params","Observable","args","subscriber","AsyncSubject","handler","_i","innerArgs","err","canReportError","console","dispatch","value","dispatchNext","bindNodeCallback","arg","dispatchError","sources","first_1","isObject","Object","pop","forkJoinInternal","values","completed","_loop_1","source","hasValue","emitted","keys","fromEvent","target","eventName","options","isFunction","setupSubscription","arguments","sourceObj","unsubscribe","isEventTarget","isJQueryStyleEventEmitter","isNodeStyleEventEmitter","fromEventPattern","addHandler","removeHandler","retValue","generate","initialStateOrOptions","condition","iterate","resultSelectorOrObservable","initialState","identity","conditionResult","trueResult","period","async","counter","never","first","subscribe","complete","pairs","subscription","key","closed","partition","predicate","thisArg","filter","subscribeTo","using","resourceFactory","observableFactory","resource","result","EMPTY","_subscribe","thrownError","hasCompleted","hasNext","BehaviorSubject","_value","configurable","getValue","NotificationKind","Notification","kind","observe","observer","do","accept","nextOrObserver","toObservable","of","throwError","_isScalar","lift","operator","observable","sink","Subscriber","config","syncErrorThrowable","syncErrorThrown","forEach","promiseCtor","reject","resolve","Symbol_observable","operations","toPromise","create","getPromiseCtor","empty","hostReportError","OuterSubscriber","notifyNext","notifyError","notifyComplete","ReplaySubject","bufferSize","windowTime","nextInfiniteTimeWindow","_events","nextTimeWindow","_getNow","_infiniteTimeWindow","SubjectSubscription","queue","now","_trimBufferThenGetEvents","_bufferSize","_windowTime","spliceCount","time","eventsCount","ReplayEvent","SubjectSubscriber","destination","Subject","rxSubscriberSymbol","AnonymousSubject","observers","hasError","isStopped","_trySubscribe","asObservable","subscriberIndex","destinationOrNext","emptyObserver","_next","_error","_complete","_parentOrParents","SafeSubscriber","_parentSubscriber","observerOrNext","_context","useDeprecatedSynchronousErrorHandling","__tryOrSetError","__tryOrUnsub","syncErrorValue","wrappedComplete","fn","parent","Subscription","_subscriptions","_ctorUnsubscribe","errors","_unsubscribe","parent_1","UnsubscriptionError","teardown","indexOf","subscriptions","remove","subscriptionIndex","flattenUnsubscriptionErrors","Promise","_enable_super_gross_mode_that_will_cause_bad_things","SimpleInnerSubscriber","SimpleOuterSubscriber","innerSubscribe","innerSubscriber","ConnectableObservable","subjectFactory","getSubject","_subject","connect","connection","_connection","refCount","connectableObservableDescriptor","_refCount","writable","connectableProto","_isComplete","ConnectableSubscriber","connectable","observables","CombineLatestOperator","CombineLatestSubscriber","NONE","toRespond","oldVal","innerValue","defer","fromArray","concurrent","last","RaceOperator","RaceSubscriber","hasFirst","outerIndex","dueTime","periodOrScheduler","ZipOperator","ZipSubscriber","iterators","StaticArrayIterator","StaticIterator","iterator","notifyInactive","checkIterators","shouldComplete","_tryresultSelector","apply","array","done","ZipBufferIterator","isComplete","concatAll","FilterOperator","FilterSubscriber","groupBy","keySelector","elementSelector","durationSelector","subjectSelector","GroupByOperator","GroupBySubscriber","_group","groups","element","group","groupedObservable","duration","removeGroup","attemptedToUnsubscribe","GroupDurationSubscriber","GroupedObservable","refCountSubscription","groupSubject","InnerRefCountSubscription","map","project","MapOperator","MapSubscriber","MergeMapOperator","MergeMapSubscriber","_tryNext","_innerSub","innerSubscription","ObserveOnOperator","notification","ObserveOnSubscriber","scheduleMessage","RefCountOperator","refCounter","RefCountSubscriber","sharedConnection","scheduleArray","scheduled","isInteropObservable","Symbol_iterator","setInterval","clearInterval","execute","pending","_execute","errored","errorValue","Action","Scheduler","nextHandle","RESOLVED","findAndClearHandle","handle","activeHandles","cb","AsapAction","Immediate","AsapScheduler","asapScheduler","asyncScheduler","QueueAction","QueueScheduler","queueScheduler","getSymbolIterator","ArgumentOutOfRangeErrorImpl","message","EmptyErrorImpl","ObjectUnsubscribedErrorImpl","TimeoutErrorImpl","UnsubscriptionErrorImpl","closed_1","setTimeout","isNumeric","isPromise","not","pred","notPred","pipeFromArray","fns","then","iterable","item","return","subscribeToArray","InnerSubscriber","outerValue","audit","AuditOperator","AuditSubscriber","throttled","clearThrottle","closingNotifier","BufferOperator","BufferSubscriber","startBufferEvery","BufferCountOperator","BufferCountSubscriber","BufferSkipCountSubscriber","buffers","bufferTime","bufferTimeSpan","bufferCreationInterval","maxBufferSize","BufferTimeOperator","Context","BufferTimeSubscriber","closeState","dispatchBufferClose","contexts","context_1","filledBufferContext","onBufferFull","closeContext","closeAction","timeSpanOnlyState","openContext","dispatchBufferTimeSpanOnly","prevContext","dispatchBufferCreation","bufferToggle","openings","closingSelector","BufferToggleOperator","BufferToggleSubscriber","context_2","closeBuffer","trySubscribe","subscribeToResult","bufferWhen","BufferWhenOperator","BufferWhenSubscriber","subscribing","closingSubscription","catchError","selector","CatchOperator","CatchSubscriber","caught","err2","_unsubscribeAndRecycle","combineAll","concatMap","concatMapTo","innerObservable","CountOperator","CountSubscriber","debounce","DebounceOperator","DebounceSubscriber","emitValue","DebounceTimeOperator","DebounceTimeSubscriber","clearDebounce","debouncedNext","lastValue","debouncedSubscription","defaultValue","DefaultIfEmptyOperator","DefaultIfEmptySubscriber","isEmpty","isDate","DelayOperator","DelaySubscriber","delay_1","_schedule","DelayMessage","scheduleNotification","delayWhen","delayDurationSelector","subscriptionDelay","SubscriptionDelayObservable","DelayWhenOperator","DelayWhenSubscriber","removeSubscription","innerSub","delayNotifier","tryComplete","subscriptionIdx","delayNotifierSubscriptions","tryDelay","notifierSubscription","SubscriptionDelaySubscriber","subscribeToSource","sourceSubscribed","dematerialize","DeMaterializeOperator","DeMaterializeSubscriber","distinct","flushes","DistinctOperator","DistinctSubscriber","_finalizeNext","distinctUntilChanged","compare","DistinctUntilChangedOperator","DistinctUntilChangedSubscriber","hasKey","distinctUntilKeyChanged","errorFactory","defaultErrorFactory","ThrowIfEmptyOperator","ThrowIfEmptySubscriber","take","TakeOperator","TakeSubscriber","elementAt","pipe","hasDefaultValue","defaultIfEmpty","every","EveryOperator","EverySubscriber","everyValueMatch","exhaust","SwitchFirstOperator","SwitchFirstSubscriber","hasSubscription","exhaustMap","ExhaustMapOperator","ExhaustMapSubscriber","ExpandOperator","ExpandSubscriber","subscribeToProjection","finalize","callback","FinallyOperator","FinallySubscriber","find","FindValueOperator","FindValueSubscriber","yieldIndex","findIndex","ignoreElements","IgnoreElementsOperator","IgnoreElementsSubscriber","IsEmptyOperator","IsEmptySubscriber","takeLast","TakeLastOperator","TakeLastSubscriber","ring","mapTo","MapToOperator","MapToSubscriber","materialize","MaterializeOperator","MaterializeSubscriber","scan","accumulator","seed","hasSeed","ScanOperator","ScanSubscriber","_seed","set","enumerable","reduce","comparer","MergeScanOperator","MergeScanSubscriber","ish","multicast","subjectOrSubjectFactory","MulticastOperator","nextSources","OnErrorResumeNextOperator","OnErrorResumeNextSubscriber","subscribeToNextSource","pairwise","PairwiseOperator","PairwiseSubscriber","pair","hasPrev","plucker","props","currentProp","publish","publishBehavior","publishLast","publishReplay","selectorOrScheduler","RepeatOperator","RepeatSubscriber","repeatWhen","notifier","RepeatWhenOperator","RepeatWhenSubscriber","sourceIsBeingSubscribedTo","retries","retriesSubscription","notifications","subscribeToRetries","RetryOperator","RetrySubscriber","retryWhen","RetryWhenOperator","RetryWhenSubscriber","sample","SampleOperator","sampleSubscriber","SampleSubscriber","SampleTimeOperator","SampleTimeSubscriber","dispatchNotification","sequenceEqual","compareTo","comparator","SequenceEqualOperator","SequenceEqualSubscriber","_oneComplete","checkValues","areEqual","nextB","completeB","SequenceEqualCompareToSubscriber","shareSubjectFactory","share","shareReplay","configOrBufferSize","shareReplayOperator","useRefCount","single","SingleOperator","SingleSubscriber","applySingleValue","seenValue","skip","SkipOperator","SkipSubscriber","skipLast","SkipLastOperator","_skipCount","SkipLastSubscriber","_count","skipCount","currentIndex","_ring","oldValue","skipUntil","SkipUntilOperator","SkipUntilSubscriber","skipWhile","SkipWhileOperator","SkipWhileSubscriber","skipping","SubscribeOnObservable","delayTime","asap","SubscribeOnOperator","switchMap","SwitchMapOperator","SwitchMapSubscriber","switchAll","switchMapTo","takeUntil","TakeUntilOperator","takeUntilSubscriber","TakeUntilSubscriber","inclusive","TakeWhileOperator","TakeWhileSubscriber","nextOrComplete","tap","DoOperator","TapSubscriber","noop","_tapComplete","_tapError","_tapNext","defaultThrottleConfig","leading","trailing","ThrottleOperator","ThrottleSubscriber","_leading","_hasValue","send","_sendValue","throttle","_throttled","_trailing","throttlingDone","ThrottleTimeOperator","ThrottleTimeSubscriber","_trailingValue","_hasTrailingValue","TimeInterval","interval","TimeoutWithOperator","withObservable","waitFor","TimeoutWithSubscriber","scheduleTimeout","timestamp","toArrayReducer","arr","windowBoundaries","WindowOperator","windowSubscriber","WindowSubscriber","sourceSubscription","openWindow","prevWindow","startWindowEvery","WindowCountOperator","windowSize","WindowCountSubscriber","windows","windowTimeSpan","windowCreationInterval","maxWindowSize","POSITIVE_INFINITY","WindowTimeOperator","CountedSubject","WindowTimeSubscriber","dispatchWindowClose","window_1","window_2","closeWindow","dispatchWindowTimeSpanOnly","dispatchWindowCreation","timeSpanState","windowToggle","WindowToggleOperator","WindowToggleSubscriber","context_3","context_4","inner","windowWhen","closingNotification","WithLatestFromOperator","WithLatestFromSubscriber","found","zipAll","extendStatics","setPrototypeOf","__proto__","hasOwnProperty","__extends","__","copyProps","dst","SafeBuffer","encodingOrOffset","allocUnsafeSlow","TypeError","encoding","SlowBuffer","safer","Safer","RangeError","kStringMaxLength","process","binding","constants","MAX_LENGTH","kMaxLength","MAX_STRING_LENGTH","f","performance","unstable_now","Date","MessageChannel","clearTimeout","unstable_shouldYield","unstable_forceFrameRate","E","floor","F","G","port2","port1","onmessage","postMessage","H","I","J","K","sortIndex","L","M","O","P","Q","R","S","T","startTime","expirationTime","U","V","priorityLevel","W","unstable_IdlePriority","unstable_ImmediatePriority","unstable_LowPriority","unstable_NormalPriority","unstable_Profiling","unstable_UserBlockingPriority","unstable_cancelCallback","unstable_continueExecution","unstable_getCurrentPriorityLevel","unstable_getFirstCallbackNode","unstable_next","unstable_pauseExecution","unstable_requestPaint","unstable_runWithPriority","unstable_scheduleCallback","unstable_wrapCallback","root","MAX_VALUE","SHA256","Uint32Array","h0","h1","h2","h3","h4","h5","h6","h7","blocks","t1","t2","bytesLeft","bitLenHi","bitLenLo","numZeros","PBKDF2_HMAC_SHA256_OneIter","password","salt","dkLen","innerLen","outerKey","dk","incrementCounter","blockmix_salsa8","BY","Yi","_X","arraycopy","blockxor","salsa20_8","Si","srcPos","destPos","checkBufferish","ensureInteger","_scrypt","i1","Bi","XY","totalOps","currentOp","lastPercent10","stop","i0","limit","nextTick","setImmediate","incrementalSMix","steps","percent10","derivedKey","lib","scrypt","progressCallback","lastProgress","progress","syncScrypt","intervalId","navigator","userAgentData","test","userAgent","indexedDB","databases","tryIdb","finally"],"sourceRoot":""}