package com.ss.android.ugc.aweme.account.bind;

import X.070;
import X.2nK;
import X.7he;
import X.C1633RlF;
import X.C1741Rmz;
import X.C1907Rpf;
import X.C2133RtJ;
import X.C2162Rtm;
import X.C2180Ru4;
import X.C2247Rv9;
import X.C2257RvJ;
import X.C2260RvM;
import X.C2261RvN;
import X.C2264RvQ;
import X.C2440RyG;
import X.C2580S1g;
import X.Crj;
import X.JtF;
import X.LsE;
import X.M12;
import X.PgW;
import X.Qeg;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.account.login.v2.base.BaseAccountFlowFragment;
import com.ss.android.ugc.aweme.account.login.v2.timer.TimerHolder;
import com.ss.android.ugc.aweme.account.login.v2.ui.fragments.CommonInputEmailFragment;
import com.ss.android.ugc.aweme.base.utils.KeyboardUtils;
import java.util.HashMap;
import kotlin.h.b.n;

public final class BindEmailFragment extends CommonInputEmailFragment {
    public static final int LIZ = 8;
    public static final LsE<BaseAccountFlowFragment, String, String, PgW<C1633RlF<C1741Rmz>>> LIZIZ = C2260RvM.LIZ;
    public static final String LIZJ = "email_bundling_success";
    public static final C2264RvQ LIZLLL = new C2264RvQ((byte) 0);
    public final Crj LJIILIIL = 7he.LIZ(new C2257RvJ(this));
    public HashMap LJIILJJIL;

