{"ast":null,"code":"import _get from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/get\";\nimport _getPrototypeOf from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/getPrototypeOf\";\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 { Subject } from '../Subject';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function repeatWhen(notifier) {\n  return function (source) {\n    return source.lift(new RepeatWhenOperator(notifier));\n  };\n}\n\nvar RepeatWhenOperator = /*#__PURE__*/function () {\n  function RepeatWhenOperator(notifier) {\n    _classCallCheck(this, RepeatWhenOperator);\n\n    this.notifier = notifier;\n  }\n\n  _createClass(RepeatWhenOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));\n    }\n  }]);\n\n  return RepeatWhenOperator;\n}();\n\nvar RepeatWhenSubscriber = /*#__PURE__*/function (_SimpleOuterSubscribe) {\n  _inherits(RepeatWhenSubscriber, _SimpleOuterSubscribe);\n\n  var _super = _createSuper(RepeatWhenSubscriber);\n\n  function RepeatWhenSubscriber(destination, notifier, source) {\n    var _this;\n\n    _classCallCheck(this, RepeatWhenSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.notifier = notifier;\n    _this.source = source;\n    _this.sourceIsBeingSubscribedTo = true;\n    return _this;\n  }\n\n  _createClass(RepeatWhenSubscriber, [{\n    key: \"notifyNext\",\n    value: function notifyNext() {\n      this.sourceIsBeingSubscribedTo = true;\n      this.source.subscribe(this);\n    }\n  }, {\n    key: \"notifyComplete\",\n    value: function notifyComplete() {\n      if (this.sourceIsBeingSubscribedTo === false) {\n        return _get(_getPrototypeOf(RepeatWhenSubscriber.prototype), \"complete\", this).call(this);\n      }\n    }\n  }, {\n    key: \"complete\",\n    value: function complete() {\n      this.sourceIsBeingSubscribedTo = false;\n\n      if (!this.isStopped) {\n        if (!this.retries) {\n          this.subscribeToRetries();\n        }\n\n        if (!this.retriesSubscription || this.retriesSubscription.closed) {\n          return _get(_getPrototypeOf(RepeatWhenSubscriber.prototype), \"complete\", this).call(this);\n        }\n\n        this._unsubscribeAndRecycle();\n\n        this.notifications.next(undefined);\n      }\n    }\n  }, {\n    key: \"_unsubscribe\",\n    value: function _unsubscribe() {\n      var notifications = this.notifications,\n          retriesSubscription = this.retriesSubscription;\n\n      if (notifications) {\n        notifications.unsubscribe();\n        this.notifications = undefined;\n      }\n\n      if (retriesSubscription) {\n        retriesSubscription.unsubscribe();\n        this.retriesSubscription = undefined;\n      }\n\n      this.retries = undefined;\n    }\n  }, {\n    key: \"_unsubscribeAndRecycle\",\n    value: function _unsubscribeAndRecycle() {\n      var _unsubscribe = this._unsubscribe;\n      this._unsubscribe = null;\n\n      _get(_getPrototypeOf(RepeatWhenSubscriber.prototype), \"_unsubscribeAndRecycle\", this).call(this);\n\n      this._unsubscribe = _unsubscribe;\n      return this;\n    }\n  }, {\n    key: \"subscribeToRetries\",\n    value: function subscribeToRetries() {\n      this.notifications = new Subject();\n      var retries;\n\n      try {\n        var notifier = this.notifier;\n        retries = notifier(this.notifications);\n      } catch (e) {\n        return _get(_getPrototypeOf(RepeatWhenSubscriber.prototype), \"complete\", this).call(this);\n      }\n\n      this.retries = retries;\n      this.retriesSubscription = innerSubscribe(retries, new SimpleInnerSubscriber(this));\n    }\n  }]);\n\n  return RepeatWhenSubscriber;\n}(SimpleOuterSubscriber); //# sourceMappingURL=repeatWhen.js.map","map":null,"metadata":{},"sourceType":"module"}