package com.discord.stores; import android.content.Context; import com.discord.models.domain.ModelInvite; import com.discord.stores.StoreInstantInvites; import com.discord.utilities.analytics.AnalyticsTracker; import com.discord.utilities.error.Error; import com.discord.utilities.rx.ObservableExtensionsKt; import d0.z.d.m; import d0.z.d.o; import kotlin.Unit; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; /* compiled from: StoreInstantInvites.kt */ public final class StoreInstantInvites$fetchInviteIfNotLoaded$1 extends o implements Function0 { public final /* synthetic */ String $inviteCode; public final /* synthetic */ String $location; public final /* synthetic */ StoreInstantInvites this$0; /* compiled from: StoreInstantInvites.kt */ /* renamed from: com.discord.stores.StoreInstantInvites$fetchInviteIfNotLoaded$1$1 reason: invalid class name */ public static final class AnonymousClass1 extends o implements Function1 { public final /* synthetic */ StoreInstantInvites$fetchInviteIfNotLoaded$1 this$0; /* compiled from: StoreInstantInvites.kt */ /* renamed from: com.discord.stores.StoreInstantInvites$fetchInviteIfNotLoaded$1$1$1 reason: invalid class name */ public static final class AnonymousClass1 extends o implements Function0 { public final /* synthetic */ ModelInvite $it; public final /* synthetic */ AnonymousClass1 this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass1(AnonymousClass1 r1, ModelInvite modelInvite) { super(0); this.this$0 = r1; this.$it = modelInvite; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { StoreInstantInvites$fetchInviteIfNotLoaded$1 storeInstantInvites$fetchInviteIfNotLoaded$1 = this.this$0.this$0; StoreInstantInvites.access$setChatInvites(storeInstantInvites$fetchInviteIfNotLoaded$1.this$0, storeInstantInvites$fetchInviteIfNotLoaded$1.$inviteCode, new StoreInstantInvites.InviteState.Resolved(this.$it)); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass1(StoreInstantInvites$fetchInviteIfNotLoaded$1 storeInstantInvites$fetchInviteIfNotLoaded$1) { super(1); this.this$0 = storeInstantInvites$fetchInviteIfNotLoaded$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 */ Unit invoke(ModelInvite modelInvite) { invoke(modelInvite); return Unit.a; } public final void invoke(ModelInvite modelInvite) { m.checkNotNullParameter(modelInvite, "it"); StoreInstantInvites.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this, modelInvite)); String str = this.this$0.$location; if (str != null) { AnalyticsTracker.INSTANCE.inviteResolved(modelInvite, str); } } } /* compiled from: StoreInstantInvites.kt */ /* renamed from: com.discord.stores.StoreInstantInvites$fetchInviteIfNotLoaded$1$2 reason: invalid class name */ public static final class AnonymousClass2 extends o implements Function1 { public final /* synthetic */ StoreInstantInvites$fetchInviteIfNotLoaded$1 this$0; /* compiled from: StoreInstantInvites.kt */ /* renamed from: com.discord.stores.StoreInstantInvites$fetchInviteIfNotLoaded$1$2$1 reason: invalid class name */ public static final class AnonymousClass1 extends o implements Function0 { public final /* synthetic */ AnonymousClass2 this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass1(AnonymousClass2 r1) { super(0); this.this$0 = r1; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { StoreInstantInvites$fetchInviteIfNotLoaded$1 storeInstantInvites$fetchInviteIfNotLoaded$1 = this.this$0.this$0; StoreInstantInvites.access$setChatInvites(storeInstantInvites$fetchInviteIfNotLoaded$1.this$0, storeInstantInvites$fetchInviteIfNotLoaded$1.$inviteCode, StoreInstantInvites.InviteState.Invalid.INSTANCE); } } /* compiled from: StoreInstantInvites.kt */ /* renamed from: com.discord.stores.StoreInstantInvites$fetchInviteIfNotLoaded$1$2$2 reason: invalid class name */ public static final class AnonymousClass2 extends o implements Function0 { public final /* synthetic */ AnonymousClass2 this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass2(AnonymousClass2 r1) { super(0); this.this$0 = r1; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { StoreInstantInvites$fetchInviteIfNotLoaded$1 storeInstantInvites$fetchInviteIfNotLoaded$1 = this.this$0.this$0; StoreInstantInvites.access$setChatInvites(storeInstantInvites$fetchInviteIfNotLoaded$1.this$0, storeInstantInvites$fetchInviteIfNotLoaded$1.$inviteCode, StoreInstantInvites.InviteState.LoadFailed.INSTANCE); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass2(StoreInstantInvites$fetchInviteIfNotLoaded$1 storeInstantInvites$fetchInviteIfNotLoaded$1) { super(1); this.this$0 = storeInstantInvites$fetchInviteIfNotLoaded$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 */ Unit invoke(Error error) { invoke(error); return Unit.a; } public final void invoke(Error error) { m.checkNotNullParameter(error, "error"); int ordinal = error.getType().ordinal(); if (ordinal == 3) { error.setShowErrorToasts(false); StoreInstantInvites.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this)); StoreInstantInvites$fetchInviteIfNotLoaded$1 storeInstantInvites$fetchInviteIfNotLoaded$1 = this.this$0; String str = storeInstantInvites$fetchInviteIfNotLoaded$1.$location; if (str != null) { String str2 = storeInstantInvites$fetchInviteIfNotLoaded$1.$inviteCode; Error.Response response = error.getResponse(); m.checkNotNullExpressionValue(response, "error.response"); String message = response.getMessage(); Error.Response response2 = error.getResponse(); m.checkNotNullExpressionValue(response2, "error.response"); AnalyticsTracker.inviteResolveFailed(str2, str, message, Integer.valueOf(response2.getCode())); } } else if (ordinal == 11) { StoreInstantInvites.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass2(this)); } } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public StoreInstantInvites$fetchInviteIfNotLoaded$1(StoreInstantInvites storeInstantInvites, String str, String str2) { super(0); this.this$0 = storeInstantInvites; this.$inviteCode = str; this.$location = str2; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { if (!StoreInstantInvites.access$getKnownInvites$p(this.this$0).containsKey(this.$inviteCode) || (StoreInstantInvites.access$getKnownInvites$p(this.this$0).get(this.$inviteCode) instanceof StoreInstantInvites.InviteState.LoadFailed)) { AnalyticsTracker.inviteOpened(this.$inviteCode); StoreInstantInvites.access$setChatInvites(this.this$0, this.$inviteCode, StoreInstantInvites.InviteState.Loading.INSTANCE); ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(StoreInstantInvites.access$getRestAPI$p(this.this$0).getInviteCode(this.$inviteCode, true), false, 1, null), this.this$0.getClass(), (Context) null, (Function1) null, new AnonymousClass2(this), (Function0) null, (Function0) null, new AnonymousClass1(this), 54, (Object) null); } } }