package com.google.android.material.chip;

import android.R;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Outline;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.PointerIcon;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import androidx.appcompat.widget.g;
import androidx.core.view.accessibility.d;
import androidx.core.view.y;
import c1.n;
import com.google.android.material.chip.a;
import com.google.android.material.internal.h;
import com.google.android.material.internal.m;
import com.google.android.material.internal.o;
import java.util.List;
import l0.i;
import l0.j;
import l0.k;
import z0.f;

/* JADX INFO: loaded from: classes.dex */
public class Chip extends g implements a.InterfaceC0047a, n, h<Chip> {
    private static final int B = j.f5453h;
    private static final Rect C = new Rect();
    private static final int[] D = {R.attr.state_selected};
    private static final int[] E = {R.attr.state_checkable};
    private final f A;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private com.google.android.material.chip.a f3756i;

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

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

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private View.OnClickListener f3759l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private CompoundButton.OnCheckedChangeListener f3760m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    private h.a<Chip> f3761n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    private boolean f3762o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    private boolean f3763p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    private boolean f3764q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    private boolean f3765r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    private boolean f3766s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    private int f3767t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    private int f3768u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    private CharSequence f3769v;

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

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    private boolean f3771x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    private final Rect f3772y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    private final RectF f3773z;

    class a extends f {
        a() {
        }

        @Override // z0.f
        public void a(int i3) {
        }

        @Override // z0.f
        public void b(Typeface typeface, boolean z2) {
            Chip chip = Chip.this;
            chip.setText(chip.f3756i.K2() ? Chip.this.f3756i.g1() : Chip.this.getText());
            Chip.this.requestLayout();
            Chip.this.invalidate();
        }
    }

    class b implements CompoundButton.OnCheckedChangeListener {
        b() {
        }

