导航菜单

页面标题

页面副标题

OVO v3.139.0 - CheckoutPromoActivity.java 源代码

正在查看: OVO v3.139.0 应用的 CheckoutPromoActivity.java JAVA 源代码文件

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


package ovo.id.wallet.checkout.ui.presentation.compose;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.activity.ComponentActivity;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.platform.AndroidCompositionLocals_androidKt;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import kotlin.Metadata;
import o.i.Alignment;
import o.i.Arrangement;
import o.i.Composer;
import o.i.Function110;
import o.i.Function23;
import o.i.Function31;
import o.i.a02;
import o.i.agc;
import o.i.an1;
import o.i.ap8;
import o.i.ay1;
import o.i.b22;
import o.i.b52;
import o.i.bcd;
import o.i.bn1;
import o.i.bx1;
import o.i.c22;
import o.i.c27;
import o.i.c65;
import o.i.cf8;
import o.i.cn1;
import o.i.dgc;
import o.i.di2;
import o.i.dx1;
import o.i.en1;
import o.i.f10;
import o.i.fac;
import o.i.fm1;
import o.i.fn1;
import o.i.fxa;
import o.i.ggc;
import o.i.hc;
import o.i.hce;
import o.i.hhc;
import o.i.hj8;
import o.i.ihf;
import o.i.im8;
import o.i.in1;
import o.i.jgc;
import o.i.jo3;
import o.i.jt0;
import o.i.jt7;
import o.i.k22;
import o.i.khf;
import o.i.kt0;
import o.i.lj0;
import o.i.mwa;
import o.i.n8b;
import o.i.nic;
import o.i.oye;
import o.i.p1g;
import o.i.pgc;
import o.i.pk4;
import o.i.pm1;
import o.i.pw5;
import o.i.q1f;
import o.i.qm1;
import o.i.r89;
import o.i.rig;
import o.i.rl2;
import o.i.rm1;
import o.i.rm9;
import o.i.rrc;
import o.i.sh2;
import o.i.sm1;
import o.i.ssb;
import o.i.t02;
import o.i.tf8;
import o.i.tm1;
import o.i.u5g;
import o.i.u9e;
import o.i.ua8;
import o.i.uh;
import o.i.us;
import o.i.ux;
import o.i.v11;
import o.i.v42;
import o.i.vk7;
import o.i.vke;
import o.i.vuc;
import o.i.vx;
import o.i.vx0;
import o.i.wm1;
import o.i.xh;
import o.i.xh9;
import o.i.xm1;
import o.i.xo8;
import o.i.yfc;
import o.i.ym1;
import o.i.yrg;
import o.i.zbe;
import o.i.zfc;
import o.i.zm1;
import o.i.zu5;
import o.i.zz1;
import ovo.id.base.BaseActivity;
import ovo.id.base.utils.StringWrapper;
import ovo.id.ravier.widgets.CommonLayoutClickType;
import ovo.id.ravier.widgets.LoadingState;
import ovo.id.ravier.widgets.LoadingType;
import ovo.id.utils.ui.ErrorImageMapper;
import ovo.id.wallet.checkout.core.data.entity.request.PromoRequest;
import ovo.id.wallet.checkout.core.data.entity.response.CheckoutComponentResponse;
import ovo.id.wallet.checkout.core.domain.entity.model.PromoDetailInfo;
import ovo.id.wallet.checkout.ui.presentation.utils.CheckoutError;
import ovo.id.wallet.checkout.ui.presentation.utils.CheckoutPromoTrackingPayload;
import zendesk.chat.WebSocket;

@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lovo/id/wallet/checkout/ui/presentation/compose/CheckoutPromoActivity;", "Lovo/id/base/BaseActivity;", "<init>", "()V", "checkout-ui_release"}, k = 1, mv = {1, 8, 0})
public final class CheckoutPromoActivity extends BaseActivity {
    public static final int K = 0;
    public ViewModelProvider.Factory G;
    public final ViewModelLazy H = new ViewModelLazy(vuc.a(in1.class), new s(this), new u(), new t(this));
    public final oye I = im8.b(new l());
    public com.google.android.material.bottomsheet.b J;

    public static final class a extends ua8 implements Function110<CommonLayoutClickType, p1g> {
        public final vke<CheckoutError> b;

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

