LINE.apk(点击下载) / PaySignUpView.java


package com.linecorp.line.pay.impl.biz.signup;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.databinding.h;
import androidx.lifecycle.e1;
import androidx.lifecycle.g1;
import com.linecorp.line.pay.impl.legacy.customview.InputButton;
import com.linecorp.line.pay.impl.legacy.customview.a;
import com.linepaycorp.module.trackingservice.PayTrackingServiceContent;
import cy0.b0;
import cy0.c6;
import cy0.x5;
import cy0.y5;
import em3.q;
import em3.s;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import jp.naver.line.android.R;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.internal.DefaultConstructorMarker;
import ks2.a;
import ks2.t;
import mp0.i;
import mp0.j;
import mp0.p;
import ns0.m;
import ns0.n;
import ql3.w;
import sq0.r0;

@Metadata(bv = {}, d1 = {"\u0000|\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u00002\u00020\u00012\u00020\u0002:\u0001VB'\b\u0007\u0012\u0006\u0010P\u001a\u00020O\u0012\n\b\u0002\u0010R\u001a\u0004\u0018\u00010Q\u0012\b\b\u0002\u0010S\u001a\u00020\u0015¢\u0006\u0004\bT\u0010UJ\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003J\u0014\u0010\t\u001a\u00020\u00072\f\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006R\u001b\u0010\u000f\u001a\u00020\n8BX‚„\u0002¢\u0006\f\n\u0004\b\u000b\u0010\f\u001a\u0004\b\r\u0010\u000eR\u001b\u0010\u0014\u001a\u00020\u00108BX‚„\u0002¢\u0006\f\n\u0004\b\u0011\u0010\f\u001a\u0004\b\u0012\u0010\u0013R\"\u0010\u001c\u001a\u00020\u00158\u0016@\u0016X–\u000e¢\u0006\u0012\n\u0004\b\u0016\u0010\u0017\u001a\u0004\b\u0018\u0010\u0019\"\u0004\b\u001a\u0010\u001bR$\u0010$\u001a\u0004\u0018\u00010\u001d8\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u001e\u0010\u001f\u001a\u0004\b \u0010!\"\u0004\b\"\u0010#R$\u0010,\u001a\u0004\u0018\u00010%8\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b&\u0010'\u001a\u0004\b(\u0010)\"\u0004\b*\u0010+R*\u00104\u001a\n\u0012\u0004\u0012\u00020-\u0018\u00010\u00038\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b.\u0010/\u001a\u0004\b0\u00101\"\u0004\b2\u00103R*\u00108\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u00038\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b5\u0010/\u001a\u0004\b6\u00101\"\u0004\b7\u00103R\u0014\u0010<\u001a\u0002098VX–\u0004¢\u0006\u0006\u001a\u0004\b:\u0010;R\u0014\u0010@\u001a\u00020=8VX–\u0004¢\u0006\u0006\u001a\u0004\b>\u0010?R*\u0010C\u001a\n\u0012\u0004\u0012\u00020B\u0018\u00010A8\u0016@\u0016X–\u000e¢\u0006\u0012\n\u0004\bC\u0010D\u001a\u0004\bE\u0010F\"\u0004\bG\u0010HR$\u0010I\u001a\u0004\u0018\u00010B8\u0016@\u0016X–\u000e¢\u0006\u0012\n\u0004\bI\u0010J\u001a\u0004\bK\u0010L\"\u0004\bM\u0010N¨\u0006W"}, d2 = {"Lcom/linecorp/line/pay/impl/biz/signup/PaySignUpView;", "Landroid/widget/FrameLayout;", "Lns0/n;", "", "", "getTermsUrlKeys", "Lkotlin/Function0;", "", "onDone", "setOnDoneClickListener", "Lsq0/r0;", "b", "Lkotlin/Lazy;", "getBinding", "()Lsq0/r0;", "binding", "Lmp0/p;", "c", "getViewModel", "()Lmp0/p;", "viewModel", "", "e", "I", "getKeptCheckedCheckBox", "()I", "setKeptCheckedCheckBox", "(I)V", "keptCheckedCheckBox", "Landroid/os/Bundle;", "h", "Landroid/os/Bundle;", "getSavedInstanceState", "()Landroid/os/Bundle;", "setSavedInstanceState", "(Landroid/os/Bundle;)V", "savedInstanceState", "Lcom/linecorp/line/pay/impl/biz/signup/PaySignUpView$a;", "i", "Lcom/linecorp/line/pay/impl/biz/signup/PaySignUpView$a;", "getListener", "()Lcom/linecorp/line/pay/impl/biz/signup/PaySignUpView$a;", "setListener", "(Lcom/linecorp/line/pay/impl/biz/signup/PaySignUpView$a;)V", "listener", "Lcy0/c6;", "j", "Ljava/util/List;", "getJobList", "()Ljava/util/List;", "setJobList", "(Ljava/util/List;)V", "jobList", "k", "getUrlKeys", "setUrlKeys", "urlKeys", "", "getHasAllMandatoryData", "()Z", "hasAllMandatoryData", "Lcy0/b0;", "getCacheableSettings", "()Lcy0/b0;", "cacheableSettings", "", "Lns0/m;", "agreementCheckBoxes", "[Lns0/m;", "getAgreementCheckBoxes", "()[Lns0/m;", "setAgreementCheckBoxes", "([Lns0/m;)V", "completeAgreementView", "Lns0/m;", "getCompleteAgreementView", "()Lns0/m;", "setCompleteAgreementView", "(Lns0/m;)V", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "a", "pay-impl_release"}, k = 1, mv = {1, 6, 0})
public final class PaySignUpView extends FrameLayout implements n {

