{"ast":null,"code":"import { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { defaultThrottleConfig } from './throttle';\nexport function throttleTime(duration, scheduler = async, config = defaultThrottleConfig) {\n return source => source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));\n}\nclass ThrottleTimeOperator {\n constructor(duration, scheduler, leading, trailing) {\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n }\n call(subscriber, source) {\n return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));\n }\n}\nclass ThrottleTimeSubscriber extends Subscriber {\n constructor(destination, duration, scheduler, leading, trailing) {\n super(destination);\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n this._hasTrailingValue = false;\n this._trailingValue = null;\n }\n _next(value) {\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, {\n subscriber: this\n }));\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 _complete() {\n if (this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this.destination.complete();\n } else {\n this.destination.complete();\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}\nfunction dispatchNext(arg) {\n const {\n subscriber\n } = arg;\n subscriber.clearThrottle();\n}","map":{"version":3,"names":["Subscriber","async","defaultThrottleConfig","throttleTime","duration","scheduler","config","source","lift","ThrottleTimeOperator","leading","trailing","constructor","call","subscriber","subscribe","ThrottleTimeSubscriber","destination","_hasTrailingValue","_trailingValue","_next","value","throttled","add","schedule","dispatchNext","next","_complete","complete","clearThrottle","unsubscribe","remove","arg"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/throttleTime.js"],"sourcesContent":["import { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { defaultThrottleConfig } from './throttle';\nexport function throttleTime(duration, scheduler = async, config = defaultThrottleConfig) {\n return (source) => source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));\n}\nclass ThrottleTimeOperator {\n constructor(duration, scheduler, leading, trailing) {\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n }\n call(subscriber, source) {\n return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));\n }\n}\nclass ThrottleTimeSubscriber extends Subscriber {\n constructor(destination, duration, scheduler, leading, trailing) {\n super(destination);\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n this._hasTrailingValue = false;\n this._trailingValue = null;\n }\n _next(value) {\n if (this.throttled) {\n if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\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 }\n else if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n }\n }\n _complete() {\n if (this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this.destination.complete();\n }\n else {\n this.destination.complete();\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}\nfunction dispatchNext(arg) {\n const { subscriber } = arg;\n subscriber.clearThrottle();\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe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