package o;

import android.content.Context;
import android.view.textclassifier.TextClassificationManager;
import android.view.textclassifier.TextClassifier;
import ir.devixor.app.activity.WebViewActivity;
import java.io.IOException;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.a4, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0684a4 extends Sb0 implements SC {
    public final /* synthetic */ int p;
    public final /* synthetic */ Object q;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C0684a4(Object obj, InterfaceC0220Im interfaceC0220Im, int i) {
        super(2, interfaceC0220Im);
        this.p = i;
        this.q = obj;
    }

    @Override // o.SC
    public final Object f(Object obj, Object obj2) {
        switch (this.p) {
            case 0:
                C0684a4 c0684a4 = (C0684a4) l((InterfaceC0065Cn) obj, (InterfaceC0220Im) obj2);
                Oh0 oh0 = Oh0.a;
                c0684a4.n(oh0);
                return oh0;
            case 1:
                return ((C0684a4) l((InterfaceC0065Cn) obj, (InterfaceC0220Im) obj2)).n(Oh0.a);
            case 2:
                return ((C0684a4) l((InterfaceC0065Cn) obj, (InterfaceC0220Im) obj2)).n(Oh0.a);
            case 3:
                C0684a4 c0684a42 = (C0684a4) l((InterfaceC0065Cn) obj, (InterfaceC0220Im) obj2);
                Oh0 oh02 = Oh0.a;
                c0684a42.n(oh02);
                return oh02;
            case 4:
                C0684a4 c0684a43 = (C0684a4) l((V60) obj, (InterfaceC0220Im) obj2);
                IJ.H(Oh0.a);
                return (V60) c0684a43.q;
            default:
                return ((C0684a4) l((InterfaceC0065Cn) obj, (InterfaceC0220Im) obj2)).n(Oh0.a);
        }
    }

    @Override // o.AbstractC0728ad
    public final InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        switch (this.p) {
            case 0:
                return new C0684a4((DialogC0484Sr) this.q, interfaceC0220Im, 0);
            case 1:
                return new C0684a4((C1332gs) this.q, interfaceC0220Im, 1);
            case 2:
                return new C0684a4((C2149pX) this.q, interfaceC0220Im, 2);
            case 3:
                return new C0684a4((B10) this.q, interfaceC0220Im, 3);
            case 4:
                return new C0684a4((V60) this.q, interfaceC0220Im, 4);
            default:
                return new C0684a4((WebViewActivity) this.q, interfaceC0220Im, 5);
        }
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) {
        String str;
        switch (this.p) {
            case 0:
                IJ.H(obj);
                ((DialogC0484Sr) this.q).show();
                return Oh0.a;
            case 1:
                IJ.H(obj);
                C1332gs c1332gs = (C1332gs) this.q;
                synchronized (c1332gs) {
                    if (!c1332gs.w || c1332gs.x) {
                        return Oh0.a;
                    }
                    try {
                        c1332gs.u();
                    } catch (IOException unused) {
                        c1332gs.y = true;
                    }
                    try {
                        if (c1332gs.t >= 2000) {
                            c1332gs.y();
                        }
                    } catch (IOException unused2) {
                        c1332gs.z = true;
                        c1332gs.u = new C1632k00(new C0418Qd());
                    }
                    return Oh0.a;
                }
            case 2:
                IJ.H(obj);
                C2149pX c2149pX = (C2149pX) this.q;
                Context context = c2149pX.b;
                EnumC2971y50 enumC2971y50 = c2149pX.c;
                TextClassificationManager textClassificationManagerK = AbstractC0719aX.k(context.getSystemService(AbstractC0719aX.p()));
                int iOrdinal = enumC2971y50.ordinal();
                if (iOrdinal == 0) {
                    str = "edittext";
                } else {
                    if (iOrdinal != 1) {
                        throw new C2170pj();
                    }
                    str = "textview";
                }
                AbstractC0816bY.k();
                TextClassifier textClassifierCreateTextClassificationSession = textClassificationManagerK.createTextClassificationSession(AbstractC0816bY.f(context.getPackageName(), str).build());
                c2149pX.f = textClassifierCreateTextClassificationSession;
                return textClassifierCreateTextClassificationSession;
            case 3:
                IJ.H(obj);
                AbstractC2793wD.p((Context) ((B10) this.q).l);
                return Oh0.a;
            case 4:
                IJ.H(obj);
                return (V60) this.q;
            default:
                IJ.H(obj);
                try {
                    int i = AbstractC1480iS.a;
                    String strB = AbstractC1480iS.b(((WebViewActivity) this.q).getApplicationContext());
                    if (strB == null) {
                        return "";
                    }
                    if (Za0.Y(strB)) {
                        strB = null;
                    }
                    return strB == null ? "" : strB;
                } catch (Exception unused3) {
                    return "";
                }
        }
    }
}
