package z2;

import android.os.LocaleList;
import android.text.style.LocaleSpan;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Locale;
import sm.v;
import y2.g;

/* loaded from: classes.dex */
public final class a {

    /* renamed from: a, reason: collision with root package name */
    public static final a f53149a = new a();

    private a() {
    }

    public final Object a(x2.e eVar) {
        int v10;
        v10 = v.v(eVar, 10);
        ArrayList arrayList = new ArrayList(v10);
        Iterator<E> it = eVar.iterator();
        while (it.hasNext()) {
            arrayList.add(((x2.d) it.next()).a());
        }
        Locale[] localeArr = (Locale[]) arrayList.toArray(new Locale[0]);
        return new LocaleSpan(new LocaleList((Locale[]) Arrays.copyOf(localeArr, localeArr.length)));
    }

    public final void b(g gVar, x2.e eVar) {
        int v10;
        v10 = v.v(eVar, 10);
        ArrayList arrayList = new ArrayList(v10);
        Iterator<E> it = eVar.iterator();
        while (it.hasNext()) {
            arrayList.add(((x2.d) it.next()).a());
        }
        Locale[] localeArr = (Locale[]) arrayList.toArray(new Locale[0]);
        gVar.setTextLocales(new LocaleList((Locale[]) Arrays.copyOf(localeArr, localeArr.length)));
    }
}
