package m;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.text.InputFilter;
import android.util.AttributeSet;
import android.widget.CheckBox;
import com.riyaz.zvytour.R;
import e4.AbstractC0566j;
import h.AbstractC0617a;

/* JADX INFO: renamed from: m.p, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC0875p extends CheckBox {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final C0877q f9226k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final C0871n f9227l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final C0837F f9228m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public C0884u f9229n;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public AbstractC0875p(Context context, AttributeSet attributeSet) {
        int resourceId;
        int resourceId2;
        super(context, attributeSet, R.attr.chipStyle);
        M0.a(context);
        L0.a(this, getContext());
        this.f9226k = new C0877q(this);
        Context context2 = getContext();
        int[] iArr = AbstractC0617a.f6477j;
        B2.a aVarA = B2.a.A(context2, attributeSet, iArr, R.attr.chipStyle);
        TypedArray typedArray = (TypedArray) aVarA.f136n;
        P.Q.j(this, getContext(), iArr, attributeSet, (TypedArray) aVarA.f136n, R.attr.chipStyle);
        try {
            if (typedArray.hasValue(1) && (resourceId2 = typedArray.getResourceId(1, 0)) != 0) {
                try {
                    setButtonDrawable(AbstractC0566j.j(getContext(), resourceId2));
                } catch (Resources.NotFoundException unused) {
                    if (typedArray.hasValue(0)) {
                        setButtonDrawable(AbstractC0566j.j(getContext(), resourceId));
                    }
                }
            } else if (typedArray.hasValue(0) && (resourceId = typedArray.getResourceId(0, 0)) != 0) {
                setButtonDrawable(AbstractC0566j.j(getContext(), resourceId));
            }
            if (typedArray.hasValue(2)) {
                setButtonTintList(aVarA.s(2));
            }
            if (typedArray.hasValue(3)) {
                setButtonTintMode(V.c(typedArray.getInt(3, -1), null));
            }
            aVarA.D();
            C0871n c0871n = new C0871n(this);
            this.f9227l = c0871n;
            c0871n.d(attributeSet, R.attr.chipStyle);
            C0837F c0837f = new C0837F(this);
            this.f9228m = c0837f;
            c0837f.d(attributeSet, R.attr.chipStyle);
            getEmojiTextViewHelper().a(attributeSet, R.attr.chipStyle);
        } catch (Throwable th) {
            aVarA.D();
            throw th;
        }
    }

    private C0884u getEmojiTextViewHelper() {
        if (this.f9229n == null) {
            this.f9229n = new C0884u(this);
        }
        return this.f9229n;
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public void drawableStateChanged() {
        super.drawableStateChanged();
        C0871n c0871n = this.f9227l;
        if (c0871n != null) {
            c0871n.a();
        }
        C0837F c0837f = this.f9228m;
        if (c0837f != null) {
            c0837f.b();
        }
    }

    @Override // android.widget.CompoundButton, android.widget.TextView
    public int getCompoundPaddingLeft() {
        int compoundPaddingLeft = super.getCompoundPaddingLeft();
        C0877q c0877q = this.f9226k;
        if (c0877q != null) {
            c0877q.getClass();
        }
        return compoundPaddingLeft;
    }

    public ColorStateList getSupportBackgroundTintList() {
        C0871n c0871n = this.f9227l;
        if (c0871n != null) {
            return c0871n.b();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C0871n c0871n = this.f9227l;
        if (c0871n != null) {
            return c0871n.c();
        }
        return null;
    }

    public ColorStateList getSupportButtonTintList() {
        C0877q c0877q = this.f9226k;
        if (c0877q != null) {
            return c0877q.f9231b;
        }
        return null;
    }

    public PorterDuff.Mode getSupportButtonTintMode() {
        C0877q c0877q = this.f9226k;
        if (c0877q != null) {
            return c0877q.f9232c;
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        K4.h hVar = this.f9228m.f9007h;
        if (hVar != null) {
            return (ColorStateList) hVar.f1123c;
        }
        return null;
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        K4.h hVar = this.f9228m.f9007h;
        if (hVar != null) {
            return (PorterDuff.Mode) hVar.f1124d;
        }
        return null;
    }

    @Override // android.widget.TextView
    public void setAllCaps(boolean z5) {
        super.setAllCaps(z5);
        ((A1.h) getEmojiTextViewHelper().f9250b.f2797k).D(z5);
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C0871n c0871n = this.f9227l;
        if (c0871n != null) {
            c0871n.e();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C0871n c0871n = this.f9227l;
        if (c0871n != null) {
            c0871n.f(i);
        }
    }

    @Override // android.widget.CompoundButton
    public void setButtonDrawable(Drawable drawable) {
        super.setButtonDrawable(drawable);
        C0877q c0877q = this.f9226k;
        if (c0877q != null) {
            if (c0877q.f9235f) {
                c0877q.f9235f = false;
            } else {
                c0877q.f9235f = true;
                c0877q.a();
            }
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        C0837F c0837f = this.f9228m;
        if (c0837f != null) {
            c0837f.b();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        C0837F c0837f = this.f9228m;
        if (c0837f != null) {
            c0837f.b();
        }
    }

    public void setEmojiCompatEnabled(boolean z5) {
        ((A1.h) getEmojiTextViewHelper().f9250b.f2797k).F(z5);
    }

    @Override // android.widget.TextView
    public void setFilters(InputFilter[] inputFilterArr) {
        super.setFilters(((A1.h) getEmojiTextViewHelper().f9250b.f2797k).p(inputFilterArr));
    }

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C0871n c0871n = this.f9227l;
        if (c0871n != null) {
            c0871n.h(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C0871n c0871n = this.f9227l;
        if (c0871n != null) {
            c0871n.i(mode);
        }
    }

    public void setSupportButtonTintList(ColorStateList colorStateList) {
        C0877q c0877q = this.f9226k;
        if (c0877q != null) {
            c0877q.f9231b = colorStateList;
            c0877q.f9233d = true;
            c0877q.a();
        }
    }

    public void setSupportButtonTintMode(PorterDuff.Mode mode) {
        C0877q c0877q = this.f9226k;
        if (c0877q != null) {
            c0877q.f9232c = mode;
            c0877q.f9234e = true;
            c0877q.a();
        }
    }

    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        C0837F c0837f = this.f9228m;
        c0837f.j(colorStateList);
        c0837f.b();
    }

    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        C0837F c0837f = this.f9228m;
        c0837f.k(mode);
        c0837f.b();
    }

    @Override // android.widget.CompoundButton
    public void setButtonDrawable(int i) {
        setButtonDrawable(AbstractC0566j.j(getContext(), i));
    }
}
