package defpackage;

import android.net.Uri;
import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: renamed from: ᵦᐧˈː, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class C3574 implements InterfaceC4422 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final Object f13659;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final Object f13660;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final /* synthetic */ int f13661;

    public /* synthetic */ C3574(Object obj, int i, Object obj2) {
        this.f13661 = i;
        this.f13659 = obj;
        this.f13660 = obj2;
    }

    @Override // defpackage.InterfaceC4422
    public final ListenableFuture apply(Object obj) throws IOException {
        switch (this.f13661) {
            case 0:
                C5283 c5283 = (C5283) this.f13659;
                return ((C1431) c5283.f19948.get()).m4102(new ʽᵺᴵ(c5283, (InterfaceC2011) this.f13660));
            case 1:
                List list = (List) this.f13659;
                C0613 c0613 = (C0613) obj;
                int size = list.size();
                ArrayList arrayList = new ArrayList(size);
                Iterator it = list.iterator();
                if (it.hasNext()) {
                    it.next().getClass();
                    C1685.m4560();
                    return null;
                }
                C3574 c3574M4991 = AbstractC1818.m4991(new C0300(this, arrayList, size));
                EnumC2921 enumC2921 = EnumC2921.f11255;
                return AbstractC4226.m9196(AbstractC4226.m9198(AbstractC4226.m9196(AbstractC4226.m9194(c0613.f2951.f2676.m6758()), AbstractC1818.m4991(new C3574(c0613, 3, c3574M4991)), enumC2921), new C3414(), enumC2921), AbstractC1818.m4991(new C0300(this, size, arrayList)), enumC2921);
            case 2:
                C4735 c4735 = (C4735) this.f13659;
                C5326 c5326 = (C5326) this.f13660;
                c4735.m9900((Uri) AbstractC4226.m9192((ListenableFuture) c4735.f18005), obj);
                synchronized (c4735.f17999) {
                    c4735.f18002 = c5326;
                    break;
                }
                return AbstractC4226.m9197(obj);
            case 3:
                return ((C0613) this.f13659).f2951.f2675.m9899((C3574) this.f13660, EnumC2921.f11255);
            default:
                InterfaceC1040 interfaceC1040 = (InterfaceC1040) this.f13659;
                C3858 c3858M7695 = AbstractC3351.m7695();
                InterfaceC1040 interfaceC1040M7696 = AbstractC3351.m7696(c3858M7695, interfaceC1040);
                try {
                    ListenableFuture listenableFutureApply = ((InterfaceC4422) this.f13660).apply(obj);
                    if (listenableFutureApply != null) {
                        return listenableFutureApply;
                    }
                    throw new IllegalStateException("AsyncFunction should return a ListenableFuture instead of null.");
                } catch (Throwable th) {
                    try {
                        AbstractC2803.m6783(th);
                        throw th;
                    } finally {
                        AbstractC3351.m7696(c3858M7695, interfaceC1040M7696);
                    }
                }
        }
    }

    public String toString() {
        switch (this.f13661) {
            case 4:
                InterfaceC4422 interfaceC4422 = (InterfaceC4422) this.f13660;
                StringBuilder sb = new StringBuilder(interfaceC4422.toString().length() + 14);
                sb.append("propagating=[");
                sb.append(interfaceC4422);
                sb.append("]");
                return sb.toString();
            default:
                return super.toString();
        }
    }
}
