package cc;

import ca.canadapost.core.data.auth.model.Scope;
import java.util.Iterator;
import java.util.List;

/* loaded from: classes4.dex */
public final class m {

    /* renamed from: a, reason: collision with root package name */
    private final t7.c f11647a;

    /* renamed from: b, reason: collision with root package name */
    private final /* synthetic */ s8.q f11648b;

    /* renamed from: c, reason: collision with root package name */
    private androidx.lifecycle.f0 f11649c;

    /* renamed from: d, reason: collision with root package name */
    private androidx.lifecycle.f0 f11650d;

    /* renamed from: e, reason: collision with root package name */
    private androidx.lifecycle.f0 f11651e;

    /* renamed from: f, reason: collision with root package name */
    private final androidx.lifecycle.a0 f11652f;

    /* renamed from: g, reason: collision with root package name */
    private final androidx.lifecycle.a0 f11653g;

    /* renamed from: h, reason: collision with root package name */
    private final androidx.lifecycle.a0 f11654h;

    /* renamed from: i, reason: collision with root package name */
    private final androidx.lifecycle.a0 f11655i;

    /* renamed from: j, reason: collision with root package name */
    private final androidx.lifecycle.a0 f11656j;

    /* loaded from: classes4.dex */
    static final class a extends kotlin.jvm.internal.v implements dn.l {
        a() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final String invoke(List list) {
            return m.this.g(list, "province");
        }
    }

    /* loaded from: classes4.dex */
    static final class b extends kotlin.jvm.internal.v implements dn.l {
        b() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final String invoke(List list) {
            return m.this.g(list, "addressLine1");
        }
    }

    /* loaded from: classes4.dex */
    static final class c extends kotlin.jvm.internal.v implements dn.l {
        c() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final String invoke(List list) {
            return m.this.g(list, "addressLine2");
        }
    }

    /* loaded from: classes4.dex */
    static final class d extends kotlin.jvm.internal.v implements dn.l {
        d() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final String invoke(List list) {
            return m.this.g(list, "city");
        }
    }

    /* loaded from: classes4.dex */
    static final class e extends kotlin.jvm.internal.v implements dn.l {
        e() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final String invoke(List list) {
            return m.this.g(list, "postCode");
        }
    }

    public m(ka.b repository, t7.c contextService) {
        kotlin.jvm.internal.t.g(repository, "repository");
        kotlin.jvm.internal.t.g(contextService, "contextService");
        this.f11647a = contextService;
        this.f11648b = new s8.q(contextService);
        this.f11649c = new androidx.lifecycle.f0();
        this.f11650d = new androidx.lifecycle.f0();
        this.f11651e = new androidx.lifecycle.f0();
        this.f11652f = androidx.lifecycle.y0.a(repository.I(), new b());
        this.f11653g = androidx.lifecycle.y0.a(repository.I(), new c());
        this.f11654h = androidx.lifecycle.y0.a(repository.I(), new d());
        this.f11655i = androidx.lifecycle.y0.a(repository.I(), new a());
        this.f11656j = androidx.lifecycle.y0.a(repository.I(), new e());
    }

