package ng;

import com.adobe.marketing.mobile.MobilePrivacyStatus;
import java.util.HashMap;
import java.util.Map;
import kotlin.jvm.internal.t;
import ng.a;

/* loaded from: classes4.dex */
public final class h {

    /* renamed from: v, reason: collision with root package name */
    public static final a f29980v = new a(null);

    /* renamed from: a, reason: collision with root package name */
    private String f29981a;

    /* renamed from: b, reason: collision with root package name */
    private long f29982b;

    /* renamed from: c, reason: collision with root package name */
    private boolean f29983c;

    /* renamed from: d, reason: collision with root package name */
    private boolean f29984d;

    /* renamed from: e, reason: collision with root package name */
    private int f29985e;

    /* renamed from: g, reason: collision with root package name */
    private int f29987g;

    /* renamed from: h, reason: collision with root package name */
    private boolean f29988h;

    /* renamed from: i, reason: collision with root package name */
    private boolean f29989i;

    /* renamed from: j, reason: collision with root package name */
    private String f29990j;

    /* renamed from: k, reason: collision with root package name */
    private String f29991k;

    /* renamed from: l, reason: collision with root package name */
    private String f29992l;

    /* renamed from: m, reason: collision with root package name */
    private String f29993m;

    /* renamed from: n, reason: collision with root package name */
    private String f29994n;

    /* renamed from: o, reason: collision with root package name */
    private String f29995o;

    /* renamed from: p, reason: collision with root package name */
    private String f29996p;

    /* renamed from: q, reason: collision with root package name */
    private String f29997q;

    /* renamed from: t, reason: collision with root package name */
    private long f30000t;

    /* renamed from: u, reason: collision with root package name */
    private long f30001u;

    /* renamed from: f, reason: collision with root package name */
    private MobilePrivacyStatus f29986f = a.C0686a.f29945b.a();

    /* renamed from: r, reason: collision with root package name */
    private final Map f29998r = new HashMap();

    /* renamed from: s, reason: collision with root package name */
    private int f29999s = 300000;

