package com.revenuecat.purchases.ui.revenuecatui.data;

import J4.a;
import S4.w;
import com.revenuecat.purchases.ui.revenuecatui.data.PaywallState;
import java.util.Locale;
import java.util.Map;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.p;
import x4.z;
import y4.C3277e;

/* JADX INFO: loaded from: classes3.dex */
public final class PaywallState$Loaded$Components$availableStorefrontCountryLocalesByLanguage$2 extends p implements a {
    final /* synthetic */ PaywallState.Loaded.Components this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public PaywallState$Loaded$Components$availableStorefrontCountryLocalesByLanguage$2(PaywallState.Loaded.Components components) {
        super(0);
        this.this$0 = components;
    }

    @Override // J4.a
    public final Map<String, Locale> invoke() {
        String str = this.this$0.storefrontCountryCode;
        if (str == null || S4.p.Q0(str)) {
            return z.f26066a;
        }
        PaywallState.Loaded.Components components = this.this$0;
        C3277e c3277e = new C3277e();
        Locale[] availableLocales = Locale.getAvailableLocales();
        o.g(availableLocales, "getAvailableLocales()");
        for (Locale locale : availableLocales) {
            if (w.t0(locale.getCountry(), components.storefrontCountryCode, true)) {
                String language = locale.getLanguage();
                o.g(language, "availableLocale.language");
                String lowerCase = language.toLowerCase(Locale.ROOT);
                o.g(lowerCase, "toLowerCase(...)");
                c3277e.put(lowerCase, locale);
            }
        }
        return c3277e.b();
    }
}