            static {
                int[] iArr = new int[CommonLayoutClickType.values().length];
                try {
                    iArr[CommonLayoutClickType.PRIMARY.ordinal()] = 1;
                } catch (NoSuchFieldError unused) {
                }
                try {
                    iArr[CommonLayoutClickType.SECONDARY.ordinal()] = 2;
                } catch (NoSuchFieldError unused2) {
                }
                a = iArr;
            }
        }

        public a(rm9 rm9Var) {
            super(1);
            this.b = rm9Var;
        }

        public final Object invoke(Object obj) {
            zu5<p1g> zu5Var;
            CheckoutError.ActionMetadata d;
            zu5<p1g> zu5Var2;
            CommonLayoutClickType commonLayoutClickType = (CommonLayoutClickType) obj;
            vk7.f(commonLayoutClickType, "it");
            int i = C0066a.a[commonLayoutClickType.ordinal()];
            vke<CheckoutError> vkeVar = this.b;
            if (i == 1) {
                CheckoutError.ActionMetadata a = ((CheckoutError) vkeVar.getValue()).getA();
                if (a != null && (zu5Var = a.b) != null) {
                    zu5Var.invoke();
                }
            } else if (i == 2 && (d = ((CheckoutError) vkeVar.getValue()).d()) != null && (zu5Var2 = d.b) != null) {
                zu5Var2.invoke();
            }
            return p1g.a;
        }
    }

    public static final class b extends ua8 implements Function23<Composer, Integer, p1g> {
        public final int c;

        public b(int i) {
            super(2);
            this.c = i;
        }

        public final Object invoke(Object obj, Object obj2) {
            ((Number) obj2).intValue();
            int e = jo3.e(this.c | 1);
            CheckoutPromoActivity.this.M0((Composer) obj, e);
            return p1g.a;
        }
    }

    public static final class c extends ua8 implements zu5<p1g> {
        public static final c b = new c();

        public c() {
            super(0);
        }

        public final Object invoke() {
            return p1g.a;
        }
    }

    public static final class d extends ua8 implements zu5<p1g> {
        public static final d b = new d();

        public d() {
            super(0);
        }

        public final Object invoke() {
            return p1g.a;
        }
    }

    public static final class e extends ua8 implements Function23<Composer, Integer, p1g> {
        public final int c;

        public e(int i) {
            super(2);
            this.c = i;
        }

        public final Object invoke(Object obj, Object obj2) {
            ((Number) obj2).intValue();
            int e = jo3.e(this.c | 1);
            CheckoutPromoActivity.this.N0((Composer) obj, e);
            return p1g.a;
        }
    }

    public static final class f extends ua8 implements Function23<Composer, Integer, p1g> {
        public f() {
            super(2);
        }

        public final Object invoke(Object obj, Object obj2) {
            Composer composer = (Composer) obj;
            if ((((Number) obj2).intValue() & 11) == 2 && composer.j()) {
                composer.F();
            } else {
                ux.c(k22.a, xh9.a(Modifier.a.b, "topbar_checkout_promo_form"), c22.b(composer, 1085550759, new ovo.id.wallet.checkout.ui.presentation.compose.g(CheckoutPromoActivity.this)), (Function31) null, (yrg) null, ihf.a(yfc.G, yfc.x, composer), (khf) null, composer, 390, 88);
            }
            return p1g.a;
        }
    }

    public static final class g extends ua8 implements Function23<Composer, Integer, p1g> {
        public g(hce hceVar) {
            super(2);
        }

        public final Object invoke(Object obj, Object obj2) {
            Composer composer = (Composer) obj;
            if ((((Number) obj2).intValue() & 11) == 2 && composer.j()) {
                composer.F();
            }
            return p1g.a;
        }
    }

    public static final class h extends ua8 implements Function31<mwa, Composer, Integer, p1g> {
        public final hce b;
        public final vke<Integer> c;
        public final CheckoutPromoActivity d;
        public final Context e;

        public h(hce hceVar, rm9 rm9Var, CheckoutPromoActivity checkoutPromoActivity, Context context) {
            super(3);
            this.b = hceVar;
            this.c = rm9Var;
            this.d = checkoutPromoActivity;
            this.e = context;
        }

        public final Object invoke(Object obj, Object obj2, Object obj3) {
            mwa mwaVar = (mwa) obj;
            Composer composer = (Composer) obj2;
            int intValue = ((Number) obj3).intValue();
            vk7.f(mwaVar, "padding");
            if ((intValue & 14) == 0) {
                intValue |= composer.L(mwaVar) ? 4 : 2;
            }
            if ((intValue & 91) == 18 && composer.j()) {
                composer.F();
            } else {
                Modifier.a aVar = Modifier.a.b;
                Modifier a = xh9.a(androidx.compose.foundation.layout.g.j(androidx.compose.foundation.layout.h.f(aVar), 0.0f, mwaVar.c(), 0.0f, mwaVar.a(), 5), "box_promo_list_layout");
                hce hceVar = this.b;
                composer.u(733328855);
                kt0 f = jt0.f(Alignment.a.a, false, composer, 0);
                composer.u(-1323940314);
                int H = composer.H();
                n8b m = composer.m();
                v42.c0.getClass();
                tf8.a aVar2 = v42.a.b;
                b22 c = cf8.c(a);
                if (!(composer.k() instanceof f10)) {
                    hc.o();
                    throw null;
                }
                composer.A();
                if (composer.f()) {
                    composer.q(aVar2);
                } else {
                    composer.n();
                }
                v42.a.d dVar = v42.a.f;
                u5g.a(composer, f, dVar);
                v42.a.f fVar = v42.a.e;
                u5g.a(composer, m, fVar);
                v42.a.a aVar3 = v42.a.i;
                if (composer.f() || !vk7.a(composer.v(), Integer.valueOf(H))) {
                    di2.a(H, composer, H, aVar3);
                }
                vx.c(0, c, new u9e(composer), composer, 2058660585);
                androidx.compose.foundation.layout.c cVar = androidx.compose.foundation.layout.c.a;
                Modifier a2 = xh9.a(androidx.compose.foundation.layout.h.f(aVar), "column_promo_list_layout");
                Arrangement.c cVar2 = Arrangement.e;
                lj0.a aVar4 = Alignment.a.n;
                composer.u(-483455358);
                dx1 a3 = bx1.a(cVar2, aVar4, composer, 54);
                composer.u(-1323940314);
                int H2 = composer.H();
                n8b m2 = composer.m();
                b22 c2 = cf8.c(a2);
                if (!(composer.k() instanceof f10)) {
                    hc.o();
                    throw null;
                }
                composer.A();
                if (composer.f()) {
                    composer.q(aVar2);
                } else {
                    composer.n();
                }
                u5g.a(composer, a3, dVar);
                u5g.a(composer, m2, fVar);
                if (composer.f() || !vk7.a(composer.v(), Integer.valueOf(H2))) {
                    di2.a(H2, composer, H2, aVar3);
                }
                vx.c(0, c2, new u9e(composer), composer, 2058660585);
                int intValue2 = ((Number) this.c.getValue()).intValue();
                CheckoutPromoActivity checkoutPromoActivity = this.d;
                if (intValue2 == 100) {
                    composer.u(-265417787);
                    checkoutPromoActivity.N0(composer, 8);
                    composer.K();
                } else if (intValue2 == 101) {
                    composer.u(-265417712);
                    checkoutPromoActivity.M0(composer, 8);
                    composer.K();
                } else if (intValue2 != 103) {
                    composer.u(-265417598);
                    composer.K();
                } else {
                    composer.u(-265417638);
                    checkoutPromoActivity.P0(composer, 8);
                    composer.K();
                }
                q1f.a(composer);
                zbe.b(hceVar, cVar.e(aVar, Alignment.a.b), c22.b(composer, -827754167, new ovo.id.wallet.checkout.ui.presentation.compose.j(checkoutPromoActivity, this.e)), composer, 390, 0);
                composer.K();
                composer.p();
                composer.K();
                composer.K();
            }
            return p1g.a;
        }
    }

    public static final class i extends ua8 implements Function23<Composer, Integer, p1g> {
        public final int c;

        public i(int i) {
            super(2);
            this.c = i;
        }

        public final Object invoke(Object obj, Object obj2) {
            ((Number) obj2).intValue();
            int e = jo3.e(this.c | 1);
            CheckoutPromoActivity.this.O0((Composer) obj, e);
            return p1g.a;
        }
    }

    public static final class j extends ua8 implements Function110<xo8, p1g> {
        public final vke<fxa<PromoDetailInfo, List<PromoDetailInfo>>> b;
        public final vke<String> c;
        public final CheckoutPromoActivity d;

        public j(rm9 rm9Var, rm9 rm9Var2, CheckoutPromoActivity checkoutPromoActivity) {
            super(1);
            this.b = rm9Var;
            this.c = rm9Var2;
            this.d = checkoutPromoActivity;
        }

        public final Object invoke(Object obj) {
            xo8 xo8Var = (xo8) obj;
            vk7.f(xo8Var, "$this$LazyColumn");
            vke<fxa<PromoDetailInfo, List<PromoDetailInfo>>> vkeVar = this.b;
            PromoDetailInfo promoDetailInfo = (PromoDetailInfo) ((fxa) vkeVar.getValue()).a;
            CheckoutPromoActivity checkoutPromoActivity = this.d;
            vke<String> vkeVar2 = this.c;
            if (promoDetailInfo != null) {
                ovo.id.wallet.checkout.ui.presentation.compose.k kVar = new ovo.id.wallet.checkout.ui.presentation.compose.k(promoDetailInfo, vkeVar2, checkoutPromoActivity);
                Object obj2 = c22.a;
                xo8Var.a((Object) null, (Object) null, new b22(1632023087, kVar, true));
            }
            xo8Var.a((Object) null, (Object) null, k22.c);
            List list = (List) ((fxa) vkeVar.getValue()).b;
            int size = list.size();
            qm1 qm1Var = new qm1(list, pm1.b);
            rm1 rm1Var = new rm1(list, vkeVar2, checkoutPromoActivity);
            Object obj3 = c22.a;
            xo8Var.c(size, (Function110) null, qm1Var, new b22(-632812321, rm1Var, true));
            return p1g.a;
        }
    }

    public static final class k extends ua8 implements Function23<Composer, Integer, p1g> {
        public final int c;

        public k(int i) {
            super(2);
            this.c = i;
        }

        public final Object invoke(Object obj, Object obj2) {
            ((Number) obj2).intValue();
            int e = jo3.e(this.c | 1);
            CheckoutPromoActivity.this.P0((Composer) obj, e);
            return p1g.a;
        }
    }

    public static final class l extends ua8 implements zu5<zfc> {
        public l() {
            super(0);
        }

        public final Object invoke() {
            return new zfc(CheckoutPromoActivity.this);
        }
    }

    public class m extends pw5 implements Function110<xh, p1g> {
        public m(Object obj) {
            super(1, obj, uh.class, "trackAnalyticData", "trackAnalyticData(Landroid/content/Context;Lovo/id/analytics/AnalyticPayload;)V", 1);
        }

        public final Object invoke(Object obj) {
            xh xhVar = (xh) obj;
            vk7.f(xhVar, "p0");
            uh.a((Context) ((v11) this).receiver, xhVar);
            return p1g.a;
        }
    }

    public class n extends pw5 implements Function110<List<? extends String>, p1g> {
        public n(Object obj) {
            super(1, obj, CheckoutPromoActivity.class, "processTermsConditionsDialog", "processTermsConditionsDialog(Ljava/util/List;)V", 0);
        }

        public final Object invoke(Object obj) {
            List list = (List) obj;
            vk7.f(list, "p0");
            CheckoutPromoActivity checkoutPromoActivity = (CheckoutPromoActivity) ((v11) this).receiver;
            int i = CheckoutPromoActivity.K;
            checkoutPromoActivity.getClass();
            com.google.android.material.bottomsheet.b a = fm1.a(checkoutPromoActivity, "", list, zm1.b);
            a.show();
            checkoutPromoActivity.J = a;
            return p1g.a;
        }
    }

    public class o extends pw5 implements Function110<PromoDetailInfo, p1g> {
        public o(Object obj) {
            super(1, obj, CheckoutPromoActivity.class, "processTermsConditionsSummaryDialog", "processTermsConditionsSummaryDialog(Lovo/id/wallet/checkout/core/domain/entity/model/PromoDetailInfo;)V", 0);
        }

        public final Object invoke(Object obj) {
            PromoDetailInfo promoDetailInfo = (PromoDetailInfo) obj;
            vk7.f(promoDetailInfo, "p0");
            CheckoutPromoActivity checkoutPromoActivity = (CheckoutPromoActivity) ((v11) this).receiver;
            int i = CheckoutPromoActivity.K;
            checkoutPromoActivity.getClass();
            fxa fxaVar = (promoDetailInfo.isEligible() && vk7.a(promoDetailInfo.getCampaignId(), checkoutPromoActivity.R0().I.getValue())) ? new fxa("selected", new an1(checkoutPromoActivity, promoDetailInfo)) : promoDetailInfo.isEligible() ? new fxa("eligible", new bn1(checkoutPromoActivity, promoDetailInfo)) : new fxa("ineligible", cn1.b);
            String str = (String) fxaVar.a;
            zu5 zu5Var = (zu5) fxaVar.b;
            ssb promoTerm = promoDetailInfo.toPromoTerm();
            com.google.android.material.bottomsheet.b b = fm1.b(checkoutPromoActivity, str, promoTerm.c, new en1(checkoutPromoActivity, promoTerm, str, zu5Var), new fn1(zu5Var));
            b.show();
            checkoutPromoActivity.J = b;
            return p1g.a;
        }
    }

    public class p extends pw5 implements Function110<CheckoutError, p1g> {
        public p(Object obj) {
            super(1, obj, CheckoutPromoActivity.class, "handleCheckoutError", "handleCheckoutError(Lovo/id/wallet/checkout/ui/presentation/utils/CheckoutError;)V", 0);
        }

        public final Object invoke(Object obj) {
            CheckoutError checkoutError = (CheckoutError) obj;
            ?? r0 = (CheckoutPromoActivity) ((v11) this).receiver;
            if (checkoutError == null) {
                int i = CheckoutPromoActivity.K;
                r0.getClass();
            } else {
                com.google.android.material.bottomsheet.b bVar = r0.J;
                if (bVar != null) {
                    bVar.dismiss();
                }
                ?? Q0 = r0.Q0();
                int i2 = zfc.f1687t;
                Q0.s("", dgc.b);
                Q0.v("", ggc.b);
                Q0.m("", agc.b);
                if (Q0.isShowing()) {
                    Q0.dismiss();
                }
                boolean z = !(checkoutError instanceof CheckoutError.CheckoutTimeoutError ? true : checkoutError instanceof CheckoutError.PromoFailedError ? true : checkoutError instanceof CheckoutError.PromoExpiredError);
                String a = checkoutError.getA();
                if (vk7.a(a, "")) {
                    a = null;
                }
                wm1 wm1Var = new wm1(a, r0);
                ?? Q02 = r0.Q0();
                Q02.setCancelable(z);
                Q02.p(a);
                Q02.x(checkoutError.getB().a((Context) r0));
                Q02.k(checkoutError.getC().a((Context) r0));
                CheckoutError.ActionMetadata d = checkoutError.d();
                if (d != null) {
                    String a2 = d.a.a((Context) r0);
                    if (a2 == null) {
                        a2 = "";
                    }
                    wm1Var.invoke(a2, new sm1(r0, d));
                }
                CheckoutError.ActionMetadata a3 = checkoutError.getA();
                if (a3 != null) {
                    String a4 = a3.a.a((Context) r0);
                    Q02.s(a4 != null ? a4 : "", new tm1(a3));
                }
                Q02.show();
                r0.R0().y.setValue((Object) null);
            }
            return p1g.a;
        }
    }

    public class q extends pw5 implements Function110<fxa<? extends Integer, ? extends Bundle>, p1g> {
        public q(Object obj) {
            super(1, obj, CheckoutPromoActivity.class, "processPromoActionHandler", "processPromoActionHandler(Lkotlin/Pair;)V", 0);
        }

        public final Object invoke(Object obj) {
            p1g p1gVar;
            fxa fxaVar = (fxa) obj;
            vk7.f(fxaVar, "p0");
            BaseActivity baseActivity = (CheckoutPromoActivity) ((v11) this).receiver;
            int i = CheckoutPromoActivity.K;
            baseActivity.getClass();
            Bundle bundle = (Bundle) fxaVar.b;
            Object obj2 = fxaVar.a;
            if (bundle != null) {
                int intValue = ((Number) obj2).intValue();
                Intent intent = new Intent();
                intent.putExtras(bundle);
                p1g p1gVar2 = p1g.a;
                baseActivity.setResult(intValue, intent);
                p1gVar = p1g.a;
            } else {
                p1gVar = null;
            }
            if (p1gVar == null) {
                baseActivity.setResult(((Number) obj2).intValue());
            }
            baseActivity.finish();
            return p1g.a;
        }
    }

    public static final class r extends ua8 implements Function23<Composer, Integer, p1g> {
        public r() {
            super(2);
        }

        public final Object invoke(Object obj, Object obj2) {
            Composer composer = (Composer) obj;
            if ((((Number) obj2).intValue() & 11) == 2 && composer.j()) {
                composer.F();
            } else {
                nic.a(false, c22.b(composer, -993634500, new ovo.id.wallet.checkout.ui.presentation.compose.l(CheckoutPromoActivity.this)), composer, 48, 1);
            }
            return p1g.a;
        }
    }

    public static final class s extends ua8 implements zu5<ViewModelStore> {
        public final ComponentActivity b;

        public s(ComponentActivity componentActivity) {
            super(0);
            this.b = componentActivity;
        }

        public final Object invoke() {
            ViewModelStore viewModelStore = this.b.getViewModelStore();
            vk7.e(viewModelStore, "viewModelStore");
            return viewModelStore;
        }
    }

    public static final class t extends ua8 implements zu5<sh2> {
        public final ComponentActivity b;

        public t(ComponentActivity componentActivity) {
            super(0);
            this.b = componentActivity;
        }

        public final Object invoke() {
            sh2 defaultViewModelCreationExtras = this.b.getDefaultViewModelCreationExtras();
            vk7.e(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
            return defaultViewModelCreationExtras;
        }
    }

    public static final class u extends ua8 implements zu5<ViewModelProvider.Factory> {
        public u() {
            super(0);
        }

        public final Object invoke() {
            ViewModelProvider.Factory factory = CheckoutPromoActivity.this.G;
            if (factory != null) {
                return factory;
            }
            vk7.m("factory");
            throw null;
        }
    }

    public final void G0() {
        rl2 rl2Var = vx0.a;
        if (rl2Var != null) {
            this.G = new rig(c27.h(CheckoutViewModel.class, rl2Var.f1187o, in1.class, rl2Var.p));
        } else {
            vk7.m("checkoutComponent");
            throw null;
        }
    }

    public final void M0(Composer composer, int i2) {
        StringWrapper stringWrapper;
        StringWrapper stringWrapper2;
        b52 h2 = composer.h(1581920970);
        Context context = (Context) h2.C(AndroidCompositionLocals_androidKt.b);
        rm9 l2 = jt7.l(R0().F, new CheckoutError.GeneralError(new CheckoutError.ActionMetadata(StringWrapper.a.e(""), c.b)), h2, 72);
        Modifier a2 = xh9.a(androidx.compose.foundation.layout.h.f(Modifier.a.b), "ravier_layout_checkout_promo_form");
        String a3 = ((CheckoutError) l2.getValue()).getA();
        String a4 = ((CheckoutError) l2.getValue()).getB().a(context);
        String str = a4 == null ? "" : a4;
        String a5 = ((CheckoutError) l2.getValue()).getC().a(context);
        String str2 = a5 == null ? "" : a5;
        CheckoutError.ActionMetadata a6 = ((CheckoutError) l2.getValue()).getA();
        String a7 = (a6 == null || (stringWrapper2 = a6.a) == null) ? null : stringWrapper2.a(context);
        CheckoutError.ActionMetadata d2 = ((CheckoutError) l2.getValue()).d();
        ay1.a aVar = new ay1.a((Object) a3, str, str2, a7, (d2 == null || (stringWrapper = d2.a) == null) ? null : stringWrapper.a(context), false, (String) null, true, 192);
        h2.u(1157296644);
        boolean L = h2.L(l2);
        Object v2 = h2.v();
        if (L || v2 == Composer.a.a) {
            v2 = new a(l2);
            h2.o(v2);
        }
        h2.X(false);
        jgc.a(a2, aVar, null, null, (Function110) v2, h2, 64, 12);
        rrc b0 = h2.b0();
        if (b0 == null) {
            return;
        }
        b0.d = new b(i2);
    }

    public final void N0(Composer composer, int i2) {
        b52 h2 = composer.h(-1237089642);
        if ((i2 & 1) == 0 && h2.j()) {
            h2.F();
        } else {
            Modifier.a aVar = Modifier.a.b;
            Modifier a2 = xh9.a(androidx.compose.foundation.layout.h.f(aVar), "box_checkout_promo_loading");
            h2.u(733328855);
            kt0 f2 = jt0.f(Alignment.a.a, false, h2, 0);
            h2.u(-1323940314);
            int i3 = h2.P;
            n8b T = h2.T();
            v42.c0.getClass();
            tf8.a aVar2 = v42.a.b;
            b22 c2 = cf8.c(a2);
            if (!(h2.a instanceof f10)) {
                hc.o();
                throw null;
            }
            h2.A();
            if (h2.O) {
                h2.q(aVar2);
            } else {
                h2.n();
            }
            u5g.a(h2, f2, v42.a.f);
            u5g.a(h2, T, v42.a.e);
            v42.a.a aVar3 = v42.a.i;
            if (h2.O || !vk7.a(h2.v(), Integer.valueOf(i3))) {
                us.b(i3, h2, i3, aVar3);
            }
            zz1.b(0, c2, new u9e(h2), h2, 2058660585);
            hhc.b(LoadingType.INLINE, xh9.a(androidx.compose.foundation.layout.c.a.e(aVar, Alignment.a.e), "loading_layout_checkout_promo_form"), LoadingState.LOADING, d.b, h2, 3462, 0);
            a02.c(h2, false, true, false, false);
        }
        rrc b0 = h2.b0();
        if (b0 == null) {
            return;
        }
        b0.d = new e(i2);
    }

    public final void O0(Composer composer, int i2) {
        b52 h2 = composer.h(902943525);
        rm9 l2 = jt7.l(R0().H, 100, h2, 56);
        Context context = (Context) h2.C(AndroidCompositionLocals_androidKt.b);
        h2.u(-492369756);
        Object v2 = h2.v();
        if (v2 == Composer.a.a) {
            v2 = new hce();
            h2.o(v2);
        }
        h2.X(false);
        hce hceVar = (hce) v2;
        bcd.b((Modifier) null, c22.b(h2, -965617439, new f()), (Function23) null, c22.b(h2, -1888784865, new g(hceVar)), (Function23) null, 0, 0L, 0L, (yrg) null, c22.b(h2, 912883958, new h(hceVar, l2, this, context)), h2, 805309488, 501);
        rrc b0 = h2.b0();
        if (b0 == null) {
            return;
        }
        b0.d = new i(i2);
    }

    public final void P0(Composer composer, int i2) {
        b52 h2 = composer.h(-1243813774);
        hj8.a(xh9.a(androidx.compose.foundation.layout.g.h(androidx.compose.foundation.a.c(androidx.compose.foundation.layout.h.f(Modifier.a.b), yfc.F), 0.0f, pgc.f, 1), "list_checkout_promo"), (ap8) null, (mwa) null, false, (Arrangement.l) null, (Alignment.b) null, (c65) null, false, new j(jt7.l(R0().B, new fxa((Object) null, pk4.a), h2, 72), jt7.l(R0().I, "", h2, 56), this), h2, 0, 254);
        rrc b0 = h2.b0();
        if (b0 == null) {
            return;
        }
        b0.d = new k(i2);
    }

    public final zfc Q0() {
        return (zfc) this.I.getValue();
    }

    public final in1 R0() {
        return (in1) this.H.getValue();
    }

    public final void onCreate(Bundle bundle) {
        String str;
        Object obj;
        String string;
        super.onCreate(bundle);
        Bundle extras = getIntent().getExtras();
        String string2 = extras != null ? extras.getString("eligiblePromos") : null;
        if (string2 == null) {
            string2 = "";
        }
        List list = (List) new Gson().d(string2, new xm1().getType());
        String string3 = extras != null ? extras.getString("ineligiblePromos") : null;
        if (string3 == null) {
            string3 = "";
        }
        List list2 = (List) new Gson().d(string3, new ym1().getType());
        ArrayList arrayList = new ArrayList();
        arrayList.addAll(list);
        arrayList.addAll(list2);
        in1 R0 = R0();
        String string4 = extras != null ? extras.getString("merchantId") : null;
        String str2 = string4 == null ? "" : string4;
        String string5 = extras != null ? extras.getString("storeId") : null;
        String str3 = string5 == null ? "" : string5;
        String string6 = extras != null ? extras.getString("skuId") : null;
        String str4 = string6 == null ? "" : string6;
        String str5 = "0";
        if (extras == null || (str = extras.getString("amountCash")) == null) {
            str = "0";
        }
        double parseDouble = Double.parseDouble(str);
        if (extras != null && (string = extras.getString("amountPoint")) != null) {
            str5 = string;
        }
        double parseDouble2 = Double.parseDouble(str5);
        String string7 = extras != null ? extras.getString("selectedCampaignId") : null;
        String str6 = string7 == null ? "" : string7;
        String string8 = extras != null ? extras.getString("transactionType") : null;
        if (string8 == null) {
            string8 = "";
        }
        String string9 = extras != null ? extras.getString("product") : null;
        if (string9 == null) {
            string9 = "";
        }
        R0.getClass();
        R0.s.setValue(new PromoRequest(Calendar.getInstance().getTimeInMillis() / WebSocket.CLOSE_CODE_NORMAL, str2, str3, str4, parseDouble, parseDouble2, str6));
        MutableLiveData<String> mutableLiveData = R0.f574u;
        mutableLiveData.setValue(string8);
        MutableLiveData<String> mutableLiveData2 = R0.f575v;
        mutableLiveData2.setValue(string9);
        PromoRequest promoRequest = (PromoRequest) R0.f573t.getValue();
        if (promoRequest != null) {
            Iterator it = arrayList.iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it.next();
                PromoDetailInfo promoDetailInfo = (PromoDetailInfo) obj;
                if (vk7.a(promoDetailInfo.getCampaignId(), promoRequest.getSelectedCampaignId()) && promoDetailInfo.isEligible()) {
                    break;
                }
            }
            ArrayList arrayList2 = new ArrayList();
            Iterator it2 = arrayList.iterator();
            while (it2.hasNext()) {
                Object next = it2.next();
                if (!vk7.a(((PromoDetailInfo) next).getCampaignId(), promoRequest.getSelectedCampaignId())) {
                    arrayList2.add(next);
                }
            }
            fxa fxaVar = new fxa(obj, arrayList2);
            MutableLiveData<Integer> mutableLiveData3 = R0.G;
            if (obj == null && arrayList2.isEmpty()) {
                MutableLiveData<xh> mutableLiveData4 = R0.f576w;
                String str7 = (String) mutableLiveData2.getValue();
                if (str7 == null) {
                    str7 = "";
                }
                fxa[] fxaVarArr = new fxa[3];
                String selectedCampaignId = promoRequest.getSelectedCampaignId();
                if (selectedCampaignId == null) {
                    selectedCampaignId = "";
                }
                fxaVarArr[0] = new fxa("campaign_id", selectedCampaignId);
                String str8 = (String) mutableLiveData.getValue();
                if (str8 == null) {
                    str8 = "";
                }
                fxaVarArr[1] = new fxa("oder_type", str8);
                LinkedHashMap x = r89.x(new fxa[]{new fxa("amount_cash", Double.valueOf(promoRequest.getAmountCash())), new fxa("amount_point", Double.valueOf(promoRequest.getAmountPoint())), new fxa(CheckoutComponentResponse.ATTR_JSON_MERCHANT_ID, promoRequest.getMerchantId()), new fxa(CheckoutComponentResponse.ATTR_JSON_STORE_ID, promoRequest.getStoreId()), new fxa("timestamp", Long.valueOf(promoRequest.getTimestamp()))});
                String skuId = promoRequest.getSkuId();
                if (!(!x.isEmpty())) {
                    skuId = null;
                }
                if (skuId != null) {
                    x.put(CheckoutComponentResponse.ATTR_JSON_SKU_ID, skuId);
                }
                p1g p1gVar = p1g.a;
                fxaVarArr[2] = new fxa("informasi", x);
                mutableLiveData4.setValue(new CheckoutPromoTrackingPayload.PromoListEmptyTrackingPayload(r89.v(fxaVarArr), str7).c());
                R0.E.setValue(new CheckoutError.PromoNoActionError(ErrorImageMapper.EMPTY_STATE.getId(), StringWrapper.a.a(fac.ovo_checkout_promo_list_empty_title), StringWrapper.a.a(fac.ovo_checkout_promo_list_empty_desc)));
                mutableLiveData3.setValue(101);
            } else {
                R0.A.setValue(fxaVar);
                mutableLiveData3.setValue(103);
            }
        }
        in1 R02 = R0();
        vx0.t(this, new fxa(R02.x, new m(this)));
        vx0.t(this, new fxa(R02.f572o, new n(this)));
        vx0.t(this, new fxa(R02.p, new o(this)));
        vx0.t(this, new fxa(R02.z, new p(this)));
        vx0.t(this, new fxa(R02.r, new q(this)));
        r rVar = new r();
        Object obj2 = c22.a;
        t02.a(this, new b22(-1340085234, rVar, true));
    }
}