+ var SimpleInnerSubscriber = (function (_super) {
+ __extends(SimpleInnerSubscriber, _super);
+ function SimpleInnerSubscriber(parent) {
+ var _this = _super.call(this) || this;
+ _this.parent = parent;
+ return _this;
+ }
+ SimpleInnerSubscriber.prototype._next = function (value) {
+ this.parent.notifyNext(value);
+ };
+ SimpleInnerSubscriber.prototype._error = function (error) {
+ this.parent.notifyError(error);
+ this.unsubscribe();
+ };
+ SimpleInnerSubscriber.prototype._complete = function () {
+ this.parent.notifyComplete();
+ this.unsubscribe();
+ };
+ return SimpleInnerSubscriber;
+ }(Subscriber));
+ var ComplexInnerSubscriber = (function (_super) {
+ __extends(ComplexInnerSubscriber, _super);
+ function ComplexInnerSubscriber(parent, outerValue, outerIndex) {
+ var _this = _super.call(this) || this;
+ _this.parent = parent;
+ _this.outerValue = outerValue;
+ _this.outerIndex = outerIndex;
+ return _this;
+ }
+ ComplexInnerSubscriber.prototype._next = function (value) {
+ this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);
+ };
+ ComplexInnerSubscriber.prototype._error = function (error) {
+ this.parent.notifyError(error);
+ this.unsubscribe();
+ };
+ ComplexInnerSubscriber.prototype._complete = function () {
+ this.parent.notifyComplete(this);
+ this.unsubscribe();
+ };
+ return ComplexInnerSubscriber;
+ }(Subscriber));
+ var SimpleOuterSubscriber = (function (_super) {
+ __extends(SimpleOuterSubscriber, _super);
+ function SimpleOuterSubscriber() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ SimpleOuterSubscriber.prototype.notifyNext = function (innerValue) {
+ this.destination.next(innerValue);
+ };
+ SimpleOuterSubscriber.prototype.notifyError = function (err) {
+ this.destination.error(err);
+ };
+ SimpleOuterSubscriber.prototype.notifyComplete = function () {
+ this.destination.complete();
+ };
+ return SimpleOuterSubscriber;
+ }(Subscriber));
+ var ComplexOuterSubscriber = (function (_super) {
+ __extends(ComplexOuterSubscriber, _super);
+ function ComplexOuterSubscriber() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ ComplexOuterSubscriber.prototype.notifyNext = function (_outerValue, innerValue, _outerIndex, _innerSub) {
+ this.destination.next(innerValue);
+ };
+ ComplexOuterSubscriber.prototype.notifyError = function (error) {
+ this.destination.error(error);
+ };
+ ComplexOuterSubscriber.prototype.notifyComplete = function (_innerSub) {
+ this.destination.complete();
+ };
+ return ComplexOuterSubscriber;
+ }(Subscriber));
+ function innerSubscribe(result, innerSubscriber) {
+ if (innerSubscriber.closed) {
+ return undefined;
+ }
+ if (result instanceof Observable) {
+ return result.subscribe(innerSubscriber);
+ }
+ return subscribeTo(result)(innerSubscriber);
+ }
+