package com.scb.phone.view.fragment.registration.friends; import android.content.DialogInterface; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.registration.onboarding.RegistrationOnboardingActivity; import com.scb.phone.view.custom.common.ClearableFullWidthEditText; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.fragment.registration.friends.FriendsRegistrationFragment; import java.io.Serializable; import o.AbstractC14961gcz; import o.C14866gag; import o.C14957gcv; import o.C16035ke; import o.C5826cAi; import o.EnumC1279Zn; import o.InterfaceC12827fIb; import o.InterfaceC13391fZD; import o.InterfaceC14894gbR; import o.InterfaceC9598dmk; import o.Xyz; import o.ZI; import o.fLO; import o.gjJ; import o.pug; /* loaded from: classes5.dex */ public final class FriendsRegistrationFragment extends Hilt_FriendsRegistrationFragment implements InterfaceC9598dmk { private final fLO c = new fLO(new RVV(this)); @BindView public ClearableFullWidthEditText inputReferralCode; @BindView public Button okButton; @InterfaceC13391fZD public C5826cAi presenter; @BindView public ConstraintLayout rootView; @BindView public TextView titleDetail; @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { Serializable serializableExtra; C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559862, viewGroup, false); ButterKnife.c(this, inflate); C5826cAi c5826cAi = this.presenter; C5826cAi c5826cAi2 = null; if (c5826cAi == null) { C14957gcv.a(""); c5826cAi = null; } c5826cAi.e((C5826cAi) this); Button button = this.okButton; if (button == null) { C14957gcv.a(""); button = null; } button.setEnabled(false); ClearableFullWidthEditText clearableFullWidthEditText = this.inputReferralCode; if (clearableFullWidthEditText == null) { C14957gcv.a(""); clearableFullWidthEditText = null; } clearableFullWidthEditText.inputEditText.addTextChangedListener(this.c); clearableFullWidthEditText.setEditTextKeyboardActionListener(new Sts(this)); ClearableFullWidthEditText clearableFullWidthEditText2 = this.inputReferralCode; if (clearableFullWidthEditText2 == null) { C14957gcv.a(""); clearableFullWidthEditText2 = null; } clearableFullWidthEditText2.setErrorVisible(false); ConstraintLayout constraintLayout = this.rootView; if (constraintLayout == null) { C14957gcv.a(""); constraintLayout = null; } constraintLayout.requestFocus(); FragmentActivity activity = getActivity(); if (activity != null && (serializableExtra = activity.getIntent().getSerializableExtra("SUCCESS_PAGE_DYNAMIC_TYPE")) != null && (serializableExtra instanceof EnumC1279Zn)) { C5826cAi c5826cAi3 = this.presenter; if (c5826cAi3 != null) { c5826cAi2 = c5826cAi3; } else { C14957gcv.a(""); } EnumC1279Zn enumC1279Zn = (EnumC1279Zn) serializableExtra; C14957gcv.e(enumC1279Zn, ""); if (enumC1279Zn == EnumC1279Zn.DEAD_CARD) { ZI.IeS ieS = new ZI.IeS() { // from class: o.cAm @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9598dmk) obj).b(); } }; if (c5826cAi2.f != 0) { ieS.e(c5826cAi2.f); } } } v("friends_get_friends_registration_success"); return inflate; } @Override // o.InterfaceC9598dmk public final void a(boolean z) { Button button = this.okButton; if (button == null) { C14957gcv.a(""); button = null; } button.setEnabled(z); } /* loaded from: classes5.dex */ public static final class Sts implements InterfaceC12827fIb { private FriendsRegistrationFragment c; Sts(FriendsRegistrationFragment friendsRegistrationFragment) { this.c = friendsRegistrationFragment; } @Override // o.InterfaceC12827fIb public final void b() { FriendsRegistrationFragment.d(this.c); } @Override // o.InterfaceC12827fIb public final void c() { FriendsRegistrationFragment.d(this.c); } } /* loaded from: classes5.dex */ static final class RVV extends AbstractC14961gcz implements InterfaceC14894gbR { private FriendsRegistrationFragment e; /* JADX WARN: Removed duplicated region for block: B:11:0x0030 */ @Override // o.InterfaceC14894gbR /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final /* synthetic */ o.C14866gag invoke(java.lang.String r4) { /* r3 = this; java.lang.String r4 = (java.lang.String) r4 java.lang.String r0 = "" o.C14957gcv.e(r4, r0) com.scb.phone.view.fragment.registration.friends.FriendsRegistrationFragment r1 = r3.e o.cAi r1 = r1.presenter if (r1 == 0) goto Le goto L12 Le: o.C14957gcv.a(r0) r1 = 0 L12: o.C14957gcv.e(r4, r0) int r0 = r4.length() r2 = 6 if (r0 != r2) goto L26 o.Sej r0 = r1.a boolean r4 = o.Sej.e(r4) if (r4 == 0) goto L26 r4 = 1 goto L27 L26: r4 = 0 L27: o.cAk r0 = new o.cAk r0.(r4) T extends o.cYp r4 = r1.f if (r4 == 0) goto L35 T extends o.cYp r4 = r1.f r0.e(r4) L35: o.gag r4 = o.C14866gag.c return r4 */ throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.registration.friends.FriendsRegistrationFragment.RVV.invoke(java.lang.Object):java.lang.Object"); } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ RVV(FriendsRegistrationFragment friendsRegistrationFragment) { super(1); this.e = friendsRegistrationFragment; } } @Override // o.InterfaceC9598dmk public final void a() { RegistrationOnboardingActivity.c(getContext()); } @Override // o.InterfaceC9598dmk public final void e(boolean z) { ClearableFullWidthEditText clearableFullWidthEditText = this.inputReferralCode; if (clearableFullWidthEditText == null) { C14957gcv.a(""); clearableFullWidthEditText = null; } clearableFullWidthEditText.setErrorVisible(z); } @OnClick public final void onClickSkipButton() { c("friends_get_friends_button", new pug("button", "skip")); C5826cAi c5826cAi = this.presenter; if (c5826cAi == null) { C14957gcv.a(""); c5826cAi = null; } ZI.IeS ieS = new ZI.IeS() { // from class: o.cAj @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9598dmk) obj).c(); } }; if (c5826cAi.f != 0) { ieS.e(c5826cAi.f); } } @OnClick public final void onClickOkButton() { c("friends_get_friends_button", new pug("button", "ok")); C5826cAi c5826cAi = this.presenter; ClearableFullWidthEditText clearableFullWidthEditText = null; if (c5826cAi == null) { C14957gcv.a(""); c5826cAi = null; } ClearableFullWidthEditText clearableFullWidthEditText2 = this.inputReferralCode; if (clearableFullWidthEditText2 != null) { clearableFullWidthEditText = clearableFullWidthEditText2; } else { C14957gcv.a(""); } String obj = clearableFullWidthEditText.inputEditText.getText().toString(); C14957gcv.c((Object) obj, ""); C14957gcv.e(obj, ""); if (c5826cAi.f != 0) { c5826cAi.f.y(); } C16035ke c16035ke = c5826cAi.b; C5826cAi.HBt hBt = new C5826cAi.HBt(c5826cAi); C5826cAi.RVV rvv = new C5826cAi.RVV(c5826cAi); C14957gcv.e(hBt, ""); C14957gcv.e(rvv, ""); C14957gcv.e(obj, ""); c16035ke.b(c16035ke.c, hBt, rvv, new Xyz.IeS(obj)); } @Override // o.InterfaceC9598dmk public final void c() { CustomDialog b = CustomDialog.b(getContext()); String string = getString(R.string.registration_completed_referral_skip_title); if (gjJ.a(string)) { b.mTitleTextView.setVisibility(0); b.mTitleTextView.setText(string); } String string2 = getString(R.string.registration_completed_referral_skip_text); if (gjJ.a(string2)) { b.mTextTextView.setVisibility(0); b.mTextTextView.setText(string2); } b.aoU_(getString(R.string.registration_completed_referral_skip_ok), new DialogInterface.OnClickListener(this) { // from class: o.fwE private FriendsRegistrationFragment c; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { FriendsRegistrationFragment.axd_(this.c, dialogInterface); } { this.c = this; } }).aoO_(getString(R.string.registration_completed_referral_skip_cancel), new DialogInterface.OnClickListener() { // from class: o.fwD @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }).show(); } @Override // o.InterfaceC9598dmk public final void e() { CustomDialog b = CustomDialog.b(getContext()); String string = getString(R.string.registration_completed_referral_success_title); if (gjJ.a(string)) { b.mTitleTextView.setVisibility(0); b.mTitleTextView.setText(string); } CustomDialog aoR_ = b.aoR_(getString(R.string.registration_completed_referral_success_ok), new DialogInterface.OnClickListener(this) { // from class: o.fww private FriendsRegistrationFragment a; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { FriendsRegistrationFragment.axc_(this.a, dialogInterface); } { this.a = this; } }); aoR_.setCanceledOnTouchOutside(false); aoR_.show(); } @Override // o.InterfaceC9598dmk public final void b() { TextView textView = this.titleDetail; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getResources().getString(R.string.friend_get_friends_regis_successful_success_cc_activation_register)); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { ClearableFullWidthEditText clearableFullWidthEditText = this.inputReferralCode; if (clearableFullWidthEditText == null) { C14957gcv.a(""); clearableFullWidthEditText = null; } clearableFullWidthEditText.inputEditText.removeTextChangedListener(this.c); clearableFullWidthEditText.setEditTextKeyboardActionListener(null); super.onDestroy(); } public static /* synthetic */ void axc_(FriendsRegistrationFragment friendsRegistrationFragment, DialogInterface dialogInterface) { C14957gcv.e(friendsRegistrationFragment, ""); C5826cAi c5826cAi = friendsRegistrationFragment.presenter; if (c5826cAi == null) { C14957gcv.a(""); c5826cAi = null; } ZI.IeS ieS = new ZI.IeS() { // from class: o.cAn @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9598dmk) obj).a(); } }; if (c5826cAi.f != 0) { ieS.e(c5826cAi.f); } dialogInterface.dismiss(); } public static /* synthetic */ void axd_(FriendsRegistrationFragment friendsRegistrationFragment, DialogInterface dialogInterface) { C14957gcv.e(friendsRegistrationFragment, ""); C5826cAi c5826cAi = friendsRegistrationFragment.presenter; if (c5826cAi == null) { C14957gcv.a(""); c5826cAi = null; } ZI.IeS ieS = new ZI.IeS() { // from class: o.cAe @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9598dmk) obj).a(); } }; if (c5826cAi.f != 0) { ieS.e(c5826cAi.f); } dialogInterface.dismiss(); } /* JADX WARN: Removed duplicated region for block: B:20:0x006b */ /* JADX WARN: Removed duplicated region for block: B:23:0x0074 */ /* JADX WARN: Removed duplicated region for block: B:27:0x0076 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public static final /* synthetic */ void d(com.scb.phone.view.fragment.registration.friends.FriendsRegistrationFragment r7) { /* com.scb.phone.view.custom.common.ClearableFullWidthEditText r0 = r7.inputReferralCode r1 = 0 java.lang.String r2 = "" if (r0 == 0) goto L8 goto Lc L8: o.C14957gcv.a(r2) r0 = r1 Lc: com.scb.phone.view.custom.common.ClearableFullWidthEditText r3 = r7.inputReferralCode if (r3 == 0) goto L11 goto L15 L11: o.C14957gcv.a(r2) r3 = r1 L15: com.scb.phone.view.custom.common.CustomNoteEditText r3 = r3.inputEditText android.text.Editable r3 = r3.getText() java.lang.String r3 = r3.toString() o.C14957gcv.c(r3, r2) java.lang.String r3 = r3.toUpperCase() o.C14957gcv.c(r3, r2) r0.setText(r3) o.cAi r0 = r7.presenter if (r0 == 0) goto L31 goto L35 L31: o.C14957gcv.a(r2) r0 = r1 L35: com.scb.phone.view.custom.common.ClearableFullWidthEditText r3 = r7.inputReferralCode if (r3 == 0) goto L3a goto L3e L3a: o.C14957gcv.a(r2) r3 = r1 L3e: com.scb.phone.view.custom.common.CustomNoteEditText r3 = r3.inputEditText android.text.Editable r3 = r3.getText() java.lang.String r3 = r3.toString() o.C14957gcv.c(r3, r2) o.C14957gcv.e(r3, r2) int r4 = r3.length() r5 = 6 r6 = 1 if (r4 != r5) goto L60 o.Sej r4 = r0.a boolean r3 = o.Sej.e(r3) if (r3 == 0) goto L60 r3 = r6 goto L61 L60: r3 = 0 L61: r3 = r3 ^ r6 o.cAl r4 = new o.cAl r4.(r3) T extends o.cYp r3 = r0.f if (r3 == 0) goto L70 T extends o.cYp r0 = r0.f r4.e(r0) L70: android.widget.Button r0 = r7.okButton if (r0 == 0) goto L76 r1 = r0 goto L79 L76: o.C14957gcv.a(r2) L79: android.view.View r1 = (android.view.View) r1 o.C14957gcv.e(r1, r2) r1.setFocusable(r6) r1.setFocusableInTouchMode(r6) r1.requestFocus() r7.aN_() return */ throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.registration.friends.FriendsRegistrationFragment.d(com.scb.phone.view.fragment.registration.friends.FriendsRegistrationFragment):void"); } }