package o; import com.airbnb.deeplinkdispatch.UrlTreeKt; import com.bumptech.glide.load.engine.GlideException; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import o.InterfaceC12232euN; import o.RDy; import o.SCe; /* renamed from: o.efr, reason: case insensitive filesystem */ /* loaded from: classes.dex */ final class C11467efr implements SCe { private final List> a; private final RDy.Sts> b; /* JADX INFO: Access modifiers changed from: package-private */ public C11467efr(List> list, RDy.Sts> sts) { this.a = list; this.b = sts; } @Override // o.SCe public final SCe.IeS e(Model model, int i, int i2, unA una) { SCe.IeS e; int size = this.a.size(); ArrayList arrayList = new ArrayList(size); InterfaceC2545agd interfaceC2545agd = null; for (int i3 = 0; i3 < size; i3++) { SCe sCe = this.a.get(i3); if (sCe.d(model) && (e = sCe.e(model, i, i2, una)) != null) { interfaceC2545agd = e.e; arrayList.add(e.d); } } if (arrayList.isEmpty() || interfaceC2545agd == null) { return null; } return new SCe.IeS<>(interfaceC2545agd, new IeS(arrayList, this.b)); } @Override // o.SCe public final boolean d(Model model) { Iterator> it = this.a.iterator(); while (it.hasNext()) { if (it.next().d(model)) { return true; } } return false; } public final String toString() { StringBuilder sb = new StringBuilder("MultiModelLoader{modelLoaders="); sb.append(Arrays.toString(this.a.toArray())); sb.append(UrlTreeKt.componentParamSuffixChar); return sb.toString(); } /* renamed from: o.efr$IeS */ /* loaded from: classes.dex */ static class IeS implements InterfaceC12232euN, InterfaceC12232euN.IeS { private final List> a; private List b; private int c; private boolean d; private InterfaceC12232euN.IeS e; private final RDy.Sts> f; private EnumC3495ayd j; IeS(List> list, RDy.Sts> sts) { this.f = sts; if (!list.isEmpty()) { this.a = list; this.c = 0; return; } throw new IllegalArgumentException("Must not be empty."); } @Override // o.InterfaceC12232euN public final void c(EnumC3495ayd enumC3495ayd, InterfaceC12232euN.IeS ieS) { this.j = enumC3495ayd; this.e = ieS; this.b = this.f.d(); this.a.get(this.c).c(enumC3495ayd, this); if (this.d) { a(); } } @Override // o.InterfaceC12232euN public final void e() { List list = this.b; if (list != null) { this.f.d(list); } this.b = null; Iterator> it = this.a.iterator(); while (it.hasNext()) { it.next().e(); } } @Override // o.InterfaceC12232euN public final void a() { this.d = true; Iterator> it = this.a.iterator(); while (it.hasNext()) { it.next().a(); } } @Override // o.InterfaceC12232euN public final Class c() { return this.a.get(0).c(); } @Override // o.InterfaceC12232euN public final pNW d() { return this.a.get(0).d(); } @Override // o.InterfaceC12232euN.IeS public final void a(Data data) { if (data != null) { this.e.a((InterfaceC12232euN.IeS) data); } else { b(); } } @Override // o.InterfaceC12232euN.IeS public final void a(Exception exc) { List list = this.b; if (list != null) { list.add(exc); b(); return; } throw new NullPointerException("Argument must not be null"); } private void b() { if (this.d) { return; } if (this.c < this.a.size() - 1) { this.c++; c(this.j, this.e); } else { if (this.b != null) { this.e.a((Exception) new GlideException("Fetch failed", new ArrayList(this.b))); return; } throw new NullPointerException("Argument must not be null"); } } } }