package ඓ.ῲ.K.Ԕ;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import ඓ.ῲ.K.ᕣ.AbstractC0853;

/* renamed from: ඓ.ῲ.K.Ԕ.ඓ  reason: contains not printable characters */
/* compiled from: ResourceDecoderRegistry */
public class C0813 {

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Map<String, List<C0814<?, ?>>> f4031 = new HashMap();

    /* renamed from: K  reason: contains not printable characters */
    public final List<String> f4032 = new ArrayList();

    /* renamed from: ඓ.ῲ.K.Ԕ.ඓ$K  reason: contains not printable characters */
    /* compiled from: ResourceDecoderRegistry */
    public static class C0814<T, R> {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final AbstractC0853<T, R> f4033;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final Class<R> f4034;

        /* renamed from: K  reason: contains not printable characters */
        public final Class<T> f4035;

        public C0814(Class<T> cls, Class<R> cls2, AbstractC0853<T, R> r3) {
            this.f4035 = cls;
            this.f4034 = cls2;
            this.f4033 = r3;
        }

        /* renamed from: K  reason: contains not printable characters */
        public boolean m2408(Class<?> cls, Class<?> cls2) {
            return this.f4035.isAssignableFrom(cls) && cls2.isAssignableFrom(this.f4034);
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public synchronized <T, R> List<Class<R>> m2403(Class<T> cls, Class<R> cls2) {
        ArrayList arrayList;
        arrayList = new ArrayList();
        for (String str : this.f4032) {
            List<C0814<?, ?>> list = this.f4031.get(str);
            if (list != null) {
                for (C0814<?, ?> k : list) {
                    if (k.m2408(cls, cls2) && !arrayList.contains(k.f4034)) {
                        arrayList.add(k.f4034);
                    }
                }
            }
        }
        return arrayList;
    }

    /* renamed from: K  reason: contains not printable characters */
    public synchronized void m2407(List<String> list) {
        ArrayList<String> arrayList = new ArrayList(this.f4032);
        this.f4032.clear();
        for (String str : list) {
            this.f4032.add(str);
        }
        for (String str2 : arrayList) {
            if (!list.contains(str2)) {
                this.f4032.add(str2);
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public synchronized <T, R> List<AbstractC0853<T, R>> m2404(Class<T> cls, Class<R> cls2) {
        ArrayList arrayList;
        arrayList = new ArrayList();
        for (String str : this.f4032) {
            List<C0814<?, ?>> list = this.f4031.get(str);
            if (list != null) {
                for (C0814<?, ?> k : list) {
                    if (k.m2408(cls, cls2)) {
                        arrayList.add(k.f4033);
                    }
                }
            }
        }
        return arrayList;
    }

    /* renamed from: K  reason: contains not printable characters */
    public synchronized <T, R> void m2406(String str, AbstractC0853<T, R> r3, Class<T> cls, Class<R> cls2) {
        m2405(str).add(new C0814<>(cls, cls2, r3));
    }

    /* renamed from: K  reason: contains not printable characters */
    public final synchronized List<C0814<?, ?>> m2405(String str) {
        List<C0814<?, ?>> list;
        if (!this.f4032.contains(str)) {
            this.f4032.add(str);
        }
        list = this.f4031.get(str);
        if (list == null) {
            list = new ArrayList<>();
            this.f4031.put(str, list);
        }
        return list;
    }
}
