package com.adobe.marketing.mobile.identity;

import com.adobe.marketing.mobile.Event;
import com.adobe.marketing.mobile.EventCoder;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes4.dex */
public final class k {

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

    /* renamed from: b, reason: collision with root package name */
    private final Event f12279b;

    /* JADX INFO: Access modifiers changed from: package-private */
    public k(String str, Event event) {
        this.f12278a = str;
        this.f12279b = event;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static k a(wg.d dVar) {
        if (dVar == null) {
            return null;
        }
        try {
            JSONObject jSONObject = new JSONObject(dVar.a());
            return new k(jSONObject.getString("URL"), EventCoder.a(jSONObject.getString("EVENT")));
        } catch (JSONException unused) {
            return null;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public Event b() {
        return this.f12279b;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public String c() {
        return this.f12278a;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public wg.d d() {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("URL", this.f12278a);
            jSONObject.put("EVENT", EventCoder.b(this.f12279b));
            return new wg.d(jSONObject.toString());
        } catch (JSONException unused) {
            return null;
        }
    }
}
