{"ast":null,"code":"import { empty } from './observable/empty';\nimport { of } from './observable/of';\nimport { throwError } from './observable/throwError';\nexport var NotificationKind = /*#__PURE__*/(() => {\n  (function (NotificationKind) {\n    NotificationKind[\"NEXT\"] = \"N\";\n    NotificationKind[\"ERROR\"] = \"E\";\n    NotificationKind[\"COMPLETE\"] = \"C\";\n  })(NotificationKind || (NotificationKind = {}));\n\n  return NotificationKind;\n})();\nexport class Notification {\n  constructor(kind, value, error) {\n    this.kind = kind;\n    this.value = value;\n    this.error = error;\n    this.hasValue = kind === 'N';\n  }\n\n  observe(observer) {\n    switch (this.kind) {\n      case 'N':\n        return observer.next && observer.next(this.value);\n\n      case 'E':\n        return observer.error && observer.error(this.error);\n\n      case 'C':\n        return observer.complete && observer.complete();\n    }\n  }\n\n  do(next, error, complete) {\n    const kind = this.kind;\n\n    switch (kind) {\n      case 'N':\n        return next && next(this.value);\n\n      case 'E':\n        return error && error(this.error);\n\n      case 'C':\n        return complete && complete();\n    }\n  }\n\n  accept(nextOrObserver, error, complete) {\n    if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n      return this.observe(nextOrObserver);\n    } else {\n      return this.do(nextOrObserver, error, complete);\n    }\n  }\n\n  toObservable() {\n    const kind = this.kind;\n\n    switch (kind) {\n      case 'N':\n        return of(this.value);\n\n      case 'E':\n        return throwError(this.error);\n\n      case 'C':\n        return empty();\n    }\n\n    throw new Error('unexpected notification kind value');\n  }\n\n  static createNext(value) {\n    if (typeof value !== 'undefined') {\n      return new Notification('N', value);\n    }\n\n    return Notification.undefinedValueNotification;\n  }\n\n  static createError(err) {\n    return new Notification('E', undefined, err);\n  }\n\n  static createComplete() {\n    return Notification.completeNotification;\n  }\n\n}\nNotification.completeNotification = new Notification('C');\nNotification.undefinedValueNotification = new Notification('N', undefined); //# sourceMappingURL=Notification.js.map","map":null,"metadata":{},"sourceType":"module"}