package o;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.RandomAccess;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.sY, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2434sY extends DD {
    private static final C2434sY DEFAULT_INSTANCE;
    private static volatile PV PARSER = null;
    public static final int STRINGS_FIELD_NUMBER = 1;
    private InterfaceC2323rI strings_ = C2625uZ.f746o;

    static {
        C2434sY c2434sY = new C2434sY();
        DEFAULT_INSTANCE = c2434sY;
        DD.j(C2434sY.class, c2434sY);
    }

    public static void l(C2434sY c2434sY, Iterable iterable) {
        InterfaceC2323rI interfaceC2323rI = c2434sY.strings_;
        if (!((AbstractC0676a0) interfaceC2323rI).l) {
            C2625uZ c2625uZ = (C2625uZ) interfaceC2323rI;
            int i = c2625uZ.n;
            c2434sY.strings_ = c2625uZ.c(i == 0 ? 10 : i * 2);
        }
        RandomAccess randomAccess = c2434sY.strings_;
        Charset charset = AbstractC2418sI.a;
        if (iterable instanceof DK) {
            List listJ = ((DK) iterable).j();
            if (randomAccess != null) {
                throw new ClassCastException();
            }
            ((C2625uZ) randomAccess).getClass();
            Iterator it = listJ.iterator();
            if (it.hasNext()) {
                Object next = it.next();
                next.getClass();
                if (next instanceof AbstractC0161Gf) {
                    throw null;
                }
                if (!(next instanceof byte[])) {
                    throw null;
                }
                byte[] bArr = (byte[]) next;
                AbstractC0161Gf.c(bArr, 0, bArr.length);
                throw null;
            }
            return;
        }
        if (iterable instanceof FY) {
            ((AbstractC0676a0) randomAccess).addAll((Collection) iterable);
            return;
        }
        if ((randomAccess instanceof ArrayList) && (iterable instanceof Collection)) {
            ((ArrayList) randomAccess).ensureCapacity(((Collection) iterable).size() + ((C2625uZ) randomAccess).n);
        }
        C2625uZ c2625uZ2 = (C2625uZ) randomAccess;
        int i2 = c2625uZ2.n;
        for (Object obj : iterable) {
            if (obj == null) {
                String str = "Element at index " + (c2625uZ2.n - i2) + " is null.";
                for (int i3 = c2625uZ2.n - 1; i3 >= i2; i3--) {
                    c2625uZ2.remove(i3);
                }
                throw new NullPointerException(str);
            }
            c2625uZ2.add(obj);
        }
    }

    public static C2434sY m() {
        return DEFAULT_INSTANCE;
    }

    public static C2339rY o() {
        return (C2339rY) ((BD) DEFAULT_INSTANCE.c(5));
    }

    @Override // o.DD
    public final Object c(int i) {
        PV cd;
        switch (AbstractC2462sn.w(i)) {
            case 0:
                return (byte) 1;
            case 1:
                return null;
            case 2:
                return new C1059e00(DEFAULT_INSTANCE, "\u0001\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001a", new Object[]{"strings_"});
            case 3:
                return new C2434sY();
            case 4:
                return new C2339rY(DEFAULT_INSTANCE);
            case 5:
                return DEFAULT_INSTANCE;
            case 6:
                PV pv = PARSER;
                if (pv != null) {
                    return pv;
                }
                synchronized (C2434sY.class) {
                    try {
                        cd = PARSER;
                        if (cd == null) {
                            cd = new CD();
                            PARSER = cd;
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
                return cd;
            default:
                throw new UnsupportedOperationException();
        }
    }

    public final InterfaceC2323rI n() {
        return this.strings_;
    }
}
