package c1;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;

/* JADX INFO: compiled from: ShapeAppearanceModel.java */
/* JADX INFO: loaded from: classes.dex */
public class k {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    d f3430a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    d f3431b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    d f3432c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    d f3433d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    c1.c f3434e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    c1.c f3435f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    c1.c f3436g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    c1.c f3437h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    f f3438i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    f f3439j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    f f3440k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    f f3441l;

    /* JADX INFO: compiled from: ShapeAppearanceModel.java */
    public interface c {
        c1.c a(c1.c cVar);
    }

    static {
        new i(0.5f);
    }

    public static b a() {
        return new b();
    }

    public static b b(Context context, int i3, int i4) {
        return c(context, i3, i4, 0);
    }

    private static b c(Context context, int i3, int i4, int i5) {
        return d(context, i3, i4, new c1.a(i5));
    }

    private static b d(Context context, int i3, int i4, c1.c cVar) {
        if (i4 != 0) {
            ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(context, i3);
            i3 = i4;
            context = contextThemeWrapper;
        }
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(i3, l0.k.p2);
        try {
            int i5 = typedArrayObtainStyledAttributes.getInt(l0.k.q2, 0);
            int i6 = typedArrayObtainStyledAttributes.getInt(l0.k.t2, i5);
            int i7 = typedArrayObtainStyledAttributes.getInt(l0.k.u2, i5);
            int i8 = typedArrayObtainStyledAttributes.getInt(l0.k.s2, i5);
            int i9 = typedArrayObtainStyledAttributes.getInt(l0.k.r2, i5);
            c1.c cVarM = m(typedArrayObtainStyledAttributes, l0.k.v2, cVar);
            c1.c cVarM2 = m(typedArrayObtainStyledAttributes, l0.k.y2, cVarM);
            c1.c cVarM3 = m(typedArrayObtainStyledAttributes, l0.k.z2, cVarM);
            c1.c cVarM4 = m(typedArrayObtainStyledAttributes, l0.k.x2, cVarM);
            return new b().y(i6, cVarM2).C(i7, cVarM3).u(i8, cVarM4).q(i9, m(typedArrayObtainStyledAttributes, l0.k.w2, cVarM));
        } finally {
            typedArrayObtainStyledAttributes.recycle();
        }
    }

    public static b e(Context context, AttributeSet attributeSet, int i3, int i4) {
        return f(context, attributeSet, i3, i4, 0);
    }

    public static b f(Context context, AttributeSet attributeSet, int i3, int i4, int i5) {
        return g(context, attributeSet, i3, i4, new c1.a(i5));
    }

