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

import J4.a;
import com.revenuecat.purchases.ui.revenuecatui.data.PaywallState;
import com.revenuecat.purchases.ui.revenuecatui.extensions.PackageExtensionsKt;
import kotlin.jvm.internal.p;

/* JADX INFO: loaded from: classes3.dex */
public final class PaywallState$Loaded$Components$selectedPackageInfo$2 extends p implements a {
    final /* synthetic */ PaywallState.Loaded.Components this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public PaywallState$Loaded$Components$selectedPackageInfo$2(PaywallState.Loaded.Components components) {
        super(0);
        this.this$0 = components;
    }

    @Override // J4.a
    public final PaywallState.Loaded.Components.SelectedPackageInfo invoke() {
        PaywallState.Loaded.Components.AvailablePackages.Info infoFindPackageInfoByUniqueId;
        String selectedPackageUniqueId = this.this$0.getSelectedPackageUniqueId();
        if (selectedPackageUniqueId == null || (infoFindPackageInfoByUniqueId = this.this$0.findPackageInfoByUniqueId(selectedPackageUniqueId)) == null) {
            return null;
        }
        return new PaywallState.Loaded.Components.SelectedPackageInfo(infoFindPackageInfoByUniqueId.getPkg(), infoFindPackageInfoByUniqueId.getResolvedOffer(), selectedPackageUniqueId, PackageExtensionsKt.calculateOfferEligibility(infoFindPackageInfoByUniqueId.getResolvedOffer(), infoFindPackageInfoByUniqueId.getPkg()));
    }
}
