package com.adobe.marketing.mobile.lifecycle;

import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

/* loaded from: classes4.dex */
class w {

    /* renamed from: b, reason: collision with root package name */
    private String f12398b;

    /* renamed from: c, reason: collision with root package name */
    private String f12399c;

    /* renamed from: d, reason: collision with root package name */
    private String f12400d;

    /* renamed from: e, reason: collision with root package name */
    private String f12401e;

    /* renamed from: f, reason: collision with root package name */
    private x f12402f;

    /* renamed from: a, reason: collision with root package name */
    private final String f12397a = "XDMLifecycleEnvironment";

    /* renamed from: g, reason: collision with root package name */
    private final String f12403g = "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$";

    /* renamed from: h, reason: collision with root package name */
    private final Pattern f12404h = Pattern.compile("^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$");

    private boolean a(String str) {
        return this.f12404h.matcher(str).matches();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public Map b() {
        HashMap hashMap = new HashMap();
        String str = this.f12398b;
        if (str != null) {
            hashMap.put("carrier", str);
        }
        if (!ch.j.a(this.f12399c)) {
            if (a(this.f12399c)) {
                HashMap hashMap2 = new HashMap();
                hashMap2.put("language", this.f12399c);
                hashMap.put("_dc", hashMap2);
            } else {
                wg.t.f("Lifecycle", "XDMLifecycleEnvironment", "Language tag '%s' failed validation and will be dropped. Values for XDM field 'environment._dc.language' must conform to BCP 47.", this.f12399c);
            }
        }
        String str2 = this.f12400d;
        if (str2 != null) {
            hashMap.put("operatingSystem", str2);
        }
        String str3 = this.f12401e;
        if (str3 != null) {
            hashMap.put("operatingSystemVersion", str3);
        }
        x xVar = this.f12402f;
        if (xVar != null) {
            hashMap.put("type", xVar.toString());
        }
        return hashMap;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void c(String str) {
        this.f12398b = str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void d(String str) {
        this.f12399c = str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void e(String str) {
        this.f12400d = str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void f(String str) {
        this.f12401e = str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void g(x xVar) {
        this.f12402f = xVar;
    }
}
