{"ast":null,"code":"import _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';\nexport function scan(accumulator, seed) {\n  var hasSeed = false;\n\n  if (arguments.length >= 2) {\n    hasSeed = true;\n  }\n\n  return function scanOperatorFunction(source) {\n    return source.lift(new ScanOperator(accumulator, seed, hasSeed));\n  };\n}\n\nvar ScanOperator = /*#__PURE__*/function () {\n  function ScanOperator(accumulator, seed) {\n    var hasSeed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n    _classCallCheck(this, ScanOperator);\n\n    this.accumulator = accumulator;\n    this.seed = seed;\n    this.hasSeed = hasSeed;\n  }\n\n  _createClass(ScanOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));\n    }\n  }]);\n\n  return ScanOperator;\n}();\n\nvar ScanSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(ScanSubscriber, _Subscriber);\n\n  var _super = _createSuper(ScanSubscriber);\n\n  function ScanSubscriber(destination, accumulator, _seed, hasSeed) {\n    var _this;\n\n    _classCallCheck(this, ScanSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.accumulator = accumulator;\n    _this._seed = _seed;\n    _this.hasSeed = hasSeed;\n    _this.index = 0;\n    return _this;\n  }\n\n  _createClass(ScanSubscriber, [{\n    key: \"seed\",\n    get: function get() {\n      return this._seed;\n    },\n    set: function set(value) {\n      this.hasSeed = true;\n      this._seed = value;\n    }\n  }, {\n    key: \"_next\",\n    value: function _next(value) {\n      if (!this.hasSeed) {\n        this.seed = value;\n        this.destination.next(value);\n      } else {\n        return this._tryNext(value);\n      }\n    }\n  }, {\n    key: \"_tryNext\",\n    value: function _tryNext(value) {\n      var index = this.index++;\n      var result;\n\n      try {\n        result = this.accumulator(this.seed, value, index);\n      } catch (err) {\n        this.destination.error(err);\n      }\n\n      this.seed = result;\n      this.destination.next(result);\n    }\n  }]);\n\n  return ScanSubscriber;\n}(Subscriber); //# sourceMappingURL=scan.js.map","map":null,"metadata":{},"sourceType":"module"}