package o;

import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class I9 extends AbstractC2811wV implements Q10 {
    public boolean A;
    public final MV B;
    public final MV C;
    public final MV D;
    public C0168Gm q;
    public final Ba0 r = AbstractC0752ap.h(new T80(0));
    public final MV s = AbstractC0752ap.X(null);
    public final MV t = AbstractC0752ap.X(Float.valueOf(1.0f));
    public final MV u = AbstractC0752ap.X(null);
    public B9 v;
    public AbstractC2811wV w;
    public OC x;
    public InterfaceC2555tm y;
    public int z;

    public I9(C2891xG c2891xG, C2961y00 c2961y00) {
        C2883x9 c2883x9 = C2883x9.a;
        this.v = c2883x9;
        this.x = C1160f3.F;
        this.y = C2460sm.b;
        this.z = 1;
        this.B = AbstractC0752ap.X(c2883x9);
        this.C = AbstractC0752ap.X(c2891xG);
        this.D = AbstractC0752ap.X(c2961y00);
    }

    @Override // o.Q10
    public final void a() {
        if (this.q != null) {
            return;
        }
        C2724vb0 c2724vb0T = AbstractC2378rs0.t();
        C2468sq c2468sq = AbstractC1903ms.a;
        C0168Gm c0168GmE = C80.e(AbstractC2798wI.t(c2724vb0T, AbstractC2139pN.a.p));
        this.q = c0168GmE;
        Object obj = this.w;
        InterfaceC0220Im interfaceC0220Im = null;
        Q10 q10 = obj instanceof Q10 ? (Q10) obj : null;
        if (q10 != null) {
            q10.a();
        }
        int i = 0;
        if (!this.A) {
            AbstractC1692kh0.C(c0168GmE, null, new D9(this, interfaceC0220Im, i), 3);
            return;
        }
        C2796wG c2796wGA = C2891xG.a((C2891xG) this.C.getValue());
        c2796wGA.b = ((C2961y00) this.D.getValue()).a;
        c2796wGA.p = 0;
        c2796wGA.a().u.getClass();
        C2279qq c2279qq = AbstractC1249g.a;
        k(new C3073z9(null));
    }

    @Override // o.AbstractC2811wV
    public final boolean b(float f) {
        this.t.setValue(Float.valueOf(f));
        return true;
    }

    @Override // o.AbstractC2811wV
    public final boolean c(C0444Rd c0444Rd) {
        this.u.setValue(c0444Rd);
        return true;
    }

    @Override // o.Q10
    public final void e() {
        C0168Gm c0168Gm = this.q;
        if (c0168Gm != null) {
            C80.n(c0168Gm, null);
        }
        this.q = null;
        Object obj = this.w;
        Q10 q10 = obj instanceof Q10 ? (Q10) obj : null;
        if (q10 != null) {
            q10.e();
        }
    }

    @Override // o.AbstractC2811wV
    public final long g() {
        AbstractC2811wV abstractC2811wV = (AbstractC2811wV) this.s.getValue();
        if (abstractC2811wV != null) {
            return abstractC2811wV.g();
        }
        return 9205357640488583168L;
    }

    @Override // o.Q10
    public final void h() {
        C0168Gm c0168Gm = this.q;
        if (c0168Gm != null) {
            C80.n(c0168Gm, null);
        }
        this.q = null;
        Object obj = this.w;
        Q10 q10 = obj instanceof Q10 ? (Q10) obj : null;
        if (q10 != null) {
            q10.h();
        }
    }

    @Override // o.AbstractC2811wV
    public final void i(C2610uK c2610uK) {
        C3113zg c3113zg = c2610uK.l;
        T80 t80 = new T80(c3113zg.f());
        Ba0 ba0 = this.r;
        ba0.getClass();
        ba0.i(null, t80);
        AbstractC2811wV abstractC2811wV = (AbstractC2811wV) this.s.getValue();
        if (abstractC2811wV != null) {
            abstractC2811wV.f(c2610uK, c3113zg.f(), ((Number) this.t.getValue()).floatValue(), (C0444Rd) this.u.getValue());
        }
    }

    public final AbstractC2811wV j(Drawable drawable) {
        if (!(drawable instanceof BitmapDrawable)) {
            return new C2474st(drawable.mutate());
        }
        C2493t4 c2493t4 = new C2493t4(((BitmapDrawable) drawable).getBitmap());
        int i = this.z;
        C0392Pd c0392Pd = new C0392Pd(c2493t4, (r9.getWidth() << 32) | (r9.getHeight() & 4294967295L));
        c0392Pd.s = i;
        return c0392Pd;
    }

    public final void k(B9 b9) {
        AbstractC2986yG abstractC2986yG;
        B9 b92 = this.v;
        B9 b93 = (B9) this.x.g(b9);
        this.v = b93;
        this.B.setValue(b93);
        if (!(b93 instanceof A9)) {
            if (b93 instanceof C2978y9) {
                abstractC2986yG = ((C2978y9) b93).b;
            }
            AbstractC2811wV abstractC2811wVA = b93.a();
            this.w = abstractC2811wVA;
            this.s.setValue(abstractC2811wVA);
            if (this.q != null || b92.a() == b93.a()) {
            }
            Object objA = b92.a();
            Q10 q10 = objA instanceof Q10 ? (Q10) objA : null;
            if (q10 != null) {
                q10.h();
            }
            Object objA2 = b93.a();
            Q10 q102 = objA2 instanceof Q10 ? (Q10) objA2 : null;
            if (q102 != null) {
                q102.a();
                return;
            }
            return;
        }
        abstractC2986yG = ((A9) b93).b;
        abstractC2986yG.a().f.getClass();
        AbstractC2811wV abstractC2811wVA2 = b93.a();
        this.w = abstractC2811wVA2;
        this.s.setValue(abstractC2811wVA2);
        if (this.q != null) {
        }
    }
}
