package o; import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collector; /* renamed from: o.fTo, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13201fTo extends AbstractC13163fSk { private AbstractC13163fSk a; private Collector e; public C13201fTo(AbstractC13163fSk abstractC13163fSk, Collector collector) { this.a = abstractC13163fSk; this.e = collector; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { try { this.a.subscribe(new RVV(interfaceC13174fSv, this.e.supplier().get(), this.e.accumulator(), this.e.finisher())); } catch (Throwable th) { C13147fSI.c(th); EnumC13195fTi.a(th, interfaceC13174fSv); } } /* renamed from: o.fTo$RVV */ /* loaded from: classes6.dex */ static final class RVV extends fTO implements InterfaceC13174fSv { private Function a; private A b; private BiConsumer d; private boolean e; private fSJ i; RVV(InterfaceC13174fSv interfaceC13174fSv, A a, BiConsumer biConsumer, Function function) { super(interfaceC13174fSv); this.b = a; this.d = biConsumer; this.a = function; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.i, fsj)) { this.i = fsj; this.c.onSubscribe(this); } } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.e) { return; } try { this.d.accept(this.b, t); } catch (Throwable th) { C13147fSI.c(th); this.i.dispose(); onError(th); } } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.e) { C13418fZu.c(th); return; } this.e = true; this.i = EnumC13192fTf.DISPOSED; this.b = null; this.c.onError(th); } /* JADX WARN: Multi-variable type inference failed */ @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.e) { return; } this.e = true; this.i = EnumC13192fTf.DISPOSED; A a = this.b; this.b = null; try { d(Objects.requireNonNull(this.a.apply(a), "The finisher returned a null value")); } catch (Throwable th) { C13147fSI.c(th); this.c.onError(th); } } @Override // o.fTO, o.fSJ public final void dispose() { super.dispose(); this.i.dispose(); } } }