package com.discord.widgets.servers; import com.airbnb.lottie.parser.AnimatableValueParser; import com.discord.api.channel.Channel; import com.discord.models.domain.ModelNotificationSettings; import com.discord.utilities.channel.GuildChannelsInfo; import com.discord.widgets.servers.NotificationsOverridesAdapter; import d0.d0.f; import d0.t.g0; import d0.t.o; import d0.z.d.m; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import rx.functions.Func3; /* compiled from: WidgetServerNotifications.kt */ public final class WidgetServerNotifications$Companion$getNotificationOverrides$2 implements Func3, Map, GuildChannelsInfo, List> { public static final WidgetServerNotifications$Companion$getNotificationOverrides$2 INSTANCE = new WidgetServerNotifications$Companion$getNotificationOverrides$2(); /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object, java.lang.Object] */ @Override // rx.functions.Func3 public /* bridge */ /* synthetic */ List call(List list, Map map, GuildChannelsInfo guildChannelsInfo) { return call(list, (Map) map, guildChannelsInfo); } public final List call(List list, Map map, GuildChannelsInfo guildChannelsInfo) { m.checkNotNullExpressionValue(map, "guildChannels"); List sortedVisibleChannels = guildChannelsInfo.getSortedVisibleChannels(map); m.checkNotNullExpressionValue(list, "channelOverrides"); ArrayList arrayList = new ArrayList(); Iterator it = list.iterator(); while (true) { boolean z2 = false; if (!it.hasNext()) { break; } Object next = it.next(); ModelNotificationSettings.ChannelOverride channelOverride = (ModelNotificationSettings.ChannelOverride) next; m.checkNotNullExpressionValue(channelOverride, "it"); if (channelOverride.getMessageNotifications() != ModelNotificationSettings.FREQUENCY_UNSET || channelOverride.isMuted()) { z2 = true; } if (z2) { arrayList.add(next); } } LinkedHashMap linkedHashMap = new LinkedHashMap(f.coerceAtLeast(g0.mapCapacity(o.collectionSizeOrDefault(arrayList, 10)), 16)); for (Object obj : arrayList) { ModelNotificationSettings.ChannelOverride channelOverride2 = (ModelNotificationSettings.ChannelOverride) obj; m.checkNotNullExpressionValue(channelOverride2, "override"); linkedHashMap.put(Long.valueOf(channelOverride2.getChannelId()), obj); } ArrayList arrayList2 = new ArrayList(); for (Object obj2 : sortedVisibleChannels) { Channel channel = (Channel) obj2; if (AnimatableValueParser.f1(channel) || AnimatableValueParser.z1(channel)) { arrayList2.add(obj2); } } ArrayList arrayList3 = new ArrayList(); for (Channel channel2 : arrayList2) { ModelNotificationSettings.ChannelOverride channelOverride3 = (ModelNotificationSettings.ChannelOverride) linkedHashMap.get(Long.valueOf(channel2.h())); NotificationsOverridesAdapter.Item item = channelOverride3 != null ? new NotificationsOverridesAdapter.Item(channel2, map.get(Long.valueOf(channel2.r())), channelOverride3) : null; if (item != null) { arrayList3.add(item); } } return arrayList3; } }