package com.bytedance.sdk.openadsdk.component.reward;

import android.content.Context;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/* JADX INFO: loaded from: classes2.dex */
public class sds {
    private static final Map<Integer, fm<?, ?>> fm = new ConcurrentHashMap();

    public static fm<?, ?> fm(Context context, int i10) {
        fm<?, ?> fmVarRo;
        Map<Integer, fm<?, ?>> map = fm;
        fm<?, ?> fmVar = map.get(Integer.valueOf(i10));
        if (fmVar != null) {
            return fmVar;
        }
        synchronized (sds.class) {
            try {
                fm<?, ?> fmVar2 = map.get(Integer.valueOf(i10));
                if (fmVar2 == null) {
                    fmVarRo = ro(context, i10);
                    map.put(Integer.valueOf(i10), fmVarRo);
                } else {
                    fmVarRo = fmVar2;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return fmVarRo;
    }

    private static fm<?, ?> ro(Context context, int i10) {
        if (i10 == 7) {
            return new gof(context);
        }
        if (i10 == 8) {
            return new wsy(context);
        }
        throw new IllegalArgumentException("Unsupported ad type: ".concat(String.valueOf(i10)));
    }
}