    public final View LIZ(int i) {
        if (this.LJIILJJIL == null) {
            this.LJIILJJIL = new HashMap();
        }
        View view = (View) this.LJIILJJIL.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LJIILJJIL.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    public final boolean LJII() {
        return ((Boolean) this.LJIILIIL.getValue()).booleanValue();
    }

    public final void LJIIJ() {
        HashMap hashMap = this.LJIILJJIL;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public final /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        LJIIJ();
    }

    static {
        Covode.recordClassIndex(50664);
    }

    public final boolean aA_() {
        KeyboardUtils.LIZJ(LJIIIZ());
        C1907Rpf.LIZ(as_(), (String) null);
        return super.aA_();
    }

    public final void LJIIIIZZ() {
        if (LJII()) {
            JtF jtF = new JtF();
            jtF.LIZ("page", "Input Email Captcha");
            jtF.LIZ("error_code", "1");
            2nK.LIZ("input_wrong_email", jtF.LIZ);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:23:0x009f  */
    /* JADX WARNING: Removed duplicated region for block: B:30:0x00bd  */
    /* JADX WARNING: Removed duplicated region for block: B:33:0x00d0  */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x00da  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final X.C2202RuQ LIZLLL() {
        /*
            r19 = this;
            r4 = r19
            android.os.Bundle r0 = r19.getArguments()
            if (r0 != 0) goto L_0x000b
            kotlin.h.b.n.LIZIZ()
        L_0x000b:
            java.lang.String r3 = "ENTER_REASON"
            java.lang.String r0 = r0.getString(r3)
            java.lang.String r2 = "two_step_verification"
            boolean r5 = kotlin.h.b.n.LIZ(r2, r0)
            r1 = 2131832214(0x7f112d96, float:1.9297476E38)
            r0 = 0
            if (r5 == 0) goto L_0x0065
            r8 = 2131363236(0x7f0a05a4, float:1.8346275E38)
            android.view.View r6 = r4.LIZ((int) r8)
            X.Qeg r6 = (X.Qeg) r6
            java.lang.String r5 = ""
            kotlin.h.b.n.LIZIZ(r6, r5)
            r6.setVisibility(r0)
            android.view.View r6 = r4.LIZ((int) r8)
            X.Qeg r6 = (X.Qeg) r6
            kotlin.h.b.n.LIZIZ(r6, r5)
            java.lang.String r5 = r4.getString(r1)
            r6.setText(r5)
            android.content.Context r5 = r19.getContext()
            if (r5 == 0) goto L_0x0065
            android.content.res.Resources r7 = r5.getResources()
            if (r7 == 0) goto L_0x0065
            android.view.View r6 = r4.LIZ((int) r8)
            X.Qeg r6 = (X.Qeg) r6
            r5 = 2131099758(0x7f06006e, float:1.7811878E38)
            int r5 = r7.getColor(r5)
            r6.setTextColor(r5)
            android.view.View r6 = r4.LIZ((int) r8)
            X.Qeg r6 = (X.Qeg) r6
            r5 = 51
            r6.setTuxFont(r5)
        L_0x0065:
            android.os.Bundle r5 = r19.getArguments()
            if (r5 != 0) goto L_0x006e
            kotlin.h.b.n.LIZIZ()
        L_0x006e:
            java.lang.String r7 = "show_skip"
            boolean r6 = r5.containsKey(r7)
            r5 = 1
            if (r6 == 0) goto L_0x0100
            android.os.Bundle r6 = r19.getArguments()
            if (r6 != 0) goto L_0x0080
            kotlin.h.b.n.LIZIZ()
        L_0x0080:
            boolean r6 = r6.getBoolean(r7)
            if (r6 == 0) goto L_0x0100
            r7 = 1
        L_0x0087:
            X.RuQ r8 = new X.RuQ
            r9 = 0
            r10 = 0
            r11 = 0
            r12 = 0
            r13 = 0
            r14 = 0
            r15 = 0
            r16 = 0
            r17 = 0
            r18 = 2047(0x7ff, float:2.868E-42)
            r8.<init>(r9, r10, r11, r12, r13, r14, r15, r16, r17, r18)
            android.os.Bundle r6 = r19.getArguments()
            if (r6 != 0) goto L_0x00a2
            kotlin.h.b.n.LIZIZ()
        L_0x00a2:
            java.lang.String r6 = r6.getString(r3)
            boolean r6 = kotlin.h.b.n.LIZ(r2, r6)
            if (r6 == 0) goto L_0x00fc
            if (r7 == 0) goto L_0x00fc
            r6 = 2131834332(0x7f1135dc, float:1.9301771E38)
        L_0x00b1:
            java.lang.String r6 = r4.getString(r6)
            r8.LJ = r6
            boolean r6 = r19.LJII()
            if (r6 == 0) goto L_0x00da
            r1 = 2131832242(0x7f112db2, float:1.9297532E38)
            java.lang.String r1 = r4.getString(r1)
        L_0x00c4:
            r8.LJFF = r1
            java.lang.String r1 = " "
            r8.LIZ = r1
            r8.LJIIIZ = r0
            r8.LJII = r5
            if (r7 == 0) goto L_0x00d9
            r0 = 2131834338(0x7f1135e2, float:1.9301783E38)
            java.lang.String r0 = r4.getString(r0)
            r8.LIZIZ = r0
        L_0x00d9:
            return r8
        L_0x00da:
            android.os.Bundle r6 = r19.getArguments()
            if (r6 != 0) goto L_0x00e3
            kotlin.h.b.n.LIZIZ()
        L_0x00e3:
            java.lang.String r3 = r6.getString(r3)
            boolean r2 = kotlin.h.b.n.LIZ(r2, r3)
            if (r2 == 0) goto L_0x00f7
            if (r7 == 0) goto L_0x00f7
            r1 = 2131834331(0x7f1135db, float:1.930177E38)
            java.lang.String r1 = r4.getString(r1)
            goto L_0x00c4
        L_0x00f7:
            java.lang.String r1 = r4.getString(r1)
            goto L_0x00c4
        L_0x00fc:
            r6 = 2131832215(0x7f112d97, float:1.9297478E38)
            goto L_0x00b1
        L_0x0100:
            r7 = 0
            goto L_0x0087
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.account.bind.BindEmailFragment.LIZLLL():X.RuQ");
    }

    public final void onCreate(Bundle bundle) {
        BindEmailFragment.super.onCreate(bundle);
        C1907Rpf.LIZ(as_(), "email", (String) null);
    }

    public final void LIZ(String str) {
        C2180Ru4 ru4;
        M12.LIZ(str);
        C2133RtJ.LIZ.LIZ((Fragment) this, str);
        C2247Rv9 LIZ2 = TimerHolder.LIZIZ.LIZ(getActivity(), str, LJJI());
        if (LIZ2 == null || (ru4 = LIZ2.LIZ) == null || !ru4.LIZLLL()) {
            ((PgW) LIZIZ.invoke(this, str, "user_click")).LIZLLL(new C2261RvN(this, str)).LIZLLL();
        } else {
            LIZ(str, false);
        }
    }

    public final void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        super.onViewCreated(view, bundle);
        Bundle arguments = getArguments();
        if (arguments == null) {
            n.LIZIZ();
        }
        if (arguments.getBoolean("use_phone") || LJII()) {
            Qeg LIZ2 = LIZ(2131363236);
            n.LIZIZ(LIZ2, "");
            LIZ2.setVisibility(0);
            LIZ(2131363236).setTextColor(070.LIZJ(view.getContext(), 2131099750));
            Qeg LIZ3 = LIZ(2131363236);
            n.LIZIZ(LIZ3, "");
            C2580S1g.LIZ.LIZ(LIZ3, new C2440RyG(this), 2131832212, 2131832213);
        }
    }

    public final void LIZ(String str, boolean z) {
        M12.LIZ(str);
        C2133RtJ.LIZ.LIZ((Fragment) this, z);
        Bundle arguments = getArguments();
        if (arguments == null) {
            n.LIZIZ();
        }
        arguments.putInt("next_page", C2162Rtm.EMAIL_SMS_BIND.getValue());
        n.LIZIZ(arguments, "");
        LIZ(arguments);
    }
}
