package C7;

import B7.i;
import C4.f;
import P6.g;
import P6.n;
import java.util.regex.Pattern;

/* JADX INFO: loaded from: classes.dex */
public final class c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f1421a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final a f1422b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final b f1423c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final i f1424d;

    public c(String str, f fVar) {
        b bVar;
        i cVar;
        a aVar = a.VERY_HIGH;
        g.e(str, "s");
        Pattern patternCompile = Pattern.compile("^[0-9A-Z $%*+\\-./:]+$");
        g.d(patternCompile, "compile(...)");
        if (patternCompile.matcher(str).matches()) {
            Pattern patternCompile2 = Pattern.compile("^\\d+$");
            g.d(patternCompile2, "compile(...)");
            bVar = patternCompile2.matcher(str).matches() ? b.f1416r : b.f1417s;
        } else {
            bVar = b.f1418t;
        }
        g.e(str, "data");
        g.e(fVar, "graphicsFactory");
        this.f1421a = str;
        this.f1422b = aVar;
        this.f1423c = bVar;
        int iOrdinal = bVar.ordinal();
        if (iOrdinal == 0) {
            cVar = new B7.c(1, str);
        } else if (iOrdinal == 1) {
            cVar = new B7.c(0, str);
        } else {
            if (iOrdinal != 2) {
                throw new A6.b();
            }
            cVar = new B7.b(str);
        }
        this.f1424d = cVar;
    }

    public final String toString() {
        return "QRCode(data=" + this.f1421a + ", errorCorrectionLevel=" + this.f1422b + ", dataType=" + this.f1423c + ", qrCodeData=" + n.a(this.f1424d.getClass()).c() + ')';
    }
}
