package pl;

import java.util.Collection;
import java.util.Collections;

/* loaded from: classes3.dex */
public final class j extends z {
    @Override // pl.s
    public boolean[] d(String str) {
        int length = str.length();
        if (length == 12) {
            try {
                str = str + y.r(str);
            } catch (yk.h e10) {
                throw new IllegalArgumentException(e10);
            }
        } else {
            if (length != 13) {
                throw new IllegalArgumentException("Requested contents should be 12 or 13 digits long, but got ".concat(String.valueOf(length)));
            }
            try {
                if (!y.i(str)) {
                    throw new IllegalArgumentException("Contents do not pass checksum");
                }
            } catch (yk.h unused) {
                throw new IllegalArgumentException("Illegal contents");
            }
        }
        s.c(str);
        int i10 = i.f32891j[Character.digit(str.charAt(0), 10)];
        boolean[] zArr = new boolean[95];
        int b10 = s.b(zArr, 0, y.f32919d, true) + 0;
        for (int i11 = 1; i11 <= 6; i11++) {
            int digit = Character.digit(str.charAt(i11), 10);
            if (((i10 >> (6 - i11)) & 1) == 1) {
                digit += 10;
            }
            b10 += s.b(zArr, b10, y.f32923h[digit], false);
        }
        int b11 = b10 + s.b(zArr, b10, y.f32920e, false);
        for (int i12 = 7; i12 <= 12; i12++) {
            b11 += s.b(zArr, b11, y.f32922g[Character.digit(str.charAt(i12), 10)], true);
        }
        s.b(zArr, b11, y.f32919d, true);
        return zArr;
    }

    @Override // pl.s
    protected Collection f() {
        return Collections.singleton(yk.a.EAN_13);
    }
}
