package ca.canadapost.module.epostprofile.userprofile;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import androidx.activity.p;
import androidx.activity.q;
import androidx.lifecycle.c1;
import androidx.lifecycle.g0;
import androidx.lifecycle.u;
import ca.canadapost.core.common.customView.CpcDropdownInput;
import ca.canadapost.core.data.model.ResultWrapper;
import ca.canadapost.core.data.model.ValidationError;
import ca.canadapost.module.epostprofile.userprofile.EpostEnterSecurityQuestionsFragment;
import cc.s;
import com.google.firebase.messaging.Constants;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import l8.h;
import ob.j;
import rm.i;
import rm.n0;
import w8.k;
import w8.l;
import w8.o;
import w8.p0;
import zb.a1;

@Metadata(d1 = {"\u0000\u009f\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\b\u0007\n\u0002\b\u0007*\u0001K\b\u0007\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u0003B\u0007¢\u0006\u0004\bO\u0010PJ\b\u0010\u0005\u001a\u00020\u0004H\u0002J\"\u0010\f\u001a\u00020\u000b2\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\b2\b\u0010\n\u001a\u0004\u0018\u00010\u0006H\u0002J\u0019\u0010\u0011\u001a\u00020\u000b2\u0006\u0010\u000e\u001a\u00020\r2\u0006\u0010\u0010\u001a\u00020\u000fH\u0096\u0001J\u001b\u0010\u0016\u001a\u00020\u00062\b\u0010\u0013\u001a\u0004\u0018\u00010\u00122\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J#\u0010\u0019\u001a\u00020\u00062\u0006\u0010\u0017\u001a\u00020\u00062\b\u0010\u0018\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u001b\u0010\u001a\u001a\u00020\u00062\b\u0010\u0013\u001a\u0004\u0018\u00010\u00122\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0019\u0010\u001b\u001a\u00020\u00062\u0006\u0010\u0017\u001a\u00020\u00062\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0011\u0010\u001c\u001a\u00020\u00062\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0011\u0010\u001d\u001a\u00020\u00062\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0011\u0010\u001e\u001a\u00020\u00062\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0019\u0010 \u001a\u00020\u000b2\u0006\u0010\u000e\u001a\u00020\u001f2\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0019\u0010!\u001a\u00020\u000b2\u0006\u0010\u0010\u001a\u00020\u000f2\u0006\u0010\u000e\u001a\u00020\u001fH\u0096\u0001J\u0011\u0010\"\u001a\u00020\u000b2\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0019\u0010#\u001a\u00020\u000b2\u0006\u0010\u0010\u001a\u00020\u000f2\u0006\u0010\u000e\u001a\u00020\u001fH\u0096\u0001J\u001b\u0010%\u001a\u00020\u000b2\b\u0010$\u001a\u0004\u0018\u00010\u00122\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0019\u0010(\u001a\u00020\u000b2\u0006\u0010'\u001a\u00020&2\u0006\u0010\u0010\u001a\u00020\u000fH\u0096\u0001J\u0019\u0010-\u001a\u00020\u000b2\u0006\u0010*\u001a\u00020)2\u0006\u0010,\u001a\u00020+H\u0096\u0001J\u0019\u0010.\u001a\u00020\u000b2\u0006\u0010\u0010\u001a\u00020\u000f2\u0006\u0010,\u001a\u00020+H\u0096\u0001J\u0012\u00101\u001a\u00020\u000b2\b\u00100\u001a\u0004\u0018\u00010/H\u0016J&\u00107\u001a\u0004\u0018\u0001062\u0006\u00103\u001a\u0002022\b\u00105\u001a\u0004\u0018\u0001042\b\u00100\u001a\u0004\u0018\u00010/H\u0016J\u001a\u00109\u001a\u00020\u000b2\u0006\u00108\u001a\u0002062\b\u00100\u001a\u0004\u0018\u00010/H\u0016J\b\u0010:\u001a\u00020\u0004H\u0016R\u0016\u0010>\u001a\u00020;8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b<\u0010=R\u0016\u0010B\u001a\u00020?8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b@\u0010AR\u001c\u0010F\u001a\b\u0012\u0004\u0012\u00020\u00060C8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bD\u0010ER\u001c\u0010H\u001a\b\u0012\u0004\u0012\u00020\u00060C8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bG\u0010ER\u001c\u0010J\u001a\b\u0012\u0004\u0012\u00020\u00060C8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bI\u0010ER\u0014\u0010N\u001a\u00020K8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bL\u0010M¨\u0006Q"}, d2 = {"Lca/canadapost/module/epostprofile/userprofile/EpostEnterSecurityQuestionsFragment;", "Lu8/b;", "Lw8/o;", "Lw8/p0;", "", "O", "", "selectedValue", "Lca/canadapost/core/common/customView/CpcDropdownInput;", "adapter", "selection", "Lrm/n0;", "R", "Ll8/c;", Constants.IPC_BUNDLE_KEY_SEND_ERROR, "Landroidx/fragment/app/f;", "fragment", "M", "Lca/canadapost/core/data/model/ValidationError;", "validationError", "Landroid/content/Context;", "context", "m", "code", "message", "n", "i", "j", "h", "d", "a", "Lca/canadapost/core/data/model/ResultWrapper$Error;", "e", "l", "o", "g", "valError", "k", "Ll8/h;", "spinnerVM", "N", "Landroid/app/Activity;", "activity", "Ll8/h$b;", "event", "c", "p", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "E", "Lzb/a1;", "u", "Lzb/a1;", "binding", "Lcc/s;", "v", "Lcc/s;", "viewModel", "", "w", "[Ljava/lang/String;", "secretQuestionList", "x", "secretQuestionListEn", "y", "secretQuestionListFr", "ca/canadapost/module/epostprofile/userprofile/EpostEnterSecurityQuestionsFragment$a", "z", "Lca/canadapost/module/epostprofile/userprofile/EpostEnterSecurityQuestionsFragment$a;", "onBackPressedCallback", "<init>", "()V", "epostprofile_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class EpostEnterSecurityQuestionsFragment extends u8.b implements o, p0 {

    /* renamed from: u, reason: collision with root package name and from kotlin metadata */
    private a1 binding;

    /* renamed from: v, reason: collision with root package name and from kotlin metadata */
    private s viewModel;

    /* renamed from: w, reason: collision with root package name and from kotlin metadata */
    private String[] secretQuestionList;

    /* renamed from: x, reason: collision with root package name and from kotlin metadata */
    private String[] secretQuestionListEn;

    /* renamed from: y, reason: collision with root package name and from kotlin metadata */
    private String[] secretQuestionListFr;

    /* renamed from: s, reason: collision with root package name */
    private final /* synthetic */ k f8821s = new k(null, null, null, 7, null);

    /* renamed from: t, reason: collision with root package name */
    private final /* synthetic */ l f8822t = new l();

    /* renamed from: z, reason: collision with root package name and from kotlin metadata */
    private final a onBackPressedCallback = new a();

    /* loaded from: classes4.dex */
    public static final class a extends p {
        a() {
            super(false);
        }

        @Override // androidx.activity.p
        public void d() {
            EpostEnterSecurityQuestionsFragment.this.C();
            if (EpostEnterSecurityQuestionsFragment.this.O()) {
                s sVar = EpostEnterSecurityQuestionsFragment.this.viewModel;
                if (sVar == null) {
                    t.y("viewModel");
                    sVar = null;
                }
                sVar.Y();
                j(false);
            }
        }
    }

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

        public final void a(Boolean bool) {
            t.d(bool);
            a1 a1Var = null;
            if (!bool.booleanValue()) {
                a1 a1Var2 = EpostEnterSecurityQuestionsFragment.this.binding;
                if (a1Var2 == null) {
                    t.y("binding");
                } else {
                    a1Var = a1Var2;
                }
                a1Var.A.A.setErrorEnabled(false);
                return;
            }
            a1 a1Var3 = EpostEnterSecurityQuestionsFragment.this.binding;
            if (a1Var3 == null) {
                t.y("binding");
                a1Var3 = null;
            }
            a1Var3.A.A.setErrorEnabled(true);
            a1 a1Var4 = EpostEnterSecurityQuestionsFragment.this.binding;
            if (a1Var4 == null) {
                t.y("binding");
            } else {
                a1Var = a1Var4;
            }
            a1Var.A.A.setError(EpostEnterSecurityQuestionsFragment.this.getString(ob.l.K2));
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Boolean) obj);
            return n0.f34904a;
        }
    }

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

        public final void a(Boolean bool) {
            t.d(bool);
            a1 a1Var = null;
            if (!bool.booleanValue()) {
                a1 a1Var2 = EpostEnterSecurityQuestionsFragment.this.binding;
                if (a1Var2 == null) {
                    t.y("binding");
                } else {
                    a1Var = a1Var2;
                }
                a1Var.A.B.setErrorEnabled(false);
                return;
            }
            a1 a1Var3 = EpostEnterSecurityQuestionsFragment.this.binding;
            if (a1Var3 == null) {
                t.y("binding");
                a1Var3 = null;
            }
            a1Var3.A.B.setErrorEnabled(true);
            a1 a1Var4 = EpostEnterSecurityQuestionsFragment.this.binding;
            if (a1Var4 == null) {
                t.y("binding");
            } else {
                a1Var = a1Var4;
            }
            a1Var.A.B.setError(EpostEnterSecurityQuestionsFragment.this.getString(ob.l.K2));
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Boolean) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class d extends v implements dn.l {

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes4.dex */
        public static final class a extends v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ EpostEnterSecurityQuestionsFragment f8833p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            a(EpostEnterSecurityQuestionsFragment epostEnterSecurityQuestionsFragment) {
                super(0);
                this.f8833p = epostEnterSecurityQuestionsFragment;
            }

            @Override // dn.a
            public /* bridge */ /* synthetic */ Object invoke() {
                m104invoke();
                return n0.f34904a;
            }

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m104invoke() {
                s sVar = this.f8833p.viewModel;
                if (sVar == null) {
                    t.y("viewModel");
                    sVar = null;
                }
                sVar.a0();
            }
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes4.dex */
        public static final class b extends v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ EpostEnterSecurityQuestionsFragment f8834p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            b(EpostEnterSecurityQuestionsFragment epostEnterSecurityQuestionsFragment) {
                super(0);
                this.f8834p = epostEnterSecurityQuestionsFragment;
            }

            @Override // dn.a
            public /* bridge */ /* synthetic */ Object invoke() {
                m105invoke();
                return n0.f34904a;
            }

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m105invoke() {
                s sVar = this.f8834p.viewModel;
                if (sVar == null) {
                    t.y("viewModel");
                    sVar = null;
                }
                sVar.Z();
            }
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes4.dex */
        public static final class c extends v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ EpostEnterSecurityQuestionsFragment f8835p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            c(EpostEnterSecurityQuestionsFragment epostEnterSecurityQuestionsFragment) {
                super(0);
                this.f8835p = epostEnterSecurityQuestionsFragment;
            }

            @Override // dn.a
            public /* bridge */ /* synthetic */ Object invoke() {
                m106invoke();
                return n0.f34904a;
            }

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m106invoke() {
                s sVar = this.f8835p.viewModel;
                if (sVar == null) {
                    t.y("viewModel");
                    sVar = null;
                }
                sVar.Z();
            }
        }

        d() {
            super(1);
        }

        public final void a(n0 n0Var) {
            u8.g c10 = u8.g.f36993k.c(EpostEnterSecurityQuestionsFragment.this.requireContext());
            EpostEnterSecurityQuestionsFragment epostEnterSecurityQuestionsFragment = EpostEnterSecurityQuestionsFragment.this;
            c10.o(new a(epostEnterSecurityQuestionsFragment));
            c10.r(new b(epostEnterSecurityQuestionsFragment));
            c10.q(new c(epostEnterSecurityQuestionsFragment));
            c10.x(EpostEnterSecurityQuestionsFragment.this.requireContext());
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((n0) obj);
            return n0.f34904a;
        }
    }

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

        public final void a(n0 n0Var) {
            EpostEnterSecurityQuestionsFragment.this.C();
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((n0) obj);
            return n0.f34904a;
        }
    }

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

        public final void a(n0 n0Var) {
            x4.d.a(EpostEnterSecurityQuestionsFragment.this).U();
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((n0) obj);
            return n0.f34904a;
        }
    }

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

        public final void a(Boolean bool) {
            a aVar = EpostEnterSecurityQuestionsFragment.this.onBackPressedCallback;
            t.d(bool);
            aVar.j(bool.booleanValue());
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Boolean) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class h implements g0, n {

        /* renamed from: a, reason: collision with root package name */
        private final /* synthetic */ dn.l f8839a;

        h(dn.l function) {
            t.g(function, "function");
            this.f8839a = function;
        }

        @Override // kotlin.jvm.internal.n
        public final i b() {
            return this.f8839a;
        }

        @Override // androidx.lifecycle.g0
        public final /* synthetic */ void d(Object obj) {
            this.f8839a.invoke(obj);
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof g0) && (obj instanceof n)) {
                return t.b(b(), ((n) obj).b());
            }
            return false;
        }

        public final int hashCode() {
            return b().hashCode();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final boolean O() {
        s sVar = this.viewModel;
        if (sVar == null) {
            t.y("viewModel");
            sVar = null;
        }
        Boolean bool = (Boolean) sVar.V().f();
        if (bool == null) {
            return false;
        }
        return bool.booleanValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void P(EpostEnterSecurityQuestionsFragment this$0, AdapterView adapterView, View view, int i10, long j10) {
        t.g(this$0, "this$0");
        a1 a1Var = this$0.binding;
        s sVar = null;
        if (a1Var == null) {
            t.y("binding");
            a1Var = null;
        }
        ca.canadapost.core.common.customView.i adapter = a1Var.A.C.getAdapter();
        Object item = adapter != null ? adapter.getItem(i10) : null;
        t.e(item, "null cannot be cast to non-null type kotlin.String");
        String str = (String) item;
        s sVar2 = this$0.viewModel;
        if (sVar2 == null) {
            t.y("viewModel");
            sVar2 = null;
        }
        sVar2.C0(str);
        a1 a1Var2 = this$0.binding;
        if (a1Var2 == null) {
            t.y("binding");
            a1Var2 = null;
        }
        CpcDropdownInput secretQuestion2DropDown = a1Var2.A.D;
        t.f(secretQuestion2DropDown, "secretQuestion2DropDown");
        s sVar3 = this$0.viewModel;
        if (sVar3 == null) {
            t.y("viewModel");
        } else {
            sVar = sVar3;
        }
        this$0.R(str, secretQuestion2DropDown, (String) sVar.w0().f());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void Q(EpostEnterSecurityQuestionsFragment this$0, AdapterView adapterView, View view, int i10, long j10) {
        t.g(this$0, "this$0");
        a1 a1Var = this$0.binding;
        s sVar = null;
        if (a1Var == null) {
            t.y("binding");
            a1Var = null;
        }
        ca.canadapost.core.common.customView.i adapter = a1Var.A.D.getAdapter();
        Object item = adapter != null ? adapter.getItem(i10) : null;
        t.e(item, "null cannot be cast to non-null type kotlin.String");
        String str = (String) item;
        s sVar2 = this$0.viewModel;
        if (sVar2 == null) {
            t.y("viewModel");
            sVar2 = null;
        }
        sVar2.D0(str);
        a1 a1Var2 = this$0.binding;
        if (a1Var2 == null) {
            t.y("binding");
            a1Var2 = null;
        }
        CpcDropdownInput secretQuestion1DropDown = a1Var2.A.C;
        t.f(secretQuestion1DropDown, "secretQuestion1DropDown");
        s sVar3 = this$0.viewModel;
        if (sVar3 == null) {
            t.y("viewModel");
        } else {
            sVar = sVar3;
        }
        this$0.R(str, secretQuestion1DropDown, (String) sVar.v0().f());
    }

    private final void R(String str, CpcDropdownInput cpcDropdownInput, String str2) {
        List S0;
        List S02;
        List S03;
        String[] strArr = this.secretQuestionList;
        s sVar = null;
        if (strArr == null) {
            t.y("secretQuestionList");
            strArr = null;
        }
        S0 = sm.p.S0(strArr);
        String[] strArr2 = this.secretQuestionListEn;
        if (strArr2 == null) {
            t.y("secretQuestionListEn");
            strArr2 = null;
        }
        S02 = sm.p.S0(strArr2);
        String[] strArr3 = this.secretQuestionListFr;
        if (strArr3 == null) {
            t.y("secretQuestionListFr");
            strArr3 = null;
        }
        S03 = sm.p.S0(strArr3);
        S0.remove(str);
        S02.remove(str);
        S03.remove(str);
        cpcDropdownInput.setAdapter(new ca.canadapost.core.common.customView.i(getContext(), S0));
        s sVar2 = this.viewModel;
        if (sVar2 == null) {
            t.y("viewModel");
        } else {
            sVar = sVar2;
        }
        cpcDropdownInput.setSelection(sVar.x0(S02, S03, str2));
    }

    @Override // u8.b
    public boolean E() {
        s sVar = this.viewModel;
        if (sVar == null) {
            t.y("viewModel");
            sVar = null;
        }
        return sVar.Y();
    }

    public void M(l8.c error, androidx.fragment.app.f fragment) {
        t.g(error, "error");
        t.g(fragment, "fragment");
        this.f8821s.b(error, fragment);
    }

    public void N(l8.h spinnerVM, androidx.fragment.app.f fragment) {
        t.g(spinnerVM, "spinnerVM");
        t.g(fragment, "fragment");
        this.f8822t.b(spinnerVM, fragment);
    }

    @Override // w8.o
    public String a(Context context) {
        t.g(context, "context");
        return this.f8821s.a(context);
    }

    @Override // w8.p0
    public void c(Activity activity, h.b event) {
        t.g(activity, "activity");
        t.g(event, "event");
        this.f8822t.c(activity, event);
    }

    @Override // w8.o
    public String d(Context context) {
        t.g(context, "context");
        return this.f8821s.d(context);
    }

    @Override // w8.o
    public void e(ResultWrapper.Error error, Context context) {
        t.g(error, "error");
        t.g(context, "context");
        this.f8821s.e(error, context);
    }

    @Override // w8.o
    public void g(androidx.fragment.app.f fragment, ResultWrapper.Error error) {
        t.g(fragment, "fragment");
        t.g(error, "error");
        this.f8821s.g(fragment, error);
    }

    @Override // w8.o
    public String h(Context context) {
        t.g(context, "context");
        return this.f8821s.h(context);
    }

    @Override // w8.o
    public String i(ValidationError validationError, Context context) {
        t.g(context, "context");
        return this.f8821s.i(validationError, context);
    }

    @Override // w8.o
    public String j(String code, Context context) {
        t.g(code, "code");
        t.g(context, "context");
        return this.f8821s.j(code, context);
    }

    @Override // w8.o
    public void k(ValidationError validationError, Context context) {
        t.g(context, "context");
        this.f8821s.k(validationError, context);
    }

    @Override // w8.o
    public void l(androidx.fragment.app.f fragment, ResultWrapper.Error error) {
        t.g(fragment, "fragment");
        t.g(error, "error");
        this.f8821s.l(fragment, error);
    }

    @Override // w8.o
    public String m(ValidationError validationError, Context context) {
        t.g(context, "context");
        return this.f8821s.m(validationError, context);
    }

    @Override // w8.o
    public String n(String code, String message, Context context) {
        t.g(code, "code");
        t.g(context, "context");
        return this.f8821s.n(code, message, context);
    }

    @Override // w8.o
    public void o(Context context) {
        t.g(context, "context");
        this.f8821s.o(context);
    }

    @Override // u8.b, androidx.fragment.app.f
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        om.a.b(this);
        setHasOptionsMenu(true);
        s sVar = (s) new c1(this, y()).a(s.class);
        this.viewModel = sVar;
        s sVar2 = null;
        if (sVar == null) {
            t.y("viewModel");
            sVar = null;
        }
        this.secretQuestionList = sVar.r0();
        s sVar3 = this.viewModel;
        if (sVar3 == null) {
            t.y("viewModel");
            sVar3 = null;
        }
        this.secretQuestionListEn = sVar3.s0("en");
        s sVar4 = this.viewModel;
        if (sVar4 == null) {
            t.y("viewModel");
        } else {
            sVar2 = sVar4;
        }
        this.secretQuestionListFr = sVar2.s0("fr");
    }

    @Override // androidx.fragment.app.f
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        t.g(inflater, "inflater");
        androidx.databinding.n h10 = androidx.databinding.f.h(inflater, j.A, container, false);
        t.f(h10, "inflate(...)");
        a1 a1Var = (a1) h10;
        this.binding = a1Var;
        a1 a1Var2 = null;
        if (a1Var == null) {
            t.y("binding");
            a1Var = null;
        }
        a1Var.O(getViewLifecycleOwner());
        a1 a1Var3 = this.binding;
        if (a1Var3 == null) {
            t.y("binding");
            a1Var3 = null;
        }
        s sVar = this.viewModel;
        if (sVar == null) {
            t.y("viewModel");
            sVar = null;
        }
        a1Var3.U(sVar);
        a1 a1Var4 = this.binding;
        if (a1Var4 == null) {
            t.y("binding");
        } else {
            a1Var2 = a1Var4;
        }
        return a1Var2.x();
    }

    @Override // u8.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        List S0;
        List S02;
        List S03;
        q onBackPressedDispatcher;
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        androidx.fragment.app.k activity = getActivity();
        if (activity != null) {
            activity.setTitle(getString(ob.l.L2));
        }
        s sVar = this.viewModel;
        s sVar2 = null;
        if (sVar == null) {
            t.y("viewModel");
            sVar = null;
        }
        N(sVar, this);
        String[] strArr = this.secretQuestionList;
        if (strArr == null) {
            t.y("secretQuestionList");
            strArr = null;
        }
        S0 = sm.p.S0(strArr);
        String[] strArr2 = this.secretQuestionListEn;
        if (strArr2 == null) {
            t.y("secretQuestionListEn");
            strArr2 = null;
        }
        S02 = sm.p.S0(strArr2);
        String[] strArr3 = this.secretQuestionListFr;
        if (strArr3 == null) {
            t.y("secretQuestionListFr");
            strArr3 = null;
        }
        S03 = sm.p.S0(strArr3);
        s sVar3 = this.viewModel;
        if (sVar3 == null) {
            t.y("viewModel");
            sVar3 = null;
        }
        s sVar4 = this.viewModel;
        if (sVar4 == null) {
            t.y("viewModel");
            sVar4 = null;
        }
        int x02 = sVar3.x0(S02, S03, sVar4.o0());
        s sVar5 = this.viewModel;
        if (sVar5 == null) {
            t.y("viewModel");
            sVar5 = null;
        }
        s sVar6 = this.viewModel;
        if (sVar6 == null) {
            t.y("viewModel");
            sVar6 = null;
        }
        int x03 = sVar5.x0(S02, S03, sVar6.p0());
        if (x03 == x02) {
            x03 = x02 == S0.size() + (-1) ? x02 - 1 : x02 + 1;
        }
        s sVar7 = this.viewModel;
        if (sVar7 == null) {
            t.y("viewModel");
            sVar7 = null;
        }
        sVar7.C0((String) S0.get(x02));
        s sVar8 = this.viewModel;
        if (sVar8 == null) {
            t.y("viewModel");
            sVar8 = null;
        }
        sVar8.D0((String) S0.get(x03));
        String str = (String) S0.get(x03);
        a1 a1Var = this.binding;
        if (a1Var == null) {
            t.y("binding");
            a1Var = null;
        }
        CpcDropdownInput secretQuestion1DropDown = a1Var.A.C;
        t.f(secretQuestion1DropDown, "secretQuestion1DropDown");
        R(str, secretQuestion1DropDown, (String) S0.get(x02));
        String str2 = (String) S0.get(x02);
        a1 a1Var2 = this.binding;
        if (a1Var2 == null) {
            t.y("binding");
            a1Var2 = null;
        }
        CpcDropdownInput secretQuestion2DropDown = a1Var2.A.D;
        t.f(secretQuestion2DropDown, "secretQuestion2DropDown");
        R(str2, secretQuestion2DropDown, (String) S0.get(x03));
        s sVar9 = this.viewModel;
        if (sVar9 == null) {
            t.y("viewModel");
            sVar9 = null;
        }
        sVar9.k0().j(getViewLifecycleOwner(), new h(new b()));
        s sVar10 = this.viewModel;
        if (sVar10 == null) {
            t.y("viewModel");
            sVar10 = null;
        }
        sVar10.l0().j(getViewLifecycleOwner(), new h(new c()));
        a1 a1Var3 = this.binding;
        if (a1Var3 == null) {
            t.y("binding");
            a1Var3 = null;
        }
        a1Var3.A.C.setOnItemClickListener(new AdapterView.OnItemClickListener() { // from class: cc.o
            @Override // android.widget.AdapterView.OnItemClickListener
            public final void onItemClick(AdapterView adapterView, View view2, int i10, long j10) {
                EpostEnterSecurityQuestionsFragment.P(EpostEnterSecurityQuestionsFragment.this, adapterView, view2, i10, j10);
            }
        });
        a1 a1Var4 = this.binding;
        if (a1Var4 == null) {
            t.y("binding");
            a1Var4 = null;
        }
        a1Var4.A.D.setOnItemClickListener(new AdapterView.OnItemClickListener() { // from class: cc.p
            @Override // android.widget.AdapterView.OnItemClickListener
            public final void onItemClick(AdapterView adapterView, View view2, int i10, long j10) {
                EpostEnterSecurityQuestionsFragment.Q(EpostEnterSecurityQuestionsFragment.this, adapterView, view2, i10, j10);
            }
        });
        s sVar11 = this.viewModel;
        if (sVar11 == null) {
            t.y("viewModel");
            sVar11 = null;
        }
        M(sVar11, this);
        s sVar12 = this.viewModel;
        if (sVar12 == null) {
            t.y("viewModel");
            sVar12 = null;
        }
        sVar12.S().j(getViewLifecycleOwner(), new h(new d()));
        s sVar13 = this.viewModel;
        if (sVar13 == null) {
            t.y("viewModel");
            sVar13 = null;
        }
        sVar13.Q().j(getViewLifecycleOwner(), new h(new e()));
        s sVar14 = this.viewModel;
        if (sVar14 == null) {
            t.y("viewModel");
            sVar14 = null;
        }
        sVar14.R().j(getViewLifecycleOwner(), new h(new f()));
        s sVar15 = this.viewModel;
        if (sVar15 == null) {
            t.y("viewModel");
        } else {
            sVar2 = sVar15;
        }
        sVar2.V().j(getViewLifecycleOwner(), new h(new g()));
        androidx.fragment.app.k activity2 = getActivity();
        if (activity2 == null || (onBackPressedDispatcher = activity2.getOnBackPressedDispatcher()) == null) {
            return;
        }
        u viewLifecycleOwner = getViewLifecycleOwner();
        t.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        onBackPressedDispatcher.i(viewLifecycleOwner, this.onBackPressedCallback);
    }

    @Override // w8.p0
    public void p(androidx.fragment.app.f fragment, h.b event) {
        t.g(fragment, "fragment");
        t.g(event, "event");
        this.f8822t.p(fragment, event);
    }
}
