package nn;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import kn.h;
import kn.l;
import kotlin.reflect.jvm.internal.impl.descriptors.annotations.g;
import nn.j0;
import nn.m;
import po.a;
import qo.d;
import tn.s0;
import tn.t0;
import tn.u0;
import tn.v0;

/* loaded from: classes3.dex */
public abstract class c0 extends n implements kn.l {
    public static final b B = new b(null);
    private static final Object C = new Object();
    private final j0.a A;

    /* renamed from: v, reason: collision with root package name */
    private final r f30146v;

    /* renamed from: w, reason: collision with root package name */
    private final String f30147w;

    /* renamed from: x, reason: collision with root package name */
    private final String f30148x;

    /* renamed from: y, reason: collision with root package name */
    private final Object f30149y;

    /* renamed from: z, reason: collision with root package name */
    private final rm.o f30150z;

    /* loaded from: classes3.dex */
    public static abstract class a extends n implements kn.g, l.a {
        @Override // nn.n
        public r A() {
            return l().A();
        }

        @Override // nn.n
        public on.e B() {
            return null;
        }

        @Override // nn.n
        public boolean F() {
            return l().F();
        }

        public abstract s0 G();

        /* renamed from: H */
        public abstract c0 l();

        @Override // kn.g
        public boolean isExternal() {
            return G().isExternal();
        }

        @Override // kn.g
        public boolean isInfix() {
            return G().isInfix();
        }

        @Override // kn.g
        public boolean isInline() {
            return G().isInline();
        }

        @Override // kn.g
        public boolean isOperator() {
            return G().isOperator();
        }

        @Override // kn.c
        public boolean isSuspend() {
            return G().isSuspend();
        }
    }

    /* loaded from: classes3.dex */
    public static final class b {
        private b() {
        }

