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

import J4.a;
import com.revenuecat.purchases.paywalls.components.PartialImageComponent;
import com.revenuecat.purchases.paywalls.components.properties.Size;
import com.revenuecat.purchases.ui.revenuecatui.components.PresentedImagePartial;
import kotlin.jvm.internal.p;

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public ImageComponentState$size$2(ImageComponentState imageComponentState) {
        super(0);
        this.this$0 = imageComponentState;
    }

    @Override // J4.a
    public final Size invoke() {
        Size size;
        PartialImageComponent partial;
        ImageComponentState imageComponentState = this.this$0;
        PresentedImagePartial presentedPartial = imageComponentState.getPresentedPartial();
        if (presentedPartial == null || (partial = presentedPartial.getPartial()) == null || (size = partial.getSize()) == null) {
            size = this.this$0.style.getSize();
        }
        return imageComponentState.adjustForImage(size, this.this$0.getImageUrls(), this.this$0.getDensity());
    }
}
