package com.revenuecat.purchases.ui.revenuecatui.utils;

import androidx.media3.common.PlaybackException;
import com.revenuecat.purchases.PresentedOfferingContext;
import com.revenuecat.purchases.models.InstallmentsInfo;
import com.revenuecat.purchases.models.Period;
import com.revenuecat.purchases.models.Price;
import com.revenuecat.purchases.models.PricingPhase;
import com.revenuecat.purchases.models.PurchasingData;
import com.revenuecat.purchases.models.RecurrenceMode;
import com.revenuecat.purchases.models.RecurrenceModeKt;
import com.revenuecat.purchases.models.SubscriptionOption;
import java.util.List;
import kotlin.jvm.internal.o;
import n2.AbstractC2612c;

/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class PreviewDataCreatorsKt {
    public static final /* synthetic */ PricingPhase previewPricingPhase(Period billingPeriod, String priceCurrencyCodeValue, double d6, int i6, Integer num) {
        String str;
        o.h(billingPeriod, "billingPeriod");
        o.h(priceCurrencyCodeValue, "priceCurrencyCodeValue");
        RecurrenceMode recurrenceMode = RecurrenceModeKt.toRecurrenceMode(Integer.valueOf(i6));
        if (d6 == 0.0d) {
            str = "Free";
        } else {
            str = "$" + d6;
        }
        return new PricingPhase(billingPeriod, recurrenceMode, num, new Price(str, (long) (d6 * ((double) PlaybackException.CUSTOM_ERROR_CODE_BASE)), priceCurrencyCodeValue));
    }

    public static /* synthetic */ PricingPhase previewPricingPhase$default(Period period, String str, double d6, int i6, Integer num, int i7, Object obj) {
        if ((i7 & 1) != 0) {
            period = new Period(1, Period.Unit.MONTH, "P1M");
        }
        if ((i7 & 2) != 0) {
            str = "USD";
        }
        if ((i7 & 4) != 0) {
            d6 = 4.99d;
        }
        if ((i7 & 8) != 0) {
            i6 = 1;
        }
        if ((i7 & 16) != 0) {
            num = null;
        }
        double d7 = d6;
        return previewPricingPhase(period, str, d7, i6, num);
    }

    public static final /* synthetic */ SubscriptionOption previewSubscriptionOption(final String id, final String productId, Period duration, final List pricingPhases, final PresentedOfferingContext presentedOfferingContext, final InstallmentsInfo installmentsInfo) {
        o.h(id, "id");
        o.h(productId, "productId");
        o.h(duration, "duration");
        o.h(pricingPhases, "pricingPhases");
        return new SubscriptionOption() { // from class: com.revenuecat.purchases.ui.revenuecatui.utils.PreviewDataCreatorsKt.previewSubscriptionOption.1
            @Override // com.revenuecat.purchases.models.SubscriptionOption
            public String getId() {
                return id;
            }

            @Override // com.revenuecat.purchases.models.SubscriptionOption
            public InstallmentsInfo getInstallmentsInfo() {
                return installmentsInfo;
            }

            @Override // com.revenuecat.purchases.models.SubscriptionOption
            public PresentedOfferingContext getPresentedOfferingContext() {
                return presentedOfferingContext;
            }

            @Override // com.revenuecat.purchases.models.SubscriptionOption
            public String getPresentedOfferingIdentifier() {
                PresentedOfferingContext presentedOfferingContext2 = presentedOfferingContext;
                if (presentedOfferingContext2 != null) {
                    return presentedOfferingContext2.getOfferingIdentifier();
                }
                return null;
            }

            @Override // com.revenuecat.purchases.models.SubscriptionOption
            public List<PricingPhase> getPricingPhases() {
                return pricingPhases;
            }

            @Override // com.revenuecat.purchases.models.SubscriptionOption
            public PurchasingData getPurchasingData() {
                return new PreviewPurchasingData(productId);
            }

            @Override // com.revenuecat.purchases.models.SubscriptionOption
            public List<String> getTags() {
                return AbstractC2612c.q("tag");
            }
        };
    }

    public static /* synthetic */ SubscriptionOption previewSubscriptionOption$default(String str, String str2, Period period, List list, PresentedOfferingContext presentedOfferingContext, InstallmentsInfo installmentsInfo, int i6, Object obj) {
        if ((i6 & 4) != 0) {
            period = new Period(1, Period.Unit.MONTH, "P1M");
        }
        Period period2 = period;
        if ((i6 & 8) != 0) {
            list = AbstractC2612c.q(previewPricingPhase$default(period2, null, 0.0d, 0, null, 30, null));
        }
        return previewSubscriptionOption(str, str2, period2, list, (i6 & 16) != 0 ? null : presentedOfferingContext, (i6 & 32) != 0 ? null : installmentsInfo);
    }
}
