package com.discord.utilities.embed; import androidx.annotation.DrawableRes; import d0.z.d.m; import java.util.regex.Matcher; import java.util.regex.Pattern; import kotlin.NoWhenBranchMatchedException; import kotlin.jvm.internal.DefaultConstructorMarker; /* compiled from: FileType.kt */ /* JADX WARN: Init of enum VIDEO can be incorrect */ /* JADX WARN: Init of enum ACROBAT can be incorrect */ /* JADX WARN: Init of enum AE can be incorrect */ /* JADX WARN: Init of enum SKETCH can be incorrect */ /* JADX WARN: Init of enum AI can be incorrect */ /* JADX WARN: Init of enum ARCHIVE can be incorrect */ /* JADX WARN: Init of enum CODE can be incorrect */ /* JADX WARN: Init of enum DOCUMENT can be incorrect */ /* JADX WARN: Init of enum SPREADSHEET can be incorrect */ /* JADX WARN: Init of enum WEBCODE can be incorrect */ public enum FileType { VIDEO(r2), ACROBAT(r2), AE(r2), SKETCH(r2), AI(r2), ARCHIVE(r2), CODE(r2), DOCUMENT(r2), SPREADSHEET(r2), WEBCODE(r2); public static final Companion Companion = new Companion(null); private final ThreadLocal threadLocalMatcher; /* compiled from: FileType.kt */ public static final class Companion { private Companion() { } public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } public final FileType getFromExtension(String str) { m.checkNotNullParameter(str, "extension"); FileType[] values = FileType.values(); for (int i = 0; i < 10; i++) { FileType fileType = values[i]; if (FileType.access$matches(fileType, str)) { return fileType; } } return null; } } public final /* synthetic */ class WhenMappings { public static final /* synthetic */ int[] $EnumSwitchMapping$0; static { FileType.values(); int[] iArr = new int[10]; $EnumSwitchMapping$0 = iArr; iArr[FileType.VIDEO.ordinal()] = 1; iArr[FileType.ACROBAT.ordinal()] = 2; iArr[FileType.AE.ordinal()] = 3; iArr[FileType.SKETCH.ordinal()] = 4; iArr[FileType.AI.ordinal()] = 5; iArr[FileType.ARCHIVE.ordinal()] = 6; iArr[FileType.CODE.ordinal()] = 7; iArr[FileType.DOCUMENT.ordinal()] = 8; iArr[FileType.SPREADSHEET.ordinal()] = 9; iArr[FileType.WEBCODE.ordinal()] = 10; } } static { Pattern compile = Pattern.compile("(?:avi|flv|wmv|mov|mp4)$", 0); m.checkNotNullExpressionValue(compile, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile2 = Pattern.compile("pdf$", 0); m.checkNotNullExpressionValue(compile2, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile3 = Pattern.compile("ae$", 0); m.checkNotNullExpressionValue(compile3, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile4 = Pattern.compile("sketch$", 0); m.checkNotNullExpressionValue(compile4, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile5 = Pattern.compile("ai$", 0); m.checkNotNullExpressionValue(compile5, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile6 = Pattern.compile("(?:rar|zip|7z|tar|tar\\.gz)$", 0); m.checkNotNullExpressionValue(compile6, "java.util.regex.Pattern.compile(this, flags)"); String str = "(?:c\\+\\+|cpp|cc|c|h|hpp|mm|m|json|js|rb|rake|py|asm|fs|pyc|dtd|cgi|bat|rss|java|graphml|idb|lua|o|gml|prl|sls|conf|cmake|make|sln|vbe|cxx|wbf|vbs|r|wml|php|bash|applescript|fcgi|yaml|ex|exs|sh|ml|actionscript)$"; m.checkNotNullExpressionValue(str, "StringBuilder()\n .a…(\")\\$\")\n .toString()"); Pattern compile7 = Pattern.compile(str, 0); m.checkNotNullExpressionValue(compile7, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile8 = Pattern.compile("(?:txt|rtf|doc|docx|md|pages|ppt|pptx|pptm|key|log)$", 0); m.checkNotNullExpressionValue(compile8, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile9 = Pattern.compile("(?:xls|xlsx|numbers|csv|xliff)$", 0); m.checkNotNullExpressionValue(compile9, "java.util.regex.Pattern.compile(this, flags)"); Pattern compile10 = Pattern.compile("(?:html|xhtml|htm|js|xml|xls|xsd|css|styl)$", 0); m.checkNotNullExpressionValue(compile10, "java.util.regex.Pattern.compile(this, flags)"); } private FileType(Pattern pattern) { this.threadLocalMatcher = new FileType$threadLocalMatcher$1(pattern); } public static final /* synthetic */ boolean access$matches(FileType fileType, String str) { return fileType.matches(str); } private final boolean matches(String str) { Matcher matcher = this.threadLocalMatcher.get(); m.checkNotNull(matcher); return matcher.reset(str).find(); } @DrawableRes public final int getFileDrawable() { switch (ordinal()) { case 0: return 2131231631; case 1: return 2131231614; case 2: return 2131231615; case 3: return 2131231627; case 4: return 2131231616; case 5: return 2131231617; case 6: return 2131231619; case 7: return 2131231620; case 8: return 2131231628; case 9: return 2131231632; default: throw new NoWhenBranchMatchedException(); } } }