        @Override // android.widget.CompoundButton.OnCheckedChangeListener
        public void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
            if (Chip.this.f3761n != null) {
                Chip.this.f3761n.a(Chip.this, z2);
            }
            if (Chip.this.f3760m != null) {
                Chip.this.f3760m.onCheckedChanged(compoundButton, z2);
            }
        }
    }

    class c extends ViewOutlineProvider {
        c() {
        }

        @Override // android.view.ViewOutlineProvider
        @TargetApi(21)
        public void getOutline(View view, Outline outline) {
            if (Chip.this.f3756i != null) {
                Chip.this.f3756i.getOutline(outline);
            } else {
                outline.setAlpha(0.0f);
            }
        }
    }

    private class d extends x.a {
        d(Chip chip) {
            super(chip);
        }

        @Override // x.a
        protected int B(float f3, float f4) {
            return (Chip.this.o() && Chip.this.getCloseIconTouchBounds().contains(f3, f4)) ? 1 : 0;
        }

        @Override // x.a
        protected void C(List<Integer> list) {
            list.add(0);
            if (Chip.this.o() && Chip.this.t() && Chip.this.f3759l != null) {
                list.add(1);
            }
        }

        @Override // x.a
        protected boolean J(int i3, int i4, Bundle bundle) {
            if (i4 != 16) {
                return false;
            }
            if (i3 == 0) {
                return Chip.this.performClick();
            }
            if (i3 == 1) {
                return Chip.this.u();
            }
            return false;
        }

        @Override // x.a
        protected void M(androidx.core.view.accessibility.d dVar) {
            dVar.U(Chip.this.s());
            dVar.X(Chip.this.isClickable());
            dVar.W(Chip.this.getAccessibilityClassName());
            CharSequence text = Chip.this.getText();
            if (Build.VERSION.SDK_INT >= 23) {
                dVar.s0(text);
            } else {
                dVar.a0(text);
            }
        }

        @Override // x.a
        protected void N(int i3, androidx.core.view.accessibility.d dVar) {
            if (i3 != 1) {
                dVar.a0("");
                dVar.S(Chip.C);
                return;
            }
            CharSequence closeIconContentDescription = Chip.this.getCloseIconContentDescription();
            if (closeIconContentDescription != null) {
                dVar.a0(closeIconContentDescription);
            } else {
                CharSequence text = Chip.this.getText();
                Context context = Chip.this.getContext();
                int i4 = i.f5437h;
                Object[] objArr = new Object[1];
                objArr[0] = TextUtils.isEmpty(text) ? "" : text;
                dVar.a0(context.getString(i4, objArr).trim());
            }
            dVar.S(Chip.this.getCloseIconTouchBoundsInt());
            dVar.b(d.a.f1849e);
            dVar.b0(Chip.this.isEnabled());
        }

        @Override // x.a
        protected void O(int i3, boolean z2) {
            if (i3 == 1) {
                Chip.this.f3765r = z2;
                Chip.this.refreshDrawableState();
            }
        }
    }

    public Chip(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, l0.b.f5322e);
    }

    private void A() {
        this.f3758k = new RippleDrawable(a1.b.a(this.f3756i.e1()), getBackgroundDrawable(), null);
        this.f3756i.J2(false);
        y.v0(this, this.f3758k);
        B();
    }

    private void B() {
        com.google.android.material.chip.a aVar;
        if (TextUtils.isEmpty(getText()) || (aVar = this.f3756i) == null) {
            return;
        }
        int iI0 = (int) (aVar.I0() + this.f3756i.i1() + this.f3756i.p0());
        int iN0 = (int) (this.f3756i.N0() + this.f3756i.j1() + this.f3756i.l0());
        if (this.f3757j != null) {
            Rect rect = new Rect();
            this.f3757j.getPadding(rect);
            iN0 += rect.left;
            iI0 += rect.right;
        }
        y.E0(this, iN0, getPaddingTop(), iI0, getPaddingBottom());
    }

    private void C() {
        TextPaint paint = getPaint();
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            paint.drawableState = aVar.getState();
        }
        z0.d textAppearance = getTextAppearance();
        if (textAppearance != null) {
            textAppearance.n(getContext(), paint, this.A);
        }
    }

    private void D(AttributeSet attributeSet) {
        if (attributeSet == null) {
            return;
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "background") != null) {
            Log.w("Chip", "Do not set the background; Chip manages its own background drawable.");
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableLeft") != null) {
            throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableStart") != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableEnd") != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableRight") != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        if (!attributeSet.getAttributeBooleanValue("http://schemas.android.com/apk/res/android", "singleLine", true) || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "lines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "minLines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "maxLines", 1) != 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        if (attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "gravity", 8388627) != 8388627) {
            Log.w("Chip", "Chip text must be vertically center and start aligned");
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public RectF getCloseIconTouchBounds() {
        this.f3773z.setEmpty();
        if (o() && this.f3759l != null) {
            this.f3756i.X0(this.f3773z);
        }
        return this.f3773z;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public Rect getCloseIconTouchBoundsInt() {
        RectF closeIconTouchBounds = getCloseIconTouchBounds();
        this.f3772y.set((int) closeIconTouchBounds.left, (int) closeIconTouchBounds.top, (int) closeIconTouchBounds.right, (int) closeIconTouchBounds.bottom);
        return this.f3772y;
    }

    private z0.d getTextAppearance() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.h1();
        }
        return null;
    }

    private void k(com.google.android.material.chip.a aVar) {
        aVar.o2(this);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v0, types: [boolean, int] */
    private int[] l() {
        ?? IsEnabled = isEnabled();
        int i3 = IsEnabled;
        if (this.f3765r) {
            i3 = IsEnabled + 1;
        }
        int i4 = i3;
        if (this.f3764q) {
            i4 = i3 + 1;
        }
        int i5 = i4;
        if (this.f3763p) {
            i5 = i4 + 1;
        }
        int i6 = i5;
        if (isChecked()) {
            i6 = i5 + 1;
        }
        int[] iArr = new int[i6];
        int i7 = 0;
        if (isEnabled()) {
            iArr[0] = 16842910;
            i7 = 1;
        }
        if (this.f3765r) {
            iArr[i7] = 16842908;
            i7++;
        }
        if (this.f3764q) {
            iArr[i7] = 16843623;
            i7++;
        }
        if (this.f3763p) {
            iArr[i7] = 16842919;
            i7++;
        }
        if (isChecked()) {
            iArr[i7] = 16842913;
        }
        return iArr;
    }

    private void n() {
        if (getBackgroundDrawable() == this.f3757j && this.f3756i.getCallback() == null) {
            this.f3756i.setCallback(this.f3757j);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public boolean o() {
        com.google.android.material.chip.a aVar = this.f3756i;
        return (aVar == null || aVar.Q0() == null) ? false : true;
    }

    private void p(Context context, AttributeSet attributeSet, int i3) {
        TypedArray typedArrayH = m.h(context, attributeSet, k.A, i3, B, new int[0]);
        this.f3766s = typedArrayH.getBoolean(k.f5489h0, false);
        this.f3768u = (int) Math.ceil(typedArrayH.getDimension(k.V, (float) Math.ceil(o.b(getContext(), 48))));
        typedArrayH.recycle();
    }

    private void q() {
        if (Build.VERSION.SDK_INT >= 21) {
            setOutlineProvider(new c());
        }
    }

    private void r(int i3, int i4, int i5, int i6) {
        this.f3757j = new InsetDrawable((Drawable) this.f3756i, i3, i4, i5, i6);
    }

    private void setCloseIconHovered(boolean z2) {
        if (this.f3764q != z2) {
            this.f3764q = z2;
            refreshDrawableState();
        }
    }

    private void setCloseIconPressed(boolean z2) {
        if (this.f3763p != z2) {
            this.f3763p = z2;
            refreshDrawableState();
        }
    }

    private void v() {
        if (this.f3757j != null) {
            this.f3757j = null;
            setMinWidth(0);
            setMinHeight((int) getChipMinHeight());
            z();
        }
    }

    private void x(com.google.android.material.chip.a aVar) {
        if (aVar != null) {
            aVar.o2(null);
        }
    }

    private void y() {
        if (o() && t() && this.f3759l != null) {
            y.r0(this, this.f3770w);
            this.f3771x = true;
        } else {
            y.r0(this, null);
            this.f3771x = false;
        }
    }

    private void z() {
        if (a1.b.f21a) {
            A();
            return;
        }
        this.f3756i.J2(true);
        y.v0(this, getBackgroundDrawable());
        B();
        n();
    }

    @Override // com.google.android.material.chip.a.InterfaceC0047a
    public void a() {
        m(this.f3768u);
        requestLayout();
        if (Build.VERSION.SDK_INT >= 21) {
            invalidateOutline();
        }
    }

    @Override // android.view.View
    protected boolean dispatchHoverEvent(MotionEvent motionEvent) {
        return !this.f3771x ? super.dispatchHoverEvent(motionEvent) : this.f3770w.v(motionEvent) || super.dispatchHoverEvent(motionEvent);
    }

    @Override // android.view.View
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        if (!this.f3771x) {
            return super.dispatchKeyEvent(keyEvent);
        }
        if (!this.f3770w.w(keyEvent) || this.f3770w.A() == Integer.MIN_VALUE) {
            return super.dispatchKeyEvent(keyEvent);
        }
        return true;
    }

    @Override // androidx.appcompat.widget.g, android.widget.CompoundButton, android.widget.TextView, android.view.View
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        com.google.android.material.chip.a aVar = this.f3756i;
        if ((aVar == null || !aVar.o1()) ? false : this.f3756i.k2(l())) {
            invalidate();
        }
    }

    @Override // android.widget.CheckBox, android.widget.CompoundButton, android.widget.Button, android.widget.TextView, android.view.View
    public CharSequence getAccessibilityClassName() {
        if (!TextUtils.isEmpty(this.f3769v)) {
            return this.f3769v;
        }
        if (!s()) {
            return isClickable() ? "android.widget.Button" : "android.view.View";
        }
        ViewParent parent = getParent();
        return ((parent instanceof ChipGroup) && ((ChipGroup) parent).h()) ? "android.widget.RadioButton" : "android.widget.CompoundButton";
    }

    public Drawable getBackgroundDrawable() {
        InsetDrawable insetDrawable = this.f3757j;
        return insetDrawable == null ? this.f3756i : insetDrawable;
    }

    public Drawable getCheckedIcon() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.E0();
        }
        return null;
    }

    public ColorStateList getCheckedIconTint() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.F0();
        }
        return null;
    }

    public ColorStateList getChipBackgroundColor() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.G0();
        }
        return null;
    }

    public float getChipCornerRadius() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return Math.max(0.0f, aVar.H0());
        }
        return 0.0f;
    }

    public Drawable getChipDrawable() {
        return this.f3756i;
    }

    public float getChipEndPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.I0();
        }
        return 0.0f;
    }

    public Drawable getChipIcon() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.J0();
        }
        return null;
    }

    public float getChipIconSize() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.K0();
        }
        return 0.0f;
    }

    public ColorStateList getChipIconTint() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.L0();
        }
        return null;
    }

    public float getChipMinHeight() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.M0();
        }
        return 0.0f;
    }

    public float getChipStartPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.N0();
        }
        return 0.0f;
    }

    public ColorStateList getChipStrokeColor() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.O0();
        }
        return null;
    }

    public float getChipStrokeWidth() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.P0();
        }
        return 0.0f;
    }

    @Deprecated
    public CharSequence getChipText() {
        return getText();
    }

    public Drawable getCloseIcon() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.Q0();
        }
        return null;
    }

    public CharSequence getCloseIconContentDescription() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.R0();
        }
        return null;
    }

    public float getCloseIconEndPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.S0();
        }
        return 0.0f;
    }

    public float getCloseIconSize() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.T0();
        }
        return 0.0f;
    }

    public float getCloseIconStartPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.U0();
        }
        return 0.0f;
    }

    public ColorStateList getCloseIconTint() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.W0();
        }
        return null;
    }

    @Override // android.widget.TextView
    public TextUtils.TruncateAt getEllipsize() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.a1();
        }
        return null;
    }

    @Override // android.widget.TextView, android.view.View
    public void getFocusedRect(Rect rect) {
        if (this.f3771x && (this.f3770w.A() == 1 || this.f3770w.x() == 1)) {
            rect.set(getCloseIconTouchBoundsInt());
        } else {
            super.getFocusedRect(rect);
        }
    }

    public m0.h getHideMotionSpec() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.b1();
        }
        return null;
    }

    public float getIconEndPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.c1();
        }
        return 0.0f;
    }

    public float getIconStartPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.d1();
        }
        return 0.0f;
    }

    public ColorStateList getRippleColor() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.e1();
        }
        return null;
    }

    public c1.k getShapeAppearanceModel() {
        return this.f3756i.D();
    }

    public m0.h getShowMotionSpec() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.f1();
        }
        return null;
    }

    public float getTextEndPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.i1();
        }
        return 0.0f;
    }

    public float getTextStartPadding() {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            return aVar.j1();
        }
        return 0.0f;
    }

    public boolean m(int i3) {
        this.f3768u = i3;
        if (!w()) {
            if (this.f3757j != null) {
                v();
            } else {
                z();
            }
            return false;
        }
        int iMax = Math.max(0, i3 - this.f3756i.getIntrinsicHeight());
        int iMax2 = Math.max(0, i3 - this.f3756i.getIntrinsicWidth());
        if (iMax2 <= 0 && iMax <= 0) {
            if (this.f3757j != null) {
                v();
            } else {
                z();
            }
            return false;
        }
        int i4 = iMax2 > 0 ? iMax2 / 2 : 0;
        int i5 = iMax > 0 ? iMax / 2 : 0;
        if (this.f3757j != null) {
            Rect rect = new Rect();
            this.f3757j.getPadding(rect);
            if (rect.top == i5 && rect.bottom == i5 && rect.left == i4 && rect.right == i4) {
                z();
                return true;
            }
        }
        if (Build.VERSION.SDK_INT >= 16) {
            if (getMinHeight() != i3) {
                setMinHeight(i3);
            }
            if (getMinWidth() != i3) {
                setMinWidth(i3);
            }
        } else {
            setMinHeight(i3);
            setMinWidth(i3);
        }
        r(i4, i5, i4, i5);
        z();
        return true;
    }

    @Override // android.widget.TextView, android.view.View
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        c1.h.f(this, this.f3756i);
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    protected int[] onCreateDrawableState(int i3) {
        int[] iArrOnCreateDrawableState = super.onCreateDrawableState(i3 + 2);
        if (isChecked()) {
            CheckBox.mergeDrawableStates(iArrOnCreateDrawableState, D);
        }
        if (s()) {
            CheckBox.mergeDrawableStates(iArrOnCreateDrawableState, E);
        }
        return iArrOnCreateDrawableState;
    }

    @Override // android.widget.TextView, android.view.View
    protected void onFocusChanged(boolean z2, int i3, Rect rect) {
        super.onFocusChanged(z2, i3, rect);
        if (this.f3771x) {
            this.f3770w.I(z2, i3, rect);
        }
    }

    @Override // android.view.View
    public boolean onHoverEvent(MotionEvent motionEvent) {
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 7) {
            setCloseIconHovered(getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY()));
        } else if (actionMasked == 10) {
            setCloseIconHovered(false);
        }
        return super.onHoverEvent(motionEvent);
    }

    @Override // android.view.View
    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName(getAccessibilityClassName());
        accessibilityNodeInfo.setCheckable(s());
        accessibilityNodeInfo.setClickable(isClickable());
        if (getParent() instanceof ChipGroup) {
            ChipGroup chipGroup = (ChipGroup) getParent();
            androidx.core.view.accessibility.d.w0(accessibilityNodeInfo).Z(d.c.a(chipGroup.b(this), 1, chipGroup.c() ? chipGroup.g(this) : -1, 1, false, isChecked()));
        }
    }

    @Override // android.widget.Button, android.widget.TextView, android.view.View
    @TargetApi(24)
    public PointerIcon onResolvePointerIcon(MotionEvent motionEvent, int i3) {
        if (getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY()) && isEnabled()) {
            return PointerIcon.getSystemIcon(getContext(), 1002);
        }
        return null;
    }

    @Override // android.widget.TextView, android.view.View
    @TargetApi(17)
    public void onRtlPropertiesChanged(int i3) {
        super.onRtlPropertiesChanged(i3);
        if (this.f3767t != i3) {
            this.f3767t = i3;
            B();
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:8:0x001e, code lost:
    
        if (r0 != 3) goto L22;
     */
    @Override // android.widget.TextView, android.view.View
    @android.annotation.SuppressLint({"ClickableViewAccessibility"})
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean onTouchEvent(android.view.MotionEvent r6) {
        /*
            r5 = this;
            int r0 = r6.getActionMasked()
            android.graphics.RectF r1 = r5.getCloseIconTouchBounds()
            float r2 = r6.getX()
            float r3 = r6.getY()
            boolean r1 = r1.contains(r2, r3)
            r2 = 0
            r3 = 1
            if (r0 == 0) goto L39
            if (r0 == r3) goto L2b
            r4 = 2
            if (r0 == r4) goto L21
            r1 = 3
            if (r0 == r1) goto L34
            goto L40
        L21:
            boolean r0 = r5.f3763p
            if (r0 == 0) goto L40
            if (r1 != 0) goto L3e
            r5.setCloseIconPressed(r2)
            goto L3e
        L2b:
            boolean r0 = r5.f3763p
            if (r0 == 0) goto L34
            r5.u()
            r0 = r3
            goto L35
        L34:
            r0 = r2
        L35:
            r5.setCloseIconPressed(r2)
            goto L41
        L39:
            if (r1 == 0) goto L40
            r5.setCloseIconPressed(r3)
        L3e:
            r0 = r3
            goto L41
        L40:
            r0 = r2
        L41:
            if (r0 != 0) goto L49
            boolean r5 = super.onTouchEvent(r6)
            if (r5 == 0) goto L4a
        L49:
            r2 = r3
        L4a:
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.onTouchEvent(android.view.MotionEvent):boolean");
    }

    public boolean s() {
        com.google.android.material.chip.a aVar = this.f3756i;
        return aVar != null && aVar.n1();
    }

    public void setAccessibilityClassName(CharSequence charSequence) {
        this.f3769v = charSequence;
    }

    @Override // android.view.View
    public void setBackground(Drawable drawable) {
        if (drawable == getBackgroundDrawable() || drawable == this.f3758k) {
            super.setBackground(drawable);
        } else {
            Log.w("Chip", "Do not set the background; Chip manages its own background drawable.");
        }
    }

    @Override // android.view.View
    public void setBackgroundColor(int i3) {
        Log.w("Chip", "Do not set the background color; Chip manages its own background drawable.");
    }

    @Override // androidx.appcompat.widget.g, android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        if (drawable == getBackgroundDrawable() || drawable == this.f3758k) {
            super.setBackgroundDrawable(drawable);
        } else {
            Log.w("Chip", "Do not set the background drawable; Chip manages its own background drawable.");
        }
    }

    @Override // androidx.appcompat.widget.g, android.view.View
    public void setBackgroundResource(int i3) {
        Log.w("Chip", "Do not set the background resource; Chip manages its own background drawable.");
    }

    @Override // android.view.View
    public void setBackgroundTintList(ColorStateList colorStateList) {
        Log.w("Chip", "Do not set the background tint list; Chip manages its own background drawable.");
    }

    @Override // android.view.View
    public void setBackgroundTintMode(PorterDuff.Mode mode) {
        Log.w("Chip", "Do not set the background tint mode; Chip manages its own background drawable.");
    }

    public void setCheckable(boolean z2) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.w1(z2);
        }
    }

    public void setCheckableResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.x1(i3);
        }
    }

    @Override // android.widget.CompoundButton, android.widget.Checkable
    public void setChecked(boolean z2) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar == null) {
            this.f3762o = z2;
        } else if (aVar.n1()) {
            super.setChecked(z2);
        }
    }

    public void setCheckedIcon(Drawable drawable) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.y1(drawable);
        }
    }

    @Deprecated
    public void setCheckedIconEnabled(boolean z2) {
        setCheckedIconVisible(z2);
    }

    @Deprecated
    public void setCheckedIconEnabledResource(int i3) {
        setCheckedIconVisible(i3);
    }

    public void setCheckedIconResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.z1(i3);
        }
    }

    public void setCheckedIconTint(ColorStateList colorStateList) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.A1(colorStateList);
        }
    }

    public void setCheckedIconTintResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.B1(i3);
        }
    }

    public void setCheckedIconVisible(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.C1(i3);
        }
    }

    public void setChipBackgroundColor(ColorStateList colorStateList) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.E1(colorStateList);
        }
    }

    public void setChipBackgroundColorResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.F1(i3);
        }
    }

    @Deprecated
    public void setChipCornerRadius(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.G1(f3);
        }
    }

    @Deprecated
    public void setChipCornerRadiusResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.H1(i3);
        }
    }

    public void setChipDrawable(com.google.android.material.chip.a aVar) {
        com.google.android.material.chip.a aVar2 = this.f3756i;
        if (aVar2 != aVar) {
            x(aVar2);
            this.f3756i = aVar;
            aVar.z2(false);
            k(this.f3756i);
            m(this.f3768u);
        }
    }

    public void setChipEndPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.I1(f3);
        }
    }

    public void setChipEndPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.J1(i3);
        }
    }

    public void setChipIcon(Drawable drawable) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.K1(drawable);
        }
    }

    @Deprecated
    public void setChipIconEnabled(boolean z2) {
        setChipIconVisible(z2);
    }

    @Deprecated
    public void setChipIconEnabledResource(int i3) {
        setChipIconVisible(i3);
    }

    public void setChipIconResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.L1(i3);
        }
    }

    public void setChipIconSize(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.M1(f3);
        }
    }

    public void setChipIconSizeResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.N1(i3);
        }
    }

    public void setChipIconTint(ColorStateList colorStateList) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.O1(colorStateList);
        }
    }

    public void setChipIconTintResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.P1(i3);
        }
    }

    public void setChipIconVisible(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.Q1(i3);
        }
    }

    public void setChipMinHeight(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.S1(f3);
        }
    }

    public void setChipMinHeightResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.T1(i3);
        }
    }

    public void setChipStartPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.U1(f3);
        }
    }

    public void setChipStartPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.V1(i3);
        }
    }

    public void setChipStrokeColor(ColorStateList colorStateList) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.W1(colorStateList);
        }
    }

    public void setChipStrokeColorResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.X1(i3);
        }
    }

    public void setChipStrokeWidth(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.Y1(f3);
        }
    }

    public void setChipStrokeWidthResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.Z1(i3);
        }
    }

    @Deprecated
    public void setChipText(CharSequence charSequence) {
        setText(charSequence);
    }

    @Deprecated
    public void setChipTextResource(int i3) {
        setText(getResources().getString(i3));
    }

    public void setCloseIcon(Drawable drawable) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.b2(drawable);
        }
        y();
    }

    public void setCloseIconContentDescription(CharSequence charSequence) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.c2(charSequence);
        }
    }

    @Deprecated
    public void setCloseIconEnabled(boolean z2) {
        setCloseIconVisible(z2);
    }

    @Deprecated
    public void setCloseIconEnabledResource(int i3) {
        setCloseIconVisible(i3);
    }

    public void setCloseIconEndPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.d2(f3);
        }
    }

    public void setCloseIconEndPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.e2(i3);
        }
    }

    public void setCloseIconResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.f2(i3);
        }
        y();
    }

    public void setCloseIconSize(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.g2(f3);
        }
    }

    public void setCloseIconSizeResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.h2(i3);
        }
    }

    public void setCloseIconStartPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.i2(f3);
        }
    }

    public void setCloseIconStartPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.j2(i3);
        }
    }

    public void setCloseIconTint(ColorStateList colorStateList) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.l2(colorStateList);
        }
    }

    public void setCloseIconTintResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.m2(i3);
        }
    }

    public void setCloseIconVisible(int i3) {
        setCloseIconVisible(getResources().getBoolean(i3));
    }

    @Override // androidx.appcompat.widget.g, android.widget.TextView
    public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
    }

    @Override // androidx.appcompat.widget.g, android.widget.TextView
    public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(int i3, int i4, int i5, int i6) {
        if (i3 != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (i5 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelativeWithIntrinsicBounds(i3, i4, i5, i6);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(int i3, int i4, int i5, int i6) {
        if (i3 != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (i5 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesWithIntrinsicBounds(i3, i4, i5, i6);
    }

    @Override // android.view.View
    public void setElevation(float f3) {
        super.setElevation(f3);
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.W(f3);
        }
    }

    @Override // android.widget.TextView
    public void setEllipsize(TextUtils.TruncateAt truncateAt) {
        if (this.f3756i == null) {
            return;
        }
        if (truncateAt == TextUtils.TruncateAt.MARQUEE) {
            throw new UnsupportedOperationException("Text within a chip are not allowed to scroll.");
        }
        super.setEllipsize(truncateAt);
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.p2(truncateAt);
        }
    }

    public void setEnsureMinTouchTargetSize(boolean z2) {
        this.f3766s = z2;
        m(this.f3768u);
    }

    @Override // android.widget.TextView
    public void setGravity(int i3) {
        if (i3 != 8388627) {
            Log.w("Chip", "Chip text must be vertically center and start aligned");
        } else {
            super.setGravity(i3);
        }
    }

    public void setHideMotionSpec(m0.h hVar) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.q2(hVar);
        }
    }

    public void setHideMotionSpecResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.r2(i3);
        }
    }

    public void setIconEndPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.s2(f3);
        }
    }

    public void setIconEndPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.t2(i3);
        }
    }

    public void setIconStartPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.u2(f3);
        }
    }

    public void setIconStartPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.v2(i3);
        }
    }

    @Override // com.google.android.material.internal.h
    public void setInternalOnCheckedChangeListener(h.a<Chip> aVar) {
        this.f3761n = aVar;
    }

    @Override // android.view.View
    public void setLayoutDirection(int i3) {
        if (this.f3756i != null && Build.VERSION.SDK_INT >= 17) {
            super.setLayoutDirection(i3);
        }
    }

    @Override // android.widget.TextView
    public void setLines(int i3) {
        if (i3 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setLines(i3);
    }

    @Override // android.widget.TextView
    public void setMaxLines(int i3) {
        if (i3 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMaxLines(i3);
    }

    @Override // android.widget.TextView
    public void setMaxWidth(int i3) {
        super.setMaxWidth(i3);
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.w2(i3);
        }
    }

    @Override // android.widget.TextView
    public void setMinLines(int i3) {
        if (i3 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMinLines(i3);
    }

    @Override // android.widget.CompoundButton
    public void setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener onCheckedChangeListener) {
        this.f3760m = onCheckedChangeListener;
    }

    public void setOnCloseIconClickListener(View.OnClickListener onClickListener) {
        this.f3759l = onClickListener;
        y();
    }

    public void setRippleColor(ColorStateList colorStateList) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.x2(colorStateList);
        }
        if (this.f3756i.l1()) {
            return;
        }
        A();
    }

    public void setRippleColorResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.y2(i3);
            if (this.f3756i.l1()) {
                return;
            }
            A();
        }
    }

    @Override // c1.n
    public void setShapeAppearanceModel(c1.k kVar) {
        this.f3756i.setShapeAppearanceModel(kVar);
    }

    public void setShowMotionSpec(m0.h hVar) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.A2(hVar);
        }
    }

    public void setShowMotionSpecResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.B2(i3);
        }
    }

    @Override // android.widget.TextView
    public void setSingleLine(boolean z2) {
        if (!z2) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setSingleLine(z2);
    }

    @Override // android.widget.TextView
    public void setText(CharSequence charSequence, TextView.BufferType bufferType) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar == null) {
            return;
        }
        if (charSequence == null) {
            charSequence = "";
        }
        super.setText(aVar.K2() ? null : charSequence, bufferType);
        com.google.android.material.chip.a aVar2 = this.f3756i;
        if (aVar2 != null) {
            aVar2.C2(charSequence);
        }
    }

    public void setTextAppearance(z0.d dVar) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.D2(dVar);
        }
        C();
    }

    public void setTextAppearanceResource(int i3) {
        setTextAppearance(getContext(), i3);
    }

    public void setTextEndPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.F2(f3);
        }
    }

    public void setTextEndPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.G2(i3);
        }
    }

    public void setTextStartPadding(float f3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.H2(f3);
        }
    }

    public void setTextStartPaddingResource(int i3) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.I2(i3);
        }
    }

    public boolean t() {
        com.google.android.material.chip.a aVar = this.f3756i;
        return aVar != null && aVar.p1();
    }

    public boolean u() {
        boolean z2 = false;
        playSoundEffect(0);
        View.OnClickListener onClickListener = this.f3759l;
        if (onClickListener != null) {
            onClickListener.onClick(this);
            z2 = true;
        }
        if (this.f3771x) {
            this.f3770w.U(1, 1);
        }
        return z2;
    }

    public boolean w() {
        return this.f3766s;
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public Chip(Context context, AttributeSet attributeSet, int i3) {
        int i4 = B;
        super(e1.a.c(context, attributeSet, i3, i4), attributeSet, i3);
        this.f3772y = new Rect();
        this.f3773z = new RectF();
        this.A = new a();
        Context context2 = getContext();
        D(attributeSet);
        com.google.android.material.chip.a aVarU0 = com.google.android.material.chip.a.u0(context2, attributeSet, i3, i4);
        p(context2, attributeSet, i3);
        setChipDrawable(aVarU0);
        aVarU0.W(y.y(this));
        TypedArray typedArrayH = m.h(context2, attributeSet, k.A, i3, i4, new int[0]);
        if (Build.VERSION.SDK_INT < 23) {
            setTextColor(z0.c.a(context2, typedArrayH, k.D));
        }
        boolean zHasValue = typedArrayH.hasValue(k.f5508m0);
        typedArrayH.recycle();
        this.f3770w = new d(this);
        y();
        if (!zHasValue) {
            q();
        }
        setChecked(this.f3762o);
        setText(aVarU0.g1());
        setEllipsize(aVarU0.a1());
        C();
        if (!this.f3756i.K2()) {
            setLines(1);
            setHorizontallyScrolling(true);
        }
        setGravity(8388627);
        B();
        if (w()) {
            setMinHeight(this.f3768u);
        }
        this.f3767t = y.E(this);
        super.setOnCheckedChangeListener(new b());
    }

    public void setCloseIconVisible(boolean z2) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.n2(z2);
        }
        y();
    }

    public void setCheckedIconVisible(boolean z2) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.D1(z2);
        }
    }

    public void setChipIconVisible(boolean z2) {
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.R1(z2);
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 == null) {
            super.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
            return;
        }
        throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
        }
        if (drawable3 == null) {
            super.setCompoundDrawablesWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
            return;
        }
        throw new UnsupportedOperationException("Please set right drawable using R.attr#closeIcon.");
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i3) {
        super.setTextAppearance(context, i3);
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.E2(i3);
        }
        C();
    }

    @Override // android.widget.TextView
    public void setTextAppearance(int i3) {
        super.setTextAppearance(i3);
        com.google.android.material.chip.a aVar = this.f3756i;
        if (aVar != null) {
            aVar.E2(i3);
        }
        C();
    }
}