    /* loaded from: classes4.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    private final void a() {
        this.f29998r.remove("a.loc.poi.id");
        this.f29998r.remove("a.loc.poi");
    }

    private final void b(Map map) {
        this.f29988h = !ch.j.a(ch.b.k(map, "sessionid", null));
    }

    private final void c(Map map) {
        this.f29981a = ch.b.k(map, "analytics.server", null);
        this.f29991k = ch.b.k(map, "analytics.rsids", null);
        this.f29983c = ch.b.h(map, "analytics.aamForwardingEnabled", false);
        this.f29984d = ch.b.h(map, "analytics.offlineEnabled", false);
        this.f29985e = ch.b.i(map, "analytics.batchLimit", 0);
        int i10 = ch.b.i(map, "analytics.launchHitDelay", 0);
        if (i10 >= 0) {
            this.f29987g = i10;
        }
        this.f29990j = ch.b.k(map, "experienceCloud.org", null);
        this.f29989i = ch.b.h(map, "analytics.backdatePreviousSessionInfo", false);
        MobilePrivacyStatus fromString = MobilePrivacyStatus.fromString(ch.b.k(map, "global.privacy", a.C0686a.f29945b.a().getValue()));
        t.f(fromString, "MobilePrivacyStatus.from…)\n            )\n        )");
        this.f29986f = fromString;
        this.f29999s = ch.b.i(map, "lifecycle.sessionTimeout", 300000);
    }

    private final void d(Map map) {
        this.f29992l = ch.b.k(map, "mid", null);
        this.f29995o = ch.b.k(map, "blob", null);
        this.f29993m = ch.b.k(map, "locationhint", null);
        this.f29994n = ch.b.k(map, "advertisingidentifier", null);
        if (map.containsKey("visitoridslist")) {
            try {
                this.f29996p = g.f29979a.b(ch.b.e(Object.class, map, "visitoridslist"));
            } catch (ch.c e10) {
                wg.t.a("Analytics", "AnalyticsState", "extractIdentityInfo - The format of the serializedVisitorIDsList list is invalid: %s", e10);
            }
        }
    }

    private final void e(Map map) {
        this.f30001u = ch.b.j(map, "starttimestampmillis", 0L);
        this.f30000t = ch.b.j(map, "maxsessionlength", 0L);
        Map n10 = ch.b.n(String.class, map, "lifecyclecontextdata", null);
        if (n10 == null || n10.isEmpty()) {
            return;
        }
        String str = (String) n10.get("osversion");
        if (!ch.j.a(str)) {
            Map map2 = this.f29998r;
            if (str == null) {
                str = "";
            }
            map2.put("a.OSVersion", str);
        }
        String str2 = (String) n10.get("devicename");
        if (!ch.j.a(str2)) {
            Map map3 = this.f29998r;
            if (str2 == null) {
                str2 = "";
            }
            map3.put("a.DeviceName", str2);
        }
        String str3 = (String) n10.get("resolution");
        if (!ch.j.a(str3)) {
            Map map4 = this.f29998r;
            if (str3 == null) {
                str3 = "";
            }
            map4.put("a.Resolution", str3);
        }
        String str4 = (String) n10.get("carriername");
        if (!ch.j.a(str4)) {
            Map map5 = this.f29998r;
            if (str4 == null) {
                str4 = "";
            }
            map5.put("a.CarrierName", str4);
        }
        String str5 = (String) n10.get("runmode");
        if (!ch.j.a(str5)) {
            Map map6 = this.f29998r;
            if (str5 == null) {
                str5 = "";
            }
            map6.put("a.RunMode", str5);
        }
        String str6 = (String) n10.get("appid");
        if (ch.j.a(str6)) {
            return;
        }
        this.f29998r.put("a.AppID", str6 != null ? str6 : "");
        this.f29997q = str6;
    }

    private final void f(Map map) {
        Map n10 = ch.b.n(String.class, map, "currentpoi", null);
        if (n10 == null) {
            return;
        }
        String str = (String) n10.get("regionid");
        if (!ch.j.a(str)) {
            Map map2 = this.f29998r;
            if (str == null) {
                str = "";
            }
            map2.put("a.loc.poi.id", str);
        }
        String str2 = (String) n10.get("regionname");
        if (ch.j.a(str2)) {
            return;
        }
        this.f29998r.put("a.loc.poi", str2 != null ? str2 : "");
    }

    public final void A(long j10) {
        this.f29982b = j10;
    }

    public final void B(Map dataMap) {
        t.g(dataMap, "dataMap");
        for (Map.Entry entry : dataMap.entrySet()) {
            String str = (String) entry.getKey();
            Map map = (Map) entry.getValue();
            if (map != null) {
                switch (str.hashCode()) {
                    case -1763874718:
                        if (str.equals("com.adobe.module.places")) {
                            f(map);
                            break;
                        } else {
                            break;
                        }
                    case -762198124:
                        if (str.equals("com.adobe.module.lifecycle")) {
                            e(map);
                            break;
                        } else {
                            break;
                        }
                    case -566238380:
                        if (str.equals("com.adobe.module.identity")) {
                            d(map);
                            break;
                        } else {
                            break;
                        }
                    case 1431260033:
                        if (str.equals("com.adobe.assurance")) {
                            b(map);
                            break;
                        } else {
                            break;
                        }
                    case 1940533280:
                        if (str.equals("com.adobe.module.configuration")) {
                            c(map);
                            break;
                        } else {
                            break;
                        }
                }
            } else {
                wg.t.e("Analytics", "AnalyticsState", "update - Unable to extract data for %s, it was null.", str);
            }
        }
    }

    public final Map g() {
        HashMap hashMap = new HashMap();
        if (ch.j.a(this.f29992l)) {
            return hashMap;
        }
        String str = this.f29992l;
        if (str == null) {
            str = "";
        }
        hashMap.put("mid", str);
        if (!ch.j.a(this.f29995o)) {
            String str2 = this.f29995o;
            if (str2 == null) {
                str2 = "";
            }
            hashMap.put("aamb", str2);
        }
        if (!ch.j.a(this.f29993m)) {
            String str3 = this.f29993m;
            hashMap.put("aamlh", str3 != null ? str3 : "");
        }
        return hashMap;
    }

    public final String h() {
        return this.f29997q;
    }

    public final int i() {
        return this.f29985e;
    }

    public final Map j() {
        return this.f29998r;
    }

    public final String k() {
        return this.f29981a;
    }

    public final long l() {
        return this.f29982b;
    }

    public final long m() {
        return this.f30000t;
    }

    public final long n() {
        return this.f30001u;
    }

    public final MobilePrivacyStatus o() {
        return this.f29986f;
    }

    public final int p() {
        return this.f29987g;
    }

    public final String q() {
        return this.f29991k;
    }

    public final String r() {
        return this.f29996p;
    }

    public final boolean s() {
        return (ch.j.a(this.f29991k) || ch.j.a(this.f29981a)) ? false : true;
    }

    public final boolean t() {
        return this.f29983c;
    }

    public final boolean u() {
        return this.f29988h;
    }

    public final boolean v() {
        return this.f29989i;
    }

    public final boolean w() {
        return this.f29984d;
    }

    public final boolean x() {
        return this.f29986f == MobilePrivacyStatus.OPT_IN;
    }

    public final boolean y() {
        return !ch.j.a(this.f29990j);
    }

    public final void z() {
        a();
        this.f29992l = null;
        this.f29993m = null;
        this.f29995o = null;
        this.f29996p = null;
        this.f29997q = null;
        this.f29994n = null;
    }
}
