package com.revenuecat.purchases.ui.revenuecatui.components.timeline;

import A2.c;
import B.H0;
import J4.a;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.Stable;
import androidx.compose.runtime.State;
import com.revenuecat.purchases.paywalls.components.TimelineComponent;
import com.revenuecat.purchases.paywalls.components.properties.Size;
import com.revenuecat.purchases.ui.revenuecatui.CustomVariableValue;
import com.revenuecat.purchases.ui.revenuecatui.components.PresentedTimelineItemPartial;
import com.revenuecat.purchases.ui.revenuecatui.components.PresentedTimelinePartial;
import com.revenuecat.purchases.ui.revenuecatui.components.state.PackageAwareDelegate;
import com.revenuecat.purchases.ui.revenuecatui.components.style.IconComponentStyle;
import com.revenuecat.purchases.ui.revenuecatui.components.style.TextComponentStyle;
import com.revenuecat.purchases.ui.revenuecatui.components.style.TimelineComponentStyle;
import java.util.List;
import java.util.Map;
import kotlin.jvm.internal.h;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.p;
import x4.z;

/* JADX INFO: loaded from: classes3.dex */
@Stable
public final class TimelineComponentState {
    public static final int $stable = 0;
    private final State columnGutter$delegate;
    private final a customVariablesProvider;
    private final State iconAlignment$delegate;
    private final State itemSpacing$delegate;
    private final State items$delegate;
    private final State margin$delegate;
    private final PackageAwareDelegate packageAwareDelegate;
    private final State padding$delegate;
    private final State presentedPartial$delegate;
    private final a selectedOfferEligibilityProvider;
    private final a selectedPackageInfoProvider;
    private final a selectedTabIndexProvider;
    private final State size$delegate;
    private final TimelineComponentStyle style;
    private final State textSpacing$delegate;
    private final State visible$delegate;
    private final MutableState windowSize$delegate;

    /* JADX INFO: renamed from: com.revenuecat.purchases.ui.revenuecatui.components.timeline.TimelineComponentState$1, reason: invalid class name */
    public static final class AnonymousClass1 extends p implements a {
        public static final AnonymousClass1 INSTANCE = new AnonymousClass1();

        public AnonymousClass1() {
            super(0);
        }

        @Override // J4.a
        public final Map<String, CustomVariableValue> invoke() {
            return z.f26066a;
        }
    }

