what-the-bank/sources/o/C5277bpx.java

777 lines
25 KiB
Java

package o;
import com.scb.phone.domain.errors.RetrofitException;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import kotlin.NoWhenBranchMatchedException;
import o.C0400Ft;
import o.C0690Mh;
import o.C17006tD;
import o.C5277bpx;
import o.YNc;
import o.ZI;
import o.wRi;
/* renamed from: o.bpx, reason: case insensitive filesystem */
/* loaded from: classes4.dex */
public final class C5277bpx extends ZI<InterfaceC9262dgS> {
public final YeV a;
public final tfc b;
public final C1100VpK c;
public YNc.HBt d;
public Iiy e;
public C0791Oq g;
public final C7926cxZ h;
public boolean i;
public boolean k;
public int l;
private final zOI m;
public String n;
/* renamed from: o, reason: collision with root package name */
private final C17006tD f8581o;
private boolean q;
public static /* synthetic */ void d() {
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
@InterfaceC13391fZD
public C5277bpx(C16903sI c16903sI, zOI zoi, YeV yeV, C17006tD c17006tD, C1100VpK c1100VpK, C7926cxZ c7926cxZ, tfc tfcVar) {
super(c16903sI);
C14957gcv.e(c16903sI, "");
C14957gcv.e(zoi, "");
C14957gcv.e(yeV, "");
C14957gcv.e(c17006tD, "");
C14957gcv.e(c1100VpK, "");
C14957gcv.e(c7926cxZ, "");
C14957gcv.e(tfcVar, "");
this.m = zoi;
this.a = yeV;
this.f8581o = c17006tD;
this.c = c1100VpK;
this.h = c7926cxZ;
this.b = tfcVar;
this.d = new YNc.HBt(0, 0);
this.l = -1;
this.n = "";
this.e = Iiy.KOFAX;
}
/* renamed from: o.bpx$HBt */
/* loaded from: classes4.dex */
public static final class HBt {
private HBt() {
}
public /* synthetic */ HBt(byte b) {
this();
}
}
/* renamed from: o.bpx$saX */
/* loaded from: classes4.dex */
public static final class saX extends wRi.LWm<dRS> {
private C5277bpx c;
saX(C5277bpx c5277bpx) {
this.c = c5277bpx;
}
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final /* synthetic */ void onNext(Object obj) {
final dRS drs = (dRS) obj;
C14957gcv.e(drs, "");
this.c.i = drs.c;
this.c.e = drs.e;
final C5277bpx c5277bpx = this.c;
ZI.IeS ieS = new ZI.IeS(c5277bpx, drs) { // from class: o.bqd
private C5277bpx a;
private dRS d;
@Override // o.ZI.IeS
public final void e(Object obj2) {
C5277bpx.saX.d(this.a, this.d, (InterfaceC9262dgS) obj2);
}
{
this.a = c5277bpx;
this.d = drs;
}
};
if (c5277bpx.f != 0) {
ieS.e(c5277bpx.f);
}
final C5277bpx c5277bpx2 = this.c;
ZI.IeS ieS2 = new ZI.IeS(c5277bpx2, drs) { // from class: o.bqh
private dRS c;
private C5277bpx d;
@Override // o.ZI.IeS
public final void e(Object obj2) {
C5277bpx.saX.e(this.d, this.c, (InterfaceC9262dgS) obj2);
}
{
this.d = c5277bpx2;
this.c = drs;
}
};
if (c5277bpx2.f != 0) {
ieS2.e(c5277bpx2.f);
}
if (this.c.q) {
return;
}
C5277bpx.b(this.c);
}
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final void onError(Throwable th) {
C14957gcv.e(th, "");
C5277bpx.a(this.c, th);
}
public static /* synthetic */ void e(C5277bpx c5277bpx, dRS drs, InterfaceC9262dgS interfaceC9262dgS) {
EBL ebl;
C14957gcv.e(c5277bpx, "");
C14957gcv.e(drs, "");
C0791Oq c0791Oq = c5277bpx.g;
if (c0791Oq == null || (ebl = c0791Oq.c) == null) {
return;
}
int i = LWm.e[ebl.ordinal()];
if (i == 1) {
interfaceC9262dgS.a();
interfaceC9262dgS.f();
EBL ebl2 = EBL.SUBMITTED;
C0791Oq c0791Oq2 = c5277bpx.g;
interfaceC9262dgS.d(ebl2, c0791Oq2 != null ? c0791Oq2.d : null);
return;
}
if (i == 2) {
String str = drs.a;
interfaceC9262dgS.f(str != null ? str : "");
EBL ebl3 = EBL.RESUBMIT;
C0791Oq c0791Oq3 = c5277bpx.g;
interfaceC9262dgS.d(ebl3, c0791Oq3 != null ? c0791Oq3.d : null);
final Integer num = drs.d;
final int size = drs.i.size();
final int i2 = drs.f;
final int i3 = c5277bpx.d.b;
ZI.IeS ieS = new ZI.IeS(num, i3, i2, size) { // from class: o.bpH
private int b;
private int c;
private int d;
private Integer e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C5277bpx.d(this.e, this.d, this.b, this.c, (InterfaceC9262dgS) obj);
}
{
this.e = num;
this.d = i3;
this.b = i2;
this.c = size;
}
};
if (c5277bpx.f != 0) {
ieS.e(c5277bpx.f);
return;
}
return;
}
if (i != 3) {
if (i == 4) {
interfaceC9262dgS.k();
return;
}
return;
}
interfaceC9262dgS.f();
EBL ebl4 = EBL.INITIAL;
C0791Oq c0791Oq4 = c5277bpx.g;
interfaceC9262dgS.d(ebl4, c0791Oq4 != null ? c0791Oq4.d : null);
final Integer num2 = drs.d;
final int size2 = drs.i.size();
final int i4 = drs.f;
final int i5 = c5277bpx.d.b;
ZI.IeS ieS2 = new ZI.IeS(num2, i5, i4, size2) { // from class: o.bpH
private int b;
private int c;
private int d;
private Integer e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C5277bpx.d(this.e, this.d, this.b, this.c, (InterfaceC9262dgS) obj);
}
{
this.e = num2;
this.d = i5;
this.b = i4;
this.c = size2;
}
};
if (c5277bpx.f != 0) {
ieS2.e(c5277bpx.f);
}
}
public static /* synthetic */ void d(C5277bpx c5277bpx, dRS drs, InterfaceC9262dgS interfaceC9262dgS) {
YW yw;
C14957gcv.e(c5277bpx, "");
C14957gcv.e(drs, "");
c5277bpx.i = drs.c;
c5277bpx.l = drs.i.size();
interfaceC9262dgS.a(c5277bpx.i);
interfaceC9262dgS.d(drs);
C17006tD unused = c5277bpx.f8581o;
List<Vkb> list = drs.i;
C14957gcv.e(list, "");
ArrayList arrayList = new ArrayList();
for (Vkb vkb : list) {
C14957gcv.e(vkb, "");
arrayList.add(new C0400Ft.LWm(vkb.c, vkb.b));
}
interfaceC9262dgS.e(arrayList);
C17006tD unused2 = c5277bpx.f8581o;
Set<Hzp> set = drs.g;
C14957gcv.e(set, "");
Set<Hzp> set2 = set;
C14957gcv.e(set2, "");
ArrayList arrayList2 = new ArrayList(set2 instanceof Collection ? set2.size() : 10);
Iterator<T> it = set2.iterator();
while (it.hasNext()) {
int i = C17006tD.Sts.d[((Hzp) it.next()).ordinal()];
if (i == 1) {
yw = YW.TAKE_PHOTO;
} else if (i == 2) {
yw = YW.UPLOAD_PHOTO;
} else {
if (i != 3) {
throw new NoWhenBranchMatchedException();
}
yw = YW.UPLOAD_PDF;
}
arrayList2.add(yw);
}
Set h = C14881gav.h(arrayList2);
YW yw2 = YW.CANCEL;
C14957gcv.e(h, "");
LinkedHashSet linkedHashSet = new LinkedHashSet(C14856gaP.a(h.size() + 1));
linkedHashSet.addAll(h);
linkedHashSet.add(yw2);
interfaceC9262dgS.e(linkedHashSet);
c5277bpx.k = true;
}
/* renamed from: o.bpx$saX$LWm */
/* loaded from: classes4.dex */
public final /* synthetic */ class LWm {
public static final int[] e;
static {
int[] iArr = new int[EBL.values().length];
try {
iArr[EBL.SUBMITTED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[EBL.RESUBMIT.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[EBL.INITIAL.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
iArr[EBL.UNKNOWN.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
e = iArr;
}
}
}
/* renamed from: o.bpx$tOB */
/* loaded from: classes4.dex */
public static final class tOB extends wRi.LWm<C17491xGR> {
private C5277bpx e;
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final /* synthetic */ void onNext(Object obj) {
C14957gcv.e((C17491xGR) obj, "");
this.e.q = false;
this.e.c();
}
tOB(C5277bpx c5277bpx) {
this.e = c5277bpx;
}
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final void onError(Throwable th) {
C14957gcv.e(th, "");
this.e.q = false;
C5277bpx.e(this.e, th, C0690Mh.IeS.JUST_DISMISS);
}
}
public static String b(String str) {
String str2 = str;
C14957gcv.e(str2, "");
int b = gdZ.b((CharSequence) str2, '.', str2.length() - 1);
if (b > 0) {
String substring = str.substring(b + 1);
C14957gcv.c((Object) substring, "");
return substring;
}
return "";
}
/* renamed from: o.bpx$ojQ */
/* loaded from: classes4.dex */
public static final class ojQ extends wRi.LWm<C17491xGR> {
private C5277bpx b;
private String d;
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final /* synthetic */ void onNext(Object obj) {
C14957gcv.e((C17491xGR) obj, "");
new File(this.d).delete();
C5277bpx.b(this.b);
this.b.c();
}
public ojQ(String str, C5277bpx c5277bpx) {
this.d = str;
this.b = c5277bpx;
}
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final void onError(Throwable th) {
C14866gag c14866gag;
C14957gcv.e(th, "");
if (th instanceof RetrofitException) {
RetrofitException retrofitException = (RetrofitException) th;
VCl vCl = retrofitException.e;
if (vCl == null || vCl.c == null) {
c14866gag = null;
} else {
C5277bpx c5277bpx = this.b;
String str = retrofitException.e.c.e;
if (!C14957gcv.b((Object) str, (Object) "3045")) {
if (!C14957gcv.b((Object) str, (Object) "3046")) {
C5277bpx.e(c5277bpx, th, C0690Mh.IeS.JUST_DISMISS);
} else {
ZI.IeS ieS = new ZI.IeS() { // from class: o.bql
@Override // o.ZI.IeS
public final void e(Object obj) {
C5277bpx.ojQ.a((InterfaceC9262dgS) obj);
}
};
if (c5277bpx.f != 0) {
ieS.e(c5277bpx.f);
}
}
} else {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bqg
@Override // o.ZI.IeS
public final void e(Object obj) {
C5277bpx.ojQ.c((InterfaceC9262dgS) obj);
}
};
if (c5277bpx.f != 0) {
ieS2.e(c5277bpx.f);
}
}
c14866gag = C14866gag.c;
}
if (c14866gag != null) {
return;
}
}
C5277bpx.e(this.b, th, C0690Mh.IeS.JUST_DISMISS);
}
public static /* synthetic */ void c(InterfaceC9262dgS interfaceC9262dgS) {
interfaceC9262dgS.ar_();
interfaceC9262dgS.m();
}
public static /* synthetic */ void a(InterfaceC9262dgS interfaceC9262dgS) {
interfaceC9262dgS.ar_();
interfaceC9262dgS.j();
}
}
/* renamed from: o.bpx$RVV */
/* loaded from: classes4.dex */
public static final class RVV extends wRi.LWm<Boolean> {
private C5277bpx c;
public RVV(C5277bpx c5277bpx) {
this.c = c5277bpx;
}
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final /* synthetic */ void onNext(Object obj) {
this.c.c();
}
@Override // o.wRi.LWm, o.InterfaceC13174fSv
public final void onError(Throwable th) {
C14957gcv.e(th, "");
C5277bpx.a(this.c, th);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.bpx$IeS */
/* loaded from: classes4.dex */
public static final class IeS extends AbstractC14961gcz implements InterfaceC14894gbR<BES, C14866gag> {
private Hzp c;
private C5277bpx d;
@Override // o.InterfaceC14894gbR
public final /* synthetic */ C14866gag invoke(BES bes) {
BES bes2 = bes;
if (this.c == Hzp.CAMERA) {
C5277bpx c5277bpx = this.d;
C14957gcv.c(bes2, "");
c5277bpx.c(bes2);
} else {
C5277bpx c5277bpx2 = this.d;
C14957gcv.c(bes2, "");
C14957gcv.e(bes2, "");
ZI.IeS ieS = new ZI.IeS() { // from class: o.bpJ
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9262dgS) obj).ar_();
}
};
if (c5277bpx2.f != 0) {
ieS.e(c5277bpx2.f);
}
String[] strArr = {"jpeg", "jpg", "png", "HEIC"};
C14957gcv.e(strArr, "");
Set e = C14875gap.e(strArr);
if (!(e instanceof Collection) || !e.isEmpty()) {
Iterator it = e.iterator();
while (it.hasNext()) {
if (gdZ.a((String) it.next(), C5277bpx.b(bes2.c), true)) {
C7926cxZ c7926cxZ = c5277bpx2.h;
Hzp hzp = Hzp.GALLERY;
C14957gcv.e(hzp, "");
c7926cxZ.d.c(hzp);
c5277bpx2.c(bes2);
break;
}
}
}
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bpK
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9262dgS) obj).i();
}
};
if (c5277bpx2.f != 0) {
ieS2.e(c5277bpx2.f);
}
}
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
IeS(Hzp hzp, C5277bpx c5277bpx) {
super(1);
this.c = hzp;
this.d = c5277bpx;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.bpx$LWm */
/* loaded from: classes4.dex */
public static final class LWm extends AbstractC14961gcz implements InterfaceC14894gbR<Throwable, C14866gag> {
private C5277bpx b;
@Override // o.InterfaceC14894gbR
public final /* synthetic */ C14866gag invoke(Throwable th) {
C5277bpx c5277bpx = this.b;
ZI.IeS ieS = new ZI.IeS() { // from class: o.bpL
@Override // o.ZI.IeS
public final void e(Object obj) {
C5277bpx.g((InterfaceC9262dgS) obj);
}
};
if (c5277bpx.f != 0) {
ieS.e(c5277bpx.f);
}
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
LWm(C5277bpx c5277bpx) {
super(1);
this.b = c5277bpx;
}
}
public final void b(AbstractC13175fSw<BES> abstractC13175fSw, Hzp hzp) {
C14957gcv.e(abstractC13175fSw, "");
C14957gcv.e(hzp, "");
ZI.IeS ieS = new ZI.IeS() { // from class: o.bpR
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9262dgS) obj).y();
}
};
if (this.f != 0) {
ieS.e(this.f);
}
final IeS ieS2 = new IeS(hzp, this);
fSQ<? super BES> fsq = new fSQ(ieS2) { // from class: o.bpP
private InterfaceC14894gbR d;
@Override // o.fSQ
public final void c(Object obj) {
C5277bpx.c(this.d, obj);
}
{
this.d = ieS2;
}
};
final LWm lWm = new LWm(this);
abstractC13175fSw.b(fsq, new fSQ(lWm) { // from class: o.bpN
private InterfaceC14894gbR c;
@Override // o.fSQ
public final void c(Object obj) {
C5277bpx.e(this.c, obj);
}
{
this.c = lWm;
}
});
}
public static /* synthetic */ void a(String str, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(str, "");
interfaceC9262dgS.c(str);
}
public static /* synthetic */ void c(boolean z, String str, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(str, "");
if (z) {
interfaceC9262dgS.d(str);
} else {
interfaceC9262dgS.ar_();
interfaceC9262dgS.h();
}
}
public static /* synthetic */ void e(InterfaceC14894gbR interfaceC14894gbR, Object obj) {
C14957gcv.e(interfaceC14894gbR, "");
interfaceC14894gbR.invoke(obj);
}
public static /* synthetic */ void c(InterfaceC14894gbR interfaceC14894gbR, Object obj) {
C14957gcv.e(interfaceC14894gbR, "");
interfaceC14894gbR.invoke(obj);
}
public static /* synthetic */ void a(String str, String str2, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
interfaceC9262dgS.d(str, str2, "pdf");
}
public static /* synthetic */ void c(C0791Oq c0791Oq, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(c0791Oq, "");
interfaceC9262dgS.a(c0791Oq.b);
interfaceC9262dgS.b(EBL.SUBMITTED != c0791Oq.c);
}
public static /* synthetic */ void g(InterfaceC9262dgS interfaceC9262dgS) {
interfaceC9262dgS.ar_();
interfaceC9262dgS.h();
}
public static /* synthetic */ void b(C5277bpx c5277bpx, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(c5277bpx, "");
interfaceC9262dgS.d(c5277bpx.n);
}
public static /* synthetic */ void e(C5277bpx c5277bpx, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(c5277bpx, "");
interfaceC9262dgS.e(c5277bpx.e);
}
public static /* synthetic */ void b(String str, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(str, "");
interfaceC9262dgS.e(str);
}
public static /* synthetic */ void a(C5277bpx c5277bpx, InterfaceC9262dgS interfaceC9262dgS) {
String str;
String str2 = "";
C14957gcv.e(c5277bpx, "");
Hzp hzp = Hzp.FILE_STORAGE;
C0791Oq c0791Oq = c5277bpx.g;
if (c0791Oq != null && (str = c0791Oq.a) != null) {
str2 = str;
}
interfaceC9262dgS.d(hzp, str2);
}
public static /* synthetic */ void d(C5277bpx c5277bpx, InterfaceC9262dgS interfaceC9262dgS) {
String str;
String str2 = "";
C14957gcv.e(c5277bpx, "");
Hzp hzp = Hzp.CAMERA;
C0791Oq c0791Oq = c5277bpx.g;
if (c0791Oq != null && (str = c0791Oq.a) != null) {
str2 = str;
}
interfaceC9262dgS.d(hzp, str2);
}
public static /* synthetic */ void c(C5277bpx c5277bpx, InterfaceC9262dgS interfaceC9262dgS) {
String str;
String str2 = "";
C14957gcv.e(c5277bpx, "");
Hzp hzp = Hzp.GALLERY;
C0791Oq c0791Oq = c5277bpx.g;
if (c0791Oq != null && (str = c0791Oq.a) != null) {
str2 = str;
}
interfaceC9262dgS.d(hzp, str2);
}
public static /* synthetic */ void h(C5277bpx c5277bpx, InterfaceC9262dgS interfaceC9262dgS) {
C14957gcv.e(c5277bpx, "");
interfaceC9262dgS.e(c5277bpx.e);
}
public static /* synthetic */ void d(Integer num, int i, int i2, int i3, InterfaceC9262dgS interfaceC9262dgS) {
if (num == null) {
if (i > i2) {
return;
}
} else if (i > i2 && num.intValue() > i3) {
if (i3 < num.intValue()) {
interfaceC9262dgS.b(num.toString());
return;
}
return;
}
interfaceC9262dgS.g();
}
public static final /* synthetic */ void b(C5277bpx c5277bpx) {
if (c5277bpx.f != 0) {
c5277bpx.f.ar_();
}
}
public static final /* synthetic */ void a(C5277bpx c5277bpx, Throwable th) {
if (c5277bpx.b(th)) {
c5277bpx.d(c5277bpx.j.e(th));
}
}
public static final /* synthetic */ void e(C5277bpx c5277bpx, Throwable th, C0690Mh.IeS ieS) {
if (c5277bpx.b(th)) {
c5277bpx.d(c5277bpx.j.d(th, ieS));
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void c(BES bes) {
String str;
if (this.f != 0) {
this.f.y();
}
C1100VpK c1100VpK = this.c;
C0791Oq c0791Oq = this.g;
if (c0791Oq == null || (str = c0791Oq.a) == null) {
str = "";
}
c1100VpK.d(bes, str);
this.q = true;
C1100VpK c1100VpK2 = this.c;
c1100VpK2.d(c1100VpK2.i, new tOB(this));
}
@Override // o.ZI
public final void w_() {
zOI zoi = this.m;
if (!zoi.h.isDisposed()) {
zoi.h.dispose();
}
YeV yeV = this.a;
if (!yeV.h.isDisposed()) {
yeV.h.dispose();
}
C1100VpK c1100VpK = this.c;
if (!c1100VpK.h.isDisposed()) {
c1100VpK.h.dispose();
}
super.w_();
}
public final void c() {
String str;
if (this.f != 0) {
this.f.y();
}
zOI zoi = this.m;
C0791Oq c0791Oq = this.g;
if (c0791Oq == null || (str = c0791Oq.a) == null) {
str = "";
}
zoi.d(str);
zOI zoi2 = this.m;
zoi2.d(zoi2.i, new saX(this));
}
/* renamed from: o.bpx$Sts */
/* loaded from: classes4.dex */
public final /* synthetic */ class Sts {
public static final int[] b;
static {
int[] iArr = new int[Hzp.values().length];
try {
iArr[Hzp.CAMERA.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[Hzp.FILE_STORAGE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[Hzp.GALLERY.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
b = iArr;
}
}
static {
new HBt((byte) 0);
}
}