package com.revenuecat.purchases.paywalls.components;

import androidx.compose.runtime.Immutable;
import com.revenuecat.purchases.FontAlias;
import com.revenuecat.purchases.FontAlias$$serializer;
import com.revenuecat.purchases.InternalRevenueCatAPI;
import com.revenuecat.purchases.paywalls.components.common.ComponentOverride;
import com.revenuecat.purchases.paywalls.components.common.LocalizationKey;
import com.revenuecat.purchases.paywalls.components.common.LocalizationKey$$serializer;
import com.revenuecat.purchases.paywalls.components.properties.ColorScheme;
import com.revenuecat.purchases.paywalls.components.properties.ColorScheme$$serializer;
import com.revenuecat.purchases.paywalls.components.properties.FontWeight;
import com.revenuecat.purchases.paywalls.components.properties.FontWeightDeserializer;
import com.revenuecat.purchases.paywalls.components.properties.HorizontalAlignment;
import com.revenuecat.purchases.paywalls.components.properties.HorizontalAlignmentDeserializer;
import com.revenuecat.purchases.paywalls.components.properties.Padding;
import com.revenuecat.purchases.paywalls.components.properties.Padding$$serializer;
import com.revenuecat.purchases.paywalls.components.properties.Size;
import com.revenuecat.purchases.paywalls.components.properties.Size$$serializer;
import com.revenuecat.purchases.paywalls.components.properties.SizeConstraint;
import g5.a;
import i5.g;
import j5.b;
import java.util.List;
import k5.C2416d;
import k5.C2419g;
import k5.F;
import k5.P;
import k5.a0;
import kotlin.jvm.internal.h;
import kotlin.jvm.internal.o;
import w4.InterfaceC3141c;
import x4.y;

/* JADX INFO: loaded from: classes3.dex */
@Immutable
@InternalRevenueCatAPI
public final class TextComponent implements PaywallComponent {
    private final ColorScheme backgroundColor;
    private final ColorScheme color;
    private final String fontName;
    private final int fontSize;
    private final FontWeight fontWeight;
    private final Integer fontWeightInt;
    private final HorizontalAlignment horizontalAlignment;
    private final Padding margin;
    private final List<ComponentOverride<PartialTextComponent>> overrides;
    private final Padding padding;
    private final Size size;
    private final String text;
    private final Boolean visible;
    public static final Companion Companion = new Companion(null);
    private static final a[] $childSerializers = {null, null, null, null, null, null, null, null, null, null, null, null, new C2416d(ComponentOverride.Companion.serializer(PartialTextComponent$$serializer.INSTANCE))};

    public static final class Companion {
        public /* synthetic */ Companion(h hVar) {
            this();
        }

        public final a serializer() {
            return TextComponent$$serializer.INSTANCE;
        }

        private Companion() {
        }
    }

    @InterfaceC3141c
    public /* synthetic */ TextComponent(int i6, String str, ColorScheme colorScheme, Boolean bool, ColorScheme colorScheme2, String str2, FontWeight fontWeight, Integer num, int i7, HorizontalAlignment horizontalAlignment, Size size, Padding padding, Padding padding2, List list, a0 a0Var, h hVar) {
        this(i6, str, colorScheme, bool, colorScheme2, str2, fontWeight, num, i7, horizontalAlignment, size, padding, padding2, (List<ComponentOverride<PartialTextComponent>>) list, a0Var);
    }

    public static /* synthetic */ void getBackgroundColor$annotations() {
    }

    /* JADX INFO: renamed from: getFontName-ARcRonI$annotations, reason: not valid java name */
    public static /* synthetic */ void m564getFontNameARcRonI$annotations() {
    }

    public static /* synthetic */ void getFontSize$annotations() {
    }

    public static /* synthetic */ void getFontWeight$annotations() {
    }

    public static /* synthetic */ void getFontWeightInt$annotations() {
    }

    public static /* synthetic */ void getHorizontalAlignment$annotations() {
    }

    /* JADX INFO: renamed from: getText-z7Tp-4o$annotations, reason: not valid java name */
    public static /* synthetic */ void m565getTextz7Tp4o$annotations() {
    }