    public TimelineComponentState(c initialWindowSize, TimelineComponentStyle style, a selectedPackageInfoProvider, a selectedTabIndexProvider, a selectedOfferEligibilityProvider, a customVariablesProvider) {
        o.h(initialWindowSize, "initialWindowSize");
        o.h(style, "style");
        o.h(selectedPackageInfoProvider, "selectedPackageInfoProvider");
        o.h(selectedTabIndexProvider, "selectedTabIndexProvider");
        o.h(selectedOfferEligibilityProvider, "selectedOfferEligibilityProvider");
        o.h(customVariablesProvider, "customVariablesProvider");
        this.style = style;
        this.selectedPackageInfoProvider = selectedPackageInfoProvider;
        this.selectedTabIndexProvider = selectedTabIndexProvider;
        this.selectedOfferEligibilityProvider = selectedOfferEligibilityProvider;
        this.customVariablesProvider = customVariablesProvider;
        this.windowSize$delegate = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(initialWindowSize, null, 2, null);
        this.packageAwareDelegate = new PackageAwareDelegate(style, selectedPackageInfoProvider, selectedTabIndexProvider, selectedOfferEligibilityProvider);
        this.presentedPartial$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$presentedPartial$2(this));
        this.visible$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$visible$2(this));
        this.itemSpacing$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$itemSpacing$2(this));
        this.textSpacing$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$textSpacing$2(this));
        this.columnGutter$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$columnGutter$2(this));
        this.iconAlignment$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$iconAlignment$2(this));
        this.size$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$size$2(this));
        this.padding$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$padding$2(this));
        this.margin$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$margin$2(this));
        this.items$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$items$2(this));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final PresentedTimelinePartial getPresentedPartial() {
        return (PresentedTimelinePartial) this.presentedPartial$delegate.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Multi-variable type inference failed */
    public final c getWindowSize() {
        return (c) this.windowSize$delegate.getValue();
    }

    private final void setWindowSize(c cVar) {
        this.windowSize$delegate.setValue(cVar);
    }

    public static /* synthetic */ void update$default(TimelineComponentState timelineComponentState, c cVar, int i6, Object obj) {
        if ((i6 & 1) != 0) {
            cVar = null;
        }
        timelineComponentState.update(cVar);
    }

    public final /* synthetic */ int getColumnGutter() {
        return ((Number) this.columnGutter$delegate.getValue()).intValue();
    }

    public final /* synthetic */ TimelineComponent.IconAlignment getIconAlignment() {
        return (TimelineComponent.IconAlignment) this.iconAlignment$delegate.getValue();
    }

    public final /* synthetic */ int getItemSpacing() {
        return ((Number) this.itemSpacing$delegate.getValue()).intValue();
    }

    public final /* synthetic */ List getItems() {
        return (List) this.items$delegate.getValue();
    }

    public final /* synthetic */ H0 getMargin() {
        return (H0) this.margin$delegate.getValue();
    }

    public final /* synthetic */ H0 getPadding() {
        return (H0) this.padding$delegate.getValue();
    }

    public final /* synthetic */ Size getSize() {
        return (Size) this.size$delegate.getValue();
    }

    public final /* synthetic */ int getTextSpacing() {
        return ((Number) this.textSpacing$delegate.getValue()).intValue();
    }

    public final /* synthetic */ boolean getVisible() {
        return ((Boolean) this.visible$delegate.getValue()).booleanValue();
    }

    public final /* synthetic */ void update(c cVar) {
        if (cVar != null) {
            setWindowSize(cVar);
        }
    }

    @Stable
    public static final class ItemState {
        public static final int $stable = 0;
        private final State connector$delegate;
        private final a customVariablesProvider;
        private final State description$delegate;
        private final State icon$delegate;
        private final PackageAwareDelegate packageAwareDelegate;
        private final State presentedPartial$delegate;
        private final a selectedOfferEligibilityProvider;
        private final a selectedPackageInfoProvider;
        private final a selectedTabIndexProvider;
        private final TimelineComponentStyle.ItemStyle style;
        private final State title$delegate;
        private final State visible$delegate;
        private final MutableState windowSize$delegate;

        /* JADX INFO: renamed from: com.revenuecat.purchases.ui.revenuecatui.components.timeline.TimelineComponentState$ItemState$1, reason: invalid class name */
        public static final class AnonymousClass1 extends p implements a {
            public static final AnonymousClass1 INSTANCE = new AnonymousClass1();

            public AnonymousClass1() {
                super(0);
            }

            @Override // J4.a
            public final Map<String, CustomVariableValue> invoke() {
                return z.f26066a;
            }
        }

        public ItemState(c initialWindowSize, TimelineComponentStyle.ItemStyle style, a selectedPackageInfoProvider, a selectedTabIndexProvider, a selectedOfferEligibilityProvider, a customVariablesProvider) {
            o.h(initialWindowSize, "initialWindowSize");
            o.h(style, "style");
            o.h(selectedPackageInfoProvider, "selectedPackageInfoProvider");
            o.h(selectedTabIndexProvider, "selectedTabIndexProvider");
            o.h(selectedOfferEligibilityProvider, "selectedOfferEligibilityProvider");
            o.h(customVariablesProvider, "customVariablesProvider");
            this.style = style;
            this.selectedPackageInfoProvider = selectedPackageInfoProvider;
            this.selectedTabIndexProvider = selectedTabIndexProvider;
            this.selectedOfferEligibilityProvider = selectedOfferEligibilityProvider;
            this.customVariablesProvider = customVariablesProvider;
            this.windowSize$delegate = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(initialWindowSize, null, 2, null);
            this.packageAwareDelegate = new PackageAwareDelegate(style, selectedPackageInfoProvider, selectedTabIndexProvider, selectedOfferEligibilityProvider);
            this.presentedPartial$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$ItemState$presentedPartial$2(this));
            this.visible$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$ItemState$visible$2(this));
            this.title$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$ItemState$title$2(this));
            this.description$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$ItemState$description$2(this));
            this.icon$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$ItemState$icon$2(this));
            this.connector$delegate = SnapshotStateKt.derivedStateOf(new TimelineComponentState$ItemState$connector$2(this));
        }

        /* JADX INFO: Access modifiers changed from: private */
        public final PresentedTimelineItemPartial getPresentedPartial() {
            return (PresentedTimelineItemPartial) this.presentedPartial$delegate.getValue();
        }

        /* JADX INFO: Access modifiers changed from: private */
        /* JADX WARN: Multi-variable type inference failed */
        public final c getWindowSize() {
            return (c) this.windowSize$delegate.getValue();
        }

        private final void setWindowSize(c cVar) {
            this.windowSize$delegate.setValue(cVar);
        }

        public static /* synthetic */ void update$default(ItemState itemState, c cVar, int i6, Object obj) {
            if ((i6 & 1) != 0) {
                cVar = null;
            }
            itemState.update(cVar);
        }

        public final /* synthetic */ TimelineComponentStyle.ConnectorStyle getConnector() {
            return (TimelineComponentStyle.ConnectorStyle) this.connector$delegate.getValue();
        }

        public final /* synthetic */ TextComponentStyle getDescription() {
            return (TextComponentStyle) this.description$delegate.getValue();
        }

        public final /* synthetic */ IconComponentStyle getIcon() {
            return (IconComponentStyle) this.icon$delegate.getValue();
        }

        public final /* synthetic */ TextComponentStyle getTitle() {
            return (TextComponentStyle) this.title$delegate.getValue();
        }

        public final /* synthetic */ boolean getVisible() {
            return ((Boolean) this.visible$delegate.getValue()).booleanValue();
        }

        public final /* synthetic */ void update(c cVar) {
            if (cVar != null) {
                setWindowSize(cVar);
            }
        }

        public /* synthetic */ ItemState(c cVar, TimelineComponentStyle.ItemStyle itemStyle, a aVar, a aVar2, a aVar3, a aVar4, int i6, h hVar) {
            this(cVar, itemStyle, aVar, aVar2, aVar3, (i6 & 32) != 0 ? AnonymousClass1.INSTANCE : aVar4);
        }
    }

    public /* synthetic */ TimelineComponentState(c cVar, TimelineComponentStyle timelineComponentStyle, a aVar, a aVar2, a aVar3, a aVar4, int i6, h hVar) {
        this(cVar, timelineComponentStyle, aVar, aVar2, aVar3, (i6 & 32) != 0 ? AnonymousClass1.INSTANCE : aVar4);
    }
}
