package com.discord.stores; import com.discord.models.application.Unread; import com.discord.stores.StoreMessageAck; import com.discord.stores.StoreStream; import d0.z.d.o; import j0.k.b; import java.util.Map; import kotlin.jvm.functions.Function1; import rx.Observable; import rx.functions.Func3; /* compiled from: StoreReadStates.kt */ public final class StoreReadStates$computeUnreadMarker$1 extends o implements Function1> { public static final StoreReadStates$computeUnreadMarker$1 INSTANCE = new StoreReadStates$computeUnreadMarker$1(); /* compiled from: StoreReadStates.kt */ /* renamed from: com.discord.stores.StoreReadStates$computeUnreadMarker$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements b, StoreMessageAck.Ack> { public final /* synthetic */ long $channelId; public AnonymousClass1(long j) { this.$channelId = j; } public final StoreMessageAck.Ack call(Map map) { return map.get(Long.valueOf(this.$channelId)); } /* 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 */ StoreMessageAck.Ack call(Map map) { return call((Map) map); } } /* compiled from: StoreReadStates.kt */ /* renamed from: com.discord.stores.StoreReadStates$computeUnreadMarker$1$2 reason: invalid class name */ public static final class AnonymousClass2 implements b, StoreMessageAck.Ack> { public final /* synthetic */ long $channelId; public AnonymousClass2(long j) { this.$channelId = j; } public final StoreMessageAck.Ack call(Map map) { return map.get(Long.valueOf(this.$channelId)); } /* 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 */ StoreMessageAck.Ack call(Map map) { return call((Map) map); } } /* compiled from: StoreReadStates.kt */ /* renamed from: com.discord.stores.StoreReadStates$computeUnreadMarker$1$3 reason: invalid class name */ public static final class AnonymousClass3 implements Func3 { public final /* synthetic */ long $channelId; public AnonymousClass3(long j) { this.$channelId = j; } public final Unread.Marker call(StoreMessageAck.Ack ack, StoreMessageAck.Ack ack2, Long l) { return (ack2 == null || !ack2.isLockedAck()) ? ack != null ? new Unread.Marker(this.$channelId, ack.getMessageId(), l) : new Unread.Marker(this.$channelId, 0, l) : new Unread.Marker(this.$channelId, ack2.getMessageId(), l); } } public StoreReadStates$computeUnreadMarker$1() { super(1); } /* 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 // kotlin.jvm.functions.Function1 public /* bridge */ /* synthetic */ Observable invoke(Long l) { return invoke(l.longValue()); } public final Observable invoke(long j) { StoreStream.Companion companion = StoreStream.Companion; return Observable.i(companion.getMessageAck().observeAll().F(new AnonymousClass1(j)).Z(1), companion.getMessageAck().observeAll().F(new AnonymousClass2(j)), companion.getMessagesMostRecent().observeRecentMessageIds(j).Z(1), new AnonymousClass3(j)); } }