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

import E3.v;
import com.revenuecat.purchases.paywalls.components.properties.Size;
import com.revenuecat.purchases.paywalls.components.properties.SizeConstraint;
import com.revenuecat.purchases.ui.revenuecatui.components.modifier.AspectRatio;
import kotlin.jvm.internal.p;
import n2.AbstractC2612c;

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

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

    @Override // J4.a
    public final AspectRatio invoke() {
        Size size = this.this$0.getSize();
        VideoComponentState videoComponentState = this.this$0;
        SizeConstraint height = size.getHeight();
        if (height instanceof SizeConstraint.Fit) {
            SizeConstraint width = size.getWidth();
            if (!(width instanceof SizeConstraint.Fit) && !(width instanceof SizeConstraint.Fill)) {
                if (width instanceof SizeConstraint.Fixed) {
                    return null;
                }
                throw new v();
            }
            return new AspectRatio(videoComponentState.getVideoAspectRatio(), true);
        }
        if (height instanceof SizeConstraint.Fill) {
            SizeConstraint width2 = size.getWidth();
            if (width2 instanceof SizeConstraint.Fit) {
                return new AspectRatio(videoComponentState.getVideoAspectRatio(), false);
            }
            if ((width2 instanceof SizeConstraint.Fill) || (width2 instanceof SizeConstraint.Fixed)) {
                return null;
            }
            throw new v();
        }
        if (!(height instanceof SizeConstraint.Fixed)) {
            throw new v();
        }
        SizeConstraint width3 = size.getWidth();
        if ((width3 instanceof SizeConstraint.Fit) || (width3 instanceof SizeConstraint.Fill)) {
            return null;
        }
        if (width3 instanceof SizeConstraint.Fixed) {
            return new AspectRatio(((float) AbstractC2612c.u(((SizeConstraint.Fixed) width3).m621getValuepVg5ArA())) / ((float) AbstractC2612c.u(((SizeConstraint.Fixed) height).m621getValuepVg5ArA())), true);
        }
        throw new v();
    }
}
