package o; import io.reactivex.rxjava3.exceptions.CompositeException; /* loaded from: classes.dex */ public final class fVN extends fUX { private fSQ a; private fSP b; private fSQ d; private fSP e; public fVN(InterfaceC13169fSq interfaceC13169fSq, fSQ fsq, fSQ fsq2, fSP fsp, fSP fsp2) { super(interfaceC13169fSq); this.a = fsq; this.d = fsq2; this.e = fsp; this.b = fsp2; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { this.c.subscribe(new RVV(interfaceC13174fSv, this.a, this.d, this.e, this.b)); } /* loaded from: classes6.dex */ static final class RVV implements InterfaceC13174fSv, fSJ { private boolean a; private fSP b; private InterfaceC13174fSv c; private fSQ d; private fSP e; private fSJ f; private fSQ h; RVV(InterfaceC13174fSv interfaceC13174fSv, fSQ fsq, fSQ fsq2, fSP fsp, fSP fsp2) { this.c = interfaceC13174fSv; this.h = fsq; this.d = fsq2; this.e = fsp; this.b = fsp2; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.f, fsj)) { this.f = fsj; this.c.onSubscribe(this); } } @Override // o.fSJ public final void dispose() { this.f.dispose(); } @Override // o.fSJ public final boolean isDisposed() { return this.f.isDisposed(); } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.a) { return; } try { this.h.c(t); this.c.onNext(t); } catch (Throwable th) { C13147fSI.c(th); this.f.dispose(); onError(th); } } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.a) { C13418fZu.c(th); return; } this.a = true; try { this.d.c(th); } catch (Throwable th2) { C13147fSI.c(th2); th = new CompositeException(th, th2); } this.c.onError(th); try { this.b.c(); } catch (Throwable th3) { C13147fSI.c(th3); C13418fZu.c(th3); } } @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.a) { return; } try { this.e.c(); this.a = true; this.c.onComplete(); try { this.b.c(); } catch (Throwable th) { C13147fSI.c(th); C13418fZu.c(th); } } catch (Throwable th2) { C13147fSI.c(th2); onError(th2); } } } }