导航菜单

页面标题

页面副标题

OLX India v19.42.007 - CheckoutActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 CheckoutActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.payu.ui.view.activities;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import android.os.SystemClock;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.appbar.AppBarLayout;
import com.payu.base.listeners.OnFetchImageListener;
import com.payu.base.models.BaseApiLayer;
import com.payu.base.models.BaseConfig;
import com.payu.base.models.BottomSheetType;
import com.payu.base.models.CardBinInfo;
import com.payu.base.models.CardScheme;
import com.payu.base.models.CardType;
import com.payu.base.models.ErrorResponse;
import com.payu.base.models.FetchOfferDetails;
import com.payu.base.models.ImageDetails;
import com.payu.base.models.ImageParam;
import com.payu.base.models.InternalConfig;
import com.payu.base.models.OfferInfo;
import com.payu.base.models.PayUPaymentParams;
import com.payu.base.models.PayUSIParams;
import com.payu.base.models.PayUVerifyOtpData;
import com.payu.base.models.PaymentMode;
import com.payu.base.models.PaymentOption;
import com.payu.base.models.PaymentType;
import com.payu.base.models.SavedCardOption;
import com.payu.base.models.SelectedOfferInfo;
import com.payu.base.models.SodexoCardOption;
import com.payu.base.models.UPIOption;
import com.payu.base.models.WalletOption;
import com.payu.commonui.utils.CommonUIViewUtils;
import com.payu.otpparser.OtpParser;
import com.payu.ui.SdkUiInitializer;
import com.payu.ui.model.listeners.PayUCheckoutProListener;
import com.payu.ui.model.managers.BottomSheetManager;
import com.payu.ui.model.managers.NetworkManager;
import com.payu.ui.model.managers.OfferFilterListener;
import com.payu.ui.model.managers.OfferFilterManager;
import com.payu.ui.model.models.FragmentModel;
import com.payu.ui.model.models.SnackBarModel;
import com.payu.ui.model.models.ToolTipModel;
import com.payu.ui.model.utils.AnalyticsConstant;
import com.payu.ui.model.utils.AnalyticsUtils;
import com.payu.ui.model.utils.ImageViewUtils;
import com.payu.ui.model.utils.MultipleClickHandler;
import com.payu.ui.model.utils.PayUProgressDialog;
import com.payu.ui.model.utils.SdkUiConstants;
import com.payu.ui.model.utils.TextColorSelector;
import com.payu.ui.model.utils.Utils;
import com.payu.ui.model.utils.ViewUtils;
import com.payu.ui.model.widgets.RoundedCornerBottomSheet;
import com.payu.ui.viewmodel.Event;
import com.payu.ui.viewmodel.p;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Stack;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;

@Metadata
public final class CheckoutActivity extends androidx.appcompat.app.d implements RoundedCornerBottomSheet.OnBottomSheetListener, View.OnClickListener, View.OnFocusChangeListener {
    public static final int b1 = 0;
    public LinearLayout A0;
    public String B0;
    public EditText C0;
    public ProgressBar D0;
    public TextView E0;
    public Boolean G0;
    public ProgressBar H0;
    public TextView I0;
    public TextView J0;
    public Group K0;
    public TextView L0;
    public Group M0;
    public TextView N0;
    public TextView O0;
    public EditText P0;
    public com.payu.ui.viewmodel.p Q;
    public Button Q0;
    public ImageView R;
    public ImageView R0;
    public TextView S;
    public ImageView T;
    public PayUProgressDialog T0;
    public TextView U;
    public boolean U0;
    public ConstraintLayout V;
    public CardView V0;
    public AppBarLayout W;
    public ImageView W0;
    public RoundedCornerBottomSheet X;
    public ConstraintLayout X0;
    public RoundedCornerBottomSheet Y;
    public FetchOfferDetails Y0;
    public View Z;
    public TextView Z0;
    public View a0;
    public BottomSheetType a1;
    public EditText b0;
    public Button c0;
    public ImageView d0;
    public LinearLayout e0;
    public View f0;
    public ConstraintLayout g0;
    public SavedCardOption h0;
    public String i0;
    public String j0;
    public boolean k0;
    public PaymentOption l0;
    public long m0;
    public ArrayList n0;
    public ViewTreeObserver.OnGlobalLayoutListener o0;
    public ImageView p0;
    public ImageView q0;
    public TextView r0;
    public TextView s0;
    public boolean t0;
    public ImageView u0;
    public TextView v0;
    public TextView w0;
    public TextView x0;
    public ConstraintLayout y0;
    public ConstraintLayout z0;
    public String F0 = "";
    public Stack S0 = new Stack();

    public class a {
        public static final int[] a;

        static {
            int[] iArr = new int[BottomSheetType.values().length];
            iArr[BottomSheetType.L1_BOTTOM_SHEET.ordinal()] = 1;
            a = iArr;
        }
    }

    public static final class b implements TextWatcher {
        public final Integer b;

        public b(Integer num) {
            this.b = num;
        }

        @Override
        public void afterTextChanged(Editable editable) {
            com.payu.ui.viewmodel.p pVar = CheckoutActivity.this.Q;
            if (pVar == null) {
                return;
            }
            String obj = editable.toString();
            int intValue = this.b.intValue();
            MutableLiveData mutableLiveData = pVar.T;
            Boolean bool = Boolean.TRUE;
            mutableLiveData.setValue(bool);
            if (obj.length() == intValue) {
                pVar.Q.setValue(bool);
            } else {
                pVar.Q.setValue(Boolean.FALSE);
            }
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }
    }

    public static final class c implements OnFetchImageListener {
        public final View a;

        public c(View view) {
            this.a = view;
        }

        @Override
        public void onImageGenerated(ImageDetails imageDetails) {
            ImageViewUtils imageViewUtils = ImageViewUtils.INSTANCE;
            View view = this.a;
            imageViewUtils.setImage(view == null ? null : (ImageView) view.findViewById(com.payu.ui.e.ivBank), imageDetails);
        }
    }

    public static final class d implements TextWatcher {
        public d() {
        }

        @Override
        public void afterTextChanged(Editable editable) {
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            TextView textView = CheckoutActivity.this.O0;
            if (textView != null) {
                textView.setVisibility(8);
            }
            CheckoutActivity.this.F0 = String.valueOf(charSequence);
            if (CheckoutActivity.this.F0.length() > 0) {
                ImageView imageView = CheckoutActivity.this.R0;
                if (imageView != null) {
                    imageView.setVisibility(0);
                }
            } else {
                ImageView imageView2 = CheckoutActivity.this.R0;
                if (imageView2 != null) {
                    imageView2.setVisibility(8);
                }
            }
            com.payu.ui.viewmodel.p pVar = CheckoutActivity.this.Q;
            if (pVar == null) {
                return;
            }
            pVar.M0(charSequence);
        }
    }

    public static final class e implements TextWatcher {
        public e() {
        }

        @Override
        public void afterTextChanged(Editable editable) {
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            ProgressBar progressBar = CheckoutActivity.this.D0;
            if (progressBar != null) {
                progressBar.setVisibility(8);
            }
            TextView textView = CheckoutActivity.this.J0;
            if (textView == null) {
                return;
            }
            textView.setText("");
        }
    }

    public static final class f implements TextWatcher {
        public final TextView a;
        public final Button b;

        public f(TextView textView, Button button) {
            this.a = textView;
            this.b = button;
        }

        @Override
        public void afterTextChanged(Editable editable) {
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            TextView textView = this.a;
            if (textView != null) {
                textView.setText("");
            }
            if (charSequence != null && charSequence.length() >= 1) {
                ViewUtils.INSTANCE.enableView(this.b);
            } else {
                ViewUtils.INSTANCE.disableView(this.b);
            }
        }
    }

    public static final class g implements OnFetchImageListener {
        public final View a;

        public g(View view) {
            this.a = view;
        }

        @Override
        public void onImageGenerated(ImageDetails imageDetails) {
            ImageViewUtils imageViewUtils = ImageViewUtils.INSTANCE;
            View view = this.a;
            imageViewUtils.setImage(view == null ? null : (ImageView) view.findViewById(com.payu.ui.e.ivPaymentOptionIcon), imageDetails);
        }
    }

    public static final class h implements OnFetchImageListener {
        public final View a;

        public h(View view) {
            this.a = view;
        }

        @Override
        public void onImageGenerated(ImageDetails imageDetails) {
            ImageViewUtils imageViewUtils = ImageViewUtils.INSTANCE;
            View view = this.a;
            imageViewUtils.setImage(view == null ? null : (ImageView) view.findViewById(com.payu.ui.e.ivPaymentOptionIcon), imageDetails);
        }
    }

    public static final void A2(CheckoutActivity checkoutActivity, ImageDetails imageDetails) {
        CardView cardView = checkoutActivity.V0;
        if (cardView != null) {
            cardView.setVisibility(0);
        }
        ImageViewUtils.INSTANCE.setImage((ImageView) checkoutActivity.findViewById(com.payu.ui.e.img_merchant_logo), imageDetails);
    }

    public static final void A3(CheckoutActivity checkoutActivity, String str) {
        TextView textView = checkoutActivity.J0;
        if (textView != null) {
            textView.setText(str);
        }
        Group group = checkoutActivity.K0;
        if (group != null) {
            group.setVisibility(0);
        }
        Group group2 = checkoutActivity.M0;
        if (group2 == null) {
            return;
        }
        group2.setVisibility(8);
    }

    public static final void B2(CheckoutActivity checkoutActivity, PaymentOption paymentOption) {
        if (paymentOption != null) {
            checkoutActivity.l0 = paymentOption;
            checkoutActivity.o2(paymentOption, checkoutActivity.Z);
        }
    }

