discord-jadx/app/src/main/java/c/f/j/p/i1.java

90 lines
2.5 KiB
Java

package c.f.j.p;
import c.f.j.j.e;
import com.airbnb.lottie.parser.AnimatableValueParser;
import java.util.Objects;
/* compiled from: ThumbnailBranchProducer */
public class i1 implements v0<e> {
public final j1<e>[] a;
/* compiled from: ThumbnailBranchProducer */
public class a extends p<e, e> {
/* renamed from: c reason: collision with root package name */
public final w0 f477c;
public final int d;
public final c.f.j.d.e e;
public a(l<e> lVar, w0 w0Var, int i) {
super(lVar);
this.f477c = w0Var;
this.d = i;
this.e = w0Var.e().i;
}
@Override // c.f.j.p.p, c.f.j.p.b
public void h(Throwable th) {
if (!i1.this.c(this.d + 1, this.b, this.f477c)) {
this.b.c(th);
}
}
@Override // c.f.j.p.b
public void i(Object obj, int i) {
e eVar = (e) obj;
if (eVar != null && (b.f(i) || AnimatableValueParser.n1(eVar, this.e))) {
this.b.b(eVar, i);
} else if (b.e(i)) {
if (eVar != null) {
eVar.close();
}
if (!i1.this.c(this.d + 1, this.b, this.f477c)) {
this.b.b(null, 1);
}
}
}
}
public i1(j1<e>... j1VarArr) {
Objects.requireNonNull(j1VarArr);
this.a = j1VarArr;
int length = j1VarArr.length;
if (length > 0) {
return;
}
if (length >= 0) {
throw new IndexOutOfBoundsException(AnimatableValueParser.m0("%s (%s) must be less than size (%s)", "index", 0, Integer.valueOf(length)));
}
throw new IllegalArgumentException(c.d.b.a.a.l("negative size: ", length));
}
@Override // c.f.j.p.v0
public void b(l<e> lVar, w0 w0Var) {
if (w0Var.e().i == null) {
lVar.b(null, 1);
} else if (!c(0, lVar, w0Var)) {
lVar.b(null, 1);
}
}
public final boolean c(int i, l<e> lVar, w0 w0Var) {
c.f.j.d.e eVar = w0Var.e().i;
while (true) {
j1<e>[] j1VarArr = this.a;
if (i >= j1VarArr.length) {
i = -1;
break;
} else if (j1VarArr[i].a(eVar)) {
break;
} else {
i++;
}
}
if (i == -1) {
return false;
}
this.a[i].b(new a(lVar, w0Var, i), w0Var);
return true;
}
}