package defpackage;

import android.net.Uri;
import android.text.TextUtils;
import androidx.media3.common.ParserException;
import j$.util.DesugarTimeZone;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* JADX INFO: renamed from: ᵼᐧﾞʛ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C5282 implements InterfaceC2793 {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public static final Pattern f19941 = Pattern.compile("(.+?)(Z|((\\+|-|−)(\\d\\d)(:?(\\d\\d))?))");

    @Override // defpackage.InterfaceC2793
    /* JADX INFO: renamed from: ᵜᵪʾ */
    public final Object mo6779(Uri uri, C4437 c4437) throws IOException {
        String line = new BufferedReader(new InputStreamReader(c4437, StandardCharsets.UTF_8)).readLine();
        try {
            Matcher matcher = f19941.matcher(line);
            if (!matcher.matches()) {
                throw ParserException.m355("Couldn't parse timestamp: " + line, null);
            }
            String strGroup = matcher.group(1);
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
            simpleDateFormat.setTimeZone(DesugarTimeZone.getTimeZone("UTC"));
            long time = simpleDateFormat.parse(strGroup).getTime();
            if (!"Z".equals(matcher.group(2))) {
                long j = "+".equals(matcher.group(4)) ? 1L : -1L;
                long j2 = Long.parseLong(matcher.group(5));
                String strGroup2 = matcher.group(7);
                time -= (((j2 * 60) + (TextUtils.isEmpty(strGroup2) ? 0L : Long.parseLong(strGroup2))) * 60000) * j;
            }
            return Long.valueOf(time);
        } catch (ParseException e) {
            throw ParserException.m355(null, e);
        }
    }
}
