package defpackage;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

/* JADX INFO: renamed from: ᵟʩ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3058 extends AbstractC5350 {

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final /* synthetic */ int f11712 = 1;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final Object f11713;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C3058(C0099 c0099, C2991 c2991) {
        super("getValue");
        this.f11713 = c2991;
    }

    public C3058(CallableC1105 callableC1105) {
        super("internal.appMetadata");
        this.f11713 = callableC1105;
    }

    public C3058(C2991 c2991) {
        super("internal.registerCallback");
        this.f11713 = c2991;
    }

    public C3058(C2994 c2994) {
        super("internal.eventLogger");
        this.f11713 = c2994;
    }

    public C3058(ᵷˇ r7) {
        super("internal.logger");
        this.f11713 = r7;
        this.f20245.put("log", new C1908(this, false, true));
        this.f20245.put("silent", new C0099(1, "silent"));
        ((AbstractC5350) this.f20245.get("silent")).mo7129("log", new C1908(this, true, true));
        this.f20245.put("unmonitored", new C0099(2, "unmonitored"));
        ((AbstractC5350) this.f20245.get("unmonitored")).mo7129("log", new C1908(this, false, false));
    }

    @Override // defpackage.AbstractC5350
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final InterfaceC2992 mo1168(C4055 c4055, List list) {
        TreeMap treeMap;
        int i = this.f11712;
        String str = this.f20244;
        C5293 c5293 = InterfaceC2992.f11526;
        Object obj = this.f11713;
        String str2 = null;
        switch (i) {
            case 0:
                ˀᵳˎᵹ.ˌᵨʠᵫ(str, 3, list);
                String strMo3185 = ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) list.get(0)).mo3185();
                InterfaceC2992 interfaceC2992 = (InterfaceC2992) list.get(1);
                ʽᵺᴵ r2 = (ʽᵺᴵ) c4055.f15557;
                long j = (long) ˀᵳˎᵹ.ˀᵭ(r2.ˊᵨᵧ(c4055, interfaceC2992).mo3182().doubleValue());
                InterfaceC2992 interfaceC29922 = r2.ˊᵨᵧ(c4055, (InterfaceC2992) list.get(2));
                HashMap map = interfaceC29922 instanceof C3037 ? ˀᵳˎᵹ.ˊᵡᵗʨ((C3037) interfaceC29922) : new HashMap();
                C2994 c2994 = (C2994) obj;
                c2994.getClass();
                HashMap map2 = new HashMap();
                for (String str3 : map.keySet()) {
                    HashMap map3 = ((C3003) c2994.f11535).f11565;
                    map2.put(str3, C3003.m7085(str3, map3.containsKey(str3) ? map3.get(str3) : null, map.get(str3)));
                }
                ((ArrayList) c2994.f11536).add(new C3003(strMo3185, j, map2));
                return c5293;
            case 1:
                ˀᵳˎᵹ.ˌᵨʠᵫ("getValue", 2, list);
                InterfaceC2992 interfaceC29923 = ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) list.get(0));
                InterfaceC2992 interfaceC29924 = ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) list.get(1));
                String strMo31852 = interfaceC29923.mo3185();
                C2991 c2991 = (C2991) obj;
                Map map4 = (Map) ((C1811) c2991.f11521).f7228.get((String) c2991.f11520);
                if (map4 != null && map4.containsKey(strMo31852)) {
                    str2 = (String) map4.get(strMo31852);
                }
                return str2 != null ? new C3832(str2) : interfaceC29924;
            case 2:
                return c5293;
            case 3:
                try {
                    return ᵺᵘ.ᵵᵬᵽ(((CallableC1105) obj).call());
                } catch (Exception unused) {
                    return c5293;
                }
            default:
                ˀᵳˎᵹ.ˌᵨʠᵫ(str, 3, list);
                ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) list.get(0)).mo3185();
                InterfaceC2992 interfaceC29925 = (InterfaceC2992) list.get(1);
                ʽᵺᴵ r1 = (ʽᵺᴵ) c4055.f15557;
                InterfaceC2992 interfaceC29926 = r1.ˊᵨᵧ(c4055, interfaceC29925);
                if (interfaceC29926 instanceof C3137) {
                    InterfaceC2992 interfaceC29927 = r1.ˊᵨᵧ(c4055, (InterfaceC2992) list.get(2));
                    if (interfaceC29927 instanceof C3037) {
                        C3037 c3037 = (C3037) interfaceC29927;
                        HashMap map5 = c3037.f11660;
                        if (map5.containsKey("type")) {
                            String strMo31853 = c3037.mo7131("type").mo3185();
                            int iIntValue = map5.containsKey("priority") ? ˀᵳˎᵹ.ˁˌᵩ(c3037.mo7131("priority").mo3182().doubleValue()) : 1000;
                            C2991 c29912 = (C2991) obj;
                            C3137 c3137 = (C3137) interfaceC29926;
                            c29912.getClass();
                            if ("create".equals(strMo31853)) {
                                treeMap = (TreeMap) c29912.f11521;
                            } else if ("edit".equals(strMo31853)) {
                                treeMap = (TreeMap) c29912.f11520;
                            } else {
                                ᵕᵩʽᵲ.ᵪᵹᵥᵻ("Unknown callback type: ".concat(String.valueOf(strMo31853)));
                            }
                            if (treeMap.containsKey(Integer.valueOf(iIntValue))) {
                                iIntValue = ((Integer) treeMap.lastKey()).intValue() + 1;
                            }
                            treeMap.put(Integer.valueOf(iIntValue), c3137);
                            return c5293;
                        }
                        ᵕᵩʽᵲ.ᵮᵣᵗˈ("Undefined rule type");
                    } else {
                        ᵕᵩʽᵲ.ᵮᵣᵗˈ("Invalid callback params");
                    }
                } else {
                    ᵕᵩʽᵲ.ᵮᵣᵗˈ("Invalid callback type");
                }
                return null;
        }
    }
}
