{"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 { EmptyError } from '../util/EmptyError';\nimport { Subscriber } from '../Subscriber';\nexport function throwIfEmpty() {\n  var errorFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultErrorFactory;\n  return function (source) {\n    return source.lift(new ThrowIfEmptyOperator(errorFactory));\n  };\n}\n\nvar ThrowIfEmptyOperator = /*#__PURE__*/function () {\n  function ThrowIfEmptyOperator(errorFactory) {\n    _classCallCheck(this, ThrowIfEmptyOperator);\n\n    this.errorFactory = errorFactory;\n  }\n\n  _createClass(ThrowIfEmptyOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory));\n    }\n  }]);\n\n  return ThrowIfEmptyOperator;\n}();\n\nvar ThrowIfEmptySubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(ThrowIfEmptySubscriber, _Subscriber);\n\n  var _super = _createSuper(ThrowIfEmptySubscriber);\n\n  function ThrowIfEmptySubscriber(destination, errorFactory) {\n    var _this;\n\n    _classCallCheck(this, ThrowIfEmptySubscriber);\n\n    _this = _super.call(this, destination);\n    _this.errorFactory = errorFactory;\n    _this.hasValue = false;\n    return _this;\n  }\n\n  _createClass(ThrowIfEmptySubscriber, [{\n    key: \"_next\",\n    value: function _next(value) {\n      this.hasValue = true;\n      this.destination.next(value);\n    }\n  }, {\n    key: \"_complete\",\n    value: function _complete() {\n      if (!this.hasValue) {\n        var err;\n\n        try {\n          err = this.errorFactory();\n        } catch (e) {\n          err = e;\n        }\n\n        this.destination.error(err);\n      } else {\n        return this.destination.complete();\n      }\n    }\n  }]);\n\n  return ThrowIfEmptySubscriber;\n}(Subscriber);\n\nfunction defaultErrorFactory() {\n  return new EmptyError();\n} //# sourceMappingURL=throwIfEmpty.js.map","map":null,"metadata":{},"sourceType":"module"}