    /* JADX WARN: Code restructure failed: missing block: B:10:0x003a, code lost:
    
        if (r4.equals("StreetNotFound") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:11:0x0158, code lost:
    
        r3 = r3.f11647a.getString(ob.l.f31354w0);
        kotlin.jvm.internal.t.f(r3, "getString(...)");
        r0.append(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:13:0x0044, code lost:
    
        if (r4.equals("StreetDirectionMissing") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:15:0x004e, code lost:
    
        if (r4.equals("StreetNumberNotFound") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:16:0x005c, code lost:
    
        r3 = r3.f11647a.getString(ob.l.f31359x0);
        kotlin.jvm.internal.t.f(r3, "getString(...)");
        r0.append(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:18:0x0058, code lost:
    
        if (r4.equals("StreetNumberInvalid") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:20:0x0072, code lost:
    
        if (r4.equals("POBoxInvalid") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:21:0x00dc, code lost:
    
        r3 = r3.f11647a.getString(ob.l.f31339t0);
        kotlin.jvm.internal.t.f(r3, "getString(...)");
        r0.append(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x007c, code lost:
    
        if (r4.equals("POBoxNotFound") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0086, code lost:
    
        if (r4.equals("StreetTypeInvalid") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:30:0x00aa, code lost:
    
        if (r4.equals("StreetNumberSuffixMissing") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:0x012b, code lost:
    
        r0.append(r3.f11647a.getString(ob.l.f31364y0));
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x00b4, code lost:
    
        if (r4.equals("RuralRouteNotFound") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x0140, code lost:
    
        r3 = r3.f11647a.getString(ob.l.f31349v0);
        kotlin.jvm.internal.t.f(r3, "getString(...)");
        r0.append(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:39:0x00d8, code lost:
    
        if (r4.equals("POBoxMissing") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:41:0x00f2, code lost:
    
        if (r4.equals("StreetTypeMissing") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x00fc, code lost:
    
        if (r4.equals("RuralRouteInvalid") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:48:0x011f, code lost:
    
        if (r4.equals("SuiteInvalid") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:4:0x0016, code lost:
    
        if (r4.equals("SuiteNotFound") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:50:0x0128, code lost:
    
        if (r4.equals("StreetNumberSuffixNotFound") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:52:0x013d, code lost:
    
        if (r4.equals("RuralRouteMissing") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x0155, code lost:
    
        if (r4.equals("StreetDirectionInvalid") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x016d, code lost:
    
        if (r4.equals("SuiteMissing") == false) goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:5:0x0170, code lost:
    
        r3 = r3.f11647a.getString(ob.l.A0);
        kotlin.jvm.internal.t.f(r3, "getString(...)");
        r0.append(r3);
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final String b(String str) {
        StringBuilder sb2 = new StringBuilder();
        switch (str.hashCode()) {
            case -1962029202:
                break;
            case -1818771525:
                break;
            case -1618329897:
                break;
            case -1600719028:
                break;
            case -1071693825:
                break;
            case -742842233:
                if (str.equals("ProvinceInvalid")) {
                    String string = this.f11647a.getString(ob.l.f31344u0);
                    kotlin.jvm.internal.t.f(string, "getString(...)");
                    sb2.append(string);
                    break;
                }
                break;
            case -727994520:
                break;
            case -502178647:
                break;
            case -214547334:
                break;
            case -187995861:
                if (str.equals("MunicipalityNotFound")) {
                    String string2 = this.f11647a.getString(ob.l.f31334s0);
                    kotlin.jvm.internal.t.f(string2, "getString(...)");
                    sb2.append(string2);
                    break;
                }
                break;
            case -163464930:
                break;
            case -140672279:
                break;
            case -95857313:
                if (str.equals("PostalCodeInvalid")) {
                    String string3 = this.f11647a.getString(ob.l.B1);
                    kotlin.jvm.internal.t.f(string3, "getString(...)");
                    sb2.append(string3);
                    break;
                }
                break;
            case 388156730:
                break;
            case 404121563:
                break;
            case 675788043:
                break;
            case 696393483:
                break;
            case 1042890203:
                break;
            case 1585860394:
                break;
            case 1779013042:
                break;
            case 2033283541:
                if (str.equals("StreetAddressMissing")) {
                    String string4 = this.f11647a.getString(ob.l.f31369z0);
                    kotlin.jvm.internal.t.f(string4, "getString(...)");
                    sb2.append(string4);
                    break;
                }
                break;
            case 2066758503:
                break;
        }
        String sb3 = sb2.toString();
        kotlin.jvm.internal.t.f(sb3, "toString(...)");
        return sb3;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final String g(List list, String str) {
        List list2 = list;
        String str2 = null;
        if (!(list2 == null || list2.isEmpty())) {
            Iterator it = list.iterator();
            while (it.hasNext()) {
                Scope scope = (Scope) it.next();
                if (kotlin.jvm.internal.t.b(scope.getField(), str)) {
                    str2 = b(scope.getErrorCode());
                }
            }
        }
        return str2;
    }

    public boolean c() {
        boolean C;
        String str = (String) l().f();
        if (str == null) {
            return false;
        }
        C = kotlin.text.y.C(str);
        return !C;
    }

    public boolean d() {
        boolean C;
        String str = (String) m().f();
        if (str == null) {
            return false;
        }
        C = kotlin.text.y.C(str);
        return !C;
    }

    public boolean e() {
        return qa.d.l((String) n().f());
    }

    public boolean f() {
        return this.f11648b.d();
    }

    public androidx.lifecycle.a0 h() {
        return this.f11648b.e();
    }

    public androidx.lifecycle.a0 i() {
        return this.f11648b.f();
    }

    public androidx.lifecycle.a0 j() {
        return this.f11648b.g();
    }

    public androidx.lifecycle.a0 k() {
        return this.f11648b.h();
    }

    public androidx.lifecycle.f0 l() {
        return this.f11649c;
    }

    public androidx.lifecycle.f0 m() {
        return this.f11650d;
    }

    public androidx.lifecycle.f0 n() {
        return this.f11651e;
    }

    public androidx.lifecycle.f0 o() {
        return this.f11648b.l();
    }

    public androidx.lifecycle.a0 p() {
        return this.f11655i;
    }

    public androidx.lifecycle.a0 q() {
        return this.f11652f;
    }

    public androidx.lifecycle.a0 r() {
        return this.f11653g;
    }

    public androidx.lifecycle.a0 s() {
        return this.f11654h;
    }

    public androidx.lifecycle.a0 t() {
        return this.f11656j;
    }

    public boolean u() {
        return c() && d() && e();
    }
}
