package vc;

import android.content.Context;
import androidx.compose.foundation.layout.o;
import androidx.compose.ui.platform.AndroidCompositionLocals_androidKt;
import c3.r;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.firebase.crashlytics.internal.metadata.UserMetadata;
import dn.l;
import dn.p;
import dn.q;
import h0.c0;
import h2.s;
import j2.g;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import kotlin.text.z;
import l1.i;
import l7.n;
import n8.e0;
import rm.n0;
import sm.u;
import v0.z1;
import y0.d4;
import y0.e3;
import y0.j;
import y0.l2;
import y0.m;
import y0.n1;
import y0.q1;
import y0.s3;
import y0.x2;
import y0.y;
import z.a0;

/* loaded from: classes4.dex */
public abstract class c {

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class a extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ String f39479p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ Context f39480q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(String str, Context context) {
            super(0);
            this.f39479p = str;
            this.f39480q = context;
        }

        @Override // dn.a
        public /* bridge */ /* synthetic */ Object invoke() {
            m462invoke();
            return n0.f34904a;
        }

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m462invoke() {
            String str = this.f39479p;
            if (str != null) {
                e0.f29852a.a(this.f39480q, str);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class b extends v implements p {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ float f39481p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ vc.a f39482q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ int f39483r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        b(float f10, vc.a aVar, int i10) {
            super(2);
            this.f39481p = f10;
            this.f39482q = aVar;
            this.f39483r = i10;
        }

        public final void a(m mVar, int i10) {
            c.a(this.f39481p, this.f39482q, mVar, l2.a(this.f39483r | 1));
        }

        @Override // dn.p
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
            a((m) obj, ((Number) obj2).intValue());
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* renamed from: vc.c$c, reason: collision with other inner class name */
    /* loaded from: classes4.dex */
    public static final class C0942c extends v implements l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ n1 f39484p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        C0942c(n1 n1Var) {
            super(1);
            this.f39484p = n1Var;
        }

        public final void a(s coordinates) {
            t.g(coordinates, "coordinates");
            c.e(this.f39484p, r.f(coordinates.g()));
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((s) obj);
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class d extends v implements p {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ float f39485p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ vc.a f39486q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        d(float f10, vc.a aVar) {
            super(2);
            this.f39485p = f10;
            this.f39486q = aVar;
        }

        public final void a(m mVar, int i10) {
            if ((i10 & 11) == 2 && mVar.v()) {
                mVar.A();
                return;
            }
            if (y0.p.H()) {
                y0.p.Q(-1296786964, i10, -1, "ca.canadapost.module.homepickup.ui.AHPCarouselParent.<anonymous>.<anonymous>.<anonymous> (BottomSheetWithCarousel.kt:71)");
            }
            c.a(this.f39485p, this.f39486q, mVar, 0);
            if (y0.p.H()) {
                y0.p.P();
            }
        }

        @Override // dn.p
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
            a((m) obj, ((Number) obj2).intValue());
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class e extends v implements l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ q1 f39487p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        e(q1 q1Var) {
            super(1);
            this.f39487p = q1Var;
        }

        public final void a(float f10) {
            if (c3.h.s(f10, c.c(this.f39487p)) > 0) {
                c.d(this.f39487p, f10);
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a(((c3.h) obj).y());
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class f extends v implements q {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ l f39488p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ List f39489q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ q1 f39490r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        f(l lVar, List list, q1 q1Var) {
            super(3);
            this.f39488p = lVar;
            this.f39489q = list;
            this.f39490r = q1Var;
        }

        public final void a(int i10, m mVar, int i11) {
            if ((i11 & 14) == 0) {
                i11 |= mVar.i(i10) ? 4 : 2;
            }
            if ((i11 & 91) == 18 && mVar.v()) {
                mVar.A();
                return;
            }
            if (y0.p.H()) {
                y0.p.Q(-255522614, i11, -1, "ca.canadapost.module.homepickup.ui.AHPCarouselParent.<anonymous>.<anonymous> (BottomSheetWithCarousel.kt:85)");
            }
            this.f39488p.invoke(Integer.valueOf(i10));
            c.a(c.c(this.f39490r), (vc.a) this.f39489q.get(i10), mVar, 0);
            if (y0.p.H()) {
                y0.p.P();
            }
        }

        @Override // dn.q
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2, Object obj3) {
            a(((Number) obj).intValue(), (m) obj2, ((Number) obj3).intValue());
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class g extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f39491p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        g(dn.a aVar) {
            super(0);
            this.f39491p = aVar;
        }

        @Override // dn.a
        public /* bridge */ /* synthetic */ Object invoke() {
            m463invoke();
            return n0.f34904a;
        }

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m463invoke() {
            this.f39491p.invoke();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class h extends v implements q {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ List f39492p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ c0 f39493q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        h(List list, c0 c0Var) {
            super(3);
            this.f39492p = list;
            this.f39493q = c0Var;
        }

        public final void a(e0.e0 CpcPrimaryButton, m mVar, int i10) {
            int i11;
            t.g(CpcPrimaryButton, "$this$CpcPrimaryButton");
            if ((i10 & 14) == 0) {
                i11 = i10 | (mVar.R(CpcPrimaryButton) ? 4 : 2);
            } else {
                i11 = i10;
            }
            if ((i11 & 91) == 18 && mVar.v()) {
                mVar.A();
                return;
            }
            if (y0.p.H()) {
                y0.p.Q(1450628252, i11, -1, "ca.canadapost.module.homepickup.ui.AHPCarouselParent.<anonymous>.<anonymous> (BottomSheetWithCarousel.kt:103)");
            }
            l1.i c10 = CpcPrimaryButton.c(l1.i.f27362a, l1.c.f27332a.i());
            n7.a aVar = n7.a.f29827a;
            int i12 = n7.a.f29828b;
            z1.b(((vc.a) this.f39492p.get(this.f39493q.v())).a(), androidx.compose.foundation.layout.l.m(c10, BitmapDescriptorFactory.HUE_RED, aVar.b(mVar, i12).u(), BitmapDescriptorFactory.HUE_RED, aVar.b(mVar, i12).u(), 5, null), m2.b.a(pc.e.f32562a, mVar, 0), 0L, null, null, null, 0L, null, null, 0L, 0, false, 0, 0, null, aVar.c(mVar, i12).h(), mVar, 0, 0, 65528);
            if (y0.p.H()) {
                y0.p.P();
            }
        }

        @Override // dn.q
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2, Object obj3) {
            a((e0.e0) obj, (m) obj2, ((Number) obj3).intValue());
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class i extends v implements p {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ List f39494p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ dn.a f39495q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ c0 f39496r;

        /* renamed from: s, reason: collision with root package name */
        final /* synthetic */ l f39497s;

        /* renamed from: t, reason: collision with root package name */
        final /* synthetic */ int f39498t;

        /* renamed from: u, reason: collision with root package name */
        final /* synthetic */ int f39499u;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        i(List list, dn.a aVar, c0 c0Var, l lVar, int i10, int i11) {
            super(2);
            this.f39494p = list;
            this.f39495q = aVar;
            this.f39496r = c0Var;
            this.f39497s = lVar;
            this.f39498t = i10;
            this.f39499u = i11;
        }

        public final void a(m mVar, int i10) {
            c.b(this.f39494p, this.f39495q, this.f39496r, this.f39497s, mVar, l2.a(this.f39498t | 1), this.f39499u);
        }

        @Override // dn.p
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
            a((m) obj, ((Number) obj2).intValue());
            return n0.f34904a;
        }
    }

    public static final void a(float f10, vc.a carouselItem, m mVar, int i10) {
        int i11;
        int h02;
        m mVar2;
        t.g(carouselItem, "carouselItem");
        m r10 = mVar.r(-1235210281);
        if ((i10 & 14) == 0) {
            i11 = (r10.h(f10) ? 4 : 2) | i10;
        } else {
            i11 = i10;
        }
        if ((i10 & 112) == 0) {
            i11 |= r10.R(carouselItem) ? 32 : 16;
        }
        if ((i11 & 91) == 18 && r10.v()) {
            r10.A();
            mVar2 = r10;
        } else {
            if (y0.p.H()) {
                y0.p.Q(-1235210281, i11, -1, "ca.canadapost.module.homepickup.ui.AHPCarouselItem (BottomSheetWithCarousel.kt:122)");
            }
            Context context = (Context) r10.t(AndroidCompositionLocals_androidKt.g());
            i.a aVar = l1.i.f27362a;
            l1.i h10 = o.h(l7.h.p(aVar, f10), BitmapDescriptorFactory.HUE_RED, 1, null);
            n7.a aVar2 = n7.a.f29827a;
            int i12 = n7.a.f29828b;
            l1.i m10 = androidx.compose.foundation.layout.l.m(h10, aVar2.b(r10, i12).H(), BitmapDescriptorFactory.HUE_RED, aVar2.b(r10, i12).H(), aVar2.b(r10, i12).Z(), 2, null);
            h2.e0 a10 = e0.d.a(e0.b.f16607a.h(), l1.c.f27332a.g(), r10, 48);
            int a11 = j.a(r10, 0);
            y D = r10.D();
            l1.i e10 = l1.h.e(r10, m10);
            g.a aVar3 = j2.g.f23616d;
            dn.a a12 = aVar3.a();
            if (!(r10.w() instanceof y0.f)) {
                j.c();
            }
            r10.u();
            if (r10.n()) {
                r10.o(a12);
            } else {
                r10.F();
            }
            m a13 = d4.a(r10);
            d4.b(a13, a10, aVar3.c());
            d4.b(a13, D, aVar3.e());
            p b10 = aVar3.b();
            if (a13.n() || !t.b(a13.f(), Integer.valueOf(a11))) {
                a13.I(Integer.valueOf(a11));
                a13.l(Integer.valueOf(a11), b10);
            }
            d4.b(a13, e10, aVar3.d());
            e0.g gVar = e0.g.f16653a;
            float J = aVar2.b(r10, i12).J();
            l7.o oVar = l7.o.Vertical;
            n.a(J, oVar, r10, 48);
            a0.a(m2.e.c(carouselItem.e(), r10, 0), null, o.h(aVar, BitmapDescriptorFactory.HUE_RED, 1, null), null, null, BitmapDescriptorFactory.HUE_RED, null, r10, 440, 120);
            n.a(aVar2.b(r10, i12).J(), oVar, r10, 48);
            h02 = z.h0(carouselItem.b(), "%s", 0, false, 6, null);
            boolean z10 = h02 > 0;
            String d10 = carouselItem.d();
            if (z10) {
                r10.e(-74606749);
                l7.p.a(carouselItem.c(), null, carouselItem.b(), aVar2.c(r10, i12).b(), o.h(aVar, BitmapDescriptorFactory.HUE_RED, 1, null), new a(d10, context), r10, 24576, 2);
                r10.N();
                mVar2 = r10;
            } else {
                r10.e(-74606279);
                mVar2 = r10;
                z1.b(carouselItem.b(), o.h(aVar, BitmapDescriptorFactory.HUE_RED, 1, null), 0L, 0L, null, null, null, 0L, null, null, 0L, 0, false, 0, 0, null, aVar2.c(r10, i12).b(), mVar2, 48, 0, 65532);
                mVar2.N();
            }
            mVar2.O();
            if (y0.p.H()) {
                y0.p.P();
            }
        }
        x2 y10 = mVar2.y();
        if (y10 != null) {
            y10.a(new b(f10, carouselItem, i10));
        }
    }

    public static final void b(List list, dn.a onNextClick, c0 pagerState, l onCarouselPageChange, m mVar, int i10, int i11) {
        List list2;
        List k10;
        t.g(onNextClick, "onNextClick");
        t.g(pagerState, "pagerState");
        t.g(onCarouselPageChange, "onCarouselPageChange");
        m r10 = mVar.r(-1712021807);
        int i12 = i11 & 1;
        int i13 = i12 != 0 ? i10 | 2 : i10;
        if ((i11 & 2) != 0) {
            i13 |= 48;
        } else if ((i10 & 112) == 0) {
            i13 |= r10.m(onNextClick) ? 32 : 16;
        }
        if ((i11 & 4) != 0) {
            i13 |= 384;
        } else if ((i10 & 896) == 0) {
            i13 |= r10.R(pagerState) ? 256 : 128;
        }
        if ((i11 & 8) != 0) {
            i13 |= 3072;
        } else if ((i10 & 7168) == 0) {
            i13 |= r10.m(onCarouselPageChange) ? 2048 : UserMetadata.MAX_ATTRIBUTE_SIZE;
        }
        if (i12 == 1 && (i13 & 5851) == 1170 && r10.v()) {
            r10.A();
            list2 = list;
        } else {
            if (i12 != 0) {
                k10 = u.k();
                list2 = k10;
            } else {
                list2 = list;
            }
            if (y0.p.H()) {
                y0.p.Q(-1712021807, i13, -1, "ca.canadapost.module.homepickup.ui.AHPCarouselParent (BottomSheetWithCarousel.kt:52)");
            }
            Object f10 = r10.f();
            m.a aVar = m.f51621a;
            if (f10 == aVar.a()) {
                f10 = e3.a(350);
                r10.I(f10);
            }
            n1 n1Var = (n1) f10;
            n7.a aVar2 = n7.a.f29827a;
            int i14 = n7.a.f29828b;
            float b02 = aVar2.b(r10, i14).b0();
            l1.i k11 = androidx.compose.foundation.layout.l.k(o.w(o.h(l1.i.f27362a, BitmapDescriptorFactory.HUE_RED, 1, null), null, false, 3, null), BitmapDescriptorFactory.HUE_RED, aVar2.b(r10, i14).H(), 1, null);
            r10.e(2084164513);
            boolean R = r10.R(n1Var);
            Object f11 = r10.f();
            if (R || f11 == aVar.a()) {
                f11 = new C0942c(n1Var);
                r10.I(f11);
            }
            r10.N();
            l1.i k12 = o.k(androidx.compose.ui.layout.c.a(k11, (l) f11), c3.h.t(350), BitmapDescriptorFactory.HUE_RED, 2, null);
            h2.e0 a10 = e0.d.a(e0.b.f16607a.h(), l1.c.f27332a.g(), r10, 48);
            int a11 = j.a(r10, 0);
            y D = r10.D();
            l1.i e10 = l1.h.e(r10, k12);
            g.a aVar3 = j2.g.f23616d;
            dn.a a12 = aVar3.a();
            if (!(r10.w() instanceof y0.f)) {
                j.c();
            }
            r10.u();
            if (r10.n()) {
                r10.o(a12);
            } else {
                r10.F();
            }
            m a13 = d4.a(r10);
            d4.b(a13, a10, aVar3.c());
            d4.b(a13, D, aVar3.e());
            p b10 = aVar3.b();
            if (a13.n() || !t.b(a13.f(), Integer.valueOf(a11))) {
                a13.I(Integer.valueOf(a11));
                a13.l(Integer.valueOf(a11), b10);
            }
            d4.b(a13, e10, aVar3.d());
            e0.g gVar = e0.g.f16653a;
            ArrayList arrayList = new ArrayList();
            Iterator it = list2.iterator();
            while (it.hasNext()) {
                arrayList.add(g1.c.b(r10, -1296786964, true, new d(b02, (vc.a) it.next())));
            }
            Object f12 = r10.f();
            m.a aVar4 = m.f51621a;
            if (f12 == aVar4.a()) {
                f12 = s3.d(c3.h.m(b02), null, 2, null);
                r10.I(f12);
            }
            q1 q1Var = (q1) f12;
            r10.e(2084165036);
            boolean R2 = r10.R(q1Var);
            Object f13 = r10.f();
            if (R2 || f13 == aVar4.a()) {
                f13 = new e(q1Var);
                r10.I(f13);
            }
            r10.N();
            l7.h.k(arrayList, (l) f13, r10, 8);
            l7.h.d(pagerState, g1.c.b(r10, -255522614, true, new f(onCarouselPageChange, list2, q1Var)), r10, ((i13 >> 6) & 14) | 48);
            l1.i w10 = o.w(o.h(l1.i.f27362a, BitmapDescriptorFactory.HUE_RED, 1, null), null, false, 3, null);
            n7.a aVar5 = n7.a.f29827a;
            int i15 = n7.a.f29828b;
            l1.i m10 = androidx.compose.foundation.layout.l.m(w10, aVar5.b(r10, i15).H(), BitmapDescriptorFactory.HUE_RED, aVar5.b(r10, i15).H(), aVar5.b(r10, i15).J(), 2, null);
            r10.e(2084165432);
            boolean m11 = r10.m(onNextClick);
            Object f14 = r10.f();
            if (m11 || f14 == aVar4.a()) {
                f14 = new g(onNextClick);
                r10.I(f14);
            }
            r10.N();
            l7.f.b(m10, (dn.a) f14, g1.c.b(r10, 1450628252, true, new h(list2, pagerState)), r10, 384, 0);
            r10.O();
            if (y0.p.H()) {
                y0.p.P();
            }
        }
        x2 y10 = r10.y();
        if (y10 != null) {
            y10.a(new i(list2, onNextClick, pagerState, onCarouselPageChange, i10, i11));
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final float c(q1 q1Var) {
        return ((c3.h) q1Var.getValue()).y();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void d(q1 q1Var, float f10) {
        q1Var.setValue(c3.h.m(f10));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void e(n1 n1Var, int i10) {
        n1Var.i(i10);
    }
}
