package o;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.m80, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1838m80 extends Sb0 implements TC {
    public /* synthetic */ C2123p80 p;
    public /* synthetic */ VQ q;

    @Override // o.TC
    public final Object d(Object obj, Object obj2, Object obj3) {
        C1838m80 c1838m80 = new C1838m80(3, (InterfaceC0220Im) obj3);
        c1838m80.p = (C2123p80) obj;
        c1838m80.q = (VQ) obj2;
        return c1838m80.n(Oh0.a);
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) {
        IJ.H(obj);
        C2123p80 c2123p80 = this.p;
        VQ vq = this.q;
        Set setKeySet = vq.a().keySet();
        ArrayList arrayList = new ArrayList(AbstractC0034Bi.W(setKeySet, 10));
        Iterator it = setKeySet.iterator();
        while (it.hasNext()) {
            arrayList.add(((C1770lY) it.next()).a);
        }
        Map<String, ?> all = c2123p80.a.getAll();
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        Iterator<Map.Entry<String, ?>> it2 = all.entrySet().iterator();
        while (true) {
            if (!it2.hasNext()) {
                break;
            }
            Map.Entry<String, ?> next = it2.next();
            String key = next.getKey();
            Set set = c2123p80.b;
            if (set != null ? set.contains(key) : true) {
                linkedHashMap.put(next.getKey(), next.getValue());
            }
        }
        LinkedHashMap linkedHashMap2 = new LinkedHashMap(GN.Z(linkedHashMap.size()));
        for (Map.Entry entry : linkedHashMap.entrySet()) {
            Object key2 = entry.getKey();
            Object value = entry.getValue();
            if (value instanceof Set) {
                value = AbstractC3117zi.w0((Iterable) value);
            }
            linkedHashMap2.put(key2, value);
        }
        LinkedHashMap linkedHashMap3 = new LinkedHashMap();
        for (Map.Entry entry2 : linkedHashMap2.entrySet()) {
            if (!arrayList.contains((String) entry2.getKey())) {
                linkedHashMap3.put(entry2.getKey(), entry2.getValue());
            }
        }
        VQ vq2 = new VQ(new LinkedHashMap(vq.a()), false);
        for (Map.Entry entry3 : linkedHashMap3.entrySet()) {
            String str = (String) entry3.getKey();
            Object value2 = entry3.getValue();
            if (value2 instanceof Boolean) {
                vq2.d(new C1770lY(str), value2);
            } else if (value2 instanceof Float) {
                vq2.d(new C1770lY(str), value2);
            } else if (value2 instanceof Integer) {
                vq2.d(new C1770lY(str), value2);
            } else if (value2 instanceof Long) {
                vq2.d(new C1770lY(str), value2);
            } else if (value2 instanceof String) {
                vq2.d(new C1770lY(str), value2);
            } else if (value2 instanceof Set) {
                vq2.d(new C1770lY(str), (Set) value2);
            }
        }
        return new VQ(new LinkedHashMap(vq2.a()), true);
    }
}
