package q5;

import a5.l;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
import androidx.media3.exoplayer.source.ProgressiveMediaSource;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.o;
import j5.k;
import j5.q;
import t5.n;
import t5.p;

/* JADX INFO: loaded from: classes.dex */
public abstract class a implements Cloneable {
    public boolean T;
    public boolean U;
    public boolean V;
    public boolean W;
    public boolean Y;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f32188a;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f32192e;

    @Nullable
    private Drawable errorPlaceholder;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f32193f;

    @Nullable
    private Drawable fallbackDrawable;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f32198k;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public int f32200m;

    @Nullable
    private Drawable placeholderDrawable;

    @Nullable
    private Resources.Theme theme;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public float f32189b = 1.0f;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public o f32190c = o.f5755e;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Priority f32191d = Priority.f5547c;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f32194g = true;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f32195h = -1;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int f32196i = -1;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public a5.h f32197j = s5.c.f32665b;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public boolean f32199l = true;
    public l Q = new l();
    public t5.d R = new t5.d(0);
    public Class S = Object.class;
    public boolean X = true;

    public static boolean g(int i10, int i11) {
        return (i10 & i11) != 0;
    }

    public a a(a aVar) {
        if (this.U) {
            return clone().a(aVar);
        }
        if (g(aVar.f32188a, 2)) {
            this.f32189b = aVar.f32189b;
        }
        if (g(aVar.f32188a, 262144)) {
            this.V = aVar.V;
        }
        if (g(aVar.f32188a, ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES)) {
            this.Y = aVar.Y;
        }
        if (g(aVar.f32188a, 4)) {
            this.f32190c = aVar.f32190c;
        }
        if (g(aVar.f32188a, 8)) {
            this.f32191d = aVar.f32191d;
        }
        if (g(aVar.f32188a, 16)) {
            this.errorPlaceholder = aVar.errorPlaceholder;
            this.f32192e = 0;
            this.f32188a &= -33;
        }
        if (g(aVar.f32188a, 32)) {
            this.f32192e = aVar.f32192e;
            this.errorPlaceholder = null;
            this.f32188a &= -17;
        }
        if (g(aVar.f32188a, 64)) {
            this.placeholderDrawable = aVar.placeholderDrawable;
            this.f32193f = 0;
            this.f32188a &= -129;
        }
        if (g(aVar.f32188a, 128)) {
            this.f32193f = aVar.f32193f;
            this.placeholderDrawable = null;
            this.f32188a &= -65;
        }
        if (g(aVar.f32188a, 256)) {
            this.f32194g = aVar.f32194g;
        }
        if (g(aVar.f32188a, 512)) {
            this.f32196i = aVar.f32196i;
            this.f32195h = aVar.f32195h;
        }
        if (g(aVar.f32188a, 1024)) {
            this.f32197j = aVar.f32197j;
        }
        if (g(aVar.f32188a, 4096)) {
            this.S = aVar.S;
        }
        if (g(aVar.f32188a, 8192)) {
            this.fallbackDrawable = aVar.fallbackDrawable;
            this.f32200m = 0;
            this.f32188a &= -16385;
        }
        if (g(aVar.f32188a, 16384)) {
            this.f32200m = aVar.f32200m;
            this.fallbackDrawable = null;
            this.f32188a &= -8193;
        }
        if (g(aVar.f32188a, 32768)) {
            this.theme = aVar.theme;
        }
        if (g(aVar.f32188a, C.DEFAULT_BUFFER_SEGMENT_SIZE)) {
            this.f32199l = aVar.f32199l;
        }
        if (g(aVar.f32188a, 131072)) {
            this.f32198k = aVar.f32198k;
        }
        if (g(aVar.f32188a, 2048)) {
            this.R.putAll(aVar.R);
            this.X = aVar.X;
        }
        if (g(aVar.f32188a, 524288)) {
            this.W = aVar.W;
        }
        if (!this.f32199l) {
            this.R.clear();
            int i10 = this.f32188a;
            this.f32198k = false;
            this.f32188a = i10 & (-133121);
            this.X = true;
        }
        this.f32188a |= aVar.f32188a;
        this.Q.f382b.j(aVar.Q.f382b);
        l();
        return this;
    }

