{"ast":null,"code":"import _assertThisInitialized from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createSuper\";\nimport _classCallCheck from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nexport function sampleTime(period) {\n  var scheduler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : async;\n  return function (source) {\n    return source.lift(new SampleTimeOperator(period, scheduler));\n  };\n}\n\nvar SampleTimeOperator = /*#__PURE__*/function () {\n  function SampleTimeOperator(period, scheduler) {\n    _classCallCheck(this, SampleTimeOperator);\n\n    this.period = period;\n    this.scheduler = scheduler;\n  }\n\n  _createClass(SampleTimeOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));\n    }\n  }]);\n\n  return SampleTimeOperator;\n}();\n\nvar SampleTimeSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(SampleTimeSubscriber, _Subscriber);\n\n  var _super = _createSuper(SampleTimeSubscriber);\n\n  function SampleTimeSubscriber(destination, period, scheduler) {\n    var _this;\n\n    _classCallCheck(this, SampleTimeSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.period = period;\n    _this.scheduler = scheduler;\n    _this.hasValue = false;\n\n    _this.add(scheduler.schedule(dispatchNotification, period, {\n      subscriber: _assertThisInitialized(_this),\n      period: period\n    }));\n\n    return _this;\n  }\n\n  _createClass(SampleTimeSubscriber, [{\n    key: \"_next\",\n    value: function _next(value) {\n      this.lastValue = value;\n      this.hasValue = true;\n    }\n  }, {\n    key: \"notifyNext\",\n    value: function notifyNext() {\n      if (this.hasValue) {\n        this.hasValue = false;\n        this.destination.next(this.lastValue);\n      }\n    }\n  }]);\n\n  return SampleTimeSubscriber;\n}(Subscriber);\n\nfunction dispatchNotification(state) {\n  var subscriber = state.subscriber,\n      period = state.period;\n  subscriber.notifyNext();\n  this.schedule(state, period);\n} //# sourceMappingURL=sampleTime.js.map","map":null,"metadata":{},"sourceType":"module"}