    /* renamed from: l  reason: collision with root package name */
    public static final /* synthetic */ int f39040l = 0;

    /* renamed from: b  reason: collision with root package name */
    public final Lazy f39041b;

    /* renamed from: c  reason: collision with root package name */
    public final Lazy f39042c;

    /* renamed from: d  reason: collision with root package name */
    public final a.b f39043d;

    /* renamed from: e  reason: collision with root package name */
    public int f39044e;

    /* renamed from: f  reason: collision with root package name */
    public m[] f39045f;

    /* renamed from: g  reason: collision with root package name */
    public m f39046g;

    /* renamed from: h  reason: collision with root package name */
    public Bundle f39047h;

    /* renamed from: i  reason: collision with root package name */
    public a f39048i;

    /* renamed from: j  reason: collision with root package name */
    public List<? extends c6> f39049j;

    /* renamed from: k  reason: collision with root package name */
    public List<String> f39050k;

    public interface a {
        void a(y5 y5Var, int i14);

        void b();
    }

    public static final class b extends s implements dm3.a<r0> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ Context f39051b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ PaySignUpView f39052c;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public b(Context context, PaySignUpView paySignUpView) {
            super(0);
            this.f39051b = context;
            this.f39052c = paySignUpView;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public r0 invoke() {
            return (r0) h.d(LayoutInflater.from(this.f39051b), R.layout.pay_activity_sign_up, this.f39052c, true);
        }
    }

    public static final class c implements a.b {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ PaySignUpView f39053a;

        public c(PaySignUpView paySignUpView) {
            this.f39053a = paySignUpView;
        }

        @Override // com.linecorp.line.pay.impl.legacy.customview.a.b
        public void a(boolean z14, int i14, y5 y5Var) {
            m completeAgreementView;
            q.f(y5Var, "urlInfo");
            if (!z14 && (completeAgreementView = this.f39053a.getCompleteAgreementView()) != null) {
                completeAgreementView.setChecked(z14);
            }
            this.f39053a.c();
        }

        @Override // com.linecorp.line.pay.impl.legacy.customview.a.b
        public void b(y5 y5Var, int i14) {
            q.f(y5Var, "urlInfo");
        }

        @Override // com.linecorp.line.pay.impl.legacy.customview.a.b
        public void c(y5 y5Var, int i14) {
            q.f(y5Var, "urlInfo");
            a listener = this.f39053a.getListener();
            if (listener != null) {
                listener.a(y5Var, i14);
            }
        }
    }

    public static final class d extends s implements dm3.a<p> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ PaySignUpView f39054b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public d(PaySignUpView paySignUpView) {
            super(0);
            this.f39054b = paySignUpView;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public p invoke() {
            g1 c14 = l2.b.c(this.f39054b);
            if (c14 != null) {
                return (p) new e1(c14).b(p.class);
            }
            throw new IllegalArgumentException("Required value was null.".toString());
        }
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public PaySignUpView(Context context) {
        this(context, null, 0, 6, null);
        q.f(context, "context");
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public PaySignUpView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0, 4, null);
        q.f(context, "context");
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ PaySignUpView(Context context, AttributeSet attributeSet, int i14, int i15, DefaultConstructorMarker defaultConstructorMarker) {
        this(context, (i15 & 2) != 0 ? null : attributeSet, (i15 & 4) != 0 ? 0 : i14);
    }

