package m;

import P.C0160d;
import P.C0162f;
import P.InterfaceC0159c;
import P.InterfaceC0176u;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.Editable;
import android.text.method.KeyListener;
import android.text.method.NumberKeyListener;
import android.util.AttributeSet;
import android.util.Log;
import android.view.ActionMode;
import android.view.DragEvent;
import android.view.textclassifier.TextClassifier;
import android.widget.EditText;
import android.widget.TextView;
import com.riyaz.zvytour.R;
import io.sentry.C0732k1;

/* JADX INFO: renamed from: m.t, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC0882t extends EditText implements InterfaceC0176u {

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

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

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

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final S.k f9247n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final io.sentry.internal.debugmeta.c f9248o;
    public C0880s p;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public AbstractC0882t(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, R.attr.editTextStyle);
        M0.a(context);
        L0.a(this, getContext());
        C0871n c0871n = new C0871n(this);
        this.f9244k = c0871n;
        c0871n.d(attributeSet, R.attr.editTextStyle);
        C0837F c0837f = new C0837F(this);
        this.f9245l = c0837f;
        c0837f.d(attributeSet, R.attr.editTextStyle);
        c0837f.b();
        C0732k1 c0732k1 = new C0732k1(20, false);
        c0732k1.f7858l = this;
        this.f9246m = c0732k1;
        this.f9247n = new S.k();
        io.sentry.internal.debugmeta.c cVar = new io.sentry.internal.debugmeta.c((EditText) this);
        this.f9248o = cVar;
        cVar.x(attributeSet, R.attr.editTextStyle);
        KeyListener keyListener = getKeyListener();
        if (keyListener instanceof NumberKeyListener) {
            return;
        }
        boolean zIsFocusable = super.isFocusable();
        boolean zIsClickable = super.isClickable();
        boolean zIsLongClickable = super.isLongClickable();
        int inputType = super.getInputType();
        KeyListener keyListenerS = cVar.s(keyListener);
        if (keyListenerS == keyListener) {
            return;
        }
        super.setKeyListener(keyListenerS);
        super.setRawInputType(inputType);
        super.setFocusable(zIsFocusable);
        super.setClickable(zIsClickable);
        super.setLongClickable(zIsLongClickable);
    }

    private C0880s getSuperCaller() {
        if (this.p == null) {
            this.p = new C0880s(this);
        }
        return this.p;
    }

    @Override // P.InterfaceC0176u
    public final C0162f a(C0162f c0162f) {
        this.f9247n.getClass();
        return S.k.a(this, c0162f);
    }

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

    @Override // android.widget.TextView
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return S4.d.M(super.getCustomSelectionActionModeCallback());
    }

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

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

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

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

    @Override // android.widget.TextView
    public TextClassifier getTextClassifier() {
        C0732k1 c0732k1;
        if (Build.VERSION.SDK_INT >= 28 || (c0732k1 = this.f9246m) == null) {
            return super.getTextClassifier();
        }
        TextClassifier textClassifier = (TextClassifier) c0732k1.f7859m;
        return textClassifier == null ? AbstractC0894z.a((TextView) c0732k1.f7858l) : textClassifier;
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x003b A[PHI: r1
      0x003b: PHI (r1v10 java.lang.String[]) = (r1v5 java.lang.String[]), (r1v11 java.lang.String[]) binds: [B:23:0x0052, B:15:0x0039] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:28:0x0059  */
    @Override // android.widget.TextView, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo r6) {
        /*
            r5 = this;
            android.view.inputmethod.InputConnection r0 = super.onCreateInputConnection(r6)
            m.F r1 = r5.f9245l
            r1.getClass()
            m.C0837F.f(r6, r0, r5)
            A1.h.z(r6, r0, r5)
            if (r0 == 0) goto L5f
            int r1 = android.os.Build.VERSION.SDK_INT
            r2 = 30
            if (r1 > r2) goto L5f
            java.lang.String[] r2 = P.Q.e(r5)
            if (r2 == 0) goto L5f
            R.d.a(r6, r2)
            N2.a r2 = new N2.a
            r3 = 3
            r2.<init>(r3, r5)
            r3 = 25
            if (r1 < r3) goto L31
            R.e r1 = new R.e
            r1.<init>(r0, r2)
        L2f:
            r0 = r1
            goto L5f
        L31:
            java.lang.String[] r4 = R.d.f2615a
            if (r1 < r3) goto L3d
            java.lang.String[] r1 = R.a.e(r6)
            if (r1 == 0) goto L55
        L3b:
            r4 = r1
            goto L55
        L3d:
            android.os.Bundle r1 = r6.extras
            if (r1 != 0) goto L42
            goto L55
        L42:
            java.lang.String r3 = "androidx.core.view.inputmethod.EditorInfoCompat.CONTENT_MIME_TYPES"
            java.lang.String[] r1 = r1.getStringArray(r3)
            if (r1 != 0) goto L52
            android.os.Bundle r1 = r6.extras
            java.lang.String r3 = "android.support.v13.view.inputmethod.EditorInfoCompat.CONTENT_MIME_TYPES"
            java.lang.String[] r1 = r1.getStringArray(r3)
        L52:
            if (r1 == 0) goto L55
            goto L3b
        L55:
            int r1 = r4.length
            if (r1 != 0) goto L59
            goto L5f
        L59:
            R.f r1 = new R.f
            r1.<init>(r0, r2)
            goto L2f
        L5f:
            io.sentry.internal.debugmeta.c r1 = r5.f9248o
            d0.b r6 = r1.A(r0, r6)
            return r6
        */
        throw new UnsupportedOperationException("Method not decompiled: m.AbstractC0882t.onCreateInputConnection(android.view.inputmethod.EditorInfo):android.view.inputmethod.InputConnection");
    }

    @Override // android.widget.TextView, android.view.View
    public final boolean onDragEvent(DragEvent dragEvent) {
        Activity activity;
        boolean zA = false;
        if (Build.VERSION.SDK_INT < 31 && dragEvent.getLocalState() == null && P.Q.e(this) != null) {
            Context context = getContext();
            while (true) {
                if (!(context instanceof ContextWrapper)) {
                    activity = null;
                    break;
                }
                if (context instanceof Activity) {
                    activity = (Activity) context;
                    break;
                }
                context = ((ContextWrapper) context).getBaseContext();
            }
            if (activity == null) {
                Log.i("ReceiveContent", "Can't handle drop: no activity: view=" + this);
            } else if (dragEvent.getAction() != 1 && dragEvent.getAction() == 3) {
                zA = AbstractC0892y.a(dragEvent, this, activity);
            }
        }
        if (zA) {
            return true;
        }
        return super.onDragEvent(dragEvent);
    }

    @Override // android.widget.EditText, android.widget.TextView
    public final boolean onTextContextMenuItem(int i) {
        InterfaceC0159c cVar;
        int i5 = Build.VERSION.SDK_INT;
        if (i5 >= 31 || P.Q.e(this) == null || !(i == 16908322 || i == 16908337)) {
            return super.onTextContextMenuItem(i);
        }
        ClipboardManager clipboardManager = (ClipboardManager) getContext().getSystemService("clipboard");
        ClipData primaryClip = clipboardManager == null ? null : clipboardManager.getPrimaryClip();
        if (primaryClip != null && primaryClip.getItemCount() > 0) {
            if (i5 >= 31) {
                cVar = new g3.c(primaryClip, 1);
            } else {
                C0160d c0160d = new C0160d();
                c0160d.f2434l = primaryClip;
                c0160d.f2435m = 1;
                cVar = c0160d;
            }
            cVar.m(i == 16908322 ? 0 : 1);
            P.Q.g(this, cVar.d());
        }
        return true;
    }

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

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

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

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

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(S4.d.N(callback, this));
    }

    public void setEmojiCompatEnabled(boolean z5) {
        this.f9248o.H(z5);
    }

    @Override // android.widget.TextView
    public void setKeyListener(KeyListener keyListener) {
        super.setKeyListener(this.f9248o.s(keyListener));
    }

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

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

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

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

    @Override // android.widget.TextView
    public final void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C0837F c0837f = this.f9245l;
        if (c0837f != null) {
            c0837f.e(context, i);
        }
    }

    @Override // android.widget.TextView
    public void setTextClassifier(TextClassifier textClassifier) {
        C0732k1 c0732k1;
        if (Build.VERSION.SDK_INT >= 28 || (c0732k1 = this.f9246m) == null) {
            super.setTextClassifier(textClassifier);
        } else {
            c0732k1.f7859m = textClassifier;
        }
    }

    @Override // android.widget.EditText, android.widget.TextView
    public Editable getText() {
        return Build.VERSION.SDK_INT >= 28 ? super.getText() : super.getEditableText();
    }
}
