package o; import android.content.SharedPreferences; import android.content.res.Resources; import com.scb.phone.presentation.mapper.transferandpay.BaseAssetsDisplayMapper; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.Iterator; import java.util.List; import o.C15715hv; import o.LhO; /* renamed from: o.yM, reason: case insensitive filesystem */ /* loaded from: classes3.dex */ public class C17615yM extends BaseAssetsDisplayMapper { private final String a; private final String d; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ @InterfaceC13391fZD public C17615yM(Resources resources, SharedPreferences sharedPreferences, String str, String str2, String str3) { super(resources, sharedPreferences, str2); C14957gcv.e(resources, ""); C14957gcv.e(sharedPreferences, ""); C14957gcv.e(str, ""); C14957gcv.e(str2, ""); C14957gcv.e(str3, ""); this.d = str; this.a = str3; } public final List d(List list, boolean z) { String str; List list2; C14957gcv.e(list, ""); ArrayList arrayList = new ArrayList(); for (Object obj : list) { QJg qJg = (QJg) obj; if (C14957gcv.b((Object) qJg.L, (Object) "GROUP") && (str = qJg.F) != null) { int hashCode = str.hashCode(); if (hashCode != -1842543390) { if (hashCode != 465373944) { if (hashCode == 1729844006 && str.equals("CARD_TILE_HORIZONTAL")) { list2 = qJg.M; if (list2 != null && !list2.isEmpty()) { arrayList.add(obj); } } } else if (str.equals("CARD_TILE_VERTICAL")) { list2 = qJg.M; if (list2 != null) { arrayList.add(obj); } } } else if (str.equals("CARD_TILE_CAROUSEL")) { List list3 = qJg.e; C14957gcv.c(list3, ""); ArrayList arrayList2 = new ArrayList(); for (Object obj2 : list3) { LhO lhO = (LhO) obj2; C14957gcv.e(lhO, ""); if (lhO.j == LhO.RVV.IMAGE) { arrayList2.add(obj2); } } if (!arrayList2.isEmpty()) { arrayList.add(obj); } } } } ArrayList arrayList3 = new ArrayList(); Iterator it = arrayList.iterator(); while (it.hasNext()) { C14881gav.d(arrayList3, e((QJg) it.next(), z, (QJg) null)); } return arrayList3; } /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ public final List e(QJg qJg, boolean z, QJg qJg2) { C14957gcv.e(qJg, ""); List d = C14881gav.d(d(qJg)); if (qJg2 != null) { d = C14881gav.d(d(qJg2)); } String str = qJg.F; if (str != null) { switch (str.hashCode()) { case -2131401768: if (str.equals("FUNCTION")) { d.add(c(qJg, z)); break; } break; case -1842543390: if (str.equals("CARD_TILE_CAROUSEL")) { List list = qJg.e; C14957gcv.c(list, ""); d.add(new C1020Tx(qJg, e(list), qJg.p)); break; } break; case 465373944: if (str.equals("CARD_TILE_VERTICAL")) { List list2 = qJg.M; C14957gcv.c(list2, ""); d.addAll(a(list2, z)); break; } break; case 1729844006: if (str.equals("CARD_TILE_HORIZONTAL")) { d.add(b(qJg, z)); break; } break; } } return d; } private final List a(List list, boolean z) { List list2 = list; C14957gcv.e(list2, ""); ArrayList arrayList = new ArrayList(list2 instanceof Collection ? list2.size() : 10); Iterator it = list2.iterator(); while (it.hasNext()) { arrayList.add(c((QJg) it.next(), z)); } return C14881gav.a((Iterable) arrayList, (Comparator) new IeS()); } /* renamed from: o.yM$IeS */ /* loaded from: classes3.dex */ public static final class IeS implements Comparator { /* JADX WARN: Multi-variable type inference failed */ @Override // java.util.Comparator public final int compare(T t, T t2) { Integer valueOf = Integer.valueOf(((TF) t).i); Integer valueOf2 = Integer.valueOf(((TF) t2).i); if (valueOf == valueOf2) { return 0; } if (valueOf == null) { return -1; } if (valueOf2 == null) { return 1; } return valueOf.compareTo(valueOf2); } } private final List e(List list) { List c = C14881gav.c(list, 10); C14957gcv.e(c, ""); ArrayList arrayList = new ArrayList(c instanceof Collection ? c.size() : 10); for (LhO lhO : c) { String str = lhO.f.c; String str2 = lhO.f.d; if (!C14957gcv.b((Object) this.d, (Object) "th")) { str = str2; } if (str == null) { str = ""; } String j = j(str, lhO.h, this.a); C14957gcv.c((Object) j, ""); int i = C15715hv.IeS.donations_place_holder; String str3 = lhO.a; String str4 = lhO.b; String str5 = lhO.e.c; String str6 = lhO.e.d; if (!C14957gcv.b((Object) this.d, (Object) "th")) { str5 = str6; } arrayList.add(new C1023Tz(j, i, str3, str4, str5 == null ? "" : str5)); } return arrayList; } /* renamed from: o.yM$HBt */ /* loaded from: classes3.dex */ public static final class HBt { private HBt() { } public /* synthetic */ HBt(byte b) { this(); } } private final TA d(QJg qJg) { String str = qJg.G; String str2 = qJg.I; if (!C14957gcv.b((Object) this.d, (Object) "th")) { str = str2; } if (str == null) { str = ""; } return new TA(qJg, str, qJg.p); } private final C1021Ty b(QJg qJg, boolean z) { List list = qJg.M; C14957gcv.c(list, ""); List list2 = list; C14957gcv.e(list2, ""); ArrayList arrayList = new ArrayList(list2 instanceof Collection ? list2.size() : 10); for (QJg qJg2 : list2) { C14957gcv.c(qJg2, ""); arrayList.add(c(qJg2, z)); } return new C1021Ty(qJg, arrayList, qJg.p); } private final TB c(QJg qJg, boolean z) { String b_ = b_(qJg.k); C14957gcv.c((Object) b_, ""); if (b_.length() <= 0) { b_ = null; } String str = b_; String str2 = qJg.G; String str3 = qJg.I; if (!C14957gcv.b((Object) this.d, (Object) "th")) { str2 = str3; } if (str2 == null) { str2 = ""; } String str4 = qJg.x; String str5 = qJg.r; if (!C14957gcv.b((Object) this.d, (Object) "th")) { str4 = str5; } return new TB(qJg, str, str2, str4 == null ? "" : str4, qJg.q == 1, z ? TH.NTB : TH.ETB, qJg.p); } public static boolean e(LhO lhO) { C14957gcv.e(lhO, ""); return lhO.j == LhO.RVV.IMAGE; } public final String e(QJg qJg) { String str = qJg != null ? qJg.v : null; String str2 = qJg != null ? qJg.y : null; if (!C14957gcv.b((Object) this.d, (Object) "th")) { str = str2; } return str == null ? "" : str; } public final String a(QJg qJg) { String str = qJg != null ? qJg.G : null; String str2 = qJg != null ? qJg.I : null; if (!C14957gcv.b((Object) this.d, (Object) "th")) { str = str2; } return str == null ? "" : str; } static { new HBt((byte) 0); } }