        public /* synthetic */ b(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    /* loaded from: classes3.dex */
    public static abstract class c extends a implements l.b {

        /* renamed from: x, reason: collision with root package name */
        static final /* synthetic */ kn.l[] f30151x = {kotlin.jvm.internal.p0.h(new kotlin.jvm.internal.g0(kotlin.jvm.internal.p0.b(c.class), "descriptor", "getDescriptor()Lorg/jetbrains/kotlin/descriptors/PropertyGetterDescriptor;"))};

        /* renamed from: v, reason: collision with root package name */
        private final j0.a f30152v = j0.b(new b());

        /* renamed from: w, reason: collision with root package name */
        private final rm.o f30153w;

        /* loaded from: classes3.dex */
        static final class a extends kotlin.jvm.internal.v implements dn.a {
            a() {
                super(0);
            }

            @Override // dn.a
            /* renamed from: a, reason: merged with bridge method [inline-methods] */
            public final on.e invoke() {
                return d0.a(c.this, true);
            }
        }

        /* loaded from: classes3.dex */
        static final class b extends kotlin.jvm.internal.v implements dn.a {
            b() {
                super(0);
            }

            @Override // dn.a
            /* renamed from: a, reason: merged with bridge method [inline-methods] */
            public final u0 invoke() {
                u0 getter = c.this.l().G().getGetter();
                return getter == null ? to.e.d(c.this.l().G(), kotlin.reflect.jvm.internal.impl.descriptors.annotations.g.f26219f.b()) : getter;
            }
        }

        public c() {
            rm.o b10;
            b10 = rm.q.b(rm.s.PUBLICATION, new a());
            this.f30153w = b10;
        }

        @Override // nn.c0.a
        /* renamed from: I, reason: merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */
        public u0 G() {
            Object b10 = this.f30152v.b(this, f30151x[0]);
            kotlin.jvm.internal.t.f(b10, "getValue(...)");
            return (u0) b10;
        }

        public boolean equals(Object obj) {
            return (obj instanceof c) && kotlin.jvm.internal.t.b(l(), ((c) obj).l());
        }

        @Override // kn.c
        public String getName() {
            return "<get-" + l().getName() + '>';
        }

        public int hashCode() {
            return l().hashCode();
        }

        public String toString() {
            return "getter of " + l();
        }

        @Override // nn.n
        public on.e z() {
            return (on.e) this.f30153w.getValue();
        }
    }

    /* loaded from: classes3.dex */
    public static abstract class d extends a implements h.a {

        /* renamed from: x, reason: collision with root package name */
        static final /* synthetic */ kn.l[] f30156x = {kotlin.jvm.internal.p0.h(new kotlin.jvm.internal.g0(kotlin.jvm.internal.p0.b(d.class), "descriptor", "getDescriptor()Lorg/jetbrains/kotlin/descriptors/PropertySetterDescriptor;"))};

        /* renamed from: v, reason: collision with root package name */
        private final j0.a f30157v = j0.b(new b());

        /* renamed from: w, reason: collision with root package name */
        private final rm.o f30158w;

        /* loaded from: classes3.dex */
        static final class a extends kotlin.jvm.internal.v implements dn.a {
            a() {
                super(0);
            }

            @Override // dn.a
            /* renamed from: a, reason: merged with bridge method [inline-methods] */
            public final on.e invoke() {
                return d0.a(d.this, false);
            }
        }

        /* loaded from: classes3.dex */
        static final class b extends kotlin.jvm.internal.v implements dn.a {
            b() {
                super(0);
            }

            @Override // dn.a
            /* renamed from: a, reason: merged with bridge method [inline-methods] */
            public final v0 invoke() {
                v0 f10 = d.this.l().G().f();
                if (f10 != null) {
                    return f10;
                }
                t0 G = d.this.l().G();
                g.a aVar = kotlin.reflect.jvm.internal.impl.descriptors.annotations.g.f26219f;
                return to.e.e(G, aVar.b(), aVar.b());
            }
        }

        public d() {
            rm.o b10;
            b10 = rm.q.b(rm.s.PUBLICATION, new a());
            this.f30158w = b10;
        }

        @Override // nn.c0.a
        /* renamed from: I, reason: merged with bridge method [inline-methods] */
        public v0 G() {
            Object b10 = this.f30157v.b(this, f30156x[0]);
            kotlin.jvm.internal.t.f(b10, "getValue(...)");
            return (v0) b10;
        }

        public boolean equals(Object obj) {
            return (obj instanceof d) && kotlin.jvm.internal.t.b(l(), ((d) obj).l());
        }

        @Override // kn.c
        public String getName() {
            return "<set-" + l().getName() + '>';
        }

        public int hashCode() {
            return l().hashCode();
        }

        public String toString() {
            return "setter of " + l();
        }

        @Override // nn.n
        public on.e z() {
            return (on.e) this.f30158w.getValue();
        }
    }

    /* loaded from: classes3.dex */
    static final class e extends kotlin.jvm.internal.v implements dn.a {
        e() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final t0 invoke() {
            return c0.this.A().w(c0.this.getName(), c0.this.M());
        }
    }

    /* loaded from: classes3.dex */
    static final class f extends kotlin.jvm.internal.v implements dn.a {
        f() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Field invoke() {
            Class<?> enclosingClass;
            m f10 = m0.f30218a.f(c0.this.G());
            if (!(f10 instanceof m.c)) {
                if (f10 instanceof m.a) {
                    return ((m.a) f10).b();
                }
                if ((f10 instanceof m.b) || (f10 instanceof m.d)) {
                    return null;
                }
                throw new rm.t();
            }
            m.c cVar = (m.c) f10;
            t0 b10 = cVar.b();
            d.a d10 = qo.i.d(qo.i.f34072a, cVar.e(), cVar.d(), cVar.g(), false, 8, null);
            if (d10 == null) {
                return null;
            }
            c0 c0Var = c0.this;
            if (bo.k.e(b10) || qo.i.f(cVar.e())) {
                enclosingClass = c0Var.A().e().getEnclosingClass();
            } else {
                tn.m b11 = b10.b();
                enclosingClass = b11 instanceof tn.e ? p0.q((tn.e) b11) : c0Var.A().e();
            }
            if (enclosingClass == null) {
                return null;
            }
            try {
                return enclosingClass.getDeclaredField(d10.c());
            } catch (NoSuchFieldException unused) {
                return null;
            }
        }
    }

    private c0(r rVar, String str, String str2, t0 t0Var, Object obj) {
        rm.o b10;
        this.f30146v = rVar;
        this.f30147w = str;
        this.f30148x = str2;
        this.f30149y = obj;
        b10 = rm.q.b(rm.s.PUBLICATION, new f());
        this.f30150z = b10;
        j0.a c10 = j0.c(t0Var, new e());
        kotlin.jvm.internal.t.f(c10, "lazySoft(...)");
        this.A = c10;
    }

    @Override // nn.n
    public r A() {
        return this.f30146v;
    }

    @Override // nn.n
    public on.e B() {
        return getGetter().B();
    }

    @Override // nn.n
    public boolean F() {
        return !kotlin.jvm.internal.t.b(this.f30149y, kotlin.jvm.internal.f.NO_RECEIVER);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public final Member G() {
        if (!G().J()) {
            return null;
        }
        m f10 = m0.f30218a.f(G());
        if (f10 instanceof m.c) {
            m.c cVar = (m.c) f10;
            if (cVar.f().y()) {
                a.c t10 = cVar.f().t();
                if (!t10.t() || !t10.s()) {
                    return null;
                }
                return A().v(cVar.d().getString(t10.r()), cVar.d().getString(t10.q()));
            }
        }
        return L();
    }

    public final Object H() {
        return on.k.g(this.f30149y, G());
    }

    /* JADX INFO: Access modifiers changed from: protected */
    /* JADX WARN: Multi-variable type inference failed */
    public final Object I(Member member, Object obj, Object obj2) {
        try {
            Object obj3 = C;
            if ((obj == obj3 || obj2 == obj3) && G().g0() == null) {
                throw new RuntimeException('\'' + this + "' is not an extension property and thus getExtensionDelegate() is not going to work, use getDelegate() instead");
            }
            Object H = F() ? H() : obj;
            if (!(H != obj3)) {
                H = null;
            }
            if (!F()) {
                obj = obj2;
            }
            if (!(obj != obj3)) {
                obj = null;
            }
            AccessibleObject accessibleObject = member instanceof AccessibleObject ? (AccessibleObject) member : null;
            if (accessibleObject != null) {
                accessibleObject.setAccessible(mn.a.a(this));
            }
            if (member == 0) {
                return null;
            }
            if (member instanceof Field) {
                return ((Field) member).get(H);
            }
            if (!(member instanceof Method)) {
                throw new AssertionError("delegate field/method " + member + " neither field nor method");
            }
            int length = ((Method) member).getParameterTypes().length;
            if (length == 0) {
                return ((Method) member).invoke(null, new Object[0]);
            }
            if (length == 1) {
                Method method = (Method) member;
                Object[] objArr = new Object[1];
                if (H == null) {
                    Class<?> cls = ((Method) member).getParameterTypes()[0];
                    kotlin.jvm.internal.t.f(cls, "get(...)");
                    H = p0.g(cls);
                }
                objArr[0] = H;
                return method.invoke(null, objArr);
            }
            if (length != 2) {
                throw new AssertionError("delegate method " + member + " should take 0, 1, or 2 parameters");
            }
            Method method2 = (Method) member;
            Object[] objArr2 = new Object[2];
            objArr2[0] = H;
            if (obj == null) {
                Class<?> cls2 = ((Method) member).getParameterTypes()[1];
                kotlin.jvm.internal.t.f(cls2, "get(...)");
                obj = p0.g(cls2);
            }
            objArr2[1] = obj;
            return method2.invoke(null, objArr2);
        } catch (IllegalAccessException e10) {
            throw new ln.b(e10);
        }
    }

    @Override // nn.n
    /* renamed from: J, reason: merged with bridge method [inline-methods] */
    public t0 G() {
        Object invoke = this.A.invoke();
        kotlin.jvm.internal.t.f(invoke, "invoke(...)");
        return (t0) invoke;
    }

    /* renamed from: K */
    public abstract c getGetter();

    public final Field L() {
        return (Field) this.f30150z.getValue();
    }

    public final String M() {
        return this.f30148x;
    }

    public boolean equals(Object obj) {
        c0 d10 = p0.d(obj);
        return d10 != null && kotlin.jvm.internal.t.b(A(), d10.A()) && kotlin.jvm.internal.t.b(getName(), d10.getName()) && kotlin.jvm.internal.t.b(this.f30148x, d10.f30148x) && kotlin.jvm.internal.t.b(this.f30149y, d10.f30149y);
    }

    @Override // kn.c
    public String getName() {
        return this.f30147w;
    }

    public int hashCode() {
        return (((A().hashCode() * 31) + getName().hashCode()) * 31) + this.f30148x.hashCode();
    }

    @Override // kn.l
    public boolean isConst() {
        return G().isConst();
    }

    @Override // kn.l
    public boolean isLateinit() {
        return G().n0();
    }

    @Override // kn.c
    public boolean isSuspend() {
        return false;
    }

    public String toString() {
        return l0.f30202a.g(G());
    }

    @Override // nn.n
    public on.e z() {
        return getGetter().z();
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public c0(r container, String name, String signature, Object obj) {
        this(container, name, signature, null, obj);
        kotlin.jvm.internal.t.g(container, "container");
        kotlin.jvm.internal.t.g(name, "name");
        kotlin.jvm.internal.t.g(signature, "signature");
    }

    /* JADX WARN: Illegal instructions before constructor call */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public c0(r container, t0 descriptor) {
        this(container, r3, m0.f30218a.f(descriptor).a(), descriptor, kotlin.jvm.internal.f.NO_RECEIVER);
        kotlin.jvm.internal.t.g(container, "container");
        kotlin.jvm.internal.t.g(descriptor, "descriptor");
        String e10 = descriptor.getName().e();
        kotlin.jvm.internal.t.f(e10, "asString(...)");
    }
}
