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

import android.graphics.Shader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import kotlin.jvm.internal.h;
import kotlin.jvm.internal.o;
import m3.AbstractC2478m;
import o0.C2631b;
import o0.e;
import p0.AbstractC2686D;
import p0.C2714u;
import w4.k;

/* JADX INFO: loaded from: classes3.dex */
final class RadialGradient extends GradientBrush {
    private final long center;
    private final k[] colorStopsArray;
    private final List<C2714u> colors;
    private final float radius;
    private final int tileMode;

    public /* synthetic */ RadialGradient(k[] kVarArr, long j4, float f6, int i6, h hVar) {
        this(kVarArr, j4, f6, i6);
    }

    @Override // p0.V
    /* JADX INFO: renamed from: createShader-uvyYCjk, reason: not valid java name */
    public Shader mo746createShaderuvyYCjk(long j4) {
        float fMax = this.radius;
        if (fMax == Float.POSITIVE_INFINITY) {
            fMax = Math.max(e.d(j4), e.b(j4)) / 2.0f;
        }
        float f6 = fMax;
        long jK = C2631b.b(this.center, 9205357640488583168L) ? AbstractC2478m.k(j4) : this.center;
        k[] kVarArr = this.colorStopsArray;
        ArrayList arrayList = new ArrayList(kVarArr.length);
        for (k kVar : kVarArr) {
            arrayList.add(new C2714u(((C2714u) kVar.f25470b).f22947a));
        }
        k[] kVarArr2 = this.colorStopsArray;
        ArrayList arrayList2 = new ArrayList(kVarArr2.length);
        for (k kVar2 : kVarArr2) {
            arrayList2.add(Float.valueOf(((Number) kVar2.f25469a).floatValue()));
        }
        int i6 = this.tileMode;
        AbstractC2686D.O(arrayList, arrayList2);
        int iN = AbstractC2686D.n(arrayList);
        return new android.graphics.RadialGradient(Float.intBitsToFloat((int) (jK >> 32)), Float.intBitsToFloat((int) (jK & 4294967295L)), f6, AbstractC2686D.z(iN, arrayList), AbstractC2686D.A(arrayList2, iN, arrayList), AbstractC2686D.H(i6));
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof RadialGradient)) {
            return false;
        }
        RadialGradient radialGradient = (RadialGradient) obj;
        return Arrays.equals(radialGradient.colorStopsArray, this.colorStopsArray) && C2631b.b(radialGradient.center, this.center) && radialGradient.radius == this.radius && radialGradient.tileMode == this.tileMode;
    }

    @Override // com.revenuecat.purchases.ui.revenuecatui.components.properties.GradientBrush
    public List<C2714u> getColors$revenuecatui_defaultsBc8Release() {
        return this.colors;
    }

    public int hashCode() {
        return Integer.hashCode(this.tileMode) + (Float.hashCode(this.radius) * 31) + (Long.hashCode(this.center) * 31) + (Arrays.hashCode(this.colorStopsArray) * 31);
    }

    public String toString() {
        StringBuilder sb = new StringBuilder("RadialGradient(colorStops=");
        String string = Arrays.toString(this.colorStopsArray);
        o.g(string, "toString(...)");
        sb.append(string);
        sb.append(')');
        return sb.toString();
    }

    public /* synthetic */ RadialGradient(k[] kVarArr, long j4, float f6, int i6, int i7, h hVar) {
        this(kVarArr, (i7 & 2) != 0 ? 9205357640488583168L : j4, (i7 & 4) != 0 ? Float.POSITIVE_INFINITY : f6, (i7 & 8) != 0 ? 0 : i6, null);
    }

    private RadialGradient(k[] colorStops, long j4, float f6, int i6) {
        o.h(colorStops, "colorStops");
        this.center = j4;
        this.radius = f6;
        this.tileMode = i6;
        this.colorStopsArray = colorStops;
        ArrayList arrayList = new ArrayList(colorStops.length);
        for (k kVar : colorStops) {
            arrayList.add(new C2714u(((C2714u) kVar.f25470b).f22947a));
        }
        this.colors = arrayList;
    }
}