    public static final void a(PaySignUpView paySignUpView, boolean z14) {
        m[] agreementCheckBoxes = paySignUpView.getAgreementCheckBoxes();
        if (agreementCheckBoxes != null) {
            for (m mVar : agreementCheckBoxes) {
                if (!z14 || mVar.getData() == null || !mVar.getData().f61910c || mVar.isChecked()) {
                    mVar.setChecked(z14);
                } else {
                    m completeAgreementView = paySignUpView.getCompleteAgreementView();
                    if (completeAgreementView != null) {
                        completeAgreementView.setChecked(false);
                    }
                    a aVar = paySignUpView.f39048i;
                    if (aVar != null) {
                        y5 data = mVar.getData();
                        q.e(data, "it.data");
                        aVar.a(data, mVar.getIndex());
                        return;
                    }
                    return;
                }
            }
        }
        paySignUpView.c();
    }

    private final r0 getBinding() {
        Object value = this.f39041b.getValue();
        q.e(value, "<get-binding>(...)");
        return (r0) value;
    }

    private final p getViewModel() {
        return (p) this.f39042c.getValue();
    }

    public final void b() {
        boolean[] zArr;
        InputButton.c cVar;
        List<String> termsUrlKeys = getTermsUrlKeys();
        Bundle bundle = this.f39047h;
        if (bundle == null || (zArr = bundle.getBooleanArray("save_instance_agreement_list")) == null) {
            zArr = new boolean[termsUrlKeys.size()];
        }
        this.f39047h = null;
        if (getKeptCheckedCheckBox() != -1) {
            if (getKeptCheckedCheckBox() >= 0 && getKeptCheckedCheckBox() < zArr.length) {
                zArr[getKeptCheckedCheckBox()] = true;
            }
            setKeptCheckedCheckBox(-1);
        }
        int i14 = 8;
        if (!termsUrlKeys.isEmpty()) {
            ArrayList arrayList = new ArrayList(ql3.q.p(termsUrlKeys, 10));
            int i15 = 0;
            for (T t14 : termsUrlKeys) {
                int i16 = i15 + 1;
                if (i15 >= 0) {
                    T t15 = t14;
                    Map<String, y5> map = getCacheableSettings().f60802d;
                    y5 y5Var = map != null ? map.get(t15) : null;
                    com.linecorp.line.pay.impl.legacy.customview.a aVar = new com.linecorp.line.pay.impl.legacy.customview.a(getContext());
                    aVar.d(y5Var != null ? y5Var.f61913f : null, false);
                    aVar.setDesc(y5Var != null ? y5Var.f61915h : null);
                    aVar.setOnRulesAgreementCheckboxListener(this.f39043d);
                    aVar.f40269i = t15;
                    aVar.f40270j = y5Var;
                    aVar.f40268h = i15;
                    aVar.setTextClickable(false);
                    aVar.setChecked(zArr.length > i15 && zArr[i15]);
                    getBinding().f145350b.addView(aVar);
                    if (i15 == 0) {
                        if (termsUrlKeys.size() == 1) {
                            cVar = InputButton.c.SINGLE;
                        } else {
                            cVar = InputButton.c.TOP;
                        }
                    } else if (i15 == termsUrlKeys.size() - 1) {
                        cVar = InputButton.c.BOTTOM;
                    } else {
                        cVar = InputButton.c.MIDDLE;
                    }
                    aVar.setInputButtonBackground(cVar);
                    arrayList.add(aVar);
                    i15 = i16;
                } else {
                    ql3.p.o();
                    throw null;
                }
            }
            Object[] array = arrayList.toArray(new m[0]);
            Objects.requireNonNull(array, "null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
            setAgreementCheckBoxes((m[]) array);
            if (termsUrlKeys.size() > 1) {
                com.linecorp.line.pay.impl.legacy.customview.a aVar2 = new com.linecorp.line.pay.impl.legacy.customview.a(getContext());
                Context context = getContext();
                q.e(context, "this@PaySignUpView.context");
                aVar2.setPadding(0, fe3.a.u(context, 5), 0, 0);
                aVar2.setInputButtonBackground(InputButton.c.NONE);
                aVar2.d(aVar2.getResources().getString(R.string.pay_signup_agreement_all_terms), true);
                aVar2.setContentLayoutClickable(false);
                aVar2.setTextClickable(true);
                FrameLayout frameLayout = aVar2.f40265e;
                if (frameLayout != null) {
                    frameLayout.setVisibility(8);
                }
                aVar2.setOnRulesAgreementCheckboxListener(new j(this));
                getBinding().f145350b.addView(aVar2);
                setCompleteAgreementView(aVar2);
            }
        }
        String b14 = com.linecorp.line.pay.impl.legacy.util.p.b(getCacheableSettings());
        getBinding().f145353e.setText(b14);
        TextView textView = getBinding().f145353e;
        q.e(textView, "binding.signupNoticeText");
        if (!TextUtils.isEmpty(b14)) {
            i14 = 0;
        }
        textView.setVisibility(i14);
        c();
    }

    public final void c() {
        getBinding().f145352d.setEnabled(n.a.a(this, true));
        m completeAgreementView = getCompleteAgreementView();
        if (completeAgreementView != null) {
            completeAgreementView.setChecked(n.a.a(this, false));
        }
    }

    public Set<String> getAgreedTermsUrlKeys() {
        return n.a.b(this);
    }

    @Override // ns0.n
    public m[] getAgreementCheckBoxes() {
        return this.f39045f;
    }

    public b0 getCacheableSettings() {
        b0 b0Var = getViewModel().f113226g;
        if (b0Var != null) {
            return b0Var;
        }
        q.l("cacheableSettings");
        throw null;
    }

    @Override // ns0.n
    public m getCompleteAgreementView() {
        return this.f39046g;
    }

    public boolean getHasAllMandatoryData() {
        return n.a.a(this, true);
    }

    /* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: java.util.List<? extends cy0.c6>, java.util.List<cy0.c6> */
    public final List<c6> getJobList() {
        return this.f39049j;
    }

    public int getKeptCheckedCheckBox() {
        return this.f39044e;
    }

    public final a getListener() {
        return this.f39048i;
    }

    public final Bundle getSavedInstanceState() {
        return this.f39047h;
    }

    public boolean[] getTermsAgreements() {
        return n.a.c(this);
    }

    public final List<String> getTermsUrlKeys() {
        if (this.f39050k == null) {
            Map<x5, List<String>> map = getCacheableSettings().f60803e;
            this.f39050k = map != null ? map.get(x5.JOINING_AGREEMENT_V2) : null;
        }
        List<String> list = this.f39050k;
        return list == null ? w.f133304b : list;
    }

    public final List<String> getUrlKeys() {
        return this.f39050k;
    }

    public void setAgreementCheckBoxes(m[] mVarArr) {
        this.f39045f = mVarArr;
    }

    public void setCompleteAgreementView(m mVar) {
        this.f39046g = mVar;
    }

    public final void setJobList(List<? extends c6> list) {
        this.f39049j = list;
    }

    @Override // ns0.n
    public void setKeptCheckedCheckBox(int i14) {
        this.f39044e = i14;
    }

    public final void setListener(a aVar) {
        this.f39048i = aVar;
    }

    public final void setOnDoneClickListener(dm3.a<Unit> aVar) {
        q.f(aVar, "onDone");
        getBinding().f145352d.setOnClickListener(new i(this, aVar, 0));
    }

    public final void setSavedInstanceState(Bundle bundle) {
        this.f39047h = bundle;
    }

    public final void setUrlKeys(List<String> list) {
        this.f39050k = list;
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public PaySignUpView(Context context, AttributeSet attributeSet, int i14) {
        super(context, attributeSet, i14);
        q.f(context, "context");
        this.f39041b = LazyKt.lazy(new b(context, this));
        this.f39042c = LazyKt.lazy(new d(this));
        this.f39043d = new c(this);
        this.f39044e = -1;
        setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
        getBinding().f145352d.setEnabled(false);
        getBinding().f145352d.setText(R.string.pay_join);
        getBinding().f145351c.setText(R.string.pay_signup_description_terms_of_use);
        r0 binding = getBinding();
        t tVar = t.JOIN;
        Objects.requireNonNull(tVar);
        String a14 = a.C1657a.a(tVar);
        ks2.s sVar = ks2.s.JOIN;
        Objects.requireNonNull(sVar);
        binding.d(new PayTrackingServiceContent(a14, a.C1657a.a(sVar), null, null, null, null, null, 124));
    }
}