package o; import com.bumptech.glide.Registry; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import o.RDy; import o.SCe; /* loaded from: classes.dex */ public final class Vzp { private final Set> a; private final Sts c; public final List> d; private final RDy.Sts> h; private static final Sts e = new Sts(); private static final SCe b = new LWm(); public Vzp(RDy.Sts> sts) { this(sts, e); } private Vzp(RDy.Sts> sts, Sts sts2) { this.d = new ArrayList(); this.a = new HashSet(); this.h = sts; this.c = sts2; } /* JADX INFO: Access modifiers changed from: package-private */ public final List> c(Class cls) { ArrayList arrayList; synchronized (this) { try { arrayList = new ArrayList(); for (RVV rvv : this.d) { if (!this.a.contains(rvv) && rvv.e.isAssignableFrom(cls)) { this.a.add(rvv); arrayList.add(b(rvv)); this.a.remove(rvv); } } } catch (Throwable th) { this.a.clear(); throw th; } } return arrayList; } /* JADX INFO: Access modifiers changed from: package-private */ public final List> d(Class cls) { ArrayList arrayList; synchronized (this) { arrayList = new ArrayList(); for (RVV rvv : this.d) { if (!arrayList.contains(rvv.b) && rvv.e.isAssignableFrom(cls)) { arrayList.add(rvv.b); } } } return arrayList; } public final SCe b(Class cls, Class cls2) { synchronized (this) { try { ArrayList arrayList = new ArrayList(); boolean z = false; for (RVV rvv : this.d) { if (this.a.contains(rvv)) { z = true; } else if (rvv.e.isAssignableFrom(cls) && rvv.b.isAssignableFrom(cls2)) { this.a.add(rvv); arrayList.add(b(rvv)); this.a.remove(rvv); } } if (arrayList.size() <= 1) { if (arrayList.size() == 1) { return (SCe) arrayList.get(0); } if (!z) { throw new Registry.NoModelLoaderAvailableException((Class) cls, (Class) cls2); } return (SCe) b; } return new C11467efr(arrayList, this.h); } catch (Throwable th) { this.a.clear(); throw th; } } } private SCe b(RVV rvv) { SCe c = rvv.d.c(this); if (c != null) { return c; } throw new NullPointerException("Argument must not be null"); } /* loaded from: classes.dex */ public static class RVV { final Class b; final rIx d; final Class e; public RVV(Class cls, Class cls2, rIx rix) { this.e = cls; this.b = cls2; this.d = rix; } } /* loaded from: classes.dex */ static class Sts { Sts() { } } /* loaded from: classes.dex */ static class LWm implements SCe { @Override // o.SCe public final boolean d(Object obj) { return false; } @Override // o.SCe public final SCe.IeS e(Object obj, int i, int i2, unA una) { return null; } LWm() { } } }