package defpackage;

import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.upstream.CmcdData;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\b\u0012\u0004\u0012\u00028\u00000\u0002:\u0001\u0003¨\u0006\u0004"}, d2 = {"Lcy6;", "T", "Lno6;", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "kotlinx-datetime"}, k = 1, mv = {1, 9, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
public final class cy6<T> implements no6<T> {
    public final String a;
    public final sa1 b;
    public final ArrayList c;

    @Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\b\u0002\u0018\u0000*\u0006\b\u0001\u0010\u0001 \u0000*\u0004\b\u0002\u0010\u00022\u00020\u0003:\u0001\u0004¨\u0006\u0005"}, d2 = {"Lcy6$a;", "T", "E", "", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "kotlinx-datetime"}, k = 1, mv = {1, 9, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class a<T, E> {
        public final p3 a;
        public final Object b;

        /* JADX INFO: renamed from: cy6$a$a, reason: collision with other inner class name */
        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lcy6$a$a;", "", "kotlinx-datetime"}, k = 1, mv = {1, 9, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final class C0128a {
        }

        public a(p3 p3Var, Object obj) {
            this.a = p3Var;
            this.b = obj;
        }
    }

    public cy6(String str, sa1 sa1Var) {
        this.a = str;
        this.b = sa1Var;
        za5 za5VarS = y41.s();
        xi3.a(za5VarS, sa1Var);
        za5 za5VarN = y41.n(za5VarS);
        ArrayList arrayList = new ArrayList(y41.p(za5VarN, 10));
        ListIterator listIterator = za5VarN.listIterator(0);
        while (listIterator.hasNext()) {
            arrayList.add(((ow2) listIterator.next()).c());
        }
        List<zw2> listT = y41.t(arrayList);
        ArrayList arrayList2 = new ArrayList(y41.p(listT, 10));
        for (zw2 zw2Var : listT) {
            cr4.g(zw2Var, "field");
            Object c = zw2Var.getC();
            if (c == null) {
                throw new IllegalArgumentException(("The field '" + zw2Var.getB() + "' does not define a default value").toString());
            }
            arrayList2.add(new a(zw2Var.a(), c));
        }
        this.c = arrayList2;
    }

    @Override // defpackage.wi3
    /* JADX INFO: renamed from: a */
    public final yi3 getB() {
        yi3 b = this.b.getB();
        ArrayList<a> arrayList = this.c;
        ArrayList arrayList2 = new ArrayList(y41.p(arrayList, 10));
        for (a aVar : arrayList) {
            arrayList2.add(new w71(aVar.b, new dy6(1, aVar.a, p3.class, "getter", "getter(Ljava/lang/Object;)Ljava/lang/Object;", 0)));
        }
        boolean zIsEmpty = arrayList2.isEmpty();
        vx9 vx9Var = vx9.a;
        qf7 bc1Var = zIsEmpty ? vx9Var : arrayList2.size() == 1 ? (qf7) y41.bd(arrayList2) : new bc1(arrayList2);
        return bc1Var instanceof vx9 ? new nc1() : new rb1(y41.an(new q07(new ey6(1, bc1Var, qf7.class, "test", "test(Ljava/lang/Object;)Z", 0), new nc1()), new q07(new fy6(1, vx9Var, vx9.class, "test", "test(Ljava/lang/Object;)Z", 0), b)));
    }

    @Override // defpackage.wi3
    /* JADX INFO: renamed from: b */
    public final s37 getC() {
        s37 c = this.b.getC();
        s37 c2 = new lc1(this.a).getC();
        boolean zIsEmpty = this.c.isEmpty();
        ik2 ik2Var = ik2.a;
        return new s37(ik2Var, y41.an(c, o37.a(y41.an(c2, new s37(zIsEmpty ? ik2Var : y41.am(new h5a(new C0561gy6(this))), ik2Var)))));
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof cy6)) {
            return false;
        }
        cy6 cy6Var = (cy6) obj;
        return this.a.equals(cy6Var.a) && this.b.equals(cy6Var.b);
    }

    public final int hashCode() {
        return this.b.a.hashCode() + (this.a.hashCode() * 31);
    }

    public final String toString() {
        return "Optional(" + this.a + ", " + this.b + ')';
    }
}