    public static b g(Context context, AttributeSet attributeSet, int i3, int i4, c1.c cVar) {
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, l0.k.U1, i3, i4);
        int resourceId = typedArrayObtainStyledAttributes.getResourceId(l0.k.V1, 0);
        int resourceId2 = typedArrayObtainStyledAttributes.getResourceId(l0.k.W1, 0);
        typedArrayObtainStyledAttributes.recycle();
        return d(context, resourceId, resourceId2, cVar);
    }

    private static c1.c m(TypedArray typedArray, int i3, c1.c cVar) {
        TypedValue typedValuePeekValue = typedArray.peekValue(i3);
        if (typedValuePeekValue == null) {
            return cVar;
        }
        int i4 = typedValuePeekValue.type;
        return i4 == 5 ? new c1.a(TypedValue.complexToDimensionPixelSize(typedValuePeekValue.data, typedArray.getResources().getDisplayMetrics())) : i4 == 6 ? new i(typedValuePeekValue.getFraction(1.0f, 1.0f)) : cVar;
    }

    public f h() {
        return this.f3440k;
    }

    public d i() {
        return this.f3433d;
    }

    public c1.c j() {
        return this.f3437h;
    }

    public d k() {
        return this.f3432c;
    }

    public c1.c l() {
        return this.f3436g;
    }

    public f n() {
        return this.f3441l;
    }

    public f o() {
        return this.f3439j;
    }

    public f p() {
        return this.f3438i;
    }

    public d q() {
        return this.f3430a;
    }

    public c1.c r() {
        return this.f3434e;
    }

    public d s() {
        return this.f3431b;
    }

    public c1.c t() {
        return this.f3435f;
    }

    public boolean u(RectF rectF) {
        boolean z2 = this.f3441l.getClass().equals(f.class) && this.f3439j.getClass().equals(f.class) && this.f3438i.getClass().equals(f.class) && this.f3440k.getClass().equals(f.class);
        float fA = this.f3434e.a(rectF);
        return z2 && ((this.f3435f.a(rectF) > fA ? 1 : (this.f3435f.a(rectF) == fA ? 0 : -1)) == 0 && (this.f3437h.a(rectF) > fA ? 1 : (this.f3437h.a(rectF) == fA ? 0 : -1)) == 0 && (this.f3436g.a(rectF) > fA ? 1 : (this.f3436g.a(rectF) == fA ? 0 : -1)) == 0) && ((this.f3431b instanceof j) && (this.f3430a instanceof j) && (this.f3432c instanceof j) && (this.f3433d instanceof j));
    }

    public b v() {
        return new b(this);
    }

    public k w(float f3) {
        return v().o(f3).m();
    }

    public k x(c1.c cVar) {
        return v().p(cVar).m();
    }

    public k y(c cVar) {
        return v().B(cVar.a(r())).F(cVar.a(t())).t(cVar.a(j())).x(cVar.a(l())).m();
    }

    private k(b bVar) {
        this.f3430a = bVar.f3442a;
        this.f3431b = bVar.f3443b;
        this.f3432c = bVar.f3444c;
        this.f3433d = bVar.f3445d;
        this.f3434e = bVar.f3446e;
        this.f3435f = bVar.f3447f;
        this.f3436g = bVar.f3448g;
        this.f3437h = bVar.f3449h;
        this.f3438i = bVar.f3450i;
        this.f3439j = bVar.f3451j;
        this.f3440k = bVar.f3452k;
        this.f3441l = bVar.f3453l;
    }

    /* JADX INFO: compiled from: ShapeAppearanceModel.java */
    public static final class b {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private d f3442a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private d f3443b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private d f3444c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private d f3445d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private c1.c f3446e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private c1.c f3447f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private c1.c f3448g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        private c1.c f3449h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        private f f3450i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        private f f3451j;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        private f f3452k;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        private f f3453l;

        public b() {
            this.f3442a = h.b();
            this.f3443b = h.b();
            this.f3444c = h.b();
            this.f3445d = h.b();
            this.f3446e = new c1.a(0.0f);
            this.f3447f = new c1.a(0.0f);
            this.f3448g = new c1.a(0.0f);
            this.f3449h = new c1.a(0.0f);
            this.f3450i = h.c();
            this.f3451j = h.c();
            this.f3452k = h.c();
            this.f3453l = h.c();
        }

        private static float n(d dVar) {
            if (dVar instanceof j) {
                return ((j) dVar).f3429a;
            }
            if (dVar instanceof e) {
                return ((e) dVar).f3381a;
            }
            return -1.0f;
        }

        public b A(float f3) {
            this.f3446e = new c1.a(f3);
            return this;
        }

        public b B(c1.c cVar) {
            this.f3446e = cVar;
            return this;
        }

        public b C(int i3, c1.c cVar) {
            return D(h.a(i3)).F(cVar);
        }

        public b D(d dVar) {
            this.f3443b = dVar;
            float fN = n(dVar);
            if (fN != -1.0f) {
                E(fN);
            }
            return this;
        }

        public b E(float f3) {
            this.f3447f = new c1.a(f3);
            return this;
        }

        public b F(c1.c cVar) {
            this.f3447f = cVar;
            return this;
        }

        public k m() {
            return new k(this);
        }

        public b o(float f3) {
            return A(f3).E(f3).w(f3).s(f3);
        }

        public b p(c1.c cVar) {
            return B(cVar).F(cVar).x(cVar).t(cVar);
        }

        public b q(int i3, c1.c cVar) {
            return r(h.a(i3)).t(cVar);
        }

        public b r(d dVar) {
            this.f3445d = dVar;
            float fN = n(dVar);
            if (fN != -1.0f) {
                s(fN);
            }
            return this;
        }

        public b s(float f3) {
            this.f3449h = new c1.a(f3);
            return this;
        }

        public b t(c1.c cVar) {
            this.f3449h = cVar;
            return this;
        }

        public b u(int i3, c1.c cVar) {
            return v(h.a(i3)).x(cVar);
        }

        public b v(d dVar) {
            this.f3444c = dVar;
            float fN = n(dVar);
            if (fN != -1.0f) {
                w(fN);
            }
            return this;
        }

        public b w(float f3) {
            this.f3448g = new c1.a(f3);
            return this;
        }

        public b x(c1.c cVar) {
            this.f3448g = cVar;
            return this;
        }

        public b y(int i3, c1.c cVar) {
            return z(h.a(i3)).B(cVar);
        }

        public b z(d dVar) {
            this.f3442a = dVar;
            float fN = n(dVar);
            if (fN != -1.0f) {
                A(fN);
            }
            return this;
        }

        public b(k kVar) {
            this.f3442a = h.b();
            this.f3443b = h.b();
            this.f3444c = h.b();
            this.f3445d = h.b();
            this.f3446e = new c1.a(0.0f);
            this.f3447f = new c1.a(0.0f);
            this.f3448g = new c1.a(0.0f);
            this.f3449h = new c1.a(0.0f);
            this.f3450i = h.c();
            this.f3451j = h.c();
            this.f3452k = h.c();
            this.f3453l = h.c();
            this.f3442a = kVar.f3430a;
            this.f3443b = kVar.f3431b;
            this.f3444c = kVar.f3432c;
            this.f3445d = kVar.f3433d;
            this.f3446e = kVar.f3434e;
            this.f3447f = kVar.f3435f;
            this.f3448g = kVar.f3436g;
            this.f3449h = kVar.f3437h;
            this.f3450i = kVar.f3438i;
            this.f3451j = kVar.f3439j;
            this.f3452k = kVar.f3440k;
            this.f3453l = kVar.f3441l;
        }
    }

    public k() {
        this.f3430a = h.b();
        this.f3431b = h.b();
        this.f3432c = h.b();
        this.f3433d = h.b();
        this.f3434e = new c1.a(0.0f);
        this.f3435f = new c1.a(0.0f);
        this.f3436g = new c1.a(0.0f);
        this.f3437h = new c1.a(0.0f);
        this.f3438i = h.c();
        this.f3439j = h.c();
        this.f3440k = h.c();
        this.f3441l = h.c();
    }
}