    public static final /* synthetic */ void write$Self$purchases_defaultsBc8Release(TextComponent textComponent, b bVar, g gVar) {
        a[] aVarArr = $childSerializers;
        bVar.z(gVar, 0, LocalizationKey$$serializer.INSTANCE, LocalizationKey.m607boximpl(textComponent.text));
        ColorScheme$$serializer colorScheme$$serializer = ColorScheme$$serializer.INSTANCE;
        bVar.z(gVar, 1, colorScheme$$serializer, textComponent.color);
        if (bVar.g(gVar) || textComponent.visible != null) {
            bVar.E(gVar, 2, C2419g.f20053a, textComponent.visible);
        }
        if (bVar.g(gVar) || textComponent.backgroundColor != null) {
            bVar.E(gVar, 3, colorScheme$$serializer, textComponent.backgroundColor);
        }
        if (bVar.g(gVar) || textComponent.fontName != null) {
            FontAlias$$serializer fontAlias$$serializer = FontAlias$$serializer.INSTANCE;
            String str = textComponent.fontName;
            bVar.E(gVar, 4, fontAlias$$serializer, str != null ? FontAlias.m396boximpl(str) : null);
        }
        if (bVar.g(gVar) || textComponent.fontWeight != FontWeight.REGULAR) {
            bVar.z(gVar, 5, FontWeightDeserializer.INSTANCE, textComponent.fontWeight);
        }
        if (bVar.g(gVar) || textComponent.fontWeightInt != null) {
            bVar.E(gVar, 6, F.f19995a, textComponent.fontWeightInt);
        }
        if (bVar.g(gVar) || textComponent.fontSize != 15) {
            bVar.z(gVar, 7, FontSizeSerializer.INSTANCE, Integer.valueOf(textComponent.fontSize));
        }
        if (bVar.g(gVar) || textComponent.horizontalAlignment != HorizontalAlignment.CENTER) {
            bVar.z(gVar, 8, HorizontalAlignmentDeserializer.INSTANCE, textComponent.horizontalAlignment);
        }
        if (bVar.g(gVar) || !o.c(textComponent.size, new Size(SizeConstraint.Fill.INSTANCE, SizeConstraint.Fit.INSTANCE))) {
            bVar.z(gVar, 9, Size$$serializer.INSTANCE, textComponent.size);
        }
        if (bVar.g(gVar) || !o.c(textComponent.padding, Padding.Companion.getZero())) {
            bVar.z(gVar, 10, Padding$$serializer.INSTANCE, textComponent.padding);
        }
        if (bVar.g(gVar) || !o.c(textComponent.margin, Padding.Companion.getZero())) {
            bVar.z(gVar, 11, Padding$$serializer.INSTANCE, textComponent.margin);
        }
        if (!bVar.g(gVar) && o.c(textComponent.overrides, y.f26065a)) {
            return;
        }
        bVar.z(gVar, 12, aVarArr[12], textComponent.overrides);
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x0042  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean equals(Object obj) {
        boolean zM399equalsimpl0;
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof TextComponent)) {
            return false;
        }
        TextComponent textComponent = (TextComponent) obj;
        if (!LocalizationKey.m610equalsimpl0(this.text, textComponent.text) || !o.c(this.color, textComponent.color) || !o.c(this.visible, textComponent.visible) || !o.c(this.backgroundColor, textComponent.backgroundColor)) {
            return false;
        }
        String str = this.fontName;
        String str2 = textComponent.fontName;
        if (str == null) {
            zM399equalsimpl0 = str2 == null;
        } else if (str2 != null) {
            zM399equalsimpl0 = FontAlias.m399equalsimpl0(str, str2);
        }
        return zM399equalsimpl0 && this.fontWeight == textComponent.fontWeight && o.c(this.fontWeightInt, textComponent.fontWeightInt) && this.fontSize == textComponent.fontSize && this.horizontalAlignment == textComponent.horizontalAlignment && o.c(this.size, textComponent.size) && o.c(this.padding, textComponent.padding) && o.c(this.margin, textComponent.margin) && o.c(this.overrides, textComponent.overrides);
    }

    public final /* synthetic */ ColorScheme getBackgroundColor() {
        return this.backgroundColor;
    }

    public final /* synthetic */ ColorScheme getColor() {
        return this.color;
    }

    /* JADX INFO: renamed from: getFontName-ARcRonI, reason: not valid java name */
    public final /* synthetic */ String m566getFontNameARcRonI() {
        return this.fontName;
    }

    public final /* synthetic */ int getFontSize() {
        return this.fontSize;
    }

    public final /* synthetic */ FontWeight getFontWeight() {
        return this.fontWeight;
    }

    public final /* synthetic */ Integer getFontWeightInt() {
        return this.fontWeightInt;
    }

    public final /* synthetic */ HorizontalAlignment getHorizontalAlignment() {
        return this.horizontalAlignment;
    }

    public final /* synthetic */ Padding getMargin() {
        return this.margin;
    }

    public final /* synthetic */ List getOverrides() {
        return this.overrides;
    }

    public final /* synthetic */ Padding getPadding() {
        return this.padding;
    }

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

    /* JADX INFO: renamed from: getText-z7Tp-4o, reason: not valid java name */
    public final /* synthetic */ String m567getTextz7Tp4o() {
        return this.text;
    }

    public final /* synthetic */ Boolean getVisible() {
        return this.visible;
    }

    public int hashCode() {
        int iHashCode = (this.color.hashCode() + (LocalizationKey.m611hashCodeimpl(this.text) * 31)) * 31;
        Boolean bool = this.visible;
        int iHashCode2 = (iHashCode + (bool == null ? 0 : bool.hashCode())) * 31;
        ColorScheme colorScheme = this.backgroundColor;
        int iHashCode3 = (iHashCode2 + (colorScheme == null ? 0 : colorScheme.hashCode())) * 31;
        String str = this.fontName;
        int iHashCode4 = (this.fontWeight.hashCode() + ((iHashCode3 + (str == null ? 0 : FontAlias.m400hashCodeimpl(str))) * 31)) * 31;
        Integer num = this.fontWeightInt;
        return this.overrides.hashCode() + ((this.margin.hashCode() + ((this.padding.hashCode() + ((this.size.hashCode() + ((this.horizontalAlignment.hashCode() + ((((iHashCode4 + (num != null ? num.hashCode() : 0)) * 31) + this.fontSize) * 31)) * 31)) * 31)) * 31)) * 31);
    }

    public String toString() {
        StringBuilder sb = new StringBuilder("TextComponent(text=");
        sb.append((Object) LocalizationKey.m612toStringimpl(this.text));
        sb.append(", color=");
        sb.append(this.color);
        sb.append(", visible=");
        sb.append(this.visible);
        sb.append(", backgroundColor=");
        sb.append(this.backgroundColor);
        sb.append(", fontName=");
        String str = this.fontName;
        sb.append((Object) (str == null ? "null" : FontAlias.m401toStringimpl(str)));
        sb.append(", fontWeight=");
        sb.append(this.fontWeight);
        sb.append(", fontWeightInt=");
        sb.append(this.fontWeightInt);
        sb.append(", fontSize=");
        sb.append(this.fontSize);
        sb.append(", horizontalAlignment=");
        sb.append(this.horizontalAlignment);
        sb.append(", size=");
        sb.append(this.size);
        sb.append(", padding=");
        sb.append(this.padding);
        sb.append(", margin=");
        sb.append(this.margin);
        sb.append(", overrides=");
        return A0.a.o(sb, this.overrides, ')');
    }

    public /* synthetic */ TextComponent(String str, ColorScheme colorScheme, Boolean bool, ColorScheme colorScheme2, String str2, FontWeight fontWeight, Integer num, int i6, HorizontalAlignment horizontalAlignment, Size size, Padding padding, Padding padding2, List list, h hVar) {
        this(str, colorScheme, bool, colorScheme2, str2, fontWeight, num, i6, horizontalAlignment, size, padding, padding2, list);
    }

    private TextComponent(int i6, String str, ColorScheme colorScheme, Boolean bool, ColorScheme colorScheme2, String str2, FontWeight fontWeight, Integer num, int i7, HorizontalAlignment horizontalAlignment, Size size, Padding padding, Padding padding2, List<ComponentOverride<PartialTextComponent>> list, a0 a0Var) {
        if (3 != (i6 & 3)) {
            P.h(i6, 3, TextComponent$$serializer.INSTANCE.getDescriptor());
            throw null;
        }
        this.text = str;
        this.color = colorScheme;
        if ((i6 & 4) == 0) {
            this.visible = null;
        } else {
            this.visible = bool;
        }
        if ((i6 & 8) == 0) {
            this.backgroundColor = null;
        } else {
            this.backgroundColor = colorScheme2;
        }
        if ((i6 & 16) == 0) {
            this.fontName = null;
        } else {
            this.fontName = str2;
        }
        if ((i6 & 32) == 0) {
            this.fontWeight = FontWeight.REGULAR;
        } else {
            this.fontWeight = fontWeight;
        }
        if ((i6 & 64) == 0) {
            this.fontWeightInt = null;
        } else {
            this.fontWeightInt = num;
        }
        if ((i6 & 128) == 0) {
            this.fontSize = 15;
        } else {
            this.fontSize = i7;
        }
        if ((i6 & 256) == 0) {
            this.horizontalAlignment = HorizontalAlignment.CENTER;
        } else {
            this.horizontalAlignment = horizontalAlignment;
        }
        if ((i6 & 512) == 0) {
            this.size = new Size(SizeConstraint.Fill.INSTANCE, SizeConstraint.Fit.INSTANCE);
        } else {
            this.size = size;
        }
        if ((i6 & 1024) == 0) {
            this.padding = Padding.Companion.getZero();
        } else {
            this.padding = padding;
        }
        this.margin = (i6 & 2048) == 0 ? Padding.Companion.getZero() : padding2;
        this.overrides = (i6 & 4096) == 0 ? y.f26065a : list;
    }

    private TextComponent(String text, ColorScheme color, Boolean bool, ColorScheme colorScheme, String str, FontWeight fontWeight, Integer num, int i6, HorizontalAlignment horizontalAlignment, Size size, Padding padding, Padding margin, List<ComponentOverride<PartialTextComponent>> overrides) {
        o.h(text, "text");
        o.h(color, "color");
        o.h(fontWeight, "fontWeight");
        o.h(horizontalAlignment, "horizontalAlignment");
        o.h(size, "size");
        o.h(padding, "padding");
        o.h(margin, "margin");
        o.h(overrides, "overrides");
        this.text = text;
        this.color = color;
        this.visible = bool;
        this.backgroundColor = colorScheme;
        this.fontName = str;
        this.fontWeight = fontWeight;
        this.fontWeightInt = num;
        this.fontSize = i6;
        this.horizontalAlignment = horizontalAlignment;
        this.size = size;
        this.padding = padding;
        this.margin = margin;
        this.overrides = overrides;
    }

    public /* synthetic */ TextComponent(String str, ColorScheme colorScheme, Boolean bool, ColorScheme colorScheme2, String str2, FontWeight fontWeight, Integer num, int i6, HorizontalAlignment horizontalAlignment, Size size, Padding padding, Padding padding2, List list, int i7, h hVar) {
        this(str, colorScheme, (i7 & 4) != 0 ? null : bool, (i7 & 8) != 0 ? null : colorScheme2, (i7 & 16) != 0 ? null : str2, (i7 & 32) != 0 ? FontWeight.REGULAR : fontWeight, (i7 & 64) != 0 ? null : num, (i7 & 128) != 0 ? 15 : i6, (i7 & 256) != 0 ? HorizontalAlignment.CENTER : horizontalAlignment, (i7 & 512) != 0 ? new Size(SizeConstraint.Fill.INSTANCE, SizeConstraint.Fit.INSTANCE) : size, (i7 & 1024) != 0 ? Padding.Companion.getZero() : padding, (i7 & 2048) != 0 ? Padding.Companion.getZero() : padding2, (i7 & 4096) != 0 ? y.f26065a : list, null);
    }
}
