package o; import android.content.Intent; import java.util.Arrays; import java.util.Collection; import java.util.EnumSet; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; /* loaded from: classes2.dex */ public final class MHV { private static final Map> c; private static final Pattern e = Pattern.compile(","); static { EnumSet of = EnumSet.of(PTS.QR_CODE); EnumSet of2 = EnumSet.of(PTS.DATA_MATRIX); EnumSet of3 = EnumSet.of(PTS.AZTEC); EnumSet of4 = EnumSet.of(PTS.PDF_417); EnumSet of5 = EnumSet.of(PTS.UPC_A, PTS.UPC_E, PTS.EAN_13, PTS.EAN_8, PTS.RSS_14, PTS.RSS_EXPANDED); EnumSet of6 = EnumSet.of(PTS.CODE_39, PTS.CODE_93, PTS.CODE_128, PTS.ITF, PTS.CODABAR); EnumSet copyOf = EnumSet.copyOf((Collection) of5); copyOf.addAll(of6); HashMap hashMap = new HashMap(); c = hashMap; hashMap.put("ONE_D_MODE", copyOf); hashMap.put("PRODUCT_MODE", of5); hashMap.put("QR_CODE_MODE", of); hashMap.put("DATA_MATRIX_MODE", of2); hashMap.put("AZTEC_MODE", of3); hashMap.put("PDF417_MODE", of4); } public static Set NL_(Intent intent) { String stringExtra = intent.getStringExtra("SCAN_FORMATS"); return d(stringExtra != null ? Arrays.asList(e.split(stringExtra)) : null, intent.getStringExtra("SCAN_MODE")); } private static Set d(Iterable iterable, String str) { if (iterable != null) { EnumSet noneOf = EnumSet.noneOf(PTS.class); try { Iterator it = iterable.iterator(); while (it.hasNext()) { noneOf.add(PTS.valueOf(it.next())); } return noneOf; } catch (IllegalArgumentException unused) { } } if (str != null) { return c.get(str); } return null; } }