    public static final void B3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(false);
    }

    public static final void C2(CheckoutActivity checkoutActivity, PaymentOption paymentOption, View view) {
        InternalConfig.INSTANCE.setRemoveOfferIfNeeded(false);
        if (SystemClock.elapsedRealtime() - checkoutActivity.m0 < 1000) {
            return;
        }
        checkoutActivity.m0 = SystemClock.elapsedRealtime();
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        if (!viewUtils.isInternetAvailable(checkoutActivity.getApplicationContext())) {
            checkoutActivity.T2(false);
            NetworkManager.INSTANCE.registerReceiver(checkoutActivity.getApplicationContext());
            ViewUtils.showSnackBar$default(viewUtils, checkoutActivity.getResources().getString(com.payu.ui.g.payu_no_internet_connection), Integer.valueOf(com.payu.ui.c.payu_no_internet), checkoutActivity, null, 8, null);
        } else {
            com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
            if (pVar != null) {
                pVar.m1(paymentOption);
            }
            checkoutActivity.T2(false);
        }
    }

    public static final void C3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            ViewUtils.INSTANCE.hideSoftKeyboard((Activity) checkoutActivity);
        }
    }

    public static final void D2(CheckoutActivity checkoutActivity, SavedCardOption savedCardOption) {
        if (savedCardOption != null) {
            checkoutActivity.q2(savedCardOption, checkoutActivity.Z);
        }
    }

    public static final void E2(CheckoutActivity checkoutActivity, SavedCardOption savedCardOption, View view) {
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        if (!viewUtils.isInternetAvailable(checkoutActivity.getApplicationContext())) {
            checkoutActivity.T2(false);
            NetworkManager.INSTANCE.registerReceiver(checkoutActivity.getApplicationContext());
            ViewUtils.showSnackBar$default(viewUtils, checkoutActivity.getApplicationContext().getString(com.payu.ui.g.payu_no_internet_connection), Integer.valueOf(com.payu.ui.c.payu_no_internet), checkoutActivity, null, 8, null);
            return;
        }
        EditText editText = checkoutActivity.b0;
        savedCardOption.setCvv(String.valueOf(editText == null ? null : editText.getText()));
        viewUtils.hideSoftKeyboardFromToken(checkoutActivity, view);
        AnalyticsUtils.INSTANCE.logMakePaymentEvent(checkoutActivity.getApplicationContext(), savedCardOption, null, SdkUiConstants.CP_SAVE_CARD);
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        pVar.m1(savedCardOption);
    }

    public static final void E3(CheckoutActivity checkoutActivity, String str) {
        TextView textView = checkoutActivity.O0;
        if (textView != null) {
            textView.setText(str);
        }
        TextView textView2 = checkoutActivity.O0;
        if (textView2 == null) {
            return;
        }
        textView2.setVisibility(0);
    }

    public static final void F2(CheckoutActivity checkoutActivity, SodexoCardOption sodexoCardOption) {
        if (sodexoCardOption != null) {
            checkoutActivity.r2(sodexoCardOption, checkoutActivity.Z);
        }
    }

    public static final void F3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(false);
    }

    public static final void G2(CheckoutActivity checkoutActivity, SodexoCardOption sodexoCardOption, View view) {
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        if (!viewUtils.isInternetAvailable(checkoutActivity.getApplicationContext())) {
            checkoutActivity.T2(false);
            NetworkManager.INSTANCE.registerReceiver(checkoutActivity.getApplicationContext());
            ViewUtils.showSnackBar$default(viewUtils, checkoutActivity.getApplicationContext().getString(com.payu.ui.g.payu_no_internet_connection), Integer.valueOf(com.payu.ui.c.payu_no_internet), checkoutActivity, null, 8, null);
        } else {
            AnalyticsUtils.logMakePaymentEvent$default(AnalyticsUtils.INSTANCE, checkoutActivity.getApplicationContext(), sodexoCardOption, null, null, 12, null);
            com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
            if (pVar == null) {
                return;
            }
            pVar.m1(sodexoCardOption);
        }
    }

    public static final void G3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.getSupportFragmentManager().o1();
            if (!checkoutActivity.S0.isEmpty()) {
                checkoutActivity.S0.pop();
            }
        }
    }

    public static final void H2(CheckoutActivity checkoutActivity, FragmentModel fragmentModel) {
        checkoutActivity.g3();
        if (!Intrinsics.d(fragmentModel.getTag(), SdkUiConstants.TAG_DYNAMIC_FRAGMENT)) {
            if (Intrinsics.d(fragmentModel.getTag(), SdkUiConstants.TAG_PAYMENT_OPTION_FRAGMENT)) {
                Iterator it = checkoutActivity.getSupportFragmentManager().F0().iterator();
                while (it.hasNext()) {
                    checkoutActivity.getSupportFragmentManager().s().r((Fragment) it.next()).i();
                }
            }
            androidx.fragment.app.o0 s = checkoutActivity.getSupportFragmentManager().s();
            ConstraintLayout constraintLayout = checkoutActivity.z0;
            if (constraintLayout != null) {
                constraintLayout.setVisibility(0);
            }
            LinearLayout linearLayout = checkoutActivity.A0;
            if (linearLayout != null) {
                linearLayout.setVisibility(8);
            }
            checkoutActivity.S0.add(fragmentModel);
            if (fragmentModel.getAddToBackStack()) {
                s.s(com.payu.ui.e.fragment_container, fragmentModel.getFragment()).g(fragmentModel.getTag()).i();
            } else {
                s.t(com.payu.ui.e.fragment_container, fragmentModel.getFragment(), fragmentModel.getTag()).i();
            }
            checkoutActivity.getSupportFragmentManager().l0();
            checkoutActivity.g3();
            return;
        }
        checkoutActivity.g3();
        androidx.fragment.app.o0 s2 = checkoutActivity.getSupportFragmentManager().s();
        AppBarLayout appBarLayout = checkoutActivity.W;
        if (appBarLayout != null) {
            appBarLayout.setExpanded(false, true);
        }
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        MutableLiveData mutableLiveData = pVar == null ? null : pVar.G;
        if (mutableLiveData != null) {
            mutableLiveData.setValue(Boolean.TRUE);
        }
        fragmentModel.setHandleBackPress(new j2(fragmentModel));
        LinearLayout linearLayout2 = checkoutActivity.A0;
        if (linearLayout2 != null) {
            linearLayout2.setVisibility(0);
        }
        checkoutActivity.S0.add(fragmentModel);
        if (fragmentModel.getAddToBackStack()) {
            s2.b(com.payu.ui.e.dynamic_fragment, fragmentModel.getFragment()).g(fragmentModel.getTag()).i();
        } else {
            s2.c(com.payu.ui.e.dynamic_fragment, fragmentModel.getFragment(), fragmentModel.getTag()).i();
        }
        checkoutActivity.getSupportFragmentManager().l0();
        ConstraintLayout constraintLayout2 = checkoutActivity.X0;
        if (constraintLayout2 != null) {
            constraintLayout2.setVisibility(8);
        }
        checkoutActivity.g3();
    }

    public static final void I2(CheckoutActivity checkoutActivity, SnackBarModel snackBarModel) {
        if (snackBarModel != null) {
            ViewUtils.showSnackBar$default(ViewUtils.INSTANCE, snackBarModel.getMessage(), snackBarModel.getIcon(), checkoutActivity, null, 8, null);
        }
    }

    public static final void I3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(false);
    }

    public static final void J2(CheckoutActivity checkoutActivity, ToolTipModel toolTipModel) {
        if (toolTipModel != null) {
            ViewUtils.INSTANCE.showImageToolTip(checkoutActivity, checkoutActivity.d0, checkoutActivity.g0, toolTipModel);
        }
    }

    public static final void J3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            int y0 = checkoutActivity.getSupportFragmentManager().y0();
            int i = 0;
            while (i < y0) {
                i++;
                checkoutActivity.getSupportFragmentManager().o1();
            }
            checkoutActivity.S0.clear();
        }
    }

    public static final void K2(CheckoutActivity checkoutActivity, Event event) {
        if (Intrinsics.d(event.getContentIfNotHandled(), Boolean.TRUE)) {
            TextView textView = checkoutActivity.Z0;
            if (textView == null) {
                return;
            }
            textView.setVisibility(0);
            return;
        }
        TextView textView2 = checkoutActivity.Z0;
        if (textView2 == null) {
            return;
        }
        textView2.setVisibility(8);
    }

    public static final void K3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(false);
    }

    public static final void L2(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.f3(true);
        } else {
            checkoutActivity.g3();
        }
    }

    public static final void L3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.T2(false);
        }
    }

    public static final void M2(CheckoutActivity checkoutActivity, Integer num) {
        EditText editText = checkoutActivity.b0;
        if (editText != null) {
            editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(num.intValue())});
        }
        EditText editText2 = checkoutActivity.b0;
        if (editText2 == null) {
            return;
        }
        editText2.addTextChangedListener(checkoutActivity.new b(num));
    }

    public static final void M3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(false);
    }

    public static final void N2(CheckoutActivity checkoutActivity, String str) {
        TextView textView = checkoutActivity.S;
        if (textView == null) {
            return;
        }
        textView.setText(str);
    }

    public static final void N3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.b(checkoutActivity.Z);
        }
    }

    public static final void O2(CheckoutActivity checkoutActivity, String str, String str2) {
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        pVar.P0(str, str2);
    }

    public static final void O3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(false);
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar != null) {
            pVar.E1();
        }
        com.payu.ui.viewmodel.p pVar2 = checkoutActivity.Q;
        if (pVar2 == null) {
            return;
        }
        pVar2.z0(checkoutActivity);
    }

    public static final void P2(CheckoutActivity checkoutActivity, Pair pair) {
        checkoutActivity.getClass();
        checkoutActivity.a1 = BottomSheetType.L1_BOTTOM_SHEET;
        RoundedCornerBottomSheet newInstance$default = RoundedCornerBottomSheet.Companion.newInstance$default(RoundedCornerBottomSheet.Companion, ((Number) pair.c()).intValue(), false, 2, null);
        checkoutActivity.X = newInstance$default;
        if (newInstance$default == null) {
            return;
        }
        newInstance$default.show(checkoutActivity.getSupportFragmentManager(), SdkUiConstants.CP_BOTTOM_SHEET_FRAGMENT);
    }

    public static final void P3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.d(checkoutActivity.Z);
        }
    }

    public static final void Q2(CheckoutActivity checkoutActivity, Function0 function0, View view) {
        TextView textView = checkoutActivity.L0;
        if (textView != null) {
            textView.setText("");
        }
        checkoutActivity.C0.addTextChangedListener(checkoutActivity.new e());
        if (checkoutActivity.C0.getText().length() != 6) {
            TextView textView2 = checkoutActivity.J0;
            if (textView2 == null) {
                return;
            }
            Context applicationContext = checkoutActivity.getApplicationContext();
            textView2.setText(applicationContext != null ? applicationContext.getString(com.payu.ui.g.payu_otp_invalid) : null);
            return;
        }
        Group group = checkoutActivity.M0;
        if (group != null) {
            group.setVisibility(0);
        }
        Group group2 = checkoutActivity.K0;
        if (group2 != null) {
            group2.setVisibility(8);
        }
        TextView textView3 = checkoutActivity.J0;
        if (textView3 != null) {
            textView3.setText("");
        }
        if (function0 == null) {
            com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
            if (pVar != null) {
                Boolean bool = checkoutActivity.G0;
                String str = checkoutActivity.F0;
                EditText editText = checkoutActivity.C0;
                pVar.L0(bool, str, String.valueOf(editText == null ? null : editText.getText()), null);
            }
        } else {
            com.payu.ui.viewmodel.p pVar2 = checkoutActivity.Q;
            if (pVar2 != null) {
                Boolean bool2 = checkoutActivity.G0;
                EditText editText2 = checkoutActivity.C0;
                String valueOf = String.valueOf(editText2 != null ? editText2.getText() : null);
                String str2 = pVar2.R0;
                if (str2 != null) {
                    pVar2.L0(bool2, str2, valueOf, function0);
                }
            }
        }
        CommonUIViewUtils.updateLayoutSecurity(checkoutActivity, false);
    }

    public static final void Q3(CheckoutActivity checkoutActivity, View view) {
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar != null) {
            pVar.z1();
        }
        checkoutActivity.T2(false);
    }

    public static final void R2(Boolean bool) {
        if (bool.booleanValue()) {
            ViewUtils.INSTANCE.hideToolTip();
        }
    }

    public static final void R3(CheckoutActivity checkoutActivity, Boolean bool) {
        checkoutActivity.a0 = checkoutActivity.Z;
        if (bool.booleanValue()) {
            checkoutActivity.c(checkoutActivity.a0);
        }
    }

    public static final void S3(CheckoutActivity checkoutActivity, View view) {
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar != null) {
            pVar.y0.setValue(Boolean.TRUE);
        }
        checkoutActivity.T2(false);
    }

    public static final void T3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.e(checkoutActivity.Z);
        }
    }

    public static final void U3(CheckoutActivity checkoutActivity, Boolean bool) {
        TextView textView;
        if (bool.booleanValue() && (textView = checkoutActivity.w0) != null && textView.getVisibility() == 8) {
            ViewUtils.INSTANCE.enableView(checkoutActivity.c0);
        } else {
            ViewUtils.INSTANCE.disableView(checkoutActivity.c0);
        }
    }

    public static final void V2(CheckoutActivity checkoutActivity, View view) {
        if (!Utils.INSTANCE.isValidPhoneNumber(checkoutActivity.F0)) {
            TextView textView = checkoutActivity.O0;
            if (textView != null) {
                textView.setVisibility(0);
            }
            TextView textView2 = checkoutActivity.O0;
            if (textView2 == null) {
                return;
            }
            Context applicationContext = checkoutActivity.getApplicationContext();
            textView2.setText(applicationContext != null ? applicationContext.getString(com.payu.ui.g.payu_phone_number_invalid) : null);
            return;
        }
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put(SdkUiConstants.CP_CTA_TYPE, SdkUiConstants.CP_TYPE_ACTION);
        AnalyticsUtils.INSTANCE.logData$one_payu_ui_sdk_android_release(checkoutActivity.getBaseContext(), AnalyticsConstant.CP_GV_OTP_AUTH_INITIATED, hashMap);
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar != null) {
            pVar.R0(checkoutActivity.F0, null);
        }
        TextView textView3 = checkoutActivity.I0;
        if (textView3 == null) {
            return;
        }
        Context applicationContext2 = checkoutActivity.getApplicationContext();
        textView3.setText(applicationContext2 != null ? applicationContext2.getString(com.payu.ui.g.payu_otp_description, checkoutActivity.F0) : null);
    }

    public static final void V3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.getClass();
            checkoutActivity.o0 = ViewUtils.INSTANCE.attachViewTreeListener(checkoutActivity.g0, checkoutActivity.f0);
            View view = checkoutActivity.f0;
            if (view == null) {
                return;
            }
            view.setVisibility(0);
            return;
        }
        checkoutActivity.getClass();
        ViewUtils.INSTANCE.removeViewTreeListener(checkoutActivity.o0, checkoutActivity.g0);
        View view2 = checkoutActivity.f0;
        if (view2 == null) {
            return;
        }
        view2.setVisibility(8);
    }

    public static final void W2(CheckoutActivity checkoutActivity, View view, TextView textView, TextView textView2, TextView textView3, View view2) {
        int i = com.payu.ui.a.one_payu_colorPrimary;
        checkoutActivity.j2(view, i, i, com.payu.ui.a.payu_color_ffffff);
        FetchOfferDetails fetchOfferDetails = checkoutActivity.Y0;
        checkoutActivity.S2(fetchOfferDetails == null ? null : fetchOfferDetails.getPayuRewardOfferArrayList(), textView, textView2, textView3);
    }

    public static final void W3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            ImageView imageView = checkoutActivity.u0;
            if (imageView != null) {
                imageView.setVisibility(0);
            }
        } else {
            ImageView imageView2 = checkoutActivity.u0;
            if (imageView2 != null) {
                imageView2.setVisibility(8);
            }
        }
        boolean booleanValue = bool.booleanValue();
        TextView textView = checkoutActivity.v0;
        if (booleanValue) {
            if (textView == null) {
                return;
            }
            textView.setVisibility(0);
        } else {
            if (textView == null) {
                return;
            }
            textView.setVisibility(8);
        }
    }

    public static final void X2(CheckoutActivity checkoutActivity, PaymentOption paymentOption) {
        checkoutActivity.l0 = paymentOption;
    }

    public static final void X3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool == null || bool.booleanValue()) {
            TextView textView = checkoutActivity.w0;
            if (textView != null) {
                textView.setVisibility(8);
            }
            TextView textView2 = checkoutActivity.x0;
            if (textView2 == null) {
                return;
            }
            textView2.setVisibility(0);
            return;
        }
        ImageView imageView = checkoutActivity.u0;
        if (imageView != null) {
            imageView.setVisibility(8);
        }
        TextView textView3 = checkoutActivity.v0;
        if (textView3 != null) {
            textView3.setVisibility(8);
        }
        TextView textView4 = checkoutActivity.w0;
        if (textView4 != null) {
            textView4.setVisibility(0);
        }
        TextView textView5 = checkoutActivity.x0;
        if (textView5 == null) {
            return;
        }
        textView5.setVisibility(0);
    }

    public static final void Y2(CheckoutActivity checkoutActivity, SavedCardOption savedCardOption, View view) {
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        CardBinInfo cardBinInfo = savedCardOption.getCardBinInfo();
        CardScheme cardScheme = cardBinInfo == null ? null : cardBinInfo.getCardScheme();
        pVar.S.setValue(Boolean.TRUE);
        pVar.R.setValue((cardScheme != null && p.a.d[cardScheme.ordinal()] == 1) ? new ToolTipModel(pVar.g0.getString(com.payu.ui.g.payu_what_is_csc), pVar.g0.getString(com.payu.ui.g.payu_the_card_security_code), Integer.valueOf(com.payu.ui.c.payu_tt_amex_cvv)) : new ToolTipModel(pVar.g0.getString(com.payu.ui.g.payu_what_is_cvv), pVar.g0.getString(com.payu.ui.g.payu_the_card_verification_value), Integer.valueOf(com.payu.ui.c.payu_tt_cvv)));
    }

    public static final void Y3(com.payu.ui.view.activities.CheckoutActivity r5, java.lang.Boolean r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.payu.ui.view.activities.CheckoutActivity.Y3(com.payu.ui.view.activities.CheckoutActivity, java.lang.Boolean):void");
    }

    public static final void Z2(CheckoutActivity checkoutActivity, Event event) {
        if (Intrinsics.d(event.getContentIfNotHandled(), Boolean.TRUE)) {
            ViewUtils.INSTANCE.showProgressDialog(checkoutActivity);
        } else {
            ViewUtils.INSTANCE.hideProgressDialog();
        }
    }

    public static final void Z3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.a(checkoutActivity.Z);
        }
    }

    public static final void a3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.f3(false);
        } else {
            checkoutActivity.g3();
        }
    }

    public static final void a4(CheckoutActivity checkoutActivity, Boolean bool) {
        checkoutActivity.k2(checkoutActivity.Z, bool.booleanValue(), null);
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        pVar.A1();
    }

    public static final void b3(CheckoutActivity checkoutActivity, Integer num) {
        checkoutActivity.getClass();
    }

    public static final void b4(CheckoutActivity checkoutActivity, Boolean bool) {
        AnalyticsUtils analyticsUtils = AnalyticsUtils.INSTANCE;
        analyticsUtils.logOtpSubmission$one_payu_ui_sdk_android_release(checkoutActivity.getBaseContext(), AnalyticsConstant.CP_OTP_SUBMISSION_STATUS, AnalyticsConstant.CP_COMPLETED);
        analyticsUtils.logOtpSubmissionForKibana$one_payu_ui_sdk_android_release(checkoutActivity.getBaseContext(), AnalyticsConstant.CP_OTP_SUBMISSION_STATUS, AnalyticsConstant.CP_COMPLETED);
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        pVar.V0(Utils.INSTANCE.getGlobalVaultStoredUserToken(checkoutActivity.getBaseContext()), true);
    }

    public static final void c3(CheckoutActivity checkoutActivity, String str) {
        TextView textView = checkoutActivity.v0;
        if (textView == null) {
            return;
        }
        textView.setText(str);
    }

    public static final void c4(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            TextView textView = checkoutActivity.N0;
            if (textView == null) {
                return;
            }
            textView.setVisibility(8);
            return;
        }
        TextView textView2 = checkoutActivity.N0;
        if (textView2 == null) {
            return;
        }
        textView2.setVisibility(0);
    }

    public static final void d3(CheckoutActivity checkoutActivity, Pair pair) {
        checkoutActivity.getClass();
        BottomSheetManager bottomSheetManager = (BottomSheetManager) pair.d();
        RoundedCornerBottomSheet newInstance = bottomSheetManager == null ? null : RoundedCornerBottomSheet.Companion.newInstance(((Number) pair.c()).intValue(), bottomSheetManager);
        if (newInstance == null) {
            newInstance = RoundedCornerBottomSheet.Companion.newInstance$default(RoundedCornerBottomSheet.Companion, ((Number) pair.c()).intValue(), false, 2, null);
        }
        checkoutActivity.X = newInstance;
        if (newInstance == null) {
            return;
        }
        newInstance.show(checkoutActivity.getSupportFragmentManager(), SdkUiConstants.CP_BOTTOM_SHEET_FRAGMENT);
    }

    public static final void d4(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.f(checkoutActivity.Z);
        }
    }

    public static final void e3(CheckoutActivity checkoutActivity, Function0 function0, View view) {
        String str;
        TextView textView = checkoutActivity.L0;
        if (textView != null) {
            textView.setText("");
        }
        TextView textView2 = checkoutActivity.E0;
        if (textView2 != null) {
            Context applicationContext = checkoutActivity.getApplicationContext();
            textView2.setText(applicationContext == null ? null : applicationContext.getString(com.payu.ui.g.payu_resending_otp));
        }
        if (function0 == null) {
            com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
            if (pVar != null) {
                pVar.j1(checkoutActivity.F0);
            }
        } else {
            com.payu.ui.viewmodel.p pVar2 = checkoutActivity.Q;
            if (pVar2 != null && (str = pVar2.R0) != null) {
                pVar2.j1(str);
            }
        }
        HashMap<String, Object> hashMap = new HashMap<>();
        AnalyticsUtils analyticsUtils = AnalyticsUtils.INSTANCE;
        analyticsUtils.logData$one_payu_ui_sdk_android_release(checkoutActivity.getBaseContext(), AnalyticsConstant.CP_OTP_RESEND, hashMap);
        AnalyticsUtils.logEventNameForKibana$one_payu_ui_sdk_android_release$default(analyticsUtils, checkoutActivity.getBaseContext(), AnalyticsConstant.CP_OTP_RESEND, null, 4, null);
    }

    public static final void e4(com.payu.ui.view.activities.CheckoutActivity r14, java.lang.Boolean r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.payu.ui.view.activities.CheckoutActivity.e4(com.payu.ui.view.activities.CheckoutActivity, java.lang.Boolean):void");
    }

    public static final void f4(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            ViewUtils.INSTANCE.enableView(checkoutActivity.Q0);
        } else {
            ViewUtils.INSTANCE.disableView(checkoutActivity.Q0);
        }
    }

    public static final void h3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(false);
        AnalyticsUtils.INSTANCE.logData$one_payu_ui_sdk_android_release(checkoutActivity.getBaseContext(), AnalyticsConstant.CP_SKIP_CLICKED, new HashMap<>());
    }

    public static final void i3(CheckoutActivity checkoutActivity, View view, TextView textView, TextView textView2, TextView textView3, View view2) {
        int i = com.payu.ui.a.one_payu_colorPrimary;
        checkoutActivity.j2(view, com.payu.ui.a.payu_color_ffffff, i, i);
        FetchOfferDetails fetchOfferDetails = checkoutActivity.Y0;
        checkoutActivity.S2(fetchOfferDetails == null ? null : fetchOfferDetails.getPayuSkuOfferList(), textView, textView2, textView3);
    }

    public static final void j3(CheckoutActivity checkoutActivity, Event event) {
        ViewUtils.showSnackBar$default(ViewUtils.INSTANCE, String.valueOf(event.getContentIfNotHandled()), Integer.valueOf(com.payu.ui.c.payu_cards_placeholder), checkoutActivity, null, 8, null);
    }

    public static final void k3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            checkoutActivity.g3();
            checkoutActivity.finish();
        }
    }

    public static final void l3(CheckoutActivity checkoutActivity, Integer num) {
        BaseConfig config;
        EditText editText;
        Editable text;
        if (num.intValue() > 1) {
            TextView textView = checkoutActivity.E0;
            if (textView != null) {
                Context applicationContext = checkoutActivity.getApplicationContext();
                textView.setText(applicationContext == null ? null : applicationContext.getString(com.payu.ui.g.payu_resend_otp_counter, Intrinsics.j("", num)));
            }
            TextView textView2 = checkoutActivity.E0;
            if (textView2 != null) {
                textView2.setClickable(false);
            }
            TextView textView3 = checkoutActivity.E0;
            if (textView3 != null) {
                textView3.setTextColor(androidx.core.content.b.getColor(checkoutActivity.getBaseContext(), com.payu.ui.a.payu_color_7b7b7b));
            }
        } else {
            TextView textView4 = checkoutActivity.E0;
            if (textView4 != null) {
                textView4.setClickable(true);
            }
            TextView textView5 = checkoutActivity.E0;
            if (textView5 != null) {
                Context applicationContext2 = checkoutActivity.getApplicationContext();
                textView5.setText(applicationContext2 == null ? null : applicationContext2.getString(com.payu.ui.g.payu_resend_otp));
            }
            ViewUtils viewUtils = ViewUtils.INSTANCE;
            TextView textView6 = checkoutActivity.E0;
            BaseApiLayer apiLayer = SdkUiInitializer.INSTANCE.getApiLayer();
            viewUtils.updateTextColor(checkoutActivity, textView6, (apiLayer == null || (config = apiLayer.getConfig()) == null) ? null : config.getPrimaryColor(), com.payu.ui.a.one_payu_colorPrimary);
        }
        if (num.intValue() <= 15 || (editText = checkoutActivity.C0) == null || (text = editText.getText()) == null || text.length() != 0) {
            EditText editText2 = checkoutActivity.C0;
            if (editText2 != null) {
                Context applicationContext3 = checkoutActivity.getApplicationContext();
                editText2.setHint(applicationContext3 != null ? applicationContext3.getString(com.payu.ui.g.payu_enter_otp) : null);
            }
            ProgressBar progressBar = checkoutActivity.D0;
            if (progressBar == null) {
                return;
            }
            progressBar.setVisibility(8);
            return;
        }
        EditText editText3 = checkoutActivity.C0;
        if (editText3 != null) {
            Context applicationContext4 = checkoutActivity.getApplicationContext();
            editText3.setHint(applicationContext4 != null ? applicationContext4.getString(com.payu.ui.g.payu_reading_otp_timer, Intrinsics.j("", Integer.valueOf(num.intValue() - 15))) : null);
        }
        ProgressBar progressBar2 = checkoutActivity.D0;
        if (progressBar2 == null) {
            return;
        }
        progressBar2.setVisibility(0);
    }

    public static final void m2(TextView textView, CheckoutActivity checkoutActivity, EditText editText, View view) {
        if (textView != null) {
            textView.setText("");
        }
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        pVar.O0(String.valueOf(editText == null ? null : editText.getText()));
    }

    public static final void m3(CheckoutActivity checkoutActivity, String str) {
        TextView textView = checkoutActivity.s0;
        if (textView == null) {
            return;
        }
        textView.setText(str);
    }

    public static final void n2(ConstraintLayout constraintLayout, View view) {
        constraintLayout.requestFocus();
    }

    public static final void n3(CheckoutActivity checkoutActivity, Pair pair) {
        if (checkoutActivity.t0) {
            return;
        }
        RoundedCornerBottomSheet newInstance = RoundedCornerBottomSheet.Companion.newInstance(((Number) pair.c()).intValue(), ((Boolean) pair.d()).booleanValue());
        checkoutActivity.Y = newInstance;
        if (newInstance == null) {
            return;
        }
        newInstance.show(checkoutActivity.getSupportFragmentManager(), SdkUiConstants.CP_BOTTOM_SHEET_FRAGMENT);
    }

    public static final void o3(CheckoutActivity checkoutActivity, View view) {
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        pVar.H.setValue(Boolean.TRUE);
        AnalyticsUtils.INSTANCE.logBackButtonClickEvent(pVar.g0, SdkUiConstants.CP_CHECKOUT_BACK_BUTTON, SdkUiConstants.CP_L1_CHECKOUT_SCREEN, false);
    }

    public static final void p3(CheckoutActivity checkoutActivity, Event event) {
        PayUVerifyOtpData payUVerifyOtpData = (PayUVerifyOtpData) event.getContentIfNotHandled();
        if (payUVerifyOtpData != null) {
            checkoutActivity.a(checkoutActivity.Z);
            com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
            if (pVar != null) {
                pVar.z0(checkoutActivity);
            }
            checkoutActivity.k2(checkoutActivity.Z, true, payUVerifyOtpData.getPostVerifyAction());
            TextView textView = checkoutActivity.I0;
            if (textView != null) {
                textView.setText(payUVerifyOtpData.getVerifyOtpDesc());
            }
            com.payu.ui.viewmodel.p pVar2 = checkoutActivity.Q;
            if (pVar2 == null) {
                return;
            }
            pVar2.A1();
        }
    }

    public static final void q3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            ConstraintLayout constraintLayout = checkoutActivity.V;
            if (constraintLayout == null) {
                return;
            }
            constraintLayout.setVisibility(8);
            return;
        }
        ConstraintLayout constraintLayout2 = checkoutActivity.V;
        if (constraintLayout2 == null) {
            return;
        }
        constraintLayout2.setVisibility(0);
    }

    public static final void r3(CheckoutActivity checkoutActivity, Integer num) {
        ProgressBar progressBar = checkoutActivity.H0;
        if (progressBar == null) {
            return;
        }
        progressBar.setProgress(num.intValue());
    }

    public static final void s2(CheckoutActivity checkoutActivity, Bundle bundle) {
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar != null) {
            pVar.h0 = bundle;
            pVar.m0.setValue(Long.valueOf(System.currentTimeMillis()));
            SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
            BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
            if (apiLayer != null) {
                apiLayer.fetchConfig();
            }
            BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
            if (apiLayer2 != null) {
                apiLayer2.fetchPaymentOptions(pVar, new com.payu.ui.viewmodel.t(pVar));
            }
        }
        com.payu.ui.viewmodel.p pVar2 = checkoutActivity.Q;
        if (pVar2 == null) {
            return;
        }
        pVar2.K0(Boolean.FALSE);
    }

    public static final void s3(CheckoutActivity checkoutActivity, String str) {
        if (str != null) {
            checkoutActivity.B0 = str;
        }
    }

    public static final void t2(CheckoutActivity checkoutActivity, Editable editable) {
        EditText editText = checkoutActivity.C0;
        if (editText == null) {
            return;
        }
        editText.setText(editable);
    }

    public static final void t3(CheckoutActivity checkoutActivity, View view) {
        com.payu.ui.viewmodel.p pVar = checkoutActivity.Q;
        if (pVar == null) {
            return;
        }
        pVar.U0(checkoutActivity.S0);
    }

    public static final void u2(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.F0 = "";
        EditText editText = checkoutActivity.P0;
        if (editText != null) {
            editText.setText(Editable.Factory.getInstance().newEditable(checkoutActivity.F0));
        }
        ImageView imageView = checkoutActivity.R0;
        if (imageView == null) {
            return;
        }
        imageView.setVisibility(8);
    }

    public static final void u3(CheckoutActivity checkoutActivity, Event event) {
        Pair pair = (Pair) event.getContentIfNotHandled();
        if (pair != null && ((Boolean) pair.c()).booleanValue()) {
            View view = checkoutActivity.a0;
            TextView textView = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvCouponError);
            if (textView == null) {
                return;
            }
            String str = (String) pair.d();
            if (str == null) {
                str = checkoutActivity.getString(com.payu.ui.g.this_coupon_is_invalid);
            }
            textView.setText(str);
        }
    }

    public static final void v2(CheckoutActivity checkoutActivity, View view, TextView textView, TextView textView2, TextView textView3, View view2) {
        int i = com.payu.ui.a.payu_color_ffffff;
        int i2 = com.payu.ui.a.one_payu_colorPrimary;
        checkoutActivity.j2(view, i2, i, i2);
        FetchOfferDetails fetchOfferDetails = checkoutActivity.Y0;
        checkoutActivity.S2(fetchOfferDetails == null ? null : fetchOfferDetails.getPayuOfferArrayList(), textView, textView2, textView3);
    }

    public static final void v3(CheckoutActivity checkoutActivity, Boolean bool) {
        if (bool.booleanValue()) {
            androidx.appcompat.app.a supportActionBar = checkoutActivity.getSupportActionBar();
            if (supportActionBar == null) {
                return;
            }
            supportActionBar.w(false);
            return;
        }
        androidx.appcompat.app.a supportActionBar2 = checkoutActivity.getSupportActionBar();
        if (supportActionBar2 == null) {
            return;
        }
        supportActionBar2.w(true);
    }

    public static final void w2(CheckoutActivity checkoutActivity, CompoundButton compoundButton, boolean z) {
        checkoutActivity.G0 = Boolean.valueOf(z);
    }

    public static final void w3(CheckoutActivity checkoutActivity, String str) {
        TextView textView = checkoutActivity.L0;
        if (textView == null) {
            return;
        }
        textView.setText(str);
    }

    public static final void x3(CheckoutActivity checkoutActivity, View view) {
        checkoutActivity.T2(true);
        CommonUIViewUtils.updateLayoutSecurity(checkoutActivity, false);
    }

    public static final void y2(CheckoutActivity checkoutActivity, ErrorResponse errorResponse) {
        PayUCheckoutProListener checkoutProListener = SdkUiInitializer.INSTANCE.getCheckoutProListener();
        if (checkoutProListener != null) {
            checkoutProListener.onError(errorResponse);
        }
        checkoutActivity.finish();
    }

    public static final void y3(CheckoutActivity checkoutActivity, Event event) {
        if (Intrinsics.d((Boolean) event.getContentIfNotHandled(), Boolean.TRUE)) {
            checkoutActivity.T2(true);
        }
    }

    public static final void z2(CheckoutActivity checkoutActivity, FetchOfferDetails fetchOfferDetails) {
        checkoutActivity.Y0 = fetchOfferDetails;
        if (fetchOfferDetails == null) {
            InternalConfig internalConfig = InternalConfig.INSTANCE;
            if (!internalConfig.getCouponsAvailable() || internalConfig.getUserSelectedOfferInfo() != null) {
                ConstraintLayout constraintLayout = checkoutActivity.X0;
                if (constraintLayout == null) {
                    return;
                }
                constraintLayout.setVisibility(8);
                return;
            }
        }
        ConstraintLayout constraintLayout2 = checkoutActivity.X0;
        if (constraintLayout2 == null) {
            return;
        }
        constraintLayout2.setVisibility(0);
    }

    public static final void z3(CheckoutActivity checkoutActivity, Boolean bool) {
        boolean z;
        boolean booleanValue = bool.booleanValue();
        AppBarLayout appBarLayout = checkoutActivity.W;
        if (booleanValue) {
            if (appBarLayout == null) {
                return;
            } else {
                z = true;
            }
        } else if (appBarLayout == null) {
            return;
        } else {
            z = false;
        }
        appBarLayout.setExpanded(z);
    }

    public final void S2(ArrayList arrayList, TextView textView, TextView textView2, TextView textView3) {
        FragmentManager childFragmentManager;
        androidx.fragment.app.o0 s;
        BaseConfig config;
        if (arrayList == null) {
            return;
        }
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        BaseApiLayer apiLayer = SdkUiInitializer.INSTANCE.getApiLayer();
        viewUtils.updateBackgroundColor(this, textView, (apiLayer == null || (config = apiLayer.getConfig()) == null) ? null : config.getPrimaryColor(), com.payu.ui.a.one_payu_colorPrimary);
        viewUtils.updateBackgroundColor(this, textView2, null, com.payu.ui.a.payu_color_ffffff);
        viewUtils.updateBackgroundColor(this, textView3, null, com.payu.ui.a.payu_color_ffffff);
        ArrayList<? extends Parcelable> arrayList2 = new ArrayList<>();
        ArrayList arrayList3 = new ArrayList();
        for (Object obj : arrayList) {
            if (((OfferInfo) obj).getToDisplay()) {
                arrayList3.add(obj);
            }
        }
        arrayList2.addAll(arrayList3);
        RoundedCornerBottomSheet roundedCornerBottomSheet = this.Y;
        if (roundedCornerBottomSheet == null || (childFragmentManager = roundedCornerBottomSheet.getChildFragmentManager()) == null || (s = childFragmentManager.s()) == null) {
            return;
        }
        int i = com.payu.ui.e.offersContainer;
        com.payu.ui.view.fragments.e eVar = new com.payu.ui.view.fragments.e();
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList(SdkUiConstants.CP_OFFERS_LIST, arrayList2);
        bundle.putSerializable(SdkUiConstants.CP_IS_SKU_OFFER, Boolean.FALSE);
        eVar.setArguments(bundle);
        androidx.fragment.app.o0 t = s.t(i, eVar, SdkUiConstants.TAG_BANK_FRAGMENT);
        if (t == null) {
            return;
        }
        t.i();
    }

    public final void T2(boolean z) {
        RoundedCornerBottomSheet roundedCornerBottomSheet;
        com.payu.ui.viewmodel.p pVar = this.Q;
        if (pVar != null) {
            pVar.B1();
        }
        RoundedCornerBottomSheet roundedCornerBottomSheet2 = this.X;
        if (roundedCornerBottomSheet2 != null) {
            roundedCornerBottomSheet2.dismiss();
        }
        if (!z && (roundedCornerBottomSheet = this.Y) != null) {
            roundedCornerBottomSheet.dismiss();
        }
        this.t0 = false;
    }

    public final void U2() {
        Fragment p0 = getSupportFragmentManager().p0(SdkUiConstants.TAG_REPLACED_FRAGMENT);
        if (p0 != null) {
            this.S0.pop();
            getSupportFragmentManager().s().r(p0).i();
        }
        if (getSupportFragmentManager().y0() <= 0) {
            finish();
            return;
        }
        String name = getSupportFragmentManager().x0(getSupportFragmentManager().y0() - 1).getName();
        com.payu.ui.viewmodel.p pVar = this.Q;
        if (pVar != null) {
            pVar.y0(getSupportFragmentManager().y0(), name, this.S0);
        }
        if (getSupportFragmentManager().y0() > 1) {
            AnalyticsUtils.INSTANCE.logBackButtonClickEvent(getApplicationContext(), SdkUiConstants.CP_CHECKOUT_BACK_BUTTON, this.B0, false);
        }
    }

    public final void a() {
        MutableLiveData mutableLiveData;
        MutableLiveData mutableLiveData2;
        MutableLiveData mutableLiveData3;
        MutableLiveData mutableLiveData4;
        MutableLiveData mutableLiveData5;
        MutableLiveData mutableLiveData6;
        MutableLiveData mutableLiveData7;
        MutableLiveData mutableLiveData8;
        MutableLiveData mutableLiveData9;
        MutableLiveData mutableLiveData10;
        MutableLiveData mutableLiveData11;
        MutableLiveData mutableLiveData12;
        MutableLiveData mutableLiveData13;
        MutableLiveData mutableLiveData14;
        MutableLiveData mutableLiveData15;
        MutableLiveData mutableLiveData16;
        MutableLiveData mutableLiveData17;
        MutableLiveData mutableLiveData18;
        MutableLiveData mutableLiveData19;
        MutableLiveData mutableLiveData20;
        MutableLiveData mutableLiveData21;
        MutableLiveData mutableLiveData22;
        MutableLiveData mutableLiveData23;
        MutableLiveData mutableLiveData24;
        MutableLiveData mutableLiveData25;
        MutableLiveData mutableLiveData26;
        MutableLiveData mutableLiveData27;
        MutableLiveData mutableLiveData28;
        MutableLiveData mutableLiveData29;
        MutableLiveData mutableLiveData30;
        MutableLiveData mutableLiveData31;
        MutableLiveData mutableLiveData32;
        MutableLiveData mutableLiveData33;
        MutableLiveData mutableLiveData34;
        MutableLiveData mutableLiveData35;
        MutableLiveData mutableLiveData36;
        MutableLiveData mutableLiveData37;
        MutableLiveData mutableLiveData38;
        MutableLiveData mutableLiveData39;
        MutableLiveData mutableLiveData40;
        MutableLiveData mutableLiveData41;
        MutableLiveData mutableLiveData42;
        MutableLiveData mutableLiveData43;
        MutableLiveData mutableLiveData44;
        MutableLiveData mutableLiveData45;
        MutableLiveData mutableLiveData46;
        MutableLiveData mutableLiveData47;
        MutableLiveData mutableLiveData48;
        MutableLiveData mutableLiveData49;
        MutableLiveData mutableLiveData50;
        MutableLiveData mutableLiveData51;
        MutableLiveData mutableLiveData52;
        MutableLiveData mutableLiveData53;
        MutableLiveData mutableLiveData54;
        MutableLiveData mutableLiveData55;
        MutableLiveData mutableLiveData56;
        MutableLiveData mutableLiveData57;
        MutableLiveData mutableLiveData58;
        com.payu.ui.viewmodel.p pVar = this.Q;
        if (pVar != null && (mutableLiveData58 = pVar.k) != null) {
            mutableLiveData58.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.H2(CheckoutActivity.this, (FragmentModel) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar2 = this.Q;
        if (pVar2 != null && (mutableLiveData57 = pVar2.r0) != null) {
            mutableLiveData57.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.j3(CheckoutActivity.this, (Event) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar3 = this.Q;
        if (pVar3 != null && (mutableLiveData56 = pVar3.x) != null) {
            mutableLiveData56.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.N2(CheckoutActivity.this, (String) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar4 = this.Q;
        if (pVar4 != null && (mutableLiveData55 = pVar4.y) != null) {
            mutableLiveData55.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.m3(CheckoutActivity.this, (String) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar5 = this.Q;
        if (pVar5 != null && (mutableLiveData54 = pVar5.z) != null) {
            mutableLiveData54.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.A2(CheckoutActivity.this, (ImageDetails) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar6 = this.Q;
        if (pVar6 != null && (mutableLiveData53 = pVar6.A) != null) {
            mutableLiveData53.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.d3(CheckoutActivity.this, (Pair) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar7 = this.Q;
        if (pVar7 != null && (mutableLiveData52 = pVar7.B) != null) {
            mutableLiveData52.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.n3(CheckoutActivity.this, (Pair) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar8 = this.Q;
        if (pVar8 != null && (mutableLiveData51 = pVar8.C) != null) {
            mutableLiveData51.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.P2(CheckoutActivity.this, (Pair) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar9 = this.Q;
        if (pVar9 != null && (mutableLiveData50 = pVar9.j) != null) {
            mutableLiveData50.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.K2(CheckoutActivity.this, (Event) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar10 = this.Q;
        if (pVar10 != null && (mutableLiveData49 = pVar10.d) != null) {
            mutableLiveData49.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.L2(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar11 = this.Q;
        if (pVar11 != null && (mutableLiveData48 = pVar11.e) != null) {
            mutableLiveData48.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.Z2(CheckoutActivity.this, (Event) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar12 = this.Q;
        if (pVar12 != null && (mutableLiveData47 = pVar12.J0) != null) {
            mutableLiveData47.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.a3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar13 = this.Q;
        if (pVar13 != null && (mutableLiveData46 = pVar13.m) != null) {
            mutableLiveData46.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.y2(CheckoutActivity.this, (ErrorResponse) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar14 = this.Q;
        if (pVar14 != null && (mutableLiveData45 = pVar14.l) != null) {
            mutableLiveData45.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.k3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar15 = this.Q;
        if (pVar15 != null && (mutableLiveData44 = pVar15.D) != null) {
            mutableLiveData44.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.q3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar16 = this.Q;
        if (pVar16 != null && (mutableLiveData43 = pVar16.E) != null) {
            mutableLiveData43.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.v3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar17 = this.Q;
        if (pVar17 != null && (mutableLiveData42 = pVar17.F) != null) {
            mutableLiveData42.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.z3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar18 = this.Q;
        if (pVar18 != null && (mutableLiveData41 = pVar18.G) != null) {
            mutableLiveData41.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.C3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar19 = this.Q;
        if (pVar19 != null && (mutableLiveData40 = pVar19.n) != null) {
            mutableLiveData40.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.G3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar20 = this.Q;
        if (pVar20 != null && (mutableLiveData39 = pVar20.n1) != null) {
            mutableLiveData39.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.J3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar21 = this.Q;
        if (pVar21 != null && (mutableLiveData38 = pVar21.I) != null) {
            mutableLiveData38.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.I2(CheckoutActivity.this, (SnackBarModel) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar22 = this.Q;
        if (pVar22 != null && (mutableLiveData37 = pVar22.H) != null) {
            mutableLiveData37.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.L3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar23 = this.Q;
        if (pVar23 != null && (mutableLiveData36 = pVar23.J) != null) {
            mutableLiveData36.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.D2(CheckoutActivity.this, (SavedCardOption) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar24 = this.Q;
        if (pVar24 != null && (mutableLiveData35 = pVar24.K) != null) {
            mutableLiveData35.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.F2(CheckoutActivity.this, (SodexoCardOption) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar25 = this.Q;
        if (pVar25 != null && (mutableLiveData34 = pVar25.L) != null) {
            mutableLiveData34.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.N3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar26 = this.Q;
        if (pVar26 != null && (mutableLiveData33 = pVar26.M) != null) {
            mutableLiveData33.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.P3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar27 = this.Q;
        if (pVar27 != null && (mutableLiveData32 = pVar27.N) != null) {
            mutableLiveData32.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.R3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar28 = this.Q;
        if (pVar28 != null && (mutableLiveData31 = pVar28.b1) != null) {
            mutableLiveData31.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.T3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar29 = this.Q;
        if (pVar29 != null && (mutableLiveData30 = pVar29.O) != null) {
            mutableLiveData30.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.B2(CheckoutActivity.this, (PaymentOption) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar30 = this.Q;
        if (pVar30 != null && (mutableLiveData29 = pVar30.P) != null) {
            mutableLiveData29.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.M2(CheckoutActivity.this, (Integer) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar31 = this.Q;
        if (pVar31 != null && (mutableLiveData28 = pVar31.Q) != null) {
            mutableLiveData28.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.U3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar32 = this.Q;
        if (pVar32 != null && (mutableLiveData27 = pVar32.R) != null) {
            mutableLiveData27.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.J2(CheckoutActivity.this, (ToolTipModel) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar33 = this.Q;
        if (pVar33 != null && (mutableLiveData26 = pVar33.S) != null) {
            mutableLiveData26.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.V3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar34 = this.Q;
        if (pVar34 != null && (mutableLiveData25 = pVar34.T) != null) {
            mutableLiveData25.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.R2((Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar35 = this.Q;
        if (pVar35 != null && (mutableLiveData24 = pVar35.U) != null) {
            mutableLiveData24.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.W3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar36 = this.Q;
        if (pVar36 != null && (mutableLiveData23 = pVar36.V) != null) {
            mutableLiveData23.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.c3(CheckoutActivity.this, (String) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar37 = this.Q;
        if (pVar37 != null && (mutableLiveData22 = pVar37.k0) != null) {
            mutableLiveData22.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.b3(CheckoutActivity.this, (Integer) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar38 = this.Q;
        if (pVar38 != null && (mutableLiveData21 = pVar38.j0) != null) {
            mutableLiveData21.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.X3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar39 = this.Q;
        if (pVar39 != null && (mutableLiveData20 = pVar39.t0) != null) {
            mutableLiveData20.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.z2(CheckoutActivity.this, (FetchOfferDetails) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar40 = this.Q;
        if (pVar40 != null && (mutableLiveData19 = pVar40.l0) != null) {
            mutableLiveData19.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.s3(CheckoutActivity.this, (String) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar41 = this.Q;
        if (pVar41 != null && (mutableLiveData18 = pVar41.u0) != null) {
            mutableLiveData18.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.Y3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar42 = this.Q;
        if (pVar42 != null && (mutableLiveData17 = pVar42.v0) != null) {
            mutableLiveData17.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.Z3(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar43 = this.Q;
        if (pVar43 != null && (mutableLiveData16 = pVar43.z0) != null) {
            mutableLiveData16.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.a4(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar44 = this.Q;
        if (pVar44 != null && (mutableLiveData15 = pVar44.D0) != null) {
            mutableLiveData15.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.l3(CheckoutActivity.this, (Integer) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar45 = this.Q;
        if (pVar45 != null && (mutableLiveData14 = pVar45.F0) != null) {
            mutableLiveData14.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.w3(CheckoutActivity.this, (String) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar46 = this.Q;
        if (pVar46 != null && (mutableLiveData13 = pVar46.C0) != null) {
            mutableLiveData13.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.r3(CheckoutActivity.this, (Integer) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar47 = this.Q;
        if (pVar47 != null && (mutableLiveData12 = pVar47.I0) != null) {
            mutableLiveData12.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.b4(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar48 = this.Q;
        if (pVar48 != null && (mutableLiveData11 = pVar48.G0) != null) {
            mutableLiveData11.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.A3(CheckoutActivity.this, (String) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar49 = this.Q;
        if (pVar49 != null && (mutableLiveData10 = pVar49.H0) != null) {
            mutableLiveData10.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.c4(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar50 = this.Q;
        if (pVar50 != null && (mutableLiveData9 = pVar50.w0) != null) {
            mutableLiveData9.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.d4(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar51 = this.Q;
        if (pVar51 != null && (mutableLiveData8 = pVar51.E0) != null) {
            mutableLiveData8.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.E3(CheckoutActivity.this, (String) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar52 = this.Q;
        if (pVar52 != null && (mutableLiveData7 = pVar52.p0) != null) {
            mutableLiveData7.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.e4(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar53 = this.Q;
        if (pVar53 != null && (mutableLiveData6 = pVar53.Z0) != null) {
            mutableLiveData6.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.X2(CheckoutActivity.this, (PaymentOption) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar54 = this.Q;
        if (pVar54 != null && (mutableLiveData5 = pVar54.j1) != null) {
            mutableLiveData5.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.f4(CheckoutActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar55 = this.Q;
        if (pVar55 != null && (mutableLiveData4 = pVar55.i1) != null) {
            mutableLiveData4.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.t2(CheckoutActivity.this, (Editable) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar56 = this.Q;
        if (pVar56 != null && (mutableLiveData3 = pVar56.o1) != null) {
            mutableLiveData3.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.p3(CheckoutActivity.this, (Event) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar57 = this.Q;
        if (pVar57 != null && (mutableLiveData2 = pVar57.p1) != null) {
            mutableLiveData2.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    CheckoutActivity.u3(CheckoutActivity.this, (Event) obj);
                }
            });
        }
        com.payu.ui.viewmodel.p pVar58 = this.Q;
        if (pVar58 == null || (mutableLiveData = pVar58.q1) == null) {
            return;
        }
        mutableLiveData.observe(this, new Observer() {
            public final void onChanged(Object obj) {
                CheckoutActivity.y3(CheckoutActivity.this, (Event) obj);
            }
        });
    }

    public final void b(View view) {
        TextView textView;
        BaseApiLayer apiLayer;
        BaseConfig config;
        BaseApiLayer apiLayer2;
        BaseConfig config2;
        String str = null;
        Button button = view == null ? null : (Button) view.findViewById(com.payu.ui.e.btnNo);
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
        viewUtils.updateBackgroundColor(this, button, (sdkUiInitializer == null || (apiLayer2 = sdkUiInitializer.getApiLayer()) == null || (config2 = apiLayer2.getConfig()) == null) ? null : config2.getPrimaryColor(), com.payu.ui.a.one_payu_colorPrimary);
        if (sdkUiInitializer != null && (apiLayer = sdkUiInitializer.getApiLayer()) != null && (config = apiLayer.getConfig()) != null) {
            str = config.getBaseTextColor();
        }
        viewUtils.updateButtonTextColor(button, str);
        if (button != null) {
            button.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.o3(CheckoutActivity.this, view2);
                }
            });
        }
        if (view == null || (textView = (TextView) view.findViewById(com.payu.ui.e.tvYes)) == null) {
            return;
        }
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                CheckoutActivity.t3(CheckoutActivity.this, view2);
            }
        });
    }

    @Override
    public void bottomSheetAttach() {
        this.t0 = true;
    }

    @Override
    public void bottomSheetDetach() {
        OtpParser otpParser;
        BottomSheetType bottomSheetType = this.a1;
        if (bottomSheetType != null && a.a[bottomSheetType.ordinal()] == 1) {
            InternalConfig internalConfig = InternalConfig.INSTANCE;
            if (internalConfig.getSelectedOfferInfo() != null) {
                SelectedOfferInfo selectedOfferInfo = internalConfig.getSelectedOfferInfo();
                if (selectedOfferInfo != null && selectedOfferInfo.isAutoApply() && internalConfig.getRemoveOfferIfNeeded()) {
                    internalConfig.setPaymentOptionSelected(false);
                    com.payu.ui.viewmodel.p pVar = this.Q;
                    if (pVar != null) {
                        OfferFilterListener.DefaultImpls.showChangeOfferView$default(pVar, false, false, false, 6, null);
                    }
                }
                if (internalConfig.getRemoveOfferIfNeeded()) {
                    internalConfig.setSelectedOfferInfo(null);
                }
            }
            internalConfig.setRemoveOfferIfNeeded(true);
        }
        com.payu.ui.viewmodel.p pVar2 = this.Q;
        if (pVar2 != null && (otpParser = pVar2.T0) != null) {
            otpParser.stopListening();
        }
        this.t0 = false;
    }

    public final void c(final View view) {
        ArrayList arrayList;
        ArrayList arrayList2;
        ArrayList arrayList3;
        int i;
        ArrayList<OfferInfo> payuSkuOfferList;
        ArrayList<OfferInfo> payuRewardOfferArrayList;
        ArrayList<OfferInfo> payuOfferArrayList;
        ImageView imageView;
        ImageView imageView2;
        if (view != null && (imageView2 = (ImageView) view.findViewById(com.payu.ui.e.ivCloseIcon)) != null) {
            imageView2.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.B3(CheckoutActivity.this, view2);
                }
            });
        }
        if (view != null && (imageView = (ImageView) view.findViewById(com.payu.ui.e.ivPaymentOptionIcon)) != null) {
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.F3(CheckoutActivity.this, view2);
                }
            });
        }
        final View view2 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.rlOfferToolbar);
        if (view2 != null) {
            view2.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view3) {
                    CheckoutActivity.n2(view2, view3);
                }
            });
        }
        View view3 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.rlCoupon);
        Button button = view3 == null ? null : (Button) view3.findViewById(com.payu.ui.e.btnApplyCouponButton);
        final EditText editText = view3 == null ? null : (EditText) view3.findViewById(com.payu.ui.e.etField);
        final TextView textView = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvCouponError);
        ViewUtils.INSTANCE.disableView(button);
        if (editText != null) {
            editText.addTextChangedListener(new f(textView, button));
        }
        if (button != null) {
            button.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view4) {
                    CheckoutActivity.m2(textView, this, editText, view4);
                }
            });
        }
        if (!InternalConfig.INSTANCE.getCouponsAvailable()) {
            if (view3 != null) {
                view3.setVisibility(8);
            }
            if (textView != null) {
                textView.setVisibility(8);
            }
        }
        TextView textView2 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvPaymentOffer);
        TextView textView3 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvSkuOffer);
        TextView textView4 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvRewardOffer);
        FetchOfferDetails fetchOfferDetails = this.Y0;
        if (fetchOfferDetails == null || (payuOfferArrayList = fetchOfferDetails.getPayuOfferArrayList()) == null) {
            arrayList = null;
        } else {
            arrayList = new ArrayList();
            for (Object obj : payuOfferArrayList) {
                if (((OfferInfo) obj).getToDisplay()) {
                    arrayList.add(obj);
                }
            }
        }
        boolean z = arrayList == null || arrayList.isEmpty();
        FetchOfferDetails fetchOfferDetails2 = this.Y0;
        if (fetchOfferDetails2 == null || (payuRewardOfferArrayList = fetchOfferDetails2.getPayuRewardOfferArrayList()) == null) {
            arrayList2 = null;
        } else {
            arrayList2 = new ArrayList();
            for (Object obj2 : payuRewardOfferArrayList) {
                if (((OfferInfo) obj2).getToDisplay()) {
                    arrayList2.add(obj2);
                }
            }
        }
        boolean z2 = arrayList2 == null || arrayList2.isEmpty();
        FetchOfferDetails fetchOfferDetails3 = this.Y0;
        if (fetchOfferDetails3 == null || (payuSkuOfferList = fetchOfferDetails3.getPayuSkuOfferList()) == null) {
            arrayList3 = null;
        } else {
            arrayList3 = new ArrayList();
            for (Object obj3 : payuSkuOfferList) {
                if (((OfferInfo) obj3).getToDisplay()) {
                    arrayList3.add(obj3);
                }
            }
        }
        boolean z3 = arrayList3 == null || arrayList3.isEmpty();
        if (z) {
            if (textView2 != null) {
                textView2.setVisibility(8);
            }
            i = 0;
        } else {
            i = 1;
        }
        if (!z2) {
            i++;
        } else if (textView4 != null) {
            textView4.setVisibility(8);
        }
        if (!z3) {
            i++;
        } else if (textView3 != null) {
            textView3.setVisibility(8);
        }
        if (i > 1) {
            View view4 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llOffersTab);
            if (view4 != null) {
                view4.setVisibility(0);
            }
            if (!z) {
                FetchOfferDetails fetchOfferDetails4 = this.Y0;
                S2(fetchOfferDetails4 == null ? null : fetchOfferDetails4.getPayuOfferArrayList(), textView2, textView3, textView4);
                if (textView2 != null) {
                    final TextView textView5 = textView2;
                    final TextView textView6 = textView3;
                    final TextView textView7 = textView4;
                    textView2.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view5) {
                            CheckoutActivity.v2(CheckoutActivity.this, view, textView5, textView6, textView7, view5);
                        }
                    });
                }
            }
            if (!z2) {
                if (textView4 != null) {
                    final TextView textView8 = textView4;
                    final TextView textView9 = textView3;
                    final TextView textView10 = textView2;
                    textView4.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view5) {
                            CheckoutActivity.W2(CheckoutActivity.this, view, textView8, textView9, textView10, view5);
                        }
                    });
                }
                if (z && textView4 != null) {
                    textView4.performClick();
                }
            }
            if (!z3 && textView3 != null) {
                final TextView textView11 = textView3;
                final TextView textView12 = textView4;
                final TextView textView13 = textView2;
                textView3.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view5) {
                        CheckoutActivity.i3(CheckoutActivity.this, view, textView11, textView12, textView13, view5);
                    }
                });
            }
        } else if (!z) {
            View view5 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llOffersTab);
            if (view5 != null) {
                view5.setVisibility(8);
            }
            FetchOfferDetails fetchOfferDetails5 = this.Y0;
            S2(fetchOfferDetails5 == null ? null : fetchOfferDetails5.getPayuOfferArrayList(), textView2, textView3, textView4);
        } else if (z2) {
            View view6 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llOffersTab);
            if (view6 != null) {
                view6.setVisibility(8);
            }
            FetchOfferDetails fetchOfferDetails6 = this.Y0;
            S2(fetchOfferDetails6 == null ? null : fetchOfferDetails6.getPayuSkuOfferList(), textView3, textView4, textView2);
        } else {
            View view7 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llOffersTab);
            if (view7 != null) {
                view7.setVisibility(8);
            }
            FetchOfferDetails fetchOfferDetails7 = this.Y0;
            S2(fetchOfferDetails7 == null ? null : fetchOfferDetails7.getPayuRewardOfferArrayList(), textView4, textView3, textView2);
        }
        if (z && z2 && z3) {
            View view8 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llOffersTab);
            if (view8 != null) {
                view8.setVisibility(8);
            }
            FrameLayout frameLayout = view == null ? null : (FrameLayout) view.findViewById(com.payu.ui.e.offersContainer);
            if (frameLayout != null) {
                frameLayout.setVisibility(8);
            }
            View view9 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.clEmptyOffers);
            if (view9 == null) {
                return;
            }
            view9.setVisibility(0);
        }
    }

    public final void d(android.view.View r38) {
        throw new UnsupportedOperationException("Method not decompiled: com.payu.ui.view.activities.CheckoutActivity.d(android.view.View):void");
    }

    public final void e(View view) {
        FragmentManager childFragmentManager;
        androidx.fragment.app.o0 s;
        Double d2;
        PayUPaymentParams payUPaymentParams;
        String amount;
        Double totalInstantDiscount;
        ImageView imageView;
        ImageView imageView2;
        if (view != null && (imageView2 = (ImageView) view.findViewById(com.payu.ui.e.ivCloseIcon)) != null) {
            imageView2.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.K3(CheckoutActivity.this, view2);
                }
            });
        }
        if (view != null && (imageView = (ImageView) view.findViewById(com.payu.ui.e.ivPaymentOptionIcon)) != null) {
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.M3(CheckoutActivity.this, view2);
                }
            });
        }
        TextView textView = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvOfferAndDiscounts);
        if (textView != null) {
            textView.setText(getApplicationContext().getString(com.payu.ui.g.payu_detailed_offer_breakup));
        }
        View view2 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.rlTotalAmt);
        if (view2 != null) {
            view2.setVisibility(0);
        }
        ViewUtils.INSTANCE.updateBackgroundColor(this, view2, String.valueOf(com.payu.ui.a.payu_color_99DBE9F9), com.payu.ui.a.payu_color_99DBE9F9);
        TextView textView2 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvTotalSkuAmtValue);
        if (textView2 != null) {
            Utils utils = Utils.INSTANCE;
            BaseApiLayer apiLayer = SdkUiInitializer.INSTANCE.getApiLayer();
            if (apiLayer == null || (payUPaymentParams = apiLayer.getPayUPaymentParams()) == null || (amount = payUPaymentParams.getAmount()) == null) {
                d2 = null;
            } else {
                double parseDouble = Double.parseDouble(amount);
                SelectedOfferInfo selectedOfferInfo = InternalConfig.INSTANCE.getSelectedOfferInfo();
                d2 = Double.valueOf(parseDouble - ((selectedOfferInfo == null || (totalInstantDiscount = selectedOfferInfo.getTotalInstantDiscount()) == null) ? SdkUiConstants.VALUE_ZERO_INT : totalInstantDiscount.doubleValue()));
            }
            textView2.setText(Utils.getFormattedAmount$one_payu_ui_sdk_android_release$default(utils, d2, this, null, 4, null));
        }
        ArrayList<? extends Parcelable> arrayList = new ArrayList<>();
        SelectedOfferInfo selectedOfferInfo2 = InternalConfig.INSTANCE.getSelectedOfferInfo();
        Map offerMap = selectedOfferInfo2 != null ? selectedOfferInfo2.getOfferMap() : null;
        if (offerMap == null) {
            offerMap = kotlin.collections.v.i();
        }
        for (Map.Entry entry : offerMap.entrySet()) {
            arrayList.add((OfferInfo) entry.getValue());
        }
        RoundedCornerBottomSheet roundedCornerBottomSheet = this.X;
        if (roundedCornerBottomSheet == null || (childFragmentManager = roundedCornerBottomSheet.getChildFragmentManager()) == null || (s = childFragmentManager.s()) == null) {
            return;
        }
        int i = com.payu.ui.e.skuContainer;
        com.payu.ui.view.fragments.e eVar = new com.payu.ui.view.fragments.e();
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList(SdkUiConstants.CP_OFFERS_LIST, arrayList);
        bundle.putSerializable(SdkUiConstants.CP_IS_SKU_OFFER, Boolean.TRUE);
        eVar.setArguments(bundle);
        androidx.fragment.app.o0 t = s.t(i, eVar, SdkUiConstants.TAG_BANK_FRAGMENT);
        if (t == null) {
            return;
        }
        t.i();
    }

    public final void f(View view) {
        ConstraintLayout findViewById;
        ConstraintLayout findViewById2;
        ConstraintLayout findViewById3;
        if (view != null && (findViewById3 = view.findViewById(com.payu.ui.e.rlChangePhoneNumber)) != null) {
            findViewById3.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.O3(CheckoutActivity.this, view2);
                }
            });
        }
        if (view != null && (findViewById2 = view.findViewById(com.payu.ui.e.rlLogout)) != null) {
            findViewById2.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.Q3(CheckoutActivity.this, view2);
                }
            });
        }
        if (view == null || (findViewById = view.findViewById(com.payu.ui.e.rlManagePaymentOption)) == null) {
            return;
        }
        findViewById.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                CheckoutActivity.S3(CheckoutActivity.this, view2);
            }
        });
    }

    public final void f3(boolean z) {
        if (this.T0 == null) {
            this.T0 = new PayUProgressDialog(this, null, z, null, 8, null);
        }
        PayUProgressDialog payUProgressDialog = this.T0;
        if (payUProgressDialog == null) {
            return;
        }
        payUProgressDialog.show();
    }

    public final void g(View view) {
        ColorStateList valueOf;
        BaseConfig config;
        BaseConfig config2;
        View view2 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llGlobalVaultOTPVerification);
        View view3 = view2 == null ? null : (ConstraintLayout) view2.findViewById(com.payu.ui.e.rlConsentSwitch);
        CheckBox checkBox = view3 == null ? null : (CheckBox) view3.findViewById(com.payu.ui.e.switchSaveCard);
        if (checkBox != null) {
            checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override
                public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    CheckoutActivity.w2(CheckoutActivity.this, compoundButton, z);
                }
            });
        }
        if (checkBox != null) {
            SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
            BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
            if (((apiLayer == null || (config2 = apiLayer.getConfig()) == null) ? null : config2.getPrimaryColor()) != null) {
                BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
                valueOf = ColorStateList.valueOf(Color.parseColor((apiLayer2 == null || (config = apiLayer2.getConfig()) == null) ? null : config.getPrimaryColor()));
            } else {
                valueOf = ColorStateList.valueOf(androidx.core.content.b.getColor(getApplicationContext(), com.payu.ui.a.payu_color_ffffff));
            }
            checkBox.setButtonTintList(valueOf);
        }
        InternalConfig internalConfig = InternalConfig.INSTANCE;
        if (!internalConfig.isUserPersonalizedOffersAvailable() || !internalConfig.isOfferEnabled()) {
            if (view3 == null) {
                return;
            }
            view3.setVisibility(8);
            return;
        }
        if (checkBox != null) {
            checkBox.setChecked(false);
        }
        this.G0 = Boolean.FALSE;
        TextView textView = view3 == null ? null : (TextView) view3.findViewById(com.payu.ui.e.tvSaveCard);
        ImageView imageView = view3 != null ? (ImageView) view3.findViewById(com.payu.ui.e.ivSavedCardNudge) : null;
        if (imageView != null) {
            imageView.setVisibility(8);
        }
        if (textView != null) {
            textView.setText(getString(com.payu.ui.g.payu_rewards_consent_message));
        }
        if (textView == null) {
            return;
        }
        textView.setTextColor(androidx.core.content.b.getColor(getApplicationContext(), com.payu.ui.a.payu_color_7b7b7b));
    }

    public final void g3() {
        PayUProgressDialog payUProgressDialog = this.T0;
        if (payUProgressDialog == null || !payUProgressDialog.isShowing()) {
            return;
        }
        this.T0.dismiss();
        this.T0 = null;
    }

    @Override
    public void getInflatedView(View view, RoundedCornerBottomSheet roundedCornerBottomSheet) {
        if (!this.t0) {
            roundedCornerBottomSheet.dismiss();
            return;
        }
        this.Z = view;
        SavedCardOption savedCardOption = this.h0;
        if (savedCardOption != null) {
            if (this.X == null) {
                this.X = roundedCornerBottomSheet;
            }
            q2(savedCardOption, view);
            return;
        }
        PaymentOption paymentOption = this.l0;
        if (paymentOption == null || !this.k0) {
            com.payu.ui.viewmodel.p pVar = this.Q;
            if (pVar == null) {
                return;
            }
            pVar.l1();
            return;
        }
        if (this.X == null) {
            this.X = roundedCornerBottomSheet;
        }
        if (paymentOption.getPaymentType() == PaymentType.UPI) {
            UPIOption uPIOption = new UPIOption();
            p2(uPIOption, this.l0);
            uPIOption.setPackageName(this.i0);
            o2(uPIOption, view);
        } else {
            PaymentOption paymentOption2 = this.l0;
            if ((paymentOption2 == null ? null : paymentOption2.getPaymentType()) == PaymentType.WALLET) {
                PaymentOption walletOption = new WalletOption();
                p2(walletOption, this.l0);
                walletOption.setPhoneNumber(this.j0);
                o2(walletOption, view);
            }
        }
        this.l0 = null;
    }

    public final void h2(int i) {
        Window window = getWindow();
        window.addFlags(Integer.MIN_VALUE);
        window.clearFlags(67108864);
        window.setStatusBarColor(i);
    }

    @Override
    public void handleBottomSheetClose() {
        getWindow().setSoftInputMode(3);
        TextView textView = this.w0;
        if (textView != null) {
            textView.setVisibility(8);
        }
        TextView textView2 = this.x0;
        if (textView2 != null) {
            textView2.setVisibility(8);
        }
        com.payu.ui.viewmodel.p pVar = this.Q;
        if (pVar == null) {
            return;
        }
        pVar.B1();
    }

    public final void i2(final Bundle bundle) {
        com.payu.ui.viewmodel.p pVar;
        PayUPaymentParams payUPaymentParams;
        PayUSIParams payUSIParams;
        f3(true);
        this.Q = new ViewModelProvider(this, new com.payu.ui.viewmodel.e(getApplication(), new HashMap())).get(com.payu.ui.viewmodel.p.class);
        SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
        BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
        if (apiLayer != null) {
            com.payu.ui.viewmodel.p pVar2 = this.Q;
            if (pVar2 == null) {
                throw new NullPointerException("null cannot be cast to non-null type com.payu.base.listeners.BaseTransactionListener");
            }
            apiLayer.connectListener(this, pVar2);
        }
        new Handler().postDelayed(new Runnable() {
            @Override
            public final void run() {
                CheckoutActivity.s2(CheckoutActivity.this, bundle);
            }
        }, 200L);
        BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
        if (!(apiLayer2 == null || (payUPaymentParams = apiLayer2.getPayUPaymentParams()) == null || (payUSIParams = payUPaymentParams.getPayUSIParams()) == null || !payUSIParams.isPreAuthTxn()) || (pVar = this.Q) == null) {
            return;
        }
        pVar.G1();
    }

    public final void j2(View view, int i, int i2, int i3) {
        TextView textView = (TextView) view.findViewById(com.payu.ui.e.tvSkuOffer);
        if (textView != null) {
            textView.setTextColor(androidx.core.content.b.getColor(getApplicationContext(), i));
        }
        TextView textView2 = (TextView) view.findViewById(com.payu.ui.e.tvPaymentOffer);
        if (textView2 != null) {
            textView2.setTextColor(androidx.core.content.b.getColor(getApplicationContext(), i2));
        }
        TextView textView3 = (TextView) view.findViewById(com.payu.ui.e.tvRewardOffer);
        if (textView3 == null) {
            return;
        }
        textView3.setTextColor(androidx.core.content.b.getColor(getApplicationContext(), i3));
    }

    public final void k2(View view, boolean z, final Function0 function0) {
        BaseConfig config;
        BaseConfig config2;
        TextView textView;
        g(view);
        View view2 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llGlobalVaultOTPVerification);
        View view3 = view == null ? null : (ConstraintLayout) view.findViewById(com.payu.ui.e.llGlobalVaultPhoneNumberVerification);
        this.L0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvResendOTPErrorGv);
        this.J0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvVerifyOTPErrorGv);
        this.D0 = view == null ? null : (ProgressBar) view.findViewById(com.payu.ui.e.pbOtpReadGv);
        this.E0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvResendOtpGv);
        this.C0 = view == null ? null : (EditText) view.findViewById(com.payu.ui.e.etOtpGv);
        this.M0 = view == null ? null : view.findViewById(com.payu.ui.e.rlSubmitting_btnGv);
        this.K0 = view == null ? null : view.findViewById(com.payu.ui.e.llVerifyBtnsGv);
        this.H0 = view == null ? null : (ProgressBar) view.findViewById(com.payu.ui.e.pbSubmittingGv);
        this.N0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvOTPVerificationLimitError);
        if (z) {
            if (view2 != null) {
                view2.setVisibility(0);
            }
            if (view3 != null) {
                view3.setVisibility(8);
            }
            CommonUIViewUtils.updateLayoutSecurity(this, true);
        } else {
            if (view2 != null) {
                view2.setVisibility(8);
            }
            if (view3 != null) {
                view3.setVisibility(0);
            }
            Group group = this.M0;
            if (group != null) {
                group.setVisibility(8);
            }
            Group group2 = this.K0;
            if (group2 != null) {
                group2.setVisibility(0);
            }
            CommonUIViewUtils.updateLayoutSecurity(this, false);
        }
        TextView textView2 = this.L0;
        if (textView2 != null) {
            textView2.setText("");
        }
        TextView textView3 = this.J0;
        if (textView3 != null) {
            textView3.setText("");
        }
        if (view != null && (textView = (TextView) view.findViewById(com.payu.ui.e.tvCancelGv)) != null) {
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view4) {
                    CheckoutActivity.x3(CheckoutActivity.this, view4);
                }
            });
        }
        TextView textView4 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.btnVerifyOTPGv);
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
        BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
        viewUtils.updateTextColor(this, textView4, (apiLayer == null || (config2 = apiLayer.getConfig()) == null) ? null : config2.getBaseTextColor(), com.payu.ui.a.one_payu_baseTextColor);
        BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
        viewUtils.updateBackgroundColor(this, textView4, (apiLayer2 == null || (config = apiLayer2.getConfig()) == null) ? null : config.getPrimaryColor(), com.payu.ui.a.one_payu_colorPrimary);
        if (textView4 != null) {
            textView4.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view4) {
                    CheckoutActivity.Q2(CheckoutActivity.this, function0, view4);
                }
            });
        }
        TextView textView5 = view != null ? (TextView) view.findViewById(com.payu.ui.e.tvResendOtpGv) : null;
        if (textView5 == null) {
            return;
        }
        textView5.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view4) {
                CheckoutActivity.e3(CheckoutActivity.this, function0, view4);
            }
        });
    }

    public final void o2(final PaymentOption paymentOption, View view) {
        BaseConfig config;
        BaseConfig config2;
        ImageParam imageParam = new ImageParam(paymentOption, false, com.payu.ui.c.payu_credit_debit_cards, null, 8, null);
        SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
        BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
        if (apiLayer != null) {
            apiLayer.getImageForPaymentOption(imageParam, new c(view));
        }
        String str = null;
        Button button = view == null ? null : (Button) view.findViewById(com.payu.ui.e.btnPayBy);
        this.Z0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvOfferView);
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
        viewUtils.updateBackgroundColor(this, button, (apiLayer2 == null || (config2 = apiLayer2.getConfig()) == null) ? null : config2.getPrimaryColor(), com.payu.ui.a.one_payu_colorPrimary);
        BaseApiLayer apiLayer3 = sdkUiInitializer.getApiLayer();
        if (apiLayer3 != null && (config = apiLayer3.getConfig()) != null) {
            str = config.getBaseTextColor();
        }
        viewUtils.updateButtonTextColor(button, str);
        if (button != null) {
            button.setText(getString(com.payu.ui.g.payu_pay_by, paymentOption.getBankName()));
        }
        Utils utils = Utils.INSTANCE;
        Object otherParams = paymentOption.getOtherParams();
        if (otherParams == null) {
            throw new NullPointerException("null cannot be cast to non-null type java.util.HashMap<kotlin.String, kotlin.Any?>{ kotlin.collections.TypeAliasesKt.HashMap<kotlin.String, kotlin.Any?> }");
        }
        String str2 = (String) utils.getValueFromPaymentOption$one_payu_ui_sdk_android_release("pg", (HashMap) otherParams);
        Object otherParams2 = paymentOption.getOtherParams();
        if (otherParams2 == null) {
            throw new NullPointerException("null cannot be cast to non-null type java.util.HashMap<kotlin.String, kotlin.Any?>{ kotlin.collections.TypeAliasesKt.HashMap<kotlin.String, kotlin.Any?> }");
        }
        final String str3 = (String) utils.getValueFromPaymentOption$one_payu_ui_sdk_android_release("bankCode", (HashMap) otherParams2);
        if (!Intrinsics.d(str3, "TEZ")) {
            final String categoryForOffer = utils.getCategoryForOffer(str2);
            new Handler().postDelayed(new Runnable() {
                @Override
                public final void run() {
                    CheckoutActivity.O2(CheckoutActivity.this, categoryForOffer, str3);
                }
            }, 300L);
        }
        if (button == null) {
            return;
        }
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                CheckoutActivity.C2(CheckoutActivity.this, paymentOption, view2);
            }
        });
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        com.payu.ui.viewmodel.p pVar;
        OtpParser otpParser;
        super/*androidx.fragment.app.r*/.onActivityResult(i, i2, intent);
        if (i != 101 || (pVar = this.Q) == null || (otpParser = pVar.T0) == null) {
            return;
        }
        otpParser.onActivityResult(i, i2, intent);
    }

    @Override
    public void onClick(View view) {
        if (MultipleClickHandler.Companion.isSafeOnClickListener$default(MultipleClickHandler.Companion, 0L, 1, null)) {
            Integer valueOf = view == null ? null : Integer.valueOf(view.getId());
            int i = com.payu.ui.e.rl_bottom_bar;
            if (valueOf == null || valueOf.intValue() != i) {
                int i2 = com.payu.ui.e.llPaymentSection;
                if (valueOf == null || valueOf.intValue() != i2) {
                    int i3 = com.payu.ui.e.transparentView;
                    if (valueOf != null && valueOf.intValue() == i3) {
                        com.payu.ui.viewmodel.p pVar = this.Q;
                        if (pVar == null) {
                            return;
                        }
                        pVar.S.setValue(Boolean.FALSE);
                        pVar.T.setValue(Boolean.TRUE);
                        return;
                    }
                    int i4 = com.payu.ui.e.ivOrderDetails;
                    if (valueOf != null && valueOf.intValue() == i4) {
                        AnalyticsUtils.INSTANCE.logCheckoutViewDetailsCTAClickEvent(getApplicationContext(), SdkUiConstants.AMOUNT_INFO, this.B0);
                        com.payu.ui.viewmodel.p pVar2 = this.Q;
                        if (pVar2 == null) {
                            return;
                        }
                        pVar2.G.setValue(Boolean.TRUE);
                        com.payu.ui.viewmodel.p.J0(pVar2, false, false, false, true, false, false, false, false, false, 503);
                        pVar2.A.setValue(new Pair(Integer.valueOf(com.payu.ui.f.order_details_bottom_sheet_layout), null));
                        return;
                    }
                    int i5 = com.payu.ui.e.tvOffer;
                    if (valueOf == null || valueOf.intValue() != i5) {
                        int i6 = com.payu.ui.e.ivOfferDetails;
                        if (valueOf == null || valueOf.intValue() != i6) {
                            int i7 = com.payu.ui.e.offerLayout;
                            if (valueOf == null || valueOf.intValue() != i7) {
                                int i8 = com.payu.ui.e.tvPrivacyPolicy;
                                if (valueOf != null && valueOf.intValue() == i8) {
                                    ViewUtils.INSTANCE.openPrivacyUrl$one_payu_ui_sdk_android_release(this);
                                    return;
                                }
                                int i9 = com.payu.ui.e.payu_header_left_arrow;
                                if (valueOf != null && valueOf.intValue() == i9) {
                                    U2();
                                    return;
                                }
                                return;
                            }
                        }
                    }
                    AnalyticsUtils.INSTANCE.logCheckoutOfferDetailsCTAClickEvent(getApplicationContext(), SdkUiConstants.CP_OFFER_INFO, this.B0);
                    com.payu.ui.viewmodel.p pVar3 = this.Q;
                    if (pVar3 == null) {
                        return;
                    }
                    MutableLiveData mutableLiveData = pVar3.G;
                    Boolean bool = Boolean.TRUE;
                    mutableLiveData.setValue(bool);
                    com.payu.ui.viewmodel.p.J0(pVar3, false, false, false, false, true, false, false, false, false, 495);
                    pVar3.B.setValue(new Pair(Integer.valueOf(com.payu.ui.f.layout_offer_details), bool));
                    return;
                }
            }
            ViewUtils viewUtils = ViewUtils.INSTANCE;
            viewUtils.clearFocusFromSearchView(this);
            viewUtils.hideToolTip();
        }
    }

    public void onCreate(Bundle bundle) {
        SavedCardOption savedCardOption;
        SavedCardOption savedCardOption2;
        SavedCardOption savedCardOption3;
        SavedCardOption savedCardOption4;
        SavedCardOption savedCardOption5;
        PayUPaymentParams payUPaymentParams;
        PayUPaymentParams payUPaymentParams2;
        BaseConfig config;
        BaseConfig config2;
        CardView findViewById;
        BaseConfig config3;
        BaseConfig config4;
        BaseConfig config5;
        BaseConfig config6;
        PayUPaymentParams payUPaymentParams3;
        PayUPaymentParams payUPaymentParams4;
        boolean C;
        if (getIntent() != null && getIntent().getExtras() != null) {
            Bundle extras = getIntent().getExtras();
            String string = extras == null ? null : extras.getString("response");
            HashMap hashMap = new HashMap();
            hashMap.put("payuResponse", String.valueOf(string));
            hashMap.put("merchantResponse", "null");
            C = kotlin.text.m.C(string, "cancelled", false, 2, null);
            if (C) {
                PayUCheckoutProListener checkoutProListener = SdkUiInitializer.INSTANCE.getCheckoutProListener();
                if (checkoutProListener != null) {
                    checkoutProListener.onPaymentCancel(true);
                }
            } else {
                PayUCheckoutProListener checkoutProListener2 = SdkUiInitializer.INSTANCE.getCheckoutProListener();
                if (checkoutProListener2 != null) {
                    checkoutProListener2.onPaymentSuccess(hashMap);
                }
            }
            finish();
        }
        SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
        if (sdkUiInitializer.getApiLayer() == null) {
            finish();
        }
        super/*androidx.fragment.app.r*/.onCreate((Bundle) null);
        getWindow().setSoftInputMode(32);
        int i = Build.VERSION.SDK_INT;
        if (i >= 29) {
            androidx.activity.q.a(getWindow(), false);
        }
        BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
        if (((apiLayer == null || (payUPaymentParams4 = apiLayer.getPayUPaymentParams()) == null) ? null : payUPaymentParams4.getPhone()) != null) {
            BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
            this.F0 = (apiLayer2 == null || (payUPaymentParams3 = apiLayer2.getPayUPaymentParams()) == null) ? null : payUPaymentParams3.getPhone();
        }
        Window window = getWindow();
        window.addFlags(Integer.MIN_VALUE);
        window.clearFlags(67108864);
        window.setStatusBarColor(getResources().getColor(com.payu.ui.a.one_payu_colorPrimaryDark));
        setTheme(com.payu.ui.h.OnePayuTheme);
        setContentView(com.payu.ui.f.activity_checkout_collapsing);
        this.V = findViewById(com.payu.ui.e.rl_bottom_bar);
        this.e0 = (LinearLayout) findViewById(com.payu.ui.e.llPaymentSection);
        this.z0 = findViewById(com.payu.ui.e.rlCheckout);
        ConstraintLayout constraintLayout = this.V;
        this.p0 = constraintLayout == null ? null : (ImageView) constraintLayout.findViewById(com.payu.ui.e.ivPayuLogo);
        ConstraintLayout constraintLayout2 = this.V;
        this.r0 = constraintLayout2 == null ? null : (TextView) constraintLayout2.findViewById(com.payu.ui.e.tvPrivacyPolicy);
        this.q0 = (ImageView) findViewById(com.payu.ui.e.ivOrderDetails);
        this.A0 = (LinearLayout) findViewById(com.payu.ui.e.rlfragment);
        this.V0 = findViewById(com.payu.ui.e.cvMerchantLogo);
        ConstraintLayout constraintLayout3 = this.V;
        if (constraintLayout3 != null) {
            constraintLayout3.setOnClickListener(this);
        }
        LinearLayout linearLayout = this.e0;
        if (linearLayout != null) {
            linearLayout.setOnClickListener(this);
        }
        this.X0 = findViewById(com.payu.ui.e.offerLayout);
        this.U = (TextView) findViewById(com.payu.ui.e.tvOffer);
        this.T = (ImageView) findViewById(com.payu.ui.e.ivOfferDetails);
        ImageView imageView = this.q0;
        if (imageView != null) {
            imageView.setOnClickListener(this);
        }
        ConstraintLayout constraintLayout4 = this.X0;
        if (constraintLayout4 != null) {
            constraintLayout4.setOnClickListener(this);
        }
        TextView textView = this.U;
        if (textView != null) {
            textView.setOnClickListener(this);
        }
        ImageView imageView2 = this.T;
        if (imageView2 != null) {
            imageView2.setOnClickListener(this);
        }
        this.y0 = findViewById(com.payu.ui.e.rl_app_bar);
        TextView textView2 = this.r0;
        if (textView2 != null) {
            textView2.setOnClickListener(this);
        }
        BaseApiLayer apiLayer3 = sdkUiInitializer.getApiLayer();
        if (apiLayer3 == null || (config6 = apiLayer3.getConfig()) == null || !config6.getShowMerchantLogo()) {
            BaseApiLayer apiLayer4 = sdkUiInitializer.getApiLayer();
            BaseConfig config7 = apiLayer4 == null ? null : apiLayer4.getConfig();
            if (config7 != null) {
                config7.setMerchantLogo(null);
            }
            BaseApiLayer apiLayer5 = sdkUiInitializer.getApiLayer();
            BaseConfig config8 = apiLayer5 == null ? null : apiLayer5.getConfig();
            if (config8 != null) {
                config8.setMerchantLogoUrl(null);
            }
        }
        BaseApiLayer apiLayer6 = sdkUiInitializer.getApiLayer();
        String primaryColor = (apiLayer6 == null || (config5 = apiLayer6.getConfig()) == null) ? null : config5.getPrimaryColor();
        if (primaryColor != null && primaryColor.length() != 0) {
            BaseApiLayer apiLayer7 = sdkUiInitializer.getApiLayer();
            String baseTextColor = (apiLayer7 == null || (config4 = apiLayer7.getConfig()) == null) ? null : config4.getBaseTextColor();
            if (baseTextColor == null || baseTextColor.length() == 0) {
                BaseApiLayer apiLayer8 = sdkUiInitializer.getApiLayer();
                BaseConfig config9 = apiLayer8 == null ? null : apiLayer8.getConfig();
                if (config9 != null) {
                    TextColorSelector textColorSelector = TextColorSelector.INSTANCE;
                    BaseApiLayer apiLayer9 = sdkUiInitializer.getApiLayer();
                    config9.setBaseTextColor(textColorSelector.getTextColorFromBackgroundColorString((apiLayer9 == null || (config3 = apiLayer9.getConfig()) == null) ? null : config3.getPrimaryColor(), this));
                }
            }
        }
        this.S = (TextView) findViewById(com.payu.ui.e.tv_amount);
        this.s0 = (TextView) findViewById(com.payu.ui.e.tv_pay_text);
        ImageView imageView3 = (ImageView) findViewById(com.payu.ui.e.payu_header_left_arrow);
        this.W0 = imageView3;
        if (imageView3 != null) {
            imageView3.setOnClickListener(this);
        }
        if (i >= 26) {
            TextView textView3 = this.S;
            if (textView3 != null) {
                textView3.setAutoSizeTextTypeUniformWithConfiguration(14, 32, 1, 1);
            }
            TextView textView4 = this.s0;
            if (textView4 != null) {
                textView4.setAutoSizeTextTypeUniformWithConfiguration(12, 14, 1, 1);
            }
        } else {
            TextView textView5 = this.S;
            if (textView5 != null) {
                androidx.core.widget.j.h(textView5, 14, 32, 1, 1);
            }
            TextView textView6 = this.s0;
            if (textView6 != null) {
                androidx.core.widget.j.h(textView6, 12, 14, 1, 1);
            }
        }
        this.R = (ImageView) findViewById(com.payu.ui.e.img_merchant_logo);
        this.W = findViewById(com.payu.ui.e.appbar);
        ConstraintLayout constraintLayout5 = this.X0;
        if (constraintLayout5 != null) {
            constraintLayout5.setVisibility(8);
        }
        BaseApiLayer apiLayer10 = sdkUiInitializer.getApiLayer();
        if (apiLayer10 != null && (config2 = apiLayer10.getConfig()) != null && config2.getShowMerchantLogo() && (findViewById = findViewById(com.payu.ui.e.cvMerchantLogo)) != null) {
            findViewById.setVisibility(0);
        }
        TextView textView7 = this.S;
        if (textView7 != null) {
            textView7.setAlpha(1.0f);
        }
        ImageView imageView4 = this.q0;
        if (imageView4 != null) {
            imageView4.setAlpha(1.0f);
        }
        ImageView imageView5 = this.R;
        if (imageView5 != null) {
            imageView5.setAlpha(1.0f);
        }
        androidx.appcompat.app.a supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.w(false);
        }
        Drawable drawable = getResources().getDrawable(com.payu.ui.c.payu_left_arrow);
        int color = getResources().getColor(com.payu.ui.a.one_payu_baseTextColor);
        PorterDuff.Mode mode = PorterDuff.Mode.SRC_IN;
        drawable.setColorFilter(new PorterDuffColorFilter(color, mode));
        androidx.appcompat.app.a supportActionBar2 = getSupportActionBar();
        if (supportActionBar2 != null) {
            supportActionBar2.A(drawable);
        }
        i2(bundle);
        ImageView imageView6 = this.q0;
        if (imageView6 != null) {
            imageView6.setColorFilter(androidx.core.content.b.getColor(getApplicationContext(), com.payu.ui.a.one_payu_baseTextColor), mode);
        }
        BaseApiLayer apiLayer11 = sdkUiInitializer.getApiLayer();
        this.n0 = (apiLayer11 == null || (config = apiLayer11.getConfig()) == null) ? null : config.getCartDetails();
        ImageView imageView7 = this.q0;
        if (imageView7 != null) {
            imageView7.setVisibility(0);
        }
        BaseApiLayer apiLayer12 = sdkUiInitializer.getApiLayer();
        if (((apiLayer12 == null || (payUPaymentParams2 = apiLayer12.getPayUPaymentParams()) == null) ? null : payUPaymentParams2.getPhone()) != null) {
            BaseApiLayer apiLayer13 = sdkUiInitializer.getApiLayer();
            this.F0 = (apiLayer13 == null || (payUPaymentParams = apiLayer13.getPayUPaymentParams()) == null) ? null : payUPaymentParams.getPhone();
        }
        if ((bundle == null ? null : Boolean.valueOf(bundle.getBoolean(SdkUiConstants.CP_IS_BOTTOM_SHEET_VISIBLE))) != null) {
            this.t0 = bundle.getBoolean(SdkUiConstants.CP_IS_BOTTOM_SHEET_VISIBLE);
        }
        if ((bundle == null ? null : bundle.getParcelable(SdkUiConstants.PAYMENT_OPTION)) != null) {
            this.k0 = true;
            this.l0 = (PaymentOption) bundle.getParcelable(SdkUiConstants.PAYMENT_OPTION);
            if (bundle.get(SdkUiConstants.PAYMENT_OPTION_PACKAGE_NAME) != null) {
                this.i0 = bundle.getString(SdkUiConstants.PAYMENT_OPTION_PACKAGE_NAME);
            }
            if (bundle.get(SdkUiConstants.PAYMENT_OPTION_PHONE_NUMBER) != null) {
                this.j0 = bundle.getString(SdkUiConstants.PAYMENT_OPTION_PHONE_NUMBER);
            }
        }
        if ((bundle != null ? bundle.getString(SdkUiConstants.CARD_TOKEN) : null) != null) {
            this.k0 = true;
            this.h0 = new SavedCardOption();
            CardBinInfo cardBinInfo = new CardBinInfo(null, null, false, null, false, null, null, null, null, false, null, null, null, null, 16383, null);
            SavedCardOption savedCardOption6 = this.h0;
            if (savedCardOption6 != null) {
                savedCardOption6.setCardToken(bundle.getString(SdkUiConstants.CARD_TOKEN));
            }
            if (bundle.getString(SdkUiConstants.NAME_ON_CARD) != null && (savedCardOption5 = this.h0) != null) {
                savedCardOption5.setNameOnCard(bundle.getString(SdkUiConstants.NAME_ON_CARD));
            }
            if (bundle.getString(SdkUiConstants.CARD_ALIAS) != null && (savedCardOption4 = this.h0) != null) {
                savedCardOption4.setCardAlias(bundle.getString(SdkUiConstants.CARD_ALIAS));
            }
            if (bundle.getString("drawable") != null && (savedCardOption3 = this.h0) != null) {
                savedCardOption3.setDrawable((Bitmap) bundle.getParcelable("drawable"));
            }
            if (bundle.getString(SdkUiConstants.CARD_NUMBER) != null && (savedCardOption2 = this.h0) != null) {
                savedCardOption2.setCardNumber(bundle.getString(SdkUiConstants.CARD_NUMBER));
            }
            if (bundle.getString(SdkUiConstants.BANK_NAME) != null && (savedCardOption = this.h0) != null) {
                savedCardOption.setBankName(bundle.getString(SdkUiConstants.BANK_NAME));
            }
            if (bundle.get("paymentType") != null) {
                Serializable serializable = bundle.getSerializable("paymentType");
                if (serializable == null) {
                    throw new NullPointerException("null cannot be cast to non-null type com.payu.base.models.PaymentType");
                }
                PaymentType paymentType = (PaymentType) serializable;
                SavedCardOption savedCardOption7 = this.h0;
                if (savedCardOption7 != null) {
                    savedCardOption7.setPaymentType(paymentType);
                }
            }
            if (bundle.get(SdkUiConstants.CARD_SCHEME) != null) {
                Serializable serializable2 = bundle.getSerializable(SdkUiConstants.CARD_SCHEME);
                if (serializable2 == null) {
                    throw new NullPointerException("null cannot be cast to non-null type com.payu.base.models.CardScheme");
                }
                cardBinInfo.setCardScheme((CardScheme) serializable2);
            }
            if (bundle.get("cardType") != null) {
                Serializable serializable3 = bundle.getSerializable("cardType");
                if (serializable3 == null) {
                    throw new NullPointerException("null cannot be cast to non-null type com.payu.base.models.CardType");
                }
                cardBinInfo.setCardType((CardType) serializable3);
            }
            SavedCardOption savedCardOption8 = this.h0;
            if (savedCardOption8 != null) {
                savedCardOption8.setCardBinInfo(cardBinInfo);
            }
            com.payu.ui.viewmodel.p pVar = this.Q;
            if (pVar != null) {
                pVar.f = this.h0;
            }
        }
        a();
        getOnBackPressedDispatcher().i(this, new k2(this));
    }

    public void onDestroy() {
        super.onDestroy();
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        viewUtils.hideProgressDialog();
        if (!this.U0) {
            AnalyticsUtils.INSTANCE.logResetCpForKibana(getApplicationContext(), SdkUiConstants.CP_CLOSED);
            BaseApiLayer apiLayer = SdkUiInitializer.INSTANCE.getApiLayer();
            if (apiLayer != null) {
                apiLayer.reset();
            }
            NetworkManager.INSTANCE.unRegisterReceiver(getApplicationContext());
            viewUtils.removeViewTreeListener(this.o0, this.g0);
        }
        InternalConfig internalConfig = InternalConfig.INSTANCE;
        if (internalConfig.getSelectedOfferInfo() != null) {
            internalConfig.setSelectedOfferInfo(null);
        }
        if (internalConfig.getUserSelectedOfferInfo() != null) {
            internalConfig.setUserSelectedOfferInfo(null);
        }
        internalConfig.setRetryTxn(false);
        BaseApiLayer apiLayer2 = SdkUiInitializer.INSTANCE.getApiLayer();
        if (apiLayer2 != null) {
            apiLayer2.resetApiResponseRepo();
        }
        OfferFilterManager.INSTANCE.clearCouponCache();
    }

    @Override
    public void onFocusChange(View view, boolean z) {
        com.payu.ui.viewmodel.p pVar;
        if (view != null && view.getId() == com.payu.ui.e.etCvv && z && (pVar = this.Q) != null) {
            pVar.k0.setValue(Integer.valueOf(com.payu.ui.c.payu_rounded_corner_image_for_edittext_highlighted));
        }
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() == 16908332) {
            U2();
        }
        return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
    }

    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super/*androidx.fragment.app.r*/.onRequestPermissionsResult(i, strArr, iArr);
    }

    public void onResume() {
        PaymentMode paymentMode;
        super/*androidx.fragment.app.r*/.onResume();
        com.payu.ui.viewmodel.p pVar = this.Q;
        if (pVar == null || (paymentMode = pVar.X) == null) {
            return;
        }
        paymentMode.getType();
    }

    public void onSaveInstanceState(Bundle bundle) {
        PaymentOption paymentOption;
        PaymentOption paymentOption2;
        com.payu.ui.viewmodel.p pVar;
        super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
        this.U0 = true;
        if (getSupportFragmentManager().p0(SdkUiConstants.CP_BOTTOM_SHEET_FRAGMENT) == null || ((pVar = this.Q) != null && pVar.Y)) {
            bundle.putBoolean(SdkUiConstants.CP_IS_BOTTOM_SHEET_VISIBLE, false);
        } else {
            bundle.putBoolean(SdkUiConstants.CP_IS_BOTTOM_SHEET_VISIBLE, true);
        }
        com.payu.ui.viewmodel.p pVar2 = this.Q;
        if ((pVar2 == null ? null : pVar2.f) != null) {
            bundle.putString("name", (pVar2 == null || (paymentOption2 = pVar2.f) == null) ? null : paymentOption2.getBankName());
            com.payu.ui.viewmodel.p pVar3 = this.Q;
            bundle.putBoolean(SdkUiConstants.IS_PAYMENT_DOWN, ((pVar3 == null || (paymentOption = pVar3.f) == null) ? null : Boolean.valueOf(paymentOption.isBankDown())).booleanValue());
        }
        com.payu.ui.viewmodel.p pVar4 = this.Q;
        if ((pVar4 == null ? null : pVar4.f) != null) {
            if ((pVar4 == null ? null : pVar4.f) instanceof SavedCardOption) {
                PaymentOption paymentOption3 = pVar4 == null ? null : pVar4.f;
                if (paymentOption3 == null) {
                    throw new NullPointerException("null cannot be cast to non-null type com.payu.base.models.SavedCardOption");
                }
                SavedCardOption savedCardOption = (SavedCardOption) paymentOption3;
                bundle.putString(SdkUiConstants.CARD_TOKEN, savedCardOption.getCardToken());
                bundle.putString(SdkUiConstants.NAME_ON_CARD, savedCardOption.getNameOnCard());
                bundle.putString(SdkUiConstants.CARD_ALIAS, savedCardOption.getCardAlias());
                bundle.putString(SdkUiConstants.BANK_NAME, savedCardOption.getBankName());
                bundle.putString(SdkUiConstants.CARD_NUMBER, savedCardOption.getCardNumber());
                CardBinInfo cardBinInfo = savedCardOption.getCardBinInfo();
                bundle.putSerializable(SdkUiConstants.CARD_SCHEME, cardBinInfo == null ? null : cardBinInfo.getCardScheme());
                CardBinInfo cardBinInfo2 = savedCardOption.getCardBinInfo();
                bundle.putSerializable("cardType", cardBinInfo2 != null ? cardBinInfo2.getCardType() : null);
                bundle.putSerializable("paymentType", savedCardOption.getPaymentType());
                bundle.putParcelable("drawable", savedCardOption.getDrawable());
            }
        }
        PaymentOption paymentOption4 = this.l0;
        if (paymentOption4 != null) {
            bundle.putParcelable(SdkUiConstants.PAYMENT_OPTION, paymentOption4);
            PaymentOption paymentOption5 = this.l0;
            if (paymentOption5 instanceof UPIOption) {
                if (paymentOption5 == null) {
                    throw new NullPointerException("null cannot be cast to non-null type com.payu.base.models.UPIOption");
                }
                bundle.putString(SdkUiConstants.PAYMENT_OPTION_PACKAGE_NAME, ((UPIOption) paymentOption5).getPackageName());
            }
            PaymentOption paymentOption6 = this.l0;
            if (paymentOption6 instanceof WalletOption) {
                if (paymentOption6 == null) {
                    throw new NullPointerException("null cannot be cast to non-null type com.payu.base.models.WalletOption");
                }
                bundle.putString(SdkUiConstants.PAYMENT_OPTION_PHONE_NUMBER, ((WalletOption) paymentOption6).getPhoneNumber());
            }
        }
    }

    public void onStop() {
        super.onStop();
        ViewUtils.INSTANCE.hideSoftKeyboard((Activity) this);
    }

    public final void p2(PaymentOption paymentOption, PaymentOption paymentOption2) {
        paymentOption.setBankName(paymentOption2.getBankName());
        paymentOption.setBankDown(paymentOption2.isBankDown());
        paymentOption.setDrawable(paymentOption2.getDrawable());
        paymentOption.setOtherParams(paymentOption2.getOtherParams());
        paymentOption.setPaymentType(paymentOption2.getPaymentType());
    }

    public final void q2(final SavedCardOption savedCardOption, View view) {
        CardBinInfo cardBinInfo;
        String issuingBank;
        BaseConfig config;
        BaseConfig config2;
        CardType cardType;
        PaymentOption paymentOption;
        String binNumber;
        com.payu.ui.viewmodel.p pVar;
        Utils utils = Utils.INSTANCE;
        CardBinInfo cardBinInfo2 = savedCardOption.getCardBinInfo();
        String categoryForOffer = utils.getCategoryForOffer(String.valueOf(cardBinInfo2 == null ? null : cardBinInfo2.getCardType()));
        CardBinInfo cardBinInfo3 = savedCardOption.getCardBinInfo();
        if (cardBinInfo3 != null && (binNumber = cardBinInfo3.getBinNumber()) != null && (pVar = this.Q) != null) {
            pVar.Q0(binNumber, savedCardOption.getCardToken(), categoryForOffer, savedCardOption.getBankCode());
        }
        this.w0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tv_card_error);
        this.x0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tv_consent_text);
        TextView textView = this.w0;
        if (textView != null) {
            textView.setVisibility(8);
        }
        TextView textView2 = this.x0;
        if (textView2 != null) {
            textView2.setVisibility(8);
        }
        TextView textView3 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvBankName);
        if (textView3 != null) {
            com.payu.ui.viewmodel.p pVar2 = this.Q;
            textView3.setText((pVar2 == null || (paymentOption = pVar2.f) == null) ? null : paymentOption.getBankName());
        }
        TextView textView4 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvPaymentOption);
        if (textView4 != null) {
            CardBinInfo cardBinInfo4 = savedCardOption.getCardBinInfo();
            textView4.setText((cardBinInfo4 == null || (cardType = cardBinInfo4.getCardType()) == null) ? null : cardType.getTypeName());
        }
        TextView textView5 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvPaymentOptionDetail);
        if (textView5 != null) {
            String cardNumber = savedCardOption.getCardNumber();
            CardBinInfo cardBinInfo5 = savedCardOption.getCardBinInfo();
            textView5.setText(utils.getFormattedString(cardNumber, cardBinInfo5 == null ? null : cardBinInfo5.getCardScheme()));
        }
        ImageParam imageParam = new ImageParam(savedCardOption, true, com.payu.ui.c.payu_credit_debit_cards, null, 8, null);
        SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
        BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
        if (apiLayer != null) {
            apiLayer.getImageForPaymentOption(imageParam, new g(view));
        }
        Button button = view == null ? null : (Button) view.findViewById(com.payu.ui.e.btnPay);
        this.c0 = button;
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
        viewUtils.updateBackgroundColor(this, button, (apiLayer2 == null || (config2 = apiLayer2.getConfig()) == null) ? null : config2.getPrimaryColor(), com.payu.ui.a.one_payu_colorPrimary);
        Button button2 = this.c0;
        BaseApiLayer apiLayer3 = sdkUiInitializer.getApiLayer();
        viewUtils.updateButtonTextColor(button2, (apiLayer3 == null || (config = apiLayer3.getConfig()) == null) ? null : config.getBaseTextColor());
        this.g0 = view == null ? null : view.findViewById(com.payu.ui.e.rlSavedCardBottomSheet);
        this.b0 = view == null ? null : (EditText) view.findViewById(com.payu.ui.e.etCvv);
        this.u0 = view == null ? null : (ImageView) view.findViewById(com.payu.ui.e.ivOffer);
        this.v0 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvOfferText);
        com.payu.ui.viewmodel.p pVar3 = this.Q;
        if (pVar3 != null && utils.isOfferSelected$one_payu_ui_sdk_android_release() && (cardBinInfo = savedCardOption.getCardBinInfo()) != null && (issuingBank = cardBinInfo.getIssuingBank()) != null) {
            CardBinInfo cardBinInfo6 = savedCardOption.getCardBinInfo();
            String valueOf = String.valueOf(cardBinInfo6 == null ? null : cardBinInfo6.getCardScheme());
            CardBinInfo cardBinInfo7 = savedCardOption.getCardBinInfo();
            if (utils.isOfferAvailableForCards$one_payu_ui_sdk_android_release(issuingBank, valueOf, cardBinInfo7 == null ? null : cardBinInfo7.getCardType())) {
                pVar3.U.setValue(Boolean.TRUE);
            }
        }
        com.payu.ui.viewmodel.p pVar4 = this.Q;
        if (pVar4 != null) {
            CardBinInfo cardBinInfo8 = savedCardOption.getCardBinInfo();
            if (utils.isCvvLessCard(cardBinInfo8 == null ? null : cardBinInfo8.getCardScheme())) {
                pVar4.Q.setValue(Boolean.TRUE);
            } else {
                CardBinInfo cardBinInfo9 = savedCardOption.getCardBinInfo();
                pVar4.P.setValue(Integer.valueOf(utils.getCvvInputLength(cardBinInfo9 == null ? null : cardBinInfo9.getCardScheme())));
            }
        }
        Button button3 = this.c0;
        if (button3 != null) {
            button3.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.E2(CheckoutActivity.this, savedCardOption, view2);
                }
            });
        }
        ImageView imageView = view == null ? null : (ImageView) view.findViewById(com.payu.ui.e.ivToolTipCvv);
        this.d0 = imageView;
        if (imageView != null) {
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.Y2(CheckoutActivity.this, savedCardOption, view2);
                }
            });
        }
        View findViewById = view == null ? null : view.findViewById(com.payu.ui.e.transparentView);
        this.f0 = findViewById;
        if (findViewById != null) {
            findViewById.setOnClickListener(this);
        }
        this.h0 = null;
        EditText editText = this.b0;
        if (editText == null) {
            return;
        }
        editText.setOnFocusChangeListener(this);
    }

    public final void r2(final SodexoCardOption sodexoCardOption, View view) {
        BaseConfig config;
        BaseConfig config2;
        PaymentOption paymentOption;
        TextView textView = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvBankName);
        if (textView != null) {
            com.payu.ui.viewmodel.p pVar = this.Q;
            textView.setText((pVar == null || (paymentOption = pVar.f) == null) ? null : paymentOption.getBankName());
        }
        TextView textView2 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvPaymentOption);
        if (textView2 != null) {
            textView2.setText("FOOD CARD");
        }
        TextView textView3 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvPaymentOptionDetail);
        if (textView3 != null) {
            Utils utils = Utils.INSTANCE;
            String cardNumber = sodexoCardOption.getCardNumber();
            CardBinInfo cardBinInfo = sodexoCardOption.getCardBinInfo();
            textView3.setText(utils.getFormattedString(cardNumber, cardBinInfo == null ? null : cardBinInfo.getCardScheme()));
        }
        TextView textView4 = view == null ? null : (TextView) view.findViewById(com.payu.ui.e.tvAmount);
        if (textView4 != null) {
            textView4.setText(sodexoCardOption.getBalance());
        }
        ImageParam imageParam = new ImageParam(sodexoCardOption, true, com.payu.ui.c.payu_credit_debit_cards, null, 8, null);
        SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
        BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
        if (apiLayer != null) {
            apiLayer.getImageForPaymentOption(imageParam, new h(view));
        }
        Button button = view == null ? null : (Button) view.findViewById(com.payu.ui.e.btnPay);
        this.c0 = button;
        ViewUtils viewUtils = ViewUtils.INSTANCE;
        BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
        viewUtils.updateBackgroundColor(this, button, (apiLayer2 == null || (config2 = apiLayer2.getConfig()) == null) ? null : config2.getPrimaryColor(), com.payu.ui.a.one_payu_colorPrimary);
        Button button2 = this.c0;
        BaseApiLayer apiLayer3 = sdkUiInitializer.getApiLayer();
        viewUtils.updateButtonTextColor(button2, (apiLayer3 == null || (config = apiLayer3.getConfig()) == null) ? null : config.getBaseTextColor());
        this.g0 = view == null ? null : view.findViewById(com.payu.ui.e.rlSavedCardBottomSheet);
        Button button3 = this.c0;
        if (button3 != null) {
            button3.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    CheckoutActivity.G2(CheckoutActivity.this, sodexoCardOption, view2);
                }
            });
        }
        View findViewById = view == null ? null : view.findViewById(com.payu.ui.e.transparentView);
        this.f0 = findViewById;
        if (findViewById != null) {
            findViewById.setOnClickListener(this);
        }
        this.h0 = null;
    }

    public final void a(android.view.View r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.payu.ui.view.activities.CheckoutActivity.a(android.view.View):void");
    }
}