package com.discord.stores; import com.airbnb.lottie.parser.AnimatableValueParser; import com.discord.api.channel.Channel; import com.discord.api.voice.state.VoiceState; import com.discord.models.domain.ModelCall; import com.discord.models.member.GuildMember; import com.discord.models.user.MeUser; import com.discord.models.user.User; import com.discord.stores.StoreMediaSettings; import com.discord.stores.StoreVideoStreams; import com.discord.stores.StoreVoiceParticipants; import com.discord.utilities.rx.ObservableExtensionsKt; import com.discord.utilities.streams.StreamContext; import d0.o; import d0.t.h0; import d0.t.n; import d0.t.u; import d0.z.d.m; import j0.k.b; import j0.l.e.j; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; import kotlin.Pair; import rx.Observable; import rx.functions.Func2; import rx.functions.Func7; /* compiled from: StoreVoiceParticipants.kt */ public final class StoreVoiceParticipants$get$1 implements b>> { public final /* synthetic */ long $channelId; public final /* synthetic */ StoreVoiceParticipants this$0; /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements b, Observable>> { public final /* synthetic */ Channel $channel; public final /* synthetic */ long $guildId; public final /* synthetic */ StoreVoiceParticipants$get$1 this$0; /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements Func2, Pair>> { public static final AnonymousClass1 INSTANCE = new AnonymousClass1(); public final Pair> call(MeUser meUser, Collection collection) { return o.to(meUser, collection); } } /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$2 reason: invalid class name */ public static final class AnonymousClass2 implements b>, Observable>> { public final /* synthetic */ Map $voiceStates; public final /* synthetic */ AnonymousClass1 this$0; /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$2$1 reason: invalid class name */ public static final class AnonymousClass1 implements b> { public static final AnonymousClass1 INSTANCE = new AnonymousClass1(); public final List call(ModelCall modelCall) { List ringing; return (modelCall == null || (ringing = modelCall.getRinging()) == null) ? n.emptyList() : ringing; } } /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$2$2 reason: invalid class name */ public static final class AnonymousClass2 implements Func7, List, Map, Map, Map>, StoreMediaSettings.VoiceConfiguration, Map, Map> { public final /* synthetic */ MeUser $meUser; public final /* synthetic */ Collection $otherUsers; public final /* synthetic */ AnonymousClass2 this$0; public AnonymousClass2(AnonymousClass2 r1, MeUser meUser, Collection collection) { this.this$0 = r1; this.$meUser = meUser; this.$otherUsers = collection; } /* 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, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */ @Override // rx.functions.Func7 public /* bridge */ /* synthetic */ Map call(Set set, List list, Map map, Map map2, Map> map3, StoreMediaSettings.VoiceConfiguration voiceConfiguration, Map map4) { return call((Set) set, (List) list, (Map) map, (Map) map2, (Map>) map3, voiceConfiguration, (Map) map4); } public final Map call(Set set, List list, Map map, Map map2, Map> map3, StoreMediaSettings.VoiceConfiguration voiceConfiguration, Map map4) { StoreVoiceParticipants storeVoiceParticipants = this.this$0.this$0.this$0.this$0; MeUser meUser = this.$meUser; m.checkNotNullExpressionValue(meUser, "meUser"); Collection collection = this.$otherUsers; m.checkNotNullExpressionValue(collection, "otherUsers"); Map map5 = this.this$0.$voiceStates; m.checkNotNullExpressionValue(map5, "voiceStates"); m.checkNotNullExpressionValue(set, "speakingUsers"); m.checkNotNullExpressionValue(list, "ringingUsers"); m.checkNotNullExpressionValue(map, "videoStreams"); m.checkNotNullExpressionValue(map2, "guildMembers"); m.checkNotNullExpressionValue(map3, "streamSpectators"); m.checkNotNullExpressionValue(voiceConfiguration, "voiceConfig"); m.checkNotNullExpressionValue(map4, "streamContexts"); return StoreVoiceParticipants.access$create(storeVoiceParticipants, meUser, collection, map5, set, list, map, map2, map3, voiceConfiguration, map4); } } public AnonymousClass2(AnonymousClass1 r1, Map map) { this.this$0 = r1; this.$voiceStates = map; } /* 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] */ @Override // j0.k.b public /* bridge */ /* synthetic */ Observable> call(Pair> pair) { return call((Pair>) pair); } public final Observable> call(Pair> pair) { MeUser component1 = pair.component1(); Collection collection = (Collection) pair.component2(); m.checkNotNullExpressionValue(collection, "otherUsers"); ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(collection, 10)); for (T t : collection) { arrayList.add(Long.valueOf(t.getId())); } return Observable.e(ObservableExtensionsKt.leadingEdgeThrottle(this.this$0.this$0.this$0.getStream().getVoiceSpeaking$app_productionBetaRelease().observeSpeakingUsers(), 250, TimeUnit.MILLISECONDS), this.this$0.this$0.this$0.getStream().getCalls$app_productionBetaRelease().get(this.this$0.this$0.$channelId).F(AnonymousClass1.INSTANCE), this.this$0.this$0.this$0.getStream().getVideoStreams$app_productionBetaRelease().observeUserStreams(), ObservableExtensionsKt.leadingEdgeThrottle(this.this$0.this$0.this$0.getStream().getGuilds$app_productionBetaRelease().observeComputed(this.this$0.$guildId), 1, TimeUnit.SECONDS), this.this$0.this$0.this$0.getStream().getApplicationStreaming$app_productionBetaRelease().observeStreamSpectators(), this.this$0.this$0.this$0.getStream().getMediaSettings$app_productionBetaRelease().getVoiceConfig(), StoreVoiceParticipants.access$getStreamContextsForUsers(this.this$0.this$0.this$0, u.plus((Collection) arrayList, Long.valueOf(component1.getId()))), new AnonymousClass2(this, component1, collection)); } } public AnonymousClass1(StoreVoiceParticipants$get$1 storeVoiceParticipants$get$1, Channel channel, long j) { this.this$0 = storeVoiceParticipants$get$1; this.$channel = channel; this.$guildId = j; } /* 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] */ @Override // j0.k.b public /* bridge */ /* synthetic */ Observable> call(Map map) { return call((Map) map); } public final Observable> call(Map map) { Observable observeMe$default = StoreUser.observeMe$default(this.this$0.this$0.getStream().getUsers$app_productionBetaRelease(), false, 1, null); StoreVoiceParticipants storeVoiceParticipants = this.this$0.this$0; Channel channel = this.$channel; m.checkNotNullExpressionValue(map, "voiceStates"); return Observable.j(observeMe$default, StoreVoiceParticipants.access$getOtherVoiceUsers(storeVoiceParticipants, channel, map), AnonymousClass1.INSTANCE).Y(new AnonymousClass2(this, map)); } } public StoreVoiceParticipants$get$1(StoreVoiceParticipants storeVoiceParticipants, long j) { this.this$0 = storeVoiceParticipants; this.$channelId = j; } public final Observable> call(Channel channel) { if (channel == null) { return new j(h0.emptyMap()); } long f = AnimatableValueParser.t1(channel) ? 0 : channel.f(); return this.this$0.getStream().getVoiceStates$app_productionBetaRelease().observe(f, channel.h()).Y(new AnonymousClass1(this, channel, f)); } }