    public final void b() {
        if (this.T && !this.U) {
            throw new IllegalStateException("You cannot auto lock an already locked options object, try clone() first");
        }
        this.U = true;
        this.T = true;
    }

    @Override // 
    /* JADX INFO: renamed from: c, reason: merged with bridge method [inline-methods] */
    public a clone() {
        try {
            a aVar = (a) super.clone();
            l lVar = new l();
            aVar.Q = lVar;
            lVar.f382b.j(this.Q.f382b);
            t5.d dVar = new t5.d(0);
            aVar.R = dVar;
            dVar.putAll(this.R);
            aVar.T = false;
            aVar.U = false;
            return aVar;
        } catch (CloneNotSupportedException e10) {
            throw new RuntimeException(e10);
        }
    }

    public final a d(Class cls) {
        if (this.U) {
            return clone().d(cls);
        }
        this.S = (Class) n.checkNotNull(cls);
        this.f32188a |= 4096;
        l();
        return this;
    }

    public final a e(com.bumptech.glide.load.engine.n nVar) {
        if (this.U) {
            return clone().e(nVar);
        }
        this.f32190c = (o) n.checkNotNull(nVar);
        this.f32188a |= 4;
        l();
        return this;
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof a)) {
            return false;
        }
        a aVar = (a) obj;
        return Float.compare(aVar.f32189b, this.f32189b) == 0 && this.f32192e == aVar.f32192e && p.bothNullOrEqual(this.errorPlaceholder, aVar.errorPlaceholder) && this.f32193f == aVar.f32193f && p.bothNullOrEqual(this.placeholderDrawable, aVar.placeholderDrawable) && this.f32200m == aVar.f32200m && p.bothNullOrEqual(this.fallbackDrawable, aVar.fallbackDrawable) && this.f32194g == aVar.f32194g && this.f32195h == aVar.f32195h && this.f32196i == aVar.f32196i && this.f32198k == aVar.f32198k && this.f32199l == aVar.f32199l && this.V == aVar.V && this.W == aVar.W && this.f32190c.equals(aVar.f32190c) && this.f32191d == aVar.f32191d && this.Q.equals(aVar.Q) && this.R.equals(aVar.R) && this.S.equals(aVar.S) && p.bothNullOrEqual(this.f32197j, aVar.f32197j) && p.bothNullOrEqual(this.theme, aVar.theme);
    }

    @NonNull
    @CheckResult
    public a error(@Nullable Drawable drawable) {
        if (this.U) {
            return clone().error(drawable);
        }
        this.errorPlaceholder = drawable;
        int i10 = this.f32188a | 16;
        this.f32192e = 0;
        this.f32188a = i10 & (-33);
        l();
        return this;
    }

    public final a f() {
        DecodeFormat decodeFormat = DecodeFormat.f5596b;
        n.checkNotNull(decodeFormat);
        return m(j5.n.f28666f, decodeFormat).m(l5.l.f30159a, decodeFormat);
    }

    @NonNull
    @CheckResult
    public a fallback(@Nullable Drawable drawable) {
        if (this.U) {
            return clone().fallback(drawable);
        }
        this.fallbackDrawable = drawable;
        int i10 = this.f32188a | 8192;
        this.f32200m = 0;
        this.f32188a = i10 & (-16385);
        l();
        return this;
    }

    @Nullable
    public final Drawable getErrorPlaceholder() {
        return this.errorPlaceholder;
    }

    @Nullable
    public final Drawable getFallbackDrawable() {
        return this.fallbackDrawable;
    }

    @Nullable
    public final Drawable getPlaceholderDrawable() {
        return this.placeholderDrawable;
    }

    @Nullable
    public final Resources.Theme getTheme() {
        return this.theme;
    }

    public final a h(k kVar, j5.e eVar) {
        if (this.U) {
            return clone().h(kVar, eVar);
        }
        m(j5.l.f28664f, n.checkNotNull(kVar));
        return r(eVar, false);
    }

    public final int hashCode() {
        float f10 = this.f32189b;
        char[] cArr = p.f32977a;
        return p.hashCode(this.theme, p.hashCode(this.f32197j, p.hashCode(this.S, p.hashCode(this.R, p.hashCode(this.Q, p.hashCode(this.f32191d, p.hashCode(this.f32190c, p.e(this.W ? 1 : 0, p.e(this.V ? 1 : 0, p.e(this.f32199l ? 1 : 0, p.e(this.f32198k ? 1 : 0, p.e(this.f32196i, p.e(this.f32195h, p.e(this.f32194g ? 1 : 0, p.hashCode(this.fallbackDrawable, p.e(this.f32200m, p.hashCode(this.placeholderDrawable, p.e(this.f32193f, p.hashCode(this.errorPlaceholder, p.e(this.f32192e, p.e(Float.floatToIntBits(f10), 17)))))))))))))))))))));
    }

    public final a i(int i10, int i11) {
        if (this.U) {
            return clone().i(i10, i11);
        }
        this.f32196i = i10;
        this.f32195h = i11;
        this.f32188a |= 512;
        l();
        return this;
    }

    public final a j() {
        Priority priority = Priority.f5548d;
        if (this.U) {
            return clone().j();
        }
        this.f32191d = (Priority) n.checkNotNull(priority);
        this.f32188a |= 8;
        l();
        return this;
    }

    public final a k(k kVar, j5.e eVar, boolean z10) {
        a aVarS = z10 ? s(kVar, eVar) : h(kVar, eVar);
        aVarS.X = true;
        return aVarS;
    }

    public final void l() {
        if (this.T) {
            throw new IllegalStateException("You cannot modify locked T, consider clone()");
        }
    }

    public final a m(a5.k kVar, Object obj) {
        if (this.U) {
            return clone().m(kVar, obj);
        }
        n.checkNotNull(kVar);
        n.checkNotNull(obj);
        this.Q.f382b.put(kVar, obj);
        l();
        return this;
    }

    public final a n(a5.h hVar) {
        if (this.U) {
            return clone().n(hVar);
        }
        this.f32197j = (a5.h) n.checkNotNull(hVar);
        this.f32188a |= 1024;
        l();
        return this;
    }

    public final a o(float f10) {
        if (this.U) {
            return clone().o(f10);
        }
        if (f10 < 0.0f || f10 > 1.0f) {
            throw new IllegalArgumentException("sizeMultiplier must be between 0 and 1");
        }
        this.f32189b = f10;
        this.f32188a |= 2;
        l();
        return this;
    }

    @NonNull
    @CheckResult
    public a placeholder(@Nullable Drawable drawable) {
        if (this.U) {
            return clone().placeholder(drawable);
        }
        this.placeholderDrawable = drawable;
        int i10 = this.f32188a | 64;
        this.f32193f = 0;
        this.f32188a = i10 & (-129);
        l();
        return this;
    }

    public final a q(boolean z10) {
        if (this.U) {
            return clone().q(true);
        }
        this.f32194g = !z10;
        this.f32188a |= 256;
        l();
        return this;
    }

    public final a r(a5.o oVar, boolean z10) {
        if (this.U) {
            return clone().r(oVar, z10);
        }
        q qVar = new q(oVar, z10);
        t(Bitmap.class, oVar, z10);
        t(Drawable.class, qVar, z10);
        t(BitmapDrawable.class, qVar, z10);
        t(l5.d.class, new l5.f(oVar), z10);
        l();
        return this;
    }

    public final a s(k kVar, j5.e eVar) {
        if (this.U) {
            return clone().s(kVar, eVar);
        }
        m(j5.l.f28664f, n.checkNotNull(kVar));
        return r(eVar, true);
    }

    public final a t(Class cls, a5.o oVar, boolean z10) {
        if (this.U) {
            return clone().t(cls, oVar, z10);
        }
        n.checkNotNull(cls);
        n.checkNotNull(oVar);
        this.R.put(cls, oVar);
        int i10 = this.f32188a;
        this.f32199l = true;
        this.f32188a = 67584 | i10;
        this.X = false;
        if (z10) {
            this.f32188a = i10 | 198656;
            this.f32198k = true;
        }
        l();
        return this;
    }

    @NonNull
    @CheckResult
    public a theme(@Nullable Resources.Theme theme) {
        if (this.U) {
            return clone().theme(theme);
        }
        this.theme = theme;
        this.f32188a |= 32768;
        l();
        return this;
    }

    public final a u() {
        if (this.U) {
            return clone().u();
        }
        this.Y = true;
        this.f32188a |= ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES;
        l();
        return this;